提交代码

master
rong.liu 2 years ago
parent af0cde5d5b
commit c78c2cc9a2
  1. 18
      src/main/java/com/huoran/iasf/common/utils/Constant.java
  2. 34
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  3. 29
      src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java
  4. 108
      src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java
  5. 35
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  6. 81
      src/main/java/com/huoran/iasf/controller/SysContentFileController.java
  7. 104
      src/main/java/com/huoran/iasf/controller/SysContentLabelController.java
  8. 89
      src/main/java/com/huoran/iasf/controller/SysTemplateController.java
  9. 23
      src/main/java/com/huoran/iasf/entity/SysColumn.java
  10. 104
      src/main/java/com/huoran/iasf/entity/SysContent.java
  11. 57
      src/main/java/com/huoran/iasf/entity/SysContentClassification.java
  12. 63
      src/main/java/com/huoran/iasf/entity/SysContentFile.java
  13. 53
      src/main/java/com/huoran/iasf/entity/SysContentLabel.java
  14. 36
      src/main/java/com/huoran/iasf/entity/SysTemplate.java
  15. 42
      src/main/java/com/huoran/iasf/entity/SysTemplateStyle.java
  16. 2
      src/main/java/com/huoran/iasf/mapper/SysColumnMapper.java
  17. 16
      src/main/java/com/huoran/iasf/mapper/SysContentClassificationMapper.java
  18. 15
      src/main/java/com/huoran/iasf/mapper/SysContentFileMapper.java
  19. 16
      src/main/java/com/huoran/iasf/mapper/SysContentLabelMapper.java
  20. 16
      src/main/java/com/huoran/iasf/mapper/SysTemplateMapper.java
  21. 16
      src/main/java/com/huoran/iasf/mapper/SysTemplateStyleMapper.java
  22. 41
      src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml
  23. 16
      src/main/java/com/huoran/iasf/mapper/xml/SysContentClassificationMapper.xml
  24. 20
      src/main/java/com/huoran/iasf/mapper/xml/SysContentFileMapper.xml
  25. 16
      src/main/java/com/huoran/iasf/mapper/xml/SysContentLabelMapper.xml
  26. 24
      src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml
  27. 5
      src/main/java/com/huoran/iasf/mapper/xml/SysTemplateMapper.xml
  28. 5
      src/main/java/com/huoran/iasf/mapper/xml/SysTemplateStyleMapper.xml
  29. 3
      src/main/java/com/huoran/iasf/service/SysColumnService.java
  30. 14
      src/main/java/com/huoran/iasf/service/SysContentClassificationService.java
  31. 14
      src/main/java/com/huoran/iasf/service/SysContentFileService.java
  32. 14
      src/main/java/com/huoran/iasf/service/SysContentLabelService.java
  33. 16
      src/main/java/com/huoran/iasf/service/SysTemplateService.java
  34. 16
      src/main/java/com/huoran/iasf/service/SysTemplateStyleService.java
  35. 35
      src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java
  36. 26
      src/main/java/com/huoran/iasf/service/impl/SysContentClassificationServiceImpl.java
  37. 26
      src/main/java/com/huoran/iasf/service/impl/SysContentFileServiceImpl.java
  38. 26
      src/main/java/com/huoran/iasf/service/impl/SysContentLabelServiceImpl.java
  39. 20
      src/main/java/com/huoran/iasf/service/impl/SysTemplateServiceImpl.java
  40. 20
      src/main/java/com/huoran/iasf/service/impl/SysTemplateStyleServiceImpl.java
  41. 24
      src/main/java/com/huoran/iasf/vo/req/ContentReq.java

@ -59,4 +59,22 @@ public class Constant {
public static final Integer TEMPLATE_STATUS_DISABLED = 0; public static final Integer TEMPLATE_STATUS_DISABLED = 0;
public static final Integer TEMPLATE_STATUS_ENABLED = 1; public static final Integer TEMPLATE_STATUS_ENABLED = 1;
/**
* 模板类型 类型(0:列表样式 1:详情样式)',
*/
public static final Integer LIST_TEMPLATE_TYPES = 0;
public static final Integer DETAILS_TEMPLATE_TYPE = 1;
/**
* 栏目导航菜单是否可见 菜单是否可见(默认0可见 1不可见)
*/
public static final Integer NAVIGATION_MENU_VISIBLE = 0;
public static final Integer THE_NAVIGATION_MENU_IS_NOT_VISIBLE = 1;
} }

@ -2,6 +2,7 @@ package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.huoran.iasf.common.utils.Constant;
import com.huoran.iasf.entity.ColumnEntity; import com.huoran.iasf.entity.ColumnEntity;
import com.huoran.iasf.entity.SysColumn; import com.huoran.iasf.entity.SysColumn;
import com.huoran.iasf.entity.SysContent; import com.huoran.iasf.entity.SysContent;
@ -13,6 +14,7 @@ import io.swagger.annotations.*;
import com.huoran.iasf.common.utils.R; import com.huoran.iasf.common.utils.R;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -46,10 +48,16 @@ public class SysColumnController {
@PostMapping("/listWithTree") @PostMapping("/listWithTree")
@ApiOperation(value = "栏目树结构", response = SysColumn.class) @ApiOperation(value = "栏目树结构", response = SysColumn.class)
public R listWithTree(@RequestBody @Valid PaginationColumnReqVO sysColumn) { public R listWithTree(@RequestBody @Validated PaginationColumnReqVO sysColumn) {
return R.success(service.listWithTree(sysColumn)); return R.success(service.listWithTree(sysColumn));
} }
@PostMapping("/listWithTreeMenuVisible")
@ApiOperation(value = "栏目树结构(前台可见,只展示试单可见的栏目)", response = SysColumn.class)
public R listWithTreeMenuVisible(@RequestBody @Validated PaginationColumnReqVO sysColumn) {
return R.success(service.listWithTreeMenuVisible(sysColumn));
}
@PostMapping("/findById") @PostMapping("/findById")
@ApiOperation(value = "查询详情", response = SysColumn.class) @ApiOperation(value = "查询详情", response = SysColumn.class)
@ -63,7 +71,7 @@ public class SysColumnController {
@ApiOperation(value = "新增", response = SysColumn.class) @ApiOperation(value = "新增", response = SysColumn.class)
public R save(@RequestBody @Valid SysColumn sysColumn) { public R save(@RequestBody @Valid SysColumn sysColumn) {
boolean addState = service.save(sysColumn); boolean addState = service.save(sysColumn);
return addState ? R.success() : R.fail("新增失败"); return addState ? R.success(sysColumn.getId()) : R.fail("新增失败");
} }
@PostMapping("/update") @PostMapping("/update")
@ -77,6 +85,24 @@ public class SysColumnController {
@ApiOperation(value = "删除", response = SysContent.class) @ApiOperation(value = "删除", response = SysContent.class)
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
boolean delState = service.removeById(id); boolean delState = service.removeById(id);
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.in("column_id",id);
//删除栏目后删除栏目下的文章
List<SysContent> contentId = contentService.list(queryWrapper);
contentService.removeByIds(contentId);
return delState ? R.success() : R.fail("删除失败");
}
@PostMapping("/batchDeletion")
@ApiOperation(value = "批量删除栏目", response = SysColumn.class)
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List<Integer> ids) {
boolean delState = service.removeByIds(ids);
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.in("column_id",ids);
//删除栏目后删除栏目下的文章
contentService.remove(queryWrapper);
return delState ? R.success() : R.fail("删除失败"); return delState ? R.success() : R.fail("删除失败");
} }
@ -94,7 +120,7 @@ public class SysColumnController {
BeanUtils.copyProperties(sort, sysColumn); BeanUtils.copyProperties(sort, sysColumn);
service.updateById(sysColumn); service.updateById(sysColumn);
//依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id //依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>(); /*QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_id", sysColumn.getId()); queryWrapper.eq("column_id", sysColumn.getId());
List<SysContent> contentList = contentService.list(queryWrapper); List<SysContent> contentList = contentService.list(queryWrapper);
if (contentList.size() > 0) { if (contentList.size() > 0) {
@ -103,7 +129,7 @@ public class SysColumnController {
updateWrapper.set("column_id", sysColumn.getId()); updateWrapper.set("column_id", sysColumn.getId());
contentService.update(content, updateWrapper); contentService.update(content, updateWrapper);
} }
} }*/
} }

@ -3,6 +3,8 @@ package com.huoran.iasf.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.Constant; import com.huoran.iasf.common.utils.Constant;
import com.huoran.iasf.entity.SysColumn;
import com.huoran.iasf.service.SysColumnService;
import com.huoran.iasf.vo.req.SysColumnLongRedisVO; import com.huoran.iasf.vo.req.SysColumnLongRedisVO;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -39,7 +41,8 @@ public class SysColumnLongPageController {
@Autowired @Autowired
public SysColumnLongPageService service; public SysColumnLongPageService service;
@Autowired
public SysColumnService columnService;
@Autowired @Autowired
private StringRedisTemplate redisTemplate; private StringRedisTemplate redisTemplate;
@ -52,13 +55,11 @@ public class SysColumnLongPageController {
} }
@PostMapping("/getLongPageInformation") @PostMapping("/getLongPageInformation")
@ApiOperation(value = "根据栏目id查询类型长页栏目信息", response = SysColumnLongPage.class) @ApiOperation(value = "根据栏目id查询类型长页栏目信息", response = SysColumnLongPage.class)
public R getLongPageInformation(@ApiParam(name = "columnId", value = "栏目id", required = true) @RequestParam Integer columnId) { public R getLongPageInformation(@ApiParam(name = "columnId", value = "栏目id", required = true) @RequestParam Integer columnId) {
QueryWrapper<SysColumnLongPage> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysColumnLongPage> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_id",columnId); queryWrapper.eq("column_id", columnId);
List<SysColumnLongPage> longPageList = service.list(queryWrapper); List<SysColumnLongPage> longPageList = service.list(queryWrapper);
return R.success(longPageList); return R.success(longPageList);
} }
@ -67,6 +68,16 @@ public class SysColumnLongPageController {
@PostMapping("/save") @PostMapping("/save")
@ApiOperation(value = "新增", response = SysColumnLongPage.class) @ApiOperation(value = "新增", response = SysColumnLongPage.class)
public R save(@RequestBody @Valid @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) { public R save(@RequestBody @Valid @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) {
SysColumn column = columnService.getById(sysColumnLongPage.getColumnId());
if (sysColumnLongPage.getState() == Constant.ARTICLE_NOT_PUBLISHED) {//发布状态(0:草稿 1已发布)
//发布状态为草稿箱时候 导航菜单是否启用为禁用状态
column.setMenuVisible(Constant.THE_NAVIGATION_MENU_IS_NOT_VISIBLE);
} else {
column.setMenuVisible(Constant.NAVIGATION_MENU_VISIBLE);
}
columnService.updateById(column);
boolean addState = service.save(sysColumnLongPage); boolean addState = service.save(sysColumnLongPage);
return addState ? R.success() : R.fail("新增失败"); return addState ? R.success() : R.fail("新增失败");
} }
@ -75,6 +86,16 @@ public class SysColumnLongPageController {
@PostMapping("/update") @PostMapping("/update")
@ApiOperation(value = "修改", response = SysColumnLongPage.class) @ApiOperation(value = "修改", response = SysColumnLongPage.class)
public R update(@RequestBody @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) { public R update(@RequestBody @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) {
SysColumn column = columnService.getById(sysColumnLongPage.getColumnId());
if (sysColumnLongPage.getState() == Constant.ARTICLE_NOT_PUBLISHED) {//发布状态(0:草稿 1已发布)
//发布状态为草稿箱时候 导航菜单是否启用为禁用状态
column.setMenuVisible(Constant.THE_NAVIGATION_MENU_IS_NOT_VISIBLE);
} else {
column.setMenuVisible(Constant.NAVIGATION_MENU_VISIBLE);
}
columnService.updateById(column);
boolean updateState = service.updateById(sysColumnLongPage); boolean updateState = service.updateById(sysColumnLongPage);
return updateState ? R.success() : R.fail("编辑失败"); return updateState ? R.success() : R.fail("编辑失败");
} }

@ -0,0 +1,108 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.SysContentClassification;
import com.huoran.iasf.service.SysContentClassificationService;
import io.swagger.annotations.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import javax.validation.Valid;
import java.util.List;
/**
* @描述文章所属分类控制类
* @作者: Rong
* @日期: 2022-11-08
*/
@RestController
@RequestMapping("/content/classification")
@Api(value = "文章所属分类:SysContentClassificationController", tags = "R-文章所属分类")
public class SysContentClassificationController {
@Autowired
public SysContentClassificationService service;
@PostMapping("/allTheQuery")
@ApiOperation(value = "查询全部文章所属分类", response = SysContentClassification.class)
public R allTheQuery(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId) {
List<SysContentClassification> list = service.list(new QueryWrapper<SysContentClassification>().eq("site_id", siteId));
return R.success(list);
}
@PostMapping("/findById")
@ApiOperation(value = "查询详情", response = SysContentClassification.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysContentClassification sysContentClassification = service.getById(id);
return R.success(sysContentClassification);
}
@PostMapping("/checkForHeavy")
@ApiOperation(value = "分类校验判重", response = SysContentClassification.class)
public R checkForHeavy(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId,
@ApiParam(name = "classificationName", value = "分类名称", required = true) @RequestParam String classificationName,
@ApiParam(name = "classificationId", value = "分类id(新增不传,编辑传)", required = false) @RequestParam Integer classificationId) {
QueryWrapper<SysContentClassification> queryWrapper = new QueryWrapper<SysContentClassification>().eq("site_id", siteId).
eq("classification_name", classificationName);
//id不得空表示编辑校验
if (classificationId != null) {
queryWrapper.last(" and id != " + classificationId);
}
SysContentClassification sysContentClassification = service.getOne(queryWrapper);
if (sysContentClassification != null) {
return R.fail("当前分类名称已存在!");
}
return R.success();
}
@PostMapping("/save")
@ApiOperation(value = "新增", response = SysContentClassification.class)
public R save(@RequestBody @Valid @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) {
boolean addState = service.save(sysContentClassification);
return addState ? R.success() : R.fail("新增失败");
}
@PostMapping("/update")
@ApiOperation(value = "修改", response = SysContentClassification.class)
public R update(@RequestBody @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) {
boolean updateState = service.updateById(sysContentClassification);
return updateState ? R.success() : R.fail("编辑失败");
}
@PostMapping("/delete")
@ApiOperation(value = "删除", response = SysContentClassification.class)
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
boolean delState = service.removeById(id);
return delState ? R.success() : R.fail("删除失败");
}
@PostMapping("/batchDeletion")
@ApiOperation(value = "批量删除", response = SysContentClassification.class)
public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List<Integer> ids) {
boolean delState = service.removeByIds(ids);
return delState ? R.success() : R.fail("删除失败");
//
}
}

@ -1,6 +1,11 @@
package com.huoran.iasf.controller; package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huoran.iasf.entity.SysContentFile;
import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO; 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.req.PageContentReqVO;
import com.huoran.iasf.vo.resp.PageContentRespVO; import com.huoran.iasf.vo.resp.PageContentRespVO;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ -17,6 +22,7 @@ import com.huoran.iasf.service.SysContentService;
import com.huoran.iasf.entity.SysContent; import com.huoran.iasf.entity.SysContent;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
/** /**
@ -40,6 +46,9 @@ public class SysContentController {
} }
@PostMapping("/findById") @PostMapping("/findById")
@ApiOperation(value = "查询详情", response = SysContent.class) @ApiOperation(value = "查询详情", response = SysContent.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
@ -51,7 +60,7 @@ public class SysContentController {
@ApiOperation(value = "新增", response = SysContent.class) @ApiOperation(value = "新增", response = SysContent.class)
public R save(@RequestBody @Valid @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { public R save(@RequestBody @Valid @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) {
boolean addState = service.save(sysContent); boolean addState = service.save(sysContent);
return addState ? R.success() : R.fail("新增失败"); return addState ? R.success(sysContent.getId()) : R.fail("新增失败");
} }
@ -71,6 +80,14 @@ public class SysContentController {
} }
@PostMapping("/batchDeletion")
@ApiOperation(value = "批量删除文章", response = SysContent.class)
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List<Integer> ids) {
boolean delState = service.removeByIds(ids);
return delState ? R.success() : R.fail("删除失败");
}
@PostMapping("/checkIfTheTitleIsRepeat") @PostMapping("/checkIfTheTitleIsRepeat")
@ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class) @ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class)
public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) { public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) {
@ -90,5 +107,21 @@ public class SysContentController {
public R publishedEnabledArticles() { public R publishedEnabledArticles() {
return service.publishedEnabledArticles(); return service.publishedEnabledArticles();
} }
/**
* 获取栏目下的文章
* @param pageReq
* @return
*/
@PostMapping("/getColumnArticles")
@ApiOperation(value = "获取栏目下的文章",response = SysContent.class)
public R getColumnArticles(@RequestBody @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) ContentReq pageReq) {
IPage page = new Page(pageReq.getPageNum(), pageReq.getPageSize());
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.in("column_id",pageReq.getColumnIds());
IPage<SysContent> iPage = service.page(page,queryWrapper);
return R.success(iPage);
}
} }

@ -0,0 +1,81 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.SysContentFile;
import com.huoran.iasf.service.SysContentFileService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.ApiOperation;
import java.util.List;
/**
* @描述文章附件管理表控制类
* @作者: Rong
* @日期: 2022-11-07
*/
@RestController
@RequestMapping("/content/file")
@Api(value = "文章附件管理表:SysContentFileController", tags = "文章附件管理表")
public class SysContentFileController {
@Autowired
public SysContentFileService service;
@PostMapping("/theAttachmentUnderTheQueryColumn")
@ApiOperation(value = "查询文章id下的附件", response = SysContentFile.class)
public R theAttachmentUnderTheQueryColumn(@ApiParam(name = "contentId", value = "文章id", required = true) @RequestParam Integer contentId) {
QueryWrapper<SysContentFile> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("content_id",contentId);
List<SysContentFile> sysContentFile = service.list(queryWrapper);
return R.success(sysContentFile);
}
@PostMapping("/findById")
@ApiOperation(value = "查询详情", response = SysContentFile.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysContentFile sysContentFile = service.getById(id);
return R.success(sysContentFile);
}
@PostMapping("/save")
@ApiOperation(value = "新增", response = SysContentFile.class)
public R save(@RequestBody @ApiParam(name = "文章附件管理表对象", value = "传入json格式", required = true) SysContentFile sysContentFile) {
boolean addState = service.save(sysContentFile);
return addState ? R.success(sysContentFile.getId()) : R.fail("新增失败");
}
@PostMapping("/update")
@ApiOperation(value = "修改", response = SysContentFile.class)
public R update(@RequestBody @ApiParam(name = "文章附件管理表对象", value = "传入json格式", required = true) SysContentFile sysContentFile) {
boolean updateState = service.updateById(sysContentFile);
return updateState ? R.success() : R.fail("编辑失败");
}
@PostMapping("/delete")
@ApiOperation(value = "删除", response = SysContentFile.class)
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
boolean delState = service.removeById(id);
return delState ? R.success() : R.fail("删除失败");
}
@PostMapping("/batchDeletion")
@ApiOperation(value = "批量删除", response = SysContentFile.class)
public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List<Integer> ids) {
boolean delState = service.removeByIds(ids);
return delState ? R.success() : R.fail("删除失败");
}
}

@ -0,0 +1,104 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.SysContentClassification;
import com.huoran.iasf.entity.SysContentLabel;
import com.huoran.iasf.service.SysContentLabelService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.ApiOperation;
import javax.validation.Valid;
import java.util.List;
/**
* @描述文章主题标签控制类
* @作者: Rong
* @日期: 2022-11-08
*/
@RestController
@RequestMapping("/content/label")
@Api(value = "文章主题标签:SysContentLabelController", tags = "R-文章主题标签")
public class SysContentLabelController {
@Autowired
public SysContentLabelService service;
@PostMapping("/queryAllArticleSubjectTags")
@ApiOperation(value = "查询全部文章主题标签", response = SysContentLabel.class)
public R queryAllArticleSubjectTags(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId) {
List<SysContentLabel> list = service.list(new QueryWrapper<SysContentLabel>().eq("site_id", siteId));
return R.success(list);
}
@PostMapping("/findById")
@ApiOperation(value = "查询详情", response = SysContentLabel.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
SysContentLabel sysContentLabel = service.getById(id);
return R.success(sysContentLabel);
}
@PostMapping("/save")
@ApiOperation(value = "新增", response = SysContentLabel.class)
public R save(@RequestBody @Valid @ApiParam(name = "文章主题标签对象", value = "传入json格式", required = true) SysContentLabel sysContentLabel) {
boolean addState = service.save(sysContentLabel);
return addState ? R.success() : R.fail("新增失败");
}
@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) {
QueryWrapper<SysContentLabel> queryWrapper = new QueryWrapper<SysContentLabel>().eq("site_id", siteId).eq("label_name", labelName);
//id不得空表示编辑校验
if (labelId != null) {
queryWrapper.last(" and id != " + labelId);
}
SysContentLabel contentLabel = service.getOne(queryWrapper);
if (contentLabel != null) {
return R.fail("当前标签名称已存在!");
}
return R.success();
}
@PostMapping("/update")
@ApiOperation(value = "修改", response = SysContentLabel.class)
public R update(@RequestBody @ApiParam(name = "文章主题标签对象", value = "传入json格式", required = true) SysContentLabel sysContentLabel) {
boolean updateState = service.updateById(sysContentLabel);
return updateState ? R.success() : R.fail("编辑失败");
}
@PostMapping("/delete")
@ApiOperation(value = "删除", response = SysContentLabel.class)
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
boolean delState = service.removeById(id);
return delState ? R.success() : R.fail("删除失败");
}
@PostMapping("/batchDeletion")
@ApiOperation(value = "批量删除", response = SysContentLabel.class)
public R batchDeletion(@ApiParam(name = "id", value = "主键", required = true) @RequestParam List<Integer> ids) {
boolean delState = service.removeByIds(ids);
return delState ? R.success() : R.fail("删除失败");
}
}

@ -0,0 +1,89 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.Constant;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.huoran.iasf.service.SysTemplateStyleService;
import io.swagger.annotations.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huoran.iasf.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.huoran.iasf.service.SysTemplateService;
import com.huoran.iasf.entity.SysTemplate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述栏目模板控制类
* @作者: Rong
* @日期: 2022-11-11
*/
@RestController
@RequestMapping("/template")
@Api(value = "栏目模板:SysTemplateController", tags = "栏目模板:栏目模板相关")
public class SysTemplateController {
@Autowired
public SysTemplateService templateService;
@Autowired
public SysTemplateStyleService styleService;
@PostMapping("/listOfColumnTemplates")
@ApiOperation(value = "获取栏目模板列表", response = SysTemplate.class)
public R listByEntity() {
List<SysTemplate> list = templateService.list();
return R.success(list);
}
@PostMapping("/theTemplateIdGetsTheStyle")
@ApiOperation(value = "根据模板id获取样式", response = SysTemplateStyle.class)
public R theTemplateIdGetsTheStyle(@ApiParam(name = "templateId", value = "模板id", required = true) @RequestParam Integer templateId) {
QueryWrapper<SysTemplateStyle> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("template_id",templateId);
queryWrapper.eq("type", Constant.LIST_TEMPLATE_TYPES);
List<SysTemplateStyle> listingTemplateTypes = styleService.list(queryWrapper);
QueryWrapper<SysTemplateStyle> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("template_id",templateId);
queryWrapper1.eq("type", Constant.DETAILS_TEMPLATE_TYPE);
List<SysTemplateStyle> detailsTypeOfTheTemplate = styleService.list(queryWrapper1);
Map<String,Object> map = new HashMap<>();
map.put("listingTemplateTypes",listingTemplateTypes);//列表样式
map.put("detailsTypeOfTheTemplate",detailsTypeOfTheTemplate);//详情样式
return R.success(map);
}
@PostMapping("/fullDetailsTemplateStyle")
@ApiOperation(value = "全部详情模板样式", response = SysTemplateStyle.class)
public R fullDetailsTemplateStyle() {
QueryWrapper<SysTemplateStyle> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", Constant.DETAILS_TEMPLATE_TYPE);
List<SysTemplateStyle> listingTemplateTypes = styleService.list(queryWrapper);
return R.success(listingTemplateTypes);
}
}

@ -51,17 +51,17 @@ public class SysColumn implements Serializable {
@ApiModelProperty(value = "菜单是否可见(默认0可见 1不可见)") @ApiModelProperty(value = "菜单是否可见(默认0可见 1不可见)")
private Integer menuVisible; private Integer menuVisible;
@ApiModelProperty(value = "栏目类型(由前端自己设定)") @ApiModelProperty(value = "栏目类型id")
private Integer typeId; private Integer typeId;
@ApiModelProperty(value = "栏目模板(由前端自己设定)") @ApiModelProperty(value = "栏目模板id")
private Integer templateId; private Integer templateId;
@ApiModelProperty(value = "列表样式(由前端自己设定)") @ApiModelProperty(value = "列表样式id")
private Integer listStyleId; private Integer listStyleId;
@ApiModelProperty(value = "详情样式(由前端自己设定)") @ApiModelProperty(value = "详情样式id")
private Integer detailStyle; private Integer detailStyleId;
@ApiModelProperty(value = "链接类型") @ApiModelProperty(value = "链接类型")
private Integer connectionType; private Integer connectionType;
@ -136,6 +136,19 @@ public class SysColumn implements Serializable {
return 0; return 0;
} }
@TableField(exist = false)
@ApiModelProperty(value = "模板名称")
private String templateName;
@TableField(exist = false)
@ApiModelProperty(value = "列表样式")
private String listStyle;
@TableField(exist = false)
@ApiModelProperty(value = "详情样式")
private String detailStyle;
//----------------------非数据库字段End---------------------- //----------------------非数据库字段End----------------------
} }

@ -30,53 +30,44 @@ public class SysContent implements Serializable {
private Integer id; private Integer id;
@ApiModelProperty(value = "标题(全库判重)") @ApiModelProperty(value = "标题(全库判重)")
@NotNull(message = "标题不能为空!")
private String title; private String title;
@ApiModelProperty(value = "所属栏目") @ApiModelProperty(value = "所属栏目")
@NotNull(message = "所属栏目不能为空!")
private Integer columnId; private Integer columnId;
@ApiModelProperty(value = "标题图") @ApiModelProperty(value = "发布时间")
private String titleImg; private Date releaseTime;
@ApiModelProperty(value = "来源") @ApiModelProperty(value = "来源")
private String source; private String source;
@ApiModelProperty(value = "发布时间") @ApiModelProperty(value = "作者")
// @NotNull(message = "发布时间不能为空!") private String author;
private Date releaseTime;
@ApiModelProperty(value = "摘要")
private String summary;
@ApiModelProperty(value = "banner图") @ApiModelProperty(value = "banner图")
private String bannerImg; private String bannerImg;
@ApiModelProperty(value = "文章模板(前端自定义)——>没选择时默认读取当前所引用栏目的栏目类型") @ApiModelProperty(value = "文章模板(前端自定义)")
private Integer articleTemplate; private Integer articleTemplate;
@ApiModelProperty(value = "摘要")
private String summary;
@ApiModelProperty(value = "标题图(封面图)")
private String titleImg;
@ApiModelProperty(value = "正文") @ApiModelProperty(value = "正文")
private String mainBody; private String mainBody;
@ApiModelProperty(value = "作者") @ApiModelProperty(value = "是否发布(0:草稿 1:已发布)")
private String author;
@ApiModelProperty(value = "发布状态——>是否发布(0:草稿 1:已发布)")
@NotNull(message = "发布状态不能为空!")
private Integer isRelease; private Integer isRelease;
@ApiModelProperty(value = "创建人id") @ApiModelProperty(value = "创建人id")
@NotNull(message = "创建人id不能为空!")
private Integer founderId; private Integer founderId;
@ApiModelProperty(value = "编辑人id") @ApiModelProperty(value = "编辑人id")
@NotNull(message = "编辑人id不能为空!")
private Integer editorId; private Integer editorId;
@ApiModelProperty(value = "文件")
private String file;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private Date createTime; private Date createTime;
@ -84,19 +75,9 @@ public class SysContent implements Serializable {
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "文章总浏览量") @ApiModelProperty(value = "文章总浏览量")
private Integer totalBrowsing; private Integer totalBrowsing;
@ApiModelProperty(value = "链接类型")
private Integer connectionType;
@ApiModelProperty(value = "链接地址")
private String linkAddress;
@ApiModelProperty(value = "站点选择(连接类型为其它站点连接时储存)1.EFL中文2.SRL中文")
private Integer siteSelection;
@ApiModelProperty(value = "是否在新窗口打开(0:否 1:是)") @ApiModelProperty(value = "是否在新窗口打开(0:否 1:是)")
private Integer isOpen; private Integer isOpen;
@ -105,9 +86,66 @@ public class SysContent implements Serializable {
private Integer deleted; private Integer deleted;
@ApiModelProperty(value = "站点id") @ApiModelProperty(value = "站点id")
@NotNull(message = "站点id不能为空!")
private Integer siteId; private Integer siteId;
@ApiModelProperty(value = "独立模板状态(0禁用;1启用)") @ApiModelProperty(value = "模板状态(0禁用;1启用)")
private Integer templateStatus; private Integer templateStatus;
/* @ApiModelProperty(value = "其余模板字段")
private String remainingTemplateFields;*/
@ApiModelProperty(value = "链接类型")
private Integer connectionType;
@ApiModelProperty(value = "链接地址")
private String linkAddress;
@ApiModelProperty(value = "站点选择(连接类型为其它站点连接时储存)")
private Integer siteSelection;
@ApiModelProperty(value = "编辑人")
private String edit;
@ApiModelProperty(value = "审核人")
private String audit;
@ApiModelProperty(value = "活动开始时间")
private Date activityStartTime;
@ApiModelProperty(value = "活动结束时间")
private Date activityEndTime;
@ApiModelProperty(value = "演讲系列")
private String lectureSeries;
@ApiModelProperty(value = "线上地点")
private String onlineLocation;
@ApiModelProperty(value = "线下地点")
private String offlineLocation;
@ApiModelProperty(value = "主讲人")
private String keynoteSpeaker;
@ApiModelProperty(value = "活动简介")
private String eventProfile;
@ApiModelProperty(value = "出版年份")
private String publicationYear;
@ApiModelProperty(value = "出版类型(前端自定义)")
private Integer publicationTypeId;
@ApiModelProperty(value = "DOI")
private String doi;
@ApiModelProperty(value = "引用")
private String quote;
@ApiModelProperty(value = "主题标签(sys_content_label表外键) 可多选逗号隔开")
private String lableId;
@ApiModelProperty(value = "所属分类(sys_content_classification表外键)")
private Integer classificationId;
} }

@ -0,0 +1,57 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* @描述文章所属分类
* @作者: Rong
* @日期: 2022-11-08
*/
@Data
@ApiModel(value = "文章所属分类")
@TableName("sys_content_classification")
public class SysContentClassification implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "分类名称")
private String classificationName;
@ApiModelProperty(value = "创建人id")
@NotNull(message = "创建人id不能为空")
private Integer founderId;
@ApiModelProperty(value = "编辑人id")
@NotNull(message = "编辑人id不能为空")
private Integer editorId;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "是否删除(1未删除;0已删除)")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "站点id")
@NotNull(message = "站点id不能为空!")
private Integer siteId;
}

@ -0,0 +1,63 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @描述文章附件管理表
* @作者: Rong
* @日期: 2022-11-07
*/
@Data
@ApiModel(value = "文章附件管理表")
@TableName("sys_content_file")
public class SysContentFile implements Serializable {
private static final long serialVersionUID=1L;
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "文章id")
private Integer contentId;
@ApiModelProperty(value = "文件名")
private String fileName;
@ApiModelProperty(value = "创建人id")
private Integer founderId;
@ApiModelProperty(value = "编辑人id")
private Integer editorId;
@ApiModelProperty(value = "文件大小")
private String fileSize;
@ApiModelProperty(value = "文件格式")
private String fileFormat;
@ApiModelProperty(value = "oss文件名")
private String ossFileName;
@ApiModelProperty(value = "文件路径")
private String filePath;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "是否删除(1未删除;0已删除)")
@TableLogic
private Integer deleted;
}

@ -0,0 +1,53 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* @描述文章主题标签
* @作者: Rong
* @日期: 2022-11-08
*/
@Data
@ApiModel(value = "文章主题标签")
@TableName("sys_content_label")
public class SysContentLabel implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "标签名称")
private String labelName;
@ApiModelProperty(value = "创建人id")
private Integer founderId;
@ApiModelProperty(value = "编辑人id")
private Integer editorId;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "是否删除(1未删除;0已删除)")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "站点id")
@NotNull(message = "站点id不能为空!")
private Integer siteId;
}

@ -0,0 +1,36 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 栏目模板
* </p>
*
* @author cheney
* @since 2022-11-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "SysTemplate对象", description = "栏目模板")
public class SysTemplate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "模板类型名称")
private String templateType;
}

@ -0,0 +1,42 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author cheney
* @since 2022-11-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "SysTemplateStyle对象", description = "")
public class SysTemplateStyle implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "类型(0:列表样式 1:详情样式)")
private Integer type;
@ApiModelProperty(value = "样式名称")
private String style;
@ApiModelProperty(value = "模板id")
private Integer templateId;
}

@ -25,6 +25,8 @@ import java.util.List;
public interface SysColumnMapper extends BaseMapper<SysColumn> { public interface SysColumnMapper extends BaseMapper<SysColumn> {
List<SysColumn> filter(@Param("vo") PaginationColumnReqVO vo); List<SysColumn> filter(@Param("vo") PaginationColumnReqVO vo);
List<SysColumn> filterMenuVisible(@Param("vo") PaginationColumnReqVO vo);
IPage<PageContentRespVO> longPageColumnList(Page<PageContentRespVO> page, @Param("req") LongPageColumnReqVO req); IPage<PageContentRespVO> longPageColumnList(Page<PageContentRespVO> page, @Param("req") LongPageColumnReqVO req);

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.SysContentClassification;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @描述文章所属分类 Mapper 接口
* @作者: Rong
* @日期: 2022-11-08
*/
@Mapper
public interface SysContentClassificationMapper extends BaseMapper<SysContentClassification> {
}

@ -0,0 +1,15 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.SysContentFile;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @描述文章附件管理表 Mapper 接口
* @作者: Rong
* @日期: 2022-11-07
*/
@Mapper
public interface SysContentFileMapper extends BaseMapper<SysContentFile> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huoran.iasf.entity.SysContentLabel;
import org.apache.ibatis.annotations.Mapper;
/**
* @描述文章主题标签 Mapper 接口
* @作者: Rong
* @日期: 2022-11-08
*/
@Mapper
public interface SysContentLabelMapper extends BaseMapper<SysContentLabel> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.SysTemplate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 栏目模板 Mapper 接口
* </p>
*
* @author cheney
* @since 2022-11-11
*/
public interface SysTemplateMapper extends BaseMapper<SysTemplate> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author cheney
* @since 2022-11-11
*/
public interface SysTemplateStyleMapper extends BaseMapper<SysTemplateStyle> {
}

@ -15,7 +15,7 @@
<result column="type_id" property="typeId"/> <result column="type_id" property="typeId"/>
<result column="template_id" property="templateId"/> <result column="template_id" property="templateId"/>
<result column="list_style_id" property="listStyleId"/> <result column="list_style_id" property="listStyleId"/>
<result column="detail_style" property="detailStyle"/> <result column="detail_style_id" property="detailStyleId"/>
<result column="connection_type" property="connectionType"/> <result column="connection_type" property="connectionType"/>
<result column="link_address" property="linkAddress"/> <result column="link_address" property="linkAddress"/>
<result column="show_with_details" property="showWithDetails"/> <result column="show_with_details" property="showWithDetails"/>
@ -32,12 +32,16 @@
<select id="filter" resultType="com.huoran.iasf.entity.SysColumn"> <select id="filter" resultType="com.huoran.iasf.entity.SysColumn">
SELECT SELECT
* , *,
(SELECT u.username from sys_user u WHERE u.id = s.founder_id) as creteUser, ( SELECT u.username FROM sys_user u WHERE u.id = s.founder_id ) AS creteUser,
(SELECT u.username from sys_user u WHERE u.id = s.editor_id) as editorUser ( 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
FROM FROM
sys_column s sys_column s
WHERE deleted = 1 and site_id = #{vo.siteId} WHERE
deleted = 1 and site_id = #{vo.siteId}
<if test="vo.columnName != '' and vo.columnName!= null"> <if test="vo.columnName != '' and vo.columnName!= null">
and column_name LIKE CONCAT('%',#{vo.columnName},'%') and column_name LIKE CONCAT('%',#{vo.columnName},'%')
</if> </if>
@ -90,5 +94,32 @@
ORDER BY ORDER BY
T1.lvl DESC T1.lvl DESC
</select> </select>
<select id="filterMenuVisible" resultType="com.huoran.iasf.entity.SysColumn">
SELECT
*,
( SELECT u.username FROM sys_user u WHERE u.id = s.founder_id ) AS creteUser,
( 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
FROM
sys_column s
WHERE deleted = 1 and site_id = #{vo.siteId}
and menu_visible = 0
<if test="vo.columnName != '' and vo.columnName!= null">
and column_name LIKE CONCAT('%',#{vo.columnName},'%')
</if>
<if test="vo.isSort== 1">
ORDER BY
s.father_id,
s.sort ASC,
s.create_time desc
</if>
<if test="vo.isSort== 0">
ORDER BY
s.create_time asc
</if>
</select>
</mapper> </mapper>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.iasf.mapper.SysContentClassificationMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysContentClassification">
<id column="id" property="id"/>
<result column="classification_name" property="classificationName"/>
<result column="founder_id" property="founderId"/>
<result column="editor_id" property="editorId"/>
<result column="create_time" property="createTime"/>
<result column="deleted" property="deleted"/>
<result column="site_id" property="siteId"/>
</resultMap>
</mapper>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.iasf.mapper.SysContentFileMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysContentFile">
<id column="id" property="id"/>
<result column="content_id" property="contentId"/>
<result column="file_name" property="fileName"/>
<result column="founder_id" property="founderId"/>
<result column="editor_id" property="editorId"/>
<result column="file_size" property="fileSize"/>
<result column="file_format" property="fileFormat"/>
<result column="oss_file_name" property="ossFileName"/>
<result column="file_path" property="filePath"/>
<result column="create_time" property="createTime"/>
<result column="deleted" property="deleted"/>
</resultMap>
</mapper>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.iasf.mapper.SysContentLabelMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysContentLabel">
<id column="id" property="id"/>
<result column="label_name" property="labelName"/>
<result column="founder_id" property="founderId"/>
<result column="editor_id" property="editorId"/>
<result column="create_time" property="createTime"/>
<result column="deleted" property="deleted"/>
<result column="site_id" property="siteId"/>
</resultMap>
</mapper>

@ -2,23 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.iasf.mapper.SysContentMapper"> <mapper namespace="com.huoran.iasf.mapper.SysContentMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysContent"> <resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysContent">
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="title" property="title"/> <result column="title" property="title"/>
<result column="column_id" property="columnId"/> <result column="column_id" property="columnId"/>
<result column="title_img" property="titleImg"/> <result column="title_img" property="titleImg"/>
<result column="banner_img" property="bannerImg"/>
<result column="source" property="source"/> <result column="source" property="source"/>
<result column="release_time" property="releaseTime"/> <result column="release_time" property="releaseTime"/>
<result column="summary" property="summary"/> <result column="summary" property="summary"/>
<result column="banner_img" property="bannerImg"/>
<result column="article_template" property="articleTemplate"/> <result column="article_template" property="articleTemplate"/>
<result column="main_body" property="mainBody"/> <result column="main_body" property="mainBody"/>
<result column="author" property="author"/> <result column="author" property="author"/>
<result column="is_release" property="isRelease"/> <result column="is_release" property="isRelease"/>
<result column="founder_id" property="founderId"/> <result column="founder_id" property="founderId"/>
<result column="editor_id" property="editorId"/> <result column="editor_id" property="editorId"/>
<result column="file" property="file"/>
<result column="create_time" property="createTime"/> <result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/> <result column="update_time" property="updateTime"/>
<result column="total_browsing" property="totalBrowsing"/> <result column="total_browsing" property="totalBrowsing"/>
@ -27,7 +27,23 @@
<result column="site_selection" property="siteSelection"/> <result column="site_selection" property="siteSelection"/>
<result column="is_open" property="isOpen"/> <result column="is_open" property="isOpen"/>
<result column="deleted" property="deleted"/> <result column="deleted" property="deleted"/>
<result column="side_id" property="siteId"/> <result column="site_id" property="siteId"/>
<result column="template_status" property="templateStatus"/>
<result column="edit" property="edit"/>
<result column="audit" property="audit"/>
<result column="activity_start_time" property="activityStartTime"/>
<result column="activity_end_time" property="activityEndTime"/>
<result column="lecture_series" property="lectureSeries"/>
<result column="online_location" property="onlineLocation"/>
<result column="offline_location" property="offlineLocation"/>
<result column="keynote_speaker" property="keynoteSpeaker"/>
<result column="event_profile" property="eventProfile"/>
<result column="publication_year" property="publicationYear"/>
<result column="publication_type_id" property="publicationTypeId"/>
<result column="doi" property="doi"/>
<result column="quote" property="quote"/>
<result column="lable_id" property="lableId"/>
<result column="classification_id" property="classificationId"/>
</resultMap> </resultMap>
<select id="articlePaginationList" resultType="com.huoran.iasf.vo.resp.PageContentRespVO"> <select id="articlePaginationList" resultType="com.huoran.iasf.vo.resp.PageContentRespVO">
SELECT c.*, SELECT c.*,
@ -50,7 +66,7 @@
and title LIKE CONCAT('%',#{req.title},'%') and title LIKE CONCAT('%',#{req.title},'%')
</if> </if>
<if test="req.founder != null and req.founder != ''"> <if test="req.founder != null and req.founder != ''">
AND ( SELECT u.username FROM sys_user u WHERE u.id = c.founder_id ) LIKE AND ( SELECT u.username FROM sys_user u WHERE u.id = c.founder_id ) LIKE
CONCAT('%',#{req.founder},'%') CONCAT('%',#{req.founder},'%')
</if> </if>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.iasf.mapper.SysTemplateMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.iasf.mapper.SysTemplateStyleMapper">
</mapper>

@ -23,6 +23,9 @@ public interface SysColumnService extends IService<SysColumn> {
List<SysColumn> listWithTree(PaginationColumnReqVO sysColumn); List<SysColumn> listWithTree(PaginationColumnReqVO sysColumn);
//栏目树结构(前台可见,只展示试单可见的栏目)
List<SysColumn> listWithTreeMenuVisible(PaginationColumnReqVO sysColumn);
//长页栏目列表 //长页栏目列表
R longPageColumnList(LongPageColumnReqVO reqVO); R longPageColumnList(LongPageColumnReqVO reqVO);

@ -0,0 +1,14 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysContentClassification;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @描述文章所属分类 service接口
* @作者: Rong
* @日期: 2022-11-08
*/
public interface SysContentClassificationService extends IService<SysContentClassification> {
}

@ -0,0 +1,14 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysContentFile;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @描述文章附件管理表 service接口
* @作者: Rong
* @日期: 2022-11-07
*/
public interface SysContentFileService extends IService<SysContentFile> {
}

@ -0,0 +1,14 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysContentLabel;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @描述文章主题标签 service接口
* @作者: Rong
* @日期: 2022-11-08
*/
public interface SysContentLabelService extends IService<SysContentLabel> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysTemplate;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 栏目模板 服务类
* </p>
*
* @author cheney
* @since 2022-11-11
*/
public interface SysTemplateService extends IService<SysTemplate> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author cheney
* @since 2022-11-11
*/
public interface SysTemplateStyleService extends IService<SysTemplateStyle> {
}

@ -71,9 +71,9 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
} }
} }
for (SysColumn sysColumn : rootColumn) { for (SysColumn sysColumn : rootColumn) {
Integer deptId = sysColumn.getId(); Integer theColumnId = sysColumn.getId();
//调用工具类获取子节点 //调用工具类获取子节点
childList = getChildren(deptId, columnList); childList = getChildren(theColumnId, columnList);
sysColumn.setChildren(childList); sysColumn.setChildren(childList);
} }
@ -85,6 +85,37 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
} }
@Override
public List<SysColumn> listWithTreeMenuVisible(PaginationColumnReqVO column) {
//查询所有栏目
List<SysColumn> columnList = baseMapper.filterMenuVisible(column);
if (column.getColumnName().equals("")) {
//用来保存父节点
List<SysColumn> rootColumn = new ArrayList<>();
//用来保存子节点
List<SysColumn> childList = new ArrayList<>();
//遍历所有栏目,将所有栏目的父栏目id为0的栏目放入父节点集合中
for (SysColumn column1 : columnList) {
Integer parentId = column1.getFatherId();
if (parentId == 0) {
rootColumn.add(column1);
}
}
for (SysColumn sysColumn : rootColumn) {
Integer theColumnId = sysColumn.getId();
//调用工具类获取子节点
childList = getChildren(theColumnId, columnList);
sysColumn.setChildren(childList);
}
return rootColumn;
}
return columnList;
}
@Override @Override
public R longPageColumnList(LongPageColumnReqVO reqVO) { public R longPageColumnList(LongPageColumnReqVO reqVO) {
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize()); Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize());

@ -0,0 +1,26 @@
package com.huoran.iasf.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huoran.iasf.entity.SysContentClassification;
import com.huoran.iasf.mapper.SysContentClassificationMapper;
import com.huoran.iasf.service.SysContentClassificationService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
/**
* @描述文章所属分类 服务类
* @作者: Rong
* @日期: 2022-11-08
*/
@Service
public class SysContentClassificationServiceImpl extends ServiceImpl<SysContentClassificationMapper, SysContentClassification> implements SysContentClassificationService {
@Autowired
private SysContentClassificationMapper mapper;
}

@ -0,0 +1,26 @@
package com.huoran.iasf.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huoran.iasf.entity.SysContentFile;
import com.huoran.iasf.mapper.SysContentFileMapper;
import com.huoran.iasf.service.SysContentFileService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
/**
* @描述文章附件管理表 服务类
* @作者: Rong
* @日期: 2022-11-07
*/
@Service
public class SysContentFileServiceImpl extends ServiceImpl<SysContentFileMapper, SysContentFile> implements SysContentFileService {
@Autowired
private SysContentFileMapper mapper;
}

@ -0,0 +1,26 @@
package com.huoran.iasf.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huoran.iasf.entity.SysContentLabel;
import com.huoran.iasf.mapper.SysContentLabelMapper;
import com.huoran.iasf.service.SysContentLabelService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
/**
* @描述文章主题标签 服务类
* @作者: Rong
* @日期: 2022-11-08
*/
@Service
public class SysContentLabelServiceImpl extends ServiceImpl<SysContentLabelMapper, SysContentLabel> implements SysContentLabelService {
@Autowired
private SysContentLabelMapper mapper;
}

@ -0,0 +1,20 @@
package com.huoran.iasf.service.impl;
import com.huoran.iasf.entity.SysTemplate;
import com.huoran.iasf.mapper.SysTemplateMapper;
import com.huoran.iasf.service.SysTemplateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 栏目模板 服务实现类
* </p>
*
* @author cheney
* @since 2022-11-11
*/
@Service
public class SysTemplateServiceImpl extends ServiceImpl<SysTemplateMapper, SysTemplate> implements SysTemplateService {
}

@ -0,0 +1,20 @@
package com.huoran.iasf.service.impl;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.huoran.iasf.mapper.SysTemplateStyleMapper;
import com.huoran.iasf.service.SysTemplateStyleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author cheney
* @since 2022-11-11
*/
@Service
public class SysTemplateStyleServiceImpl extends ServiceImpl<SysTemplateStyleMapper, SysTemplateStyle> implements SysTemplateStyleService {
}

@ -0,0 +1,24 @@
package com.huoran.iasf.vo.req;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class ContentReq{
@ApiModelProperty(value = "栏目ids")
private List<Integer> columnIds;
@ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true)
private Integer pageNum;
@ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true)
private Integer pageSize;
}
Loading…
Cancel
Save