|
|
@ -24,6 +24,9 @@ import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
import javax.validation.Valid; |
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -67,8 +70,9 @@ public class SysContentClassificationController { |
|
|
|
@Decrypt |
|
|
|
@Decrypt |
|
|
|
@ApiOperation(value = "分类校验判重", response = SysContentClassification.class) |
|
|
|
@ApiOperation(value = "分类校验判重", response = SysContentClassification.class) |
|
|
|
public R checkForHeavy( |
|
|
|
public R checkForHeavy( |
|
|
|
@RequestBody CheckForHeavy checkForHeavy) { |
|
|
|
@RequestBody CheckForHeavy checkForHeavy) throws UnsupportedEncodingException { |
|
|
|
|
|
|
|
String name = URLDecoder.decode(checkForHeavy.getClassificationName(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
|
|
|
checkForHeavy.setClassificationName(name); |
|
|
|
QueryWrapper<SysContentClassification> queryWrapper = new QueryWrapper<SysContentClassification>().eq("site_id", checkForHeavy.getSiteId()). |
|
|
|
QueryWrapper<SysContentClassification> queryWrapper = new QueryWrapper<SysContentClassification>().eq("site_id", checkForHeavy.getSiteId()). |
|
|
|
eq("classification_name", checkForHeavy.getClassificationName()); |
|
|
|
eq("classification_name", checkForHeavy.getClassificationName()); |
|
|
|
|
|
|
|
|
|
|
@ -88,7 +92,10 @@ public class SysContentClassificationController { |
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
@Decrypt |
|
|
|
@Decrypt |
|
|
|
@ApiOperation(value = "新增", response = SysContentClassification.class) |
|
|
|
@ApiOperation(value = "新增", response = SysContentClassification.class) |
|
|
|
public R save(@RequestBody @Valid @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) { |
|
|
|
public R save(@RequestBody @Valid @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) throws UnsupportedEncodingException { |
|
|
|
|
|
|
|
String name = URLDecoder.decode(sysContentClassification.getClassificationName(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
|
|
|
sysContentClassification.setClassificationName(name); |
|
|
|
|
|
|
|
|
|
|
|
boolean addState = service.save(sysContentClassification); |
|
|
|
boolean addState = service.save(sysContentClassification); |
|
|
|
return addState ? R.success() : R.fail("新增失败"); |
|
|
|
return addState ? R.success() : R.fail("新增失败"); |
|
|
|
} |
|
|
|
} |
|
|
@ -97,7 +104,9 @@ public class SysContentClassificationController { |
|
|
|
@PostMapping("/update") |
|
|
|
@PostMapping("/update") |
|
|
|
@Decrypt |
|
|
|
@Decrypt |
|
|
|
@ApiOperation(value = "修改", response = SysContentClassification.class) |
|
|
|
@ApiOperation(value = "修改", response = SysContentClassification.class) |
|
|
|
public R update(@RequestBody @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) { |
|
|
|
public R update(@RequestBody @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) throws UnsupportedEncodingException { |
|
|
|
|
|
|
|
String name = URLDecoder.decode(sysContentClassification.getClassificationName(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
|
|
|
sysContentClassification.setClassificationName(name); |
|
|
|
boolean updateState = service.updateById(sysContentClassification); |
|
|
|
boolean updateState = service.updateById(sysContentClassification); |
|
|
|
return updateState ? R.success() : R.fail("编辑失败"); |
|
|
|
return updateState ? R.success() : R.fail("编辑失败"); |
|
|
|
} |
|
|
|
} |
|
|
|