Authored by qinchao

主机管理

@@ -216,8 +216,6 @@ public class TypeInfoCtrl { @@ -216,8 +216,6 @@ public class TypeInfoCtrl {
216 @RequestMapping(value = "/update", method = RequestMethod.POST) 216 @RequestMapping(value = "/update", method = RequestMethod.POST)
217 public BaseResponse updateMObject(@RequestBody TypeInfo request) { 217 public BaseResponse updateMObject(@RequestBody TypeInfo request) {
218 218
219 - DEBUG.debug("Update typeInfo: {}", request);  
220 -  
221 BaseResponse response = new BaseResponse(); 219 BaseResponse response = new BaseResponse();
222 220
223 try { 221 try {
@@ -238,6 +236,23 @@ public class TypeInfoCtrl { @@ -238,6 +236,23 @@ public class TypeInfoCtrl {
238 236
239 } 237 }
240 238
  239 + @RequestMapping(value = "/updateTag", method = RequestMethod.POST)
  240 + public BaseResponse updateTag(@RequestBody TypeInfo request) {
  241 + BaseResponse response = new BaseResponse();
  242 + try {
  243 + if (null != request) {
  244 + typeInfoService.updateTypeInfoTag(request);
  245 + }
  246 + } catch (Exception e) {
  247 + DEBUG.error("Failed to update typeInfo: {}, error: {}", request, e);
  248 + response.setCode(400);
  249 + response.setMessage(e.getMessage());
  250 + }
  251 +
  252 + return response;
  253 +
  254 + }
  255 +
241 256
242 @RequestMapping(value = "/queryJavaApi", method = RequestMethod.GET) 257 @RequestMapping(value = "/queryJavaApi", method = RequestMethod.GET)
243 public BaseResponse queryJavaApi() { 258 public BaseResponse queryJavaApi() {
@@ -303,15 +318,9 @@ public class TypeInfoCtrl { @@ -303,15 +318,9 @@ public class TypeInfoCtrl {
303 318
304 @RequestMapping(value = "/queryZk", method = RequestMethod.GET) 319 @RequestMapping(value = "/queryZk", method = RequestMethod.GET)
305 public BaseResponse queryZkTree() { 320 public BaseResponse queryZkTree() {
306 -  
307 - DEBUG.debug("Query all queryZkTree...");  
308 -  
309 List<TypeInfo> allTypeInfo = null; 321 List<TypeInfo> allTypeInfo = null;
310 322
311 BaseResponse response = new BaseResponse(); 323 BaseResponse response = new BaseResponse();
312 -  
313 - int parentId=7;  
314 -  
315 try { 324 try {
316 allTypeInfo = typeInfoService.getChildById(); 325 allTypeInfo = typeInfoService.getChildById();
317 326
@@ -20,6 +20,7 @@ public interface ITypeInfoService { @@ -20,6 +20,7 @@ public interface ITypeInfoService {
20 void deleteTypeInfo(int id); 20 void deleteTypeInfo(int id);
21 21
22 void updateTypeInfo(TypeInfo typeInfo); 22 void updateTypeInfo(TypeInfo typeInfo);
  23 + void updateTypeInfoTag(TypeInfo typeInfo);
23 24
24 TypeInfo queryTypeInfoByName(String typeName); 25 TypeInfo queryTypeInfoByName(String typeName);
25 26
@@ -78,6 +78,11 @@ public class TypeInfoServiceImpl implements ITypeInfoService { @@ -78,6 +78,11 @@ public class TypeInfoServiceImpl implements ITypeInfoService {
78 } 78 }
79 79
80 @Override 80 @Override
  81 + public void updateTypeInfoTag(TypeInfo typeInfo){
  82 + mTypeInfoMapper.updateTypeInfoTag(typeInfo);
  83 + }
  84 +
  85 + @Override
81 public TypeInfo queryTypeInfoByName(String typeName) { 86 public TypeInfo queryTypeInfoByName(String typeName) {
82 return mTypeInfoMapper.selectTypeInfoByName(typeName); 87 return mTypeInfoMapper.selectTypeInfoByName(typeName);
83 } 88 }
@@ -13,6 +13,7 @@ public interface MTypeInfoMapper { @@ -13,6 +13,7 @@ public interface MTypeInfoMapper {
13 void deleteTypeInfo(int typeId); 13 void deleteTypeInfo(int typeId);
14 14
15 void updateTypeInfo(TypeInfo typeInfo); 15 void updateTypeInfo(TypeInfo typeInfo);
  16 + void updateTypeInfoTag(TypeInfo typeInfo);
16 17
17 List<TypeInfo> getAllTypesInfo(); 18 List<TypeInfo> getAllTypesInfo();
18 19
@@ -46,6 +46,11 @@ @@ -46,6 +46,11 @@
46 WHERE id=#{typeId} 46 WHERE id=#{typeId}
47 </update> 47 </update>
48 48
  49 + <update id="updateTypeInfoTag" parameterType="com.model.TypeInfo">
  50 + UPDATE type_info SET tags=#{tags},descr=#{descr}
  51 + WHERE id=#{typeId}
  52 + </update>
  53 +
49 54
50 <select id="selectTypeInfoByName" resultMap="typeInfoMap" resultType="com.model.TypeInfo"> 55 <select id="selectTypeInfoByName" resultMap="typeInfoMap" resultType="com.model.TypeInfo">
51 SELECT 56 SELECT