依据需求更改

master
rong.liu 2 years ago
parent 0e6b5dd920
commit 1b58f64ce0
  1. 28
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  2. 14
      src/main/java/com/huoran/iasf/controller/SysTemplateController.java
  3. 4
      src/main/java/com/huoran/iasf/entity/SysColumn.java
  4. 6
      src/main/java/com/huoran/iasf/entity/SysContent.java
  5. 4
      src/main/java/com/huoran/iasf/entity/SysTemplate.java
  6. 5
      src/main/java/com/huoran/iasf/entity/SysTemplateStyle.java
  7. 3
      src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml
  8. 2
      src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java
  9. 3
      src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java

@ -1,15 +1,19 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huoran.iasf.entity.SysColumn;
import com.huoran.iasf.entity.SysContentFile;
import com.huoran.iasf.service.SysColumnService;
import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO;
import com.huoran.iasf.vo.req.ContentReq;
import com.huoran.iasf.vo.req.PageContentReqVO;
import com.huoran.iasf.vo.resp.PageContentRespVO;
import io.swagger.annotations.*;
import com.huoran.iasf.common.utils.R;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
@ -37,7 +41,8 @@ public class SysContentController {
@Autowired
public SysContentService service;
@Autowired
public SysColumnService columnService;
@PostMapping("/pagingQuery")
@ApiOperation(value = "分页查询", response = PageContentRespVO.class)
@ -53,6 +58,13 @@ public class SysContentController {
@ApiOperation(value = "查询详情", response = SysContent.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysContent sysContent = service.getById(id);
SysColumn sysColumn = columnService.getById(sysContent.getColumnId());
if (sysColumn.getColumnName()!=null){
sysContent.setColumnName(sysColumn.getColumnName());
}
return R.success(sysContent);
}
@ -123,5 +135,19 @@ public class SysContentController {
IPage<SysContent> iPage = service.page(page,queryWrapper);
return R.success(iPage);
}
@PostMapping("/articleEnableOrDisable")
@ApiOperation(value = "文章启用禁用",response = SysContent.class)
public R articleEnableOrDisable(@ApiParam(name = "id", value = "文章id", required = true) @RequestParam Integer id,
@ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) {
UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("is_disable",isDisable);
updateWrapper.eq("id",id);
boolean ret = service.update(updateWrapper);
return ret?R.success():R.fail("禁用/启用失败");
}
}

@ -44,9 +44,17 @@ public class SysTemplateController {
@PostMapping("/listOfColumnTemplates")
@ApiOperation(value = "获取栏目模板列表", response = SysTemplate.class)
public R listByEntity() {
List<SysTemplate> list = templateService.list();
@ApiOperation(value = "获取文章模板列表、详情样式", response = SysTemplate.class)
public R listOfColumnTemplates() {
List<SysTemplate> list = templateService.list(new QueryWrapper<SysTemplate>().eq("type",1));
return R.success(list);
}
@PostMapping("/longPageListStyle")
@ApiOperation(value = "长页列表样式", response = SysTemplate.class)
public R longPageListStyle() {
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("template_id",9));
return R.success(list);
}

@ -149,6 +149,10 @@ public class SysColumn implements Serializable {
@ApiModelProperty(value = "详情样式")
private String detailStyle;
@TableField(exist = false)
@ApiModelProperty(value = "路径")
private String path;
//----------------------非数据库字段End----------------------
}

@ -148,4 +148,10 @@ public class SysContent implements Serializable {
@ApiModelProperty(value = "所属分类(sys_content_classification表外键)")
private Integer classificationId;
@ApiModelProperty(value = "是否禁用(0默认,0启用 1禁用)")
private Integer isDisable;
@ApiModelProperty(value = "栏目名称")
@TableField(exist = false)
private String columnName;
}

@ -33,4 +33,8 @@ public class SysTemplate implements Serializable {
private String templateType;
@ApiModelProperty(value = "类型(0栏目 1文章)")
private Integer type;
}

@ -38,5 +38,10 @@ public class SysTemplateStyle implements Serializable {
@ApiModelProperty(value = "模板id")
private Integer templateId;
@ApiModelProperty(value = "跳转路径")
private String path;
}

@ -37,7 +37,8 @@
( SELECT u.username FROM sys_user u WHERE u.id = s.editor_id ) AS editorUser,
( SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id ) AS templateName,
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id ) AS listStyle,
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id ) AS detailStyle
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id ) AS detailStyle,
( SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id ) AS path
FROM
sys_column s
WHERE

@ -72,8 +72,6 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_release", Constant.ARTICLE_PUBLISHED);
queryWrapper.eq("template_status",Constant.TEMPLATE_STATUS_ENABLED);
// queryWrapper.eq("site_id", content.getSiteId());
List<SysContent> sysContentList = mapper.selectList(queryWrapper);
return R.success(sysContentList);

@ -92,4 +92,7 @@ public class PageContentRespVO {
@ApiModelProperty(value = "上级栏目")
private List<FatherContentRespVO> superiorColumn;
@ApiModelProperty(value = "是否禁用(0默认,0启用 1禁用)")
private Integer isDisable;
}
Loading…
Cancel
Save