diff --git a/src/main/java/com/huoran/iasf/common/utils/Constant.java b/src/main/java/com/huoran/iasf/common/utils/Constant.java index 6e4011c..62176d5 100644 --- a/src/main/java/com/huoran/iasf/common/utils/Constant.java +++ b/src/main/java/com/huoran/iasf/common/utils/Constant.java @@ -44,4 +44,11 @@ public class Constant { public static final Integer DATA_SCOPE_DEPT_AND_CHILD = 3; public static final Integer DATA_SCOPE_DEPT = 4; public static final Integer DATA_SCOPE_DEPT_SELF = 5; + + /** + * 文章发布状态:是否发布 0:草稿 1:已发布 + */ + public static final Integer ARTICLE_PUBLISHED = 1; + + public static final Integer ARTICLE_NOT_PUBLISHED = 0; } diff --git a/src/main/java/com/huoran/iasf/controller/SysColumnController.java b/src/main/java/com/huoran/iasf/controller/SysColumnController.java new file mode 100644 index 0000000..e93bfef --- /dev/null +++ b/src/main/java/com/huoran/iasf/controller/SysColumnController.java @@ -0,0 +1,86 @@ +package com.huoran.iasf.controller; + +import com.huoran.iasf.entity.SysColumn; +import com.huoran.iasf.entity.SysContent; +import com.huoran.iasf.vo.req.ColumnWeightReqVO; +import com.huoran.iasf.vo.req.PaginationColumnReqVO; +import io.swagger.annotations.*; +import com.huoran.iasf.common.utils.R; +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 com.huoran.iasf.service.SysColumnService; + +import javax.validation.Valid; +import java.util.List; + + +/** + * @描述:栏目基础信息控制类 + * @作者: Rong + * @日期: 2022-08-01 + */ +@RestController +@RequestMapping("/sysColumn") +@Api(value = "栏目基础信息:SysColumnController", tags = "R-栏目管理") +public class SysColumnController { + + @Autowired + public SysColumnService service; + + + @PostMapping("/listWithTree") + @ApiOperation(value = "栏目树结构", response = SysColumn.class) + public R listWithTree(@RequestBody @Valid PaginationColumnReqVO sysColumn) { + return R.success(service.listWithTree(sysColumn)); + } + + + @PostMapping("/findById") + @ApiOperation(value = "查询详情", response = SysColumn.class) + public R findById(@RequestParam("id") @ApiParam(value = "序号") Integer id) { + SysColumn sysColumn = service.getById(id); + return R.success(sysColumn); + } + + + @PostMapping("/save") + @ApiOperation(value = "新增", response = SysColumn.class) + public R save(@RequestBody @Valid SysColumn sysColumn) { + boolean addState = service.save(sysColumn); + return addState ? R.success() : R.fail("新增失败"); + } + + @PostMapping("/update") + @ApiOperation(value = "修改", response = SysColumn.class) + public R update(@RequestBody SysColumn sysColumn) { + boolean updateState = service.updateById(sysColumn); + return updateState ? R.success() : R.fail("编辑失败"); + } + + @PostMapping("/delete") + @ApiOperation(value = "删除", response = SysContent.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("/sameLevelJudgment") + @ApiOperation(value = "同级判重", response = ColumnWeightReqVO.class) + public R sameLevelJudgment(@RequestBody @Valid ColumnWeightReqVO sysColumn) { + return service.sameLevelJudgment(sysColumn) ? R.success() : R.fail("同级下已存在重复栏目!"); + } + + @PostMapping("/sortByColumn") + @ApiOperation(value = "栏目排序", response = SysColumn.class) + public R sortByColumn(@RequestBody List entityList) { + boolean updateState = service.updateBatchById(entityList); + return updateState ? R.success() : R.fail("编辑成功"); + } +} + diff --git a/src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java b/src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java new file mode 100644 index 0000000..5528b7a --- /dev/null +++ b/src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java @@ -0,0 +1,68 @@ +package com.huoran.iasf.controller; + +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.*; +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 com.huoran.iasf.service.SysColumnLongPageService; +import com.huoran.iasf.entity.SysColumnLongPage; + +import javax.validation.Valid; + + +/** + * @描述:长页栏目拓展表控制类 + * @作者: Rong + * @日期: 2022-08-09 + */ +@RestController +@RequestMapping("/sysColumnLongPage") +@Api(value = "长页栏目拓展表:SysColumnLongPageController", tags = "R-长页栏目拓展信息") +public class SysColumnLongPageController { + + @Autowired + public SysColumnLongPageService service; + + + @PostMapping("/findById") + @ApiOperation(value = "查询详情", response = SysColumnLongPage.class) + public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + SysColumnLongPage sysColumnLongPage = service.getById(id); + return R.success(sysColumnLongPage); + } + + + @PostMapping("/save") + @ApiOperation(value = "新增", response = SysColumnLongPage.class) + public R save(@RequestBody @Valid @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) { + boolean addState = service.save(sysColumnLongPage); + return addState ? R.success() : R.fail("新增失败"); + } + + + @PostMapping("/update") + @ApiOperation(value = "修改", response = SysColumnLongPage.class) + public R update(@RequestBody @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) { + boolean updateState = service.updateById(sysColumnLongPage); + return updateState ? R.success() : R.fail("编辑失败"); + } + + + @PostMapping("/delete") + @ApiOperation(value = "删除", response = SysColumnLongPage.class) + public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + boolean delState = service.removeById(id); + return delState ? R.success() : R.fail("删除失败"); + } +} + diff --git a/src/main/java/com/huoran/iasf/controller/SysContentController.java b/src/main/java/com/huoran/iasf/controller/SysContentController.java index 310770b..cbbc7f4 100644 --- a/src/main/java/com/huoran/iasf/controller/SysContentController.java +++ b/src/main/java/com/huoran/iasf/controller/SysContentController.java @@ -1,79 +1,80 @@ package com.huoran.iasf.controller; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.huoran.iasf.common.aop.annotation.DataScope; +import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO; +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 com.huoran.iasf.entity.SysContentEntity; -import com.huoran.iasf.service.SysContentService; +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 io.swagger.annotations.ApiParam; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; +import com.huoran.iasf.service.SysContentService; +import com.huoran.iasf.entity.SysContent; -import javax.annotation.Resource; -import java.util.List; +import javax.validation.Valid; /** - * 文章管理 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 + * @描述:文章管理控制类 + * @作者: Rong + * @日期: 2022-08-05 */ -@Api(tags = "文章管理") @RestController @RequestMapping("/sysContent") +@Api(value = "文章管理:SysContentController", tags = "R-文章管理") public class SysContentController { - @Resource - private SysContentService sysContentService; + + @Autowired + public SysContentService service; + + + @PostMapping("/pagingQuery") + @ApiOperation(value = "分页查询", response = PageContentRespVO.class) + public R pagingQuery(@RequestBody @Valid @ApiParam(name = "分页查询参数", value = "传入json格式", required = true) PageContentReqVO sysContent) { + return service.articlePaginationList(sysContent); + } - @ApiOperation(value = "新增") - @PostMapping("/add") - @RequiresPermissions("sysContent:add") - public R add(@RequestBody SysContentEntity sysContent) { - sysContentService.save(sysContent); - return R.success(); + @PostMapping("/findById") + @ApiOperation(value = "查询详情", response = SysContent.class) + public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + SysContent sysContent = service.getById(id); + return R.success(sysContent); } - @ApiOperation(value = "删除") - @DeleteMapping("/delete") - @RequiresPermissions("sysContent:delete") - public R delete(@RequestBody @ApiParam(value = "id集合") List ids) { - sysContentService.removeByIds(ids); - return R.success(); + @PostMapping("/save") + @ApiOperation(value = "新增", response = SysContent.class) + public R save(@RequestBody @Valid @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { + boolean addState = service.save(sysContent); + return addState ? R.success() : R.fail("新增失败"); } - @ApiOperation(value = "更新") - @PutMapping("/update") - @RequiresPermissions("sysContent:update") - public R update(@RequestBody SysContentEntity sysContent) { - sysContentService.updateById(sysContent); - return R.success(); + + @PostMapping("/update") + @ApiOperation(value = "修改", response = SysContent.class) + public R update(@RequestBody @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { + boolean updateState = service.updateById(sysContent); + return updateState ? R.success() : R.fail("编辑失败"); } - @ApiOperation(value = "查询分页数据") - @PostMapping("/listByPage") - @RequiresPermissions("sysContent:list") - @DataScope - public R findListByPage(@RequestBody SysContentEntity sysContent) { - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); - //查询条件示例 - if (!StringUtils.isEmpty(sysContent.getTitle())) { - queryWrapper.like(SysContentEntity::getTitle, sysContent.getTitle()); - } - //数据权限示例, 需手动添加此条件 begin - if (!CollectionUtils.isEmpty(sysContent.getCreateIds())) { - queryWrapper.in(SysContentEntity::getCreateId, sysContent.getCreateIds()); - } - //数据权限示例, 需手动添加此条件 end - IPage iPage = sysContentService.page(sysContent.getQueryPage(), queryWrapper); - return R.success(iPage); + + @PostMapping("/delete") + @ApiOperation(value = "删除", response = SysContent.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("/checkIfTheTitleIsRepeat") + @ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class) + public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) { + return service.checkIfTheTitleIsRepeat(content) ? R.success() : R.fail("该标题已重复!"); } } + diff --git a/src/main/java/com/huoran/iasf/controller/SysPageManagementController.java b/src/main/java/com/huoran/iasf/controller/SysPageManagementController.java new file mode 100644 index 0000000..71e5bf5 --- /dev/null +++ b/src/main/java/com/huoran/iasf/controller/SysPageManagementController.java @@ -0,0 +1,57 @@ +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.SysColumn; +import com.huoran.iasf.entity.SysContent; +import com.huoran.iasf.service.SysColumnService; +import com.huoran.iasf.service.SysContentService; +import com.huoran.iasf.vo.req.ColumnWeightReqVO; +import com.huoran.iasf.vo.req.LongPageColumnReqVO; +import com.huoran.iasf.vo.req.PageContentReqVO; +import com.huoran.iasf.vo.req.PaginationColumnReqVO; +import com.huoran.iasf.vo.resp.PageContentRespVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + + +/** + * @描述:页面管理 + * @作者: Rong + * @日期: 2022-08-08 + */ +@RestController +@RequestMapping("/pageManagement") +@Api(value = "页面管理:SysPageManagementController", tags = "R-页面管理") +public class SysPageManagementController { + + @Autowired + public SysColumnService columnService; + + + /** + * 需求:当前接口只查栏目类型为长页栏目的数据 + * + * @param sysContent + * @return + */ + @PostMapping("/longPageColumnList") + @ApiOperation(value = "长页列列表", response = PageContentRespVO.class) + public R longPageColumnList(@RequestBody @Valid @ApiParam(name = "分页查询参数", value = "传入json格式", required = true) LongPageColumnReqVO sysContent) { + return columnService.longPageColumnList(sysContent); + } + + + + + +} + diff --git a/src/main/java/com/huoran/iasf/entity/SysColumn.java b/src/main/java/com/huoran/iasf/entity/SysColumn.java new file mode 100644 index 0000000..44d6a95 --- /dev/null +++ b/src/main/java/com/huoran/iasf/entity/SysColumn.java @@ -0,0 +1,114 @@ +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 java.util.List; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @描述:栏目基础信息 + * @作者: Rong + * @日期: 2022-08-03 + */ +@Data +@ApiModel(value = "栏目基础信息") +@TableName("sys_column") +public class SysColumn implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "父id(第一级为0)") + private Integer fatherId; + + @ApiModelProperty(value = "排序") + private Integer sort; + + @ApiModelProperty(value = "层级((1-一级分类 2-二级分类 3-三级分类以此叠加))") + private Integer level; + + @ApiModelProperty(value = "栏目名称") + private String columnName; + + @ApiModelProperty(value = "banner路径") + private String columnBanner; + + @ApiModelProperty(value = "分页条数") + private Integer pageSize; + + @ApiModelProperty(value = "菜单是否可见(默认0可见 1不可见)") + private Integer menuVisible; + + @ApiModelProperty(value = "栏目类型(由前端自己设定)") + private Integer typeId; + + @ApiModelProperty(value = "栏目模板(由前端自己设定)") + private Integer templateId; + + @ApiModelProperty(value = "列表样式(由前端自己设定)") + private Integer listStyleId; + + @ApiModelProperty(value = "详情样式(由前端自己设定)") + private Integer detailStyle; + + @ApiModelProperty(value = "链接类型") + private Integer connectionType; + + @ApiModelProperty(value = "链接地址") + private String linkAddress; + + @ApiModelProperty(value = "只有一篇文章时,以详情方式展示(0默认否 1为是)") + private Integer showWithDetails; + + @ApiModelProperty(value = "站点选择(连接类型为其它站点连接时储存)1.EFL中文2.SRL中文") + private Integer siteSelection; + + @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 = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "状态(0默认草稿箱 1为已发布)") + private Integer status; + + @ApiModelProperty(value = "是否删除(1未删除;0已删除)") + @TableLogic + private Integer deleted; + + + @ApiModelProperty(value = "是否在新窗口打开(0:否 1:是)") + private Integer isOpen; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; + + @ApiModelProperty("子分类") + @TableField(exist = false) + private List children; + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysColumnLongPage.java b/src/main/java/com/huoran/iasf/entity/SysColumnLongPage.java new file mode 100644 index 0000000..ef7bae4 --- /dev/null +++ b/src/main/java/com/huoran/iasf/entity/SysColumnLongPage.java @@ -0,0 +1,65 @@ +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-08-09 + */ +@Data +@ApiModel(value = "长页栏目拓展表") +@TableName("sys_column_long_page") +public class SysColumnLongPage implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "栏目id") + @NotNull(message = "栏目id不能为空!") + private Integer columnId; + + @ApiModelProperty(value = "当前页面版面排序") + @NotNull(message = "排序不能为空!") + private Integer sort; + + @ApiModelProperty(value = "内容(json字符串)") + @NotNull(message = "内容不能为空!") + private String json; + + @ApiModelProperty(value = "创建人id") + private Integer founderId; + + @ApiModelProperty(value = "编辑人id") + private Integer editorId; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "是否删除(1未删除;0已删除)") + private Integer deleted; + + @ApiModelProperty(value = "备注") + private String remark; + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysContent.java b/src/main/java/com/huoran/iasf/entity/SysContent.java new file mode 100644 index 0000000..1a39c49 --- /dev/null +++ b/src/main/java/com/huoran/iasf/entity/SysContent.java @@ -0,0 +1,110 @@ +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-08-08 + */ +@Data +@ApiModel(value = "文章管理") +@TableName("sys_content") +public class SysContent implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "主键") + private Integer id; + + @ApiModelProperty(value = "标题(全库判重)") + @NotNull(message = "标题不能为空!") + private String title; + + @ApiModelProperty(value = "所属栏目") + @NotNull(message = "所属栏目不能为空!") + private Integer columnId; + + @ApiModelProperty(value = "标题图") + private String titleImg; + + @ApiModelProperty(value = "来源") + private String source; + + @ApiModelProperty(value = "发布时间") + @NotNull(message = "发布时间不能为空!") + private Date releaseTime; + + @ApiModelProperty(value = "摘要") + private String summary; + + @ApiModelProperty(value = "banner图") + private String bannerImg; + + @ApiModelProperty(value = "文章模板(前端自定义)——>没选择时默认读取当前所引用栏目的栏目类型") + private Integer articleTemplate; + + @ApiModelProperty(value = "正文") + private String mainBody; + + @ApiModelProperty(value = "作者") + private String author; + + @ApiModelProperty(value = "发布状态——>是否发布(0:草稿 1:已发布)") + @NotNull(message = "发布状态不能为空!") + private Integer isRelease; + + @ApiModelProperty(value = "创建人id") + @NotNull(message = "创建人id不能为空!") + private Integer founderId; + + @ApiModelProperty(value = "编辑人id") + @NotNull(message = "编辑人id不能为空!") + private Integer editorId; + + @ApiModelProperty(value = "文件") + private String file; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "文章总浏览量") + 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:是)") + private Integer isOpen; + + @ApiModelProperty(value = "是否删除(1未删除;0已删除)") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysContentEntity.java b/src/main/java/com/huoran/iasf/entity/SysContentEntity.java deleted file mode 100644 index 618708a..0000000 --- a/src/main/java/com/huoran/iasf/entity/SysContentEntity.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.huoran.iasf.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.util.Date; - -/** - * 内容管理 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 - */ -@EqualsAndHashCode(callSuper = true) -@Data -@TableName("sys_content") -public class SysContentEntity extends BaseEntity implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * 主键id - */ - @TableId("id") - @ApiModelProperty(value = "主键id") - private String id; - - /** - * 主题 - */ - @TableField("title") - @ApiModelProperty(value = "主题") - private String title; - - /** - * 内容 - */ - @TableField("content") - @ApiModelProperty(value = "内容") - private String content; - - /** - * 单个图片url - */ - @ApiModelProperty(value = "单个图片url") - private String oneImg; - - /** - * 多个图片url - */ - @ApiModelProperty(value = "多个图片url") - private String multipleImg; - - /** - * 关键字 - */ - @ApiModelProperty(value = "关键字") - private String keywords; - - /** - * 类型(数据字典) - */ - @TableField("type") - @ApiModelProperty(value = "类型") - private String type; - - /** - * 创建人 - */ - @TableField(value = "create_id", fill = FieldFill.INSERT) - @ApiModelProperty(value = "创建人") - private String createId; - - /** - * 创建时间 - */ - @TableField(value = "create_time", fill = FieldFill.INSERT) - @ApiModelProperty(value = "创建时间") - private Date createTime; - - -} diff --git a/src/main/java/com/huoran/iasf/mapper/SysColumnLongPageMapper.java b/src/main/java/com/huoran/iasf/mapper/SysColumnLongPageMapper.java new file mode 100644 index 0000000..d7039fb --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/SysColumnLongPageMapper.java @@ -0,0 +1,16 @@ +package com.huoran.iasf.mapper; + +import com.huoran.iasf.entity.SysColumnLongPage; +import org.apache.ibatis.annotations.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @描述:长页栏目拓展表 Mapper 接口 + * @作者: Rong + * @日期: 2022-08-09 + */ +@Mapper +public interface SysColumnLongPageMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/SysColumnMapper.java b/src/main/java/com/huoran/iasf/mapper/SysColumnMapper.java new file mode 100644 index 0000000..9dfb4d4 --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/SysColumnMapper.java @@ -0,0 +1,33 @@ +package com.huoran.iasf.mapper; + +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.vo.FatherContentRespVO; +import com.huoran.iasf.vo.req.LongPageColumnReqVO; +import com.huoran.iasf.vo.req.PageContentReqVO; +import com.huoran.iasf.vo.req.PaginationColumnReqVO; +import com.huoran.iasf.vo.resp.PageContentRespVO; +import org.apache.ibatis.annotations.Mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @描述: Mapper 接口 + * @作者: Rong + * @日期: 2022-08-01 + */ +@Mapper +public interface SysColumnMapper extends BaseMapper { + List filter(@Param("vo") PaginationColumnReqVO vo); + + + IPage longPageColumnList(Page page, @Param("req") LongPageColumnReqVO req); + + //依据子级查询父级 + List getParentInformationBasedOnChild(@Param("id")Integer id); +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java b/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java index 684ea54..8bedc5a 100644 --- a/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java +++ b/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java @@ -1,15 +1,20 @@ package com.huoran.iasf.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.iasf.entity.SysContent; +import com.huoran.iasf.vo.req.PageContentReqVO; +import com.huoran.iasf.vo.resp.PageContentRespVO; +import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.iasf.entity.SysContentEntity; +import org.apache.ibatis.annotations.Param; /** - * 内容管理 Mapper - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 + * @描述:文章管理 Mapper 接口 + * @作者: Rong + * @日期: 2022-08-05 */ -public interface SysContentMapper extends BaseMapper { - -} +@Mapper +public interface SysContentMapper extends BaseMapper { + IPage articlePaginationList(Page page, @Param("req") PageContentReqVO req); +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysColumnLongPageMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysColumnLongPageMapper.xml new file mode 100644 index 0000000..a9019a5 --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysColumnLongPageMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml new file mode 100644 index 0000000..d96fd49 --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml new file mode 100644 index 0000000..928cea9 --- /dev/null +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysColumnLongPageService.java b/src/main/java/com/huoran/iasf/service/SysColumnLongPageService.java new file mode 100644 index 0000000..6052d6b --- /dev/null +++ b/src/main/java/com/huoran/iasf/service/SysColumnLongPageService.java @@ -0,0 +1,14 @@ +package com.huoran.iasf.service; + +import com.huoran.iasf.entity.SysColumnLongPage; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @描述:长页栏目拓展表 service接口 + * @作者: Rong + * @日期: 2022-08-09 + */ +public interface SysColumnLongPageService extends IService { + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysColumnService.java b/src/main/java/com/huoran/iasf/service/SysColumnService.java new file mode 100644 index 0000000..fdcfced --- /dev/null +++ b/src/main/java/com/huoran/iasf/service/SysColumnService.java @@ -0,0 +1,29 @@ +package com.huoran.iasf.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.iasf.common.utils.R; +import com.huoran.iasf.entity.SysColumn; +import com.huoran.iasf.vo.req.ColumnWeightReqVO; +import com.huoran.iasf.vo.req.LongPageColumnReqVO; +import com.huoran.iasf.vo.req.PageContentReqVO; +import com.huoran.iasf.vo.req.PaginationColumnReqVO; + +import java.util.List; + +/** + * @描述: service接口 + * @作者: Rong + * @日期: 2022-08-01 + */ +public interface SysColumnService extends IService { + + //新增栏目前,同级判重 + boolean sameLevelJudgment(ColumnWeightReqVO column); + + + List listWithTree(PaginationColumnReqVO sysColumn); + + //长页栏目列表 + R longPageColumnList(LongPageColumnReqVO reqVO); + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysContentService.java b/src/main/java/com/huoran/iasf/service/SysContentService.java index bc986d4..93d6570 100644 --- a/src/main/java/com/huoran/iasf/service/SysContentService.java +++ b/src/main/java/com/huoran/iasf/service/SysContentService.java @@ -1,16 +1,19 @@ package com.huoran.iasf.service; - +import com.huoran.iasf.common.utils.R; +import com.huoran.iasf.entity.SysContent; import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.iasf.entity.SysContentEntity; +import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO; +import com.huoran.iasf.vo.req.PageContentReqVO; /** - * 内容 服务类 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 + * @描述:文章管理 service接口 + * @作者: Rong + * @日期: 2022-08-05 */ -public interface SysContentService extends IService { - -} +public interface SysContentService extends IService { + //新增栏目前,标题全库判重 + boolean checkIfTheTitleIsRepeat(ContentHeavyTitleReqVO content); + //分页栏目列表 + R articlePaginationList(PageContentReqVO reqVO); +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/impl/SysColumnLongPageServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysColumnLongPageServiceImpl.java new file mode 100644 index 0000000..0ad9524 --- /dev/null +++ b/src/main/java/com/huoran/iasf/service/impl/SysColumnLongPageServiceImpl.java @@ -0,0 +1,26 @@ +package com.huoran.iasf.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.iasf.entity.SysColumnLongPage; +import com.huoran.iasf.mapper.SysColumnLongPageMapper; +import com.huoran.iasf.service.SysColumnLongPageService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; + +/** + * @描述:长页栏目拓展表 服务类 + * @作者: Rong + * @日期: 2022-08-09 + */ +@Service +public class SysColumnLongPageServiceImpl extends ServiceImpl implements SysColumnLongPageService { + + @Autowired + private SysColumnLongPageMapper mapper; + +} + + + diff --git a/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java new file mode 100644 index 0000000..0c1cc09 --- /dev/null +++ b/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java @@ -0,0 +1,131 @@ +package com.huoran.iasf.service.impl; + +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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.iasf.common.utils.R; +import com.huoran.iasf.entity.SysColumn; +import com.huoran.iasf.mapper.SysColumnMapper; +import com.huoran.iasf.service.SysColumnService; +import com.huoran.iasf.vo.FatherContentRespVO; +import com.huoran.iasf.vo.req.ColumnWeightReqVO; +import com.huoran.iasf.vo.req.LongPageColumnReqVO; +import com.huoran.iasf.vo.req.PageContentReqVO; +import com.huoran.iasf.vo.req.PaginationColumnReqVO; +import com.huoran.iasf.vo.resp.PageContentRespVO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @描述: 服务类 + * @作者: Rong + * @日期: 2022-08-01 + */ +@Service +public class SysColumnServiceImpl extends ServiceImpl implements SysColumnService { + + @Autowired + private SysColumnMapper mapper; + + @Override + public boolean sameLevelJudgment(ColumnWeightReqVO column) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("column_name", column.getColumnName()); + queryWrapper.eq("level", column.getLevel()); + queryWrapper.eq("site_id", column.getSiteId()); + SysColumn sysColumn = mapper.selectOne(queryWrapper); + if (sysColumn != null) { + if (column.getId() != null) { + //判断为编辑情况下,如果编辑的id与查询出来的一致不提示 + if (column.getId() == sysColumn.getId()) { + return true; + } + } + + return false; + } + return true; + } + + @Override + public List listWithTree(PaginationColumnReqVO column) { + //查询所有栏目 + List columnList = baseMapper.filter(column); + + if (column.getColumnName().equals("")) { + //用来保存父节点 + List rootColumn = new ArrayList<>(); + //用来保存子节点 + List childList = new ArrayList<>(); + //遍历所有栏目,将所有栏目的父栏目id为0的栏目放入父节点集合中 + for (SysColumn column1 : columnList) { + Integer parentId = column1.getFatherId(); + if (parentId == 0) { + rootColumn.add(column1); + } + } + for (SysColumn sysColumn : rootColumn) { + Integer deptId = sysColumn.getId(); + //调用工具类获取子节点 + childList = getChildren(deptId, columnList); + sysColumn.setChildren(childList); + } + + return rootColumn; + } + + return columnList; + + + } + + @Override + public R longPageColumnList(LongPageColumnReqVO reqVO) { + Page page = new Page(reqVO.getPageNum(), reqVO.getPageSize()); + IPage pageList = baseMapper.longPageColumnList(page, reqVO); + pageList.getRecords().forEach(pageContentRespVO -> { + if (pageContentRespVO.getLevel() > 1) { + //判断该栏目层级为第一级时候不返回上级栏目 + List upperLevel = baseMapper.getParentInformationBasedOnChild(pageContentRespVO.getId()); + pageContentRespVO.setSuperiorColumn(upperLevel); + } + + }); + + + return R.success(pageList); + } + + + public static List getChildren(Integer id, List allDept) { + //存放子节点 + List childList = new ArrayList<>(); + //遍历所有栏目,如果父id与传来的id相同,则为传来的id这个栏目的子栏目 + for (SysColumn dept : allDept) { + Integer parentId = dept.getFatherId(); + if (parentId.equals(id)) { + childList.add(dept); + } + } + + //自调用来判断是否还有子节点 + for (SysColumn dept : childList) { + dept.setChildren(getChildren(dept.getId(), allDept)); + } + + //如果没有子节点则返回空集合 + if (childList.size() == 0) { + return new ArrayList<>(); + } + return childList; + } +} + + + diff --git a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java index 991dc6a..5e377fe 100644 --- a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java @@ -1,20 +1,59 @@ package com.huoran.iasf.service.impl; +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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.huoran.iasf.entity.SysContentEntity; +import com.huoran.iasf.common.utils.Constant; +import com.huoran.iasf.common.utils.R; +import com.huoran.iasf.entity.SysContent; import com.huoran.iasf.mapper.SysContentMapper; import com.huoran.iasf.service.SysContentService; +import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO; +import com.huoran.iasf.vo.req.PageContentReqVO; +import com.huoran.iasf.vo.resp.PageContentRespVO; import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; /** - * 内容 服务类 - * - * @author cheney - * @version V1.0 - * @date 2022年7月28日 + * @描述:文章管理 服务类 + * @作者: Rong + * @日期: 2022-08-05 */ -@Service("sysContentService") -public class SysContentServiceImpl extends ServiceImpl implements SysContentService { +@Service +public class SysContentServiceImpl extends ServiceImpl implements SysContentService { + + @Autowired + private SysContentMapper mapper; + + @Override + public boolean checkIfTheTitleIsRepeat(ContentHeavyTitleReqVO content) { + //只对已发布的标题判重 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("title", content.getTitle()); + queryWrapper.eq("is_release", Constant.ARTICLE_PUBLISHED); + queryWrapper.eq("site_id", content.getSiteId()); + SysContent sysContent = mapper.selectOne(queryWrapper); + if (sysContent != null) { + if (content.getId() != null) { + //判断为编辑情况下,如果编辑的id与查询出来的一致不提示 + if (content.getId() == content.getId()) { + return true; + } + } + + return false; + } + return true; + } + + @Override + public R articlePaginationList(PageContentReqVO reqVO) { + Page page = new Page(reqVO.getPageNum(), reqVO.getPageSize()); + IPage pageList = baseMapper.articlePaginationList(page, reqVO); + return R.success(pageList); + } +} + -} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/FatherContentRespVO.java b/src/main/java/com/huoran/iasf/vo/FatherContentRespVO.java new file mode 100644 index 0000000..fba2a00 --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/FatherContentRespVO.java @@ -0,0 +1,39 @@ +package com.huoran.iasf.vo; + +import com.baomidou.mybatisplus.annotation.*; +import com.huoran.iasf.entity.SysColumn; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @描述:文章管理 + * @作者: Rong + * @日期: 2022-08-05 + */ +@Data +public class FatherContentRespVO { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "父id(第一级为0)") + private Integer fatherId; + + @ApiModelProperty(value = "排序") + private Integer sort; + + @ApiModelProperty(value = "层级((1-一级分类 2-二级分类 3-三级分类以此叠加))") + private Integer level; + + @ApiModelProperty(value = "栏目名称") + private String columnName; + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/req/ColumnWeightReqVO.java b/src/main/java/com/huoran/iasf/vo/req/ColumnWeightReqVO.java new file mode 100644 index 0000000..d3e06ab --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/ColumnWeightReqVO.java @@ -0,0 +1,38 @@ +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 javax.validation.constraints.NotNull; + +/** + * @描述:栏目基础信息 + * @作者: Rong + * @日期: 2022-08-03 + */ +@Data +@ApiModel(value = "栏目判重") +public class ColumnWeightReqVO { + + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "层级((1-一级分类 2-二级分类 3-三级分类以此叠加))") + @NotNull(message = "层级不能为空") + private Integer level; + + @ApiModelProperty(value = "栏目名称") + @NotNull(message = "栏目名称不能为空") + private String columnName; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; + + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/req/ContentHeavyTitleReqVO.java b/src/main/java/com/huoran/iasf/vo/req/ContentHeavyTitleReqVO.java new file mode 100644 index 0000000..b3f4c62 --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/ContentHeavyTitleReqVO.java @@ -0,0 +1,32 @@ +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 javax.validation.constraints.NotNull; + +/** + * @描述:文章管理 + * @作者: Rong + * @日期: 2022-08-05 + */ +@Data +@ApiModel(value = "文章标题判重") +public class ContentHeavyTitleReqVO { + + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "主键(编辑时需要传)",required = false) + private Integer id; + + @ApiModelProperty(value = "标题(全库判重)",required = true) + @NotNull(message = "标题不能为空") + private String title; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/req/LongPageColumnReqVO.java b/src/main/java/com/huoran/iasf/vo/req/LongPageColumnReqVO.java new file mode 100644 index 0000000..c6ec635 --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/LongPageColumnReqVO.java @@ -0,0 +1,38 @@ +package com.huoran.iasf.vo.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @描述:文章管理 + * @作者: Rong + * @日期: 2022-08-05 + */ +@Data +public class LongPageColumnReqVO extends PageReqVO { + + + @ApiModelProperty(value = "模板名称") + private String templateName; + + + @ApiModelProperty(value = "栏目名称") + private String programName; + + + @ApiModelProperty(value = "栏目类型id",hidden = true) + private Integer columnTypeId; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; + + public Integer getColumnTypeId() { + return 3; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java new file mode 100644 index 0000000..b5c11af --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java @@ -0,0 +1,30 @@ +package com.huoran.iasf.vo.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @描述:文章管理 + * @作者: Rong + * @日期: 2022-08-05 + */ +@Data +public class PageContentReqVO extends PageReqVO { + + + @ApiModelProperty(value = "栏目id") + private List columnIds; + + @ApiModelProperty(value = "标题") + private String title; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; + + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/req/PageReqVO.java b/src/main/java/com/huoran/iasf/vo/req/PageReqVO.java new file mode 100644 index 0000000..193628f --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/PageReqVO.java @@ -0,0 +1,24 @@ +package com.huoran.iasf.vo.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @ProjectName: huorantech + * @Package: com.huoran.occupationlab.entity.req + * @ClassName: PageReq + * @Description: 分页 + * @Author: Maureen.Rong + * @CreateDate: 2021/8/12 15:10 + * @UpdateDate: 2021/8/12 15:10 + * @Version: 1.0 + */ +@Data +public class PageReqVO { + + @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) + private Integer pageNum; + @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) + private Integer pageSize; + +} diff --git a/src/main/java/com/huoran/iasf/vo/req/PaginationColumnReqVO.java b/src/main/java/com/huoran/iasf/vo/req/PaginationColumnReqVO.java new file mode 100644 index 0000000..d6144d2 --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/PaginationColumnReqVO.java @@ -0,0 +1,34 @@ +package com.huoran.iasf.vo.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @ProjectName: huorantech + * @Package: com.huoran.occupationlab.entity.req + * @ClassName: PageReq + * @Description: 分页 + * @Author: Maureen.Rong + * @CreateDate: 2021/8/12 15:10 + * @UpdateDate: 2021/8/12 15:10 + * @Version: 1.0 + */ +@Data +public class PaginationColumnReqVO extends PageReqVO { + + @ApiModelProperty(value = "栏目名称") + private String columnName; + + @ApiModelProperty(value = "栏目类型") + private Integer typeId; + + @ApiModelProperty(value = "栏目模板") + private Integer templateId; + + @ApiModelProperty(value = "站点id") + @NotNull(message = "站点id不能为空!") + private Integer siteId; + +} diff --git a/src/main/java/com/huoran/iasf/vo/req/SortByColumnReqVO.java b/src/main/java/com/huoran/iasf/vo/req/SortByColumnReqVO.java new file mode 100644 index 0000000..4835014 --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/req/SortByColumnReqVO.java @@ -0,0 +1,35 @@ +package com.huoran.iasf.vo.req; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @描述:栏目基础信息 + * @作者: Rong + * @日期: 2022-08-03 + */ +@Data +@ApiModel(value = "栏目基础信息") +@TableName("sys_column") +public class SortByColumnReqVO { + + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "父id") + private Integer fatherId; + + @ApiModelProperty(value = "排序") + private Integer sort; + + @ApiModelProperty(value = "层级((1-一级分类 2-二级分类 3-三级分类以此叠加))") + private Integer level; + + + + +} \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java b/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java new file mode 100644 index 0000000..b7bfacd --- /dev/null +++ b/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java @@ -0,0 +1,95 @@ +package com.huoran.iasf.vo.resp; + +import com.baomidou.mybatisplus.annotation.*; +import com.huoran.iasf.entity.SysColumn; +import com.huoran.iasf.vo.FatherContentRespVO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @描述:文章管理 + * @作者: Rong + * @日期: 2022-08-05 + */ +@Data +public class PageContentRespVO { + + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "主键") + private Integer id; + + @ApiModelProperty(value = "标题") + private String title; + + @ApiModelProperty(value = "所属栏目") + private String columnName; + + @ApiModelProperty(value = "所属栏目") + private Integer columnId; + + @ApiModelProperty(value = "标题图") + private String titleImg; + + @ApiModelProperty(value = "来源") + private String source; + + @ApiModelProperty(value = "发布时间") + private String releaseTime; + + @ApiModelProperty(value = "摘要") + private String summary; + + @ApiModelProperty(value = "banner图") + private String bannerImg; + + @ApiModelProperty(value = "文章模板(前端自定义)") + private Integer articleTemplate; + + @ApiModelProperty(value = "正文") + private String mainBody; + + @ApiModelProperty(value = "作者") + private String author; + + @ApiModelProperty(value = "是否发布(0:草稿 1:已发布)") + private Integer isRelease; + + @ApiModelProperty(value = "栏目类型(由前端自己设定)") + private Integer typeId; + + + @ApiModelProperty(value = "创建人") + private String founderName; + + @ApiModelProperty(value = "编辑人") + private String editorName; + + @ApiModelProperty(value = "文件") + private String file; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "文章总浏览量") + private Integer totalBrowsing; + + @ApiModelProperty(value = "父id(第一级为0)") + private Integer fatherId; + + @ApiModelProperty(value = "层级((1-一级分类 2-二级分类 3-三级分类以此叠加))") + private Integer level; + + + @ApiModelProperty(value = "上级栏目") + private List superiorColumn; + +} \ No newline at end of file