增加详情判断

master
rong.liu 2 years ago
parent 93091ff316
commit b8695d2281
  1. 4
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  2. 5
      src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java
  3. 5
      src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java
  4. 11
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  5. 9
      src/main/java/com/huoran/iasf/controller/SysContentLabelController.java

@ -81,9 +81,9 @@ public class SysColumnController {
@ApiOperation(value = "查询详情", response = SysColumn.class)
public R findById(@RequestParam("id") @ApiParam(value = "序号") Integer id) {
SysColumn sysColumn = service.getById(id);
/*if (sysColumn == null) {
if (sysColumn == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}*/
}
SysTemplateStyle sysTemplateStyle = styleService.getById(sysColumn.getListStyleId());
if (sysTemplateStyle.getPath() != null) {

@ -2,6 +2,8 @@ package com.huoran.iasf.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.exception.NotFoundException;
import com.huoran.iasf.common.exception.code.BaseResponseCode;
import com.huoran.iasf.common.utils.Constant;
import com.huoran.iasf.entity.SysColumn;
import com.huoran.iasf.service.SysColumnService;
@ -51,6 +53,9 @@ public class SysColumnLongPageController {
@ApiOperation(value = "查询详情", response = SysColumnLongPage.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysColumnLongPage sysColumnLongPage = service.getById(id);
if (sysColumnLongPage == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}
return R.success(sysColumnLongPage);
}

@ -1,6 +1,8 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.exception.NotFoundException;
import com.huoran.iasf.common.exception.code.BaseResponseCode;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.SysContentClassification;
import com.huoran.iasf.service.SysContentClassificationService;
@ -50,6 +52,9 @@ public class SysContentClassificationController {
@ApiOperation(value = "查询详情", response = SysContentClassification.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysContentClassification sysContentClassification = service.getById(id);
if (sysContentClassification == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}
return R.success(sysContentClassification);
}

@ -75,11 +75,14 @@ public class SysContentController {
SysContent sysContent = service.getById(id);
/* if (sysContent == null) {
if (sysContent == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}*/
}
SysColumn sysColumn = columnService.getById(sysContent.getColumnId());
if (sysColumn == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}
/*if (sysColumn == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}*/
@ -220,9 +223,7 @@ public class SysContentController {
@PostMapping("/articleTopOperation")
@ApiOperation(value = "文章置顶/取消置顶", response = SysContent.class)
public R articleTopOperation(
@ApiParam(name = "isTop", value = "是否置顶(默认为0 不置顶 1为置顶)", required = true) @RequestParam Integer isTop,
@ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) {
public R articleTopOperation(@ApiParam(name = "isTop", value = "是否置顶(默认为0 不置顶 1为置顶)", required = true) @RequestParam Integer isTop, @ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) {
//是否置顶(默认为0 不置顶 1为置顶)
UpdateWrapper<SysContent> updateWrap = new UpdateWrapper<>();

@ -1,6 +1,8 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.exception.NotFoundException;
import com.huoran.iasf.common.exception.code.BaseResponseCode;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.SysContentClassification;
import com.huoran.iasf.entity.SysContentLabel;
@ -46,6 +48,9 @@ public class SysContentLabelController {
@ApiOperation(value = "查询详情", response = SysContentLabel.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysContentLabel sysContentLabel = service.getById(id);
if (sysContentLabel == null) {
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST);
}
return R.success(sysContentLabel);
}
@ -60,9 +65,7 @@ public class SysContentLabelController {
@PostMapping("/checkForHeavy")
@ApiOperation(value = "标签校验判重", response = SysContentLabel.class)
public R checkForHeavy(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId,
@ApiParam(name = "labelName", value = "标签名称", required = true) @RequestParam String labelName,
@ApiParam(name = "labelId", value = "标签id(新增不传,编辑传)", required = false) @RequestParam Integer labelId) {
public R checkForHeavy(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId, @ApiParam(name = "labelName", value = "标签名称", required = true) @RequestParam String labelName, @ApiParam(name = "labelId", value = "标签id(新增不传,编辑传)", required = false) @RequestParam Integer labelId) {
QueryWrapper<SysContentLabel> queryWrapper = new QueryWrapper<SysContentLabel>().eq("site_id", siteId).eq("label_name", labelName);

Loading…
Cancel
Save