Commit a8ecf47c authored by lepdou's avatar lepdou

bugfix appnamespace format null

parent 5d404bd9
...@@ -16,6 +16,7 @@ import com.ctrip.framework.apollo.biz.entity.Audit; ...@@ -16,6 +16,7 @@ import com.ctrip.framework.apollo.biz.entity.Audit;
import com.ctrip.framework.apollo.biz.repository.AppNamespaceRepository; import com.ctrip.framework.apollo.biz.repository.AppNamespaceRepository;
import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import com.ctrip.framework.apollo.core.exception.ServiceException; import com.ctrip.framework.apollo.core.exception.ServiceException;
import com.ctrip.framework.apollo.core.utils.StringUtils; import com.ctrip.framework.apollo.core.utils.StringUtils;
...@@ -60,6 +61,7 @@ public class AppNamespaceService { ...@@ -60,6 +61,7 @@ public class AppNamespaceService {
appNs.setAppId(appId); appNs.setAppId(appId);
appNs.setName(ConfigConsts.NAMESPACE_APPLICATION); appNs.setName(ConfigConsts.NAMESPACE_APPLICATION);
appNs.setComment("default app namespace"); appNs.setComment("default app namespace");
appNs.setFormat(ConfigFileFormat.Properties.getValue());
appNs.setDataChangeCreatedBy(createBy); appNs.setDataChangeCreatedBy(createBy);
appNs.setDataChangeLastModifiedBy(createBy); appNs.setDataChangeLastModifiedBy(createBy);
appNamespaceRepository.save(appNs); appNamespaceRepository.save(appNs);
......
...@@ -5,6 +5,7 @@ import com.google.common.collect.Lists; ...@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import com.ctrip.framework.apollo.portal.entity.po.UserInfo; import com.ctrip.framework.apollo.portal.entity.po.UserInfo;
import com.ctrip.framework.apollo.portal.service.UserService; import com.ctrip.framework.apollo.portal.service.UserService;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -15,7 +16,7 @@ public class DefaultUserService implements UserService { ...@@ -15,7 +16,7 @@ public class DefaultUserService implements UserService {
@Override @Override
public List<UserInfo> searchUsers(String keyword, int offset, int limit) { public List<UserInfo> searchUsers(String keyword, int offset, int limit) {
return Collections.emptyList(); return Arrays.asList(assembleDefaultUser());
} }
@Override @Override
......
...@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.service; ...@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.service;
import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import com.ctrip.framework.apollo.core.exception.BadRequestException; import com.ctrip.framework.apollo.core.exception.BadRequestException;
import com.ctrip.framework.apollo.core.exception.ServiceException; import com.ctrip.framework.apollo.core.exception.ServiceException;
import com.ctrip.framework.apollo.portal.auth.UserInfoHolder; import com.ctrip.framework.apollo.portal.auth.UserInfoHolder;
...@@ -47,6 +48,7 @@ public class AppNamespaceService { ...@@ -47,6 +48,7 @@ public class AppNamespaceService {
appNs.setAppId(appId); appNs.setAppId(appId);
appNs.setName(ConfigConsts.NAMESPACE_APPLICATION); appNs.setName(ConfigConsts.NAMESPACE_APPLICATION);
appNs.setComment("default app namespace"); appNs.setComment("default app namespace");
appNs.setFormat(ConfigFileFormat.Properties.getValue());
String userId = userInfoHolder.getUser().getUserId(); String userId = userInfoHolder.getUser().getUserId();
appNs.setDataChangeCreatedBy(userId); appNs.setDataChangeCreatedBy(userId);
......
...@@ -42,8 +42,8 @@ namespace_module.controller("LinkNamespaceController", ...@@ -42,8 +42,8 @@ namespace_module.controller("LinkNamespaceController",
appId: $scope.appId, appId: $scope.appId,
name: '', name: '',
comment: '', comment: '',
isPublic: false, isPublic: true,
format: 'xml' format: 'properties'
}; };
$scope.switchNSType = function (type) { $scope.switchNSType = function (type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment