标签管理-标签项修改

This commit is contained in:
xiejunyu
2022-02-17 17:59:05 +08:00
parent ab81ce9fa7
commit 12eeb7e8a7
@@ -12,6 +12,7 @@ import com.jero.modules.tag.service.IOnlCgformTagService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -115,14 +116,18 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-通过id删除") @AutoLog(value = "标签管理-通过id删除")
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除") @ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<OnlCgformTag> delete(@RequestParam(name="id",required=true) String id) {
Result<OnlCgformTag> result = new Result<>();
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id); OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id);
if(onlCgformTag.getIsReadOnly() == 1 || onlCgformTag.getIsReadOnly()==2){ if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) {
return Result.error("固定字段,不可删除"); if (onlCgformTag.getIsReadOnly() == 1 || onlCgformTag.getIsReadOnly() == 2) {
}else{ result.error("固定字段,不可删除");
onlCgformTagService.deleteById(id); } else {
return Result.OK("删除成功!"); onlCgformTagService.deleteById(id);
result.OK("删除成功!");
}
} }
return result;
} }
/** /**