Authored by qinchao

主机管理

... ... @@ -216,8 +216,6 @@ public class TypeInfoCtrl {
@RequestMapping(value = "/update", method = RequestMethod.POST)
public BaseResponse updateMObject(@RequestBody TypeInfo request) {
DEBUG.debug("Update typeInfo: {}", request);
BaseResponse response = new BaseResponse();
try {
... ... @@ -238,6 +236,23 @@ public class TypeInfoCtrl {
}
@RequestMapping(value = "/updateTag", method = RequestMethod.POST)
public BaseResponse updateTag(@RequestBody TypeInfo request) {
BaseResponse response = new BaseResponse();
try {
if (null != request) {
typeInfoService.updateTypeInfoTag(request);
}
} catch (Exception e) {
DEBUG.error("Failed to update typeInfo: {}, error: {}", request, e);
response.setCode(400);
response.setMessage(e.getMessage());
}
return response;
}
@RequestMapping(value = "/queryJavaApi", method = RequestMethod.GET)
public BaseResponse queryJavaApi() {
... ... @@ -303,15 +318,9 @@ public class TypeInfoCtrl {
@RequestMapping(value = "/queryZk", method = RequestMethod.GET)
public BaseResponse queryZkTree() {
DEBUG.debug("Query all queryZkTree...");
List<TypeInfo> allTypeInfo = null;
BaseResponse response = new BaseResponse();
int parentId=7;
try {
allTypeInfo = typeInfoService.getChildById();
... ...
... ... @@ -20,6 +20,7 @@ public interface ITypeInfoService {
void deleteTypeInfo(int id);
void updateTypeInfo(TypeInfo typeInfo);
void updateTypeInfoTag(TypeInfo typeInfo);
TypeInfo queryTypeInfoByName(String typeName);
... ...
... ... @@ -78,6 +78,11 @@ public class TypeInfoServiceImpl implements ITypeInfoService {
}
@Override
public void updateTypeInfoTag(TypeInfo typeInfo){
mTypeInfoMapper.updateTypeInfoTag(typeInfo);
}
@Override
public TypeInfo queryTypeInfoByName(String typeName) {
return mTypeInfoMapper.selectTypeInfoByName(typeName);
}
... ...
... ... @@ -13,6 +13,7 @@ public interface MTypeInfoMapper {
void deleteTypeInfo(int typeId);
void updateTypeInfo(TypeInfo typeInfo);
void updateTypeInfoTag(TypeInfo typeInfo);
List<TypeInfo> getAllTypesInfo();
... ...
... ... @@ -46,6 +46,11 @@
WHERE id=#{typeId}
</update>
<update id="updateTypeInfoTag" parameterType="com.model.TypeInfo">
UPDATE type_info SET tags=#{tags},descr=#{descr}
WHERE id=#{typeId}
</update>
<select id="selectTypeInfoByName" resultMap="typeInfoMap" resultType="com.model.TypeInfo">
SELECT
... ...