5 files renamed
7 files modified
23 files added
31 files deleted
| New file |
| | |
| | | |
| | | package org.springblade.modules.article.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.article.entity.ArticleCollectEntity; |
| | | import org.springblade.modules.article.service.IArticleCollectService; |
| | | import org.springblade.modules.article.vo.ArticleCollectVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 通知收藏表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-articleCollect/articleCollect") |
| | | @Api(value = "通知收藏表", tags = "通知收藏表接口") |
| | | public class ArticleCollectController extends BladeController { |
| | | |
| | | private final IArticleCollectService articleCollectService; |
| | | |
| | | /** |
| | | * 通知收藏表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入articleCollect") |
| | | public R<ArticleCollectEntity> detail(ArticleCollectEntity articleCollect) { |
| | | ArticleCollectEntity detail = articleCollectService.getOne(Condition.getQueryWrapper(articleCollect)); |
| | | return R.data(detail); |
| | | } |
| | | /** |
| | | * 通知收藏表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入articleCollect") |
| | | public R<IPage<ArticleCollectEntity>> list(ArticleCollectEntity articleCollect, Query query) { |
| | | IPage<ArticleCollectEntity> pages = articleCollectService.page(Condition.getPage(query), Condition.getQueryWrapper(articleCollect)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 通知收藏表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入articleCollect") |
| | | public R<IPage<ArticleCollectVO>> page(ArticleCollectVO articleCollect, Query query) { |
| | | IPage<ArticleCollectVO> pages = articleCollectService.selectArticleCollectPage(Condition.getPage(query), articleCollect); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 通知收藏表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入articleCollect") |
| | | public R save(@Valid @RequestBody ArticleCollectEntity articleCollect) { |
| | | return R.status(articleCollectService.save(articleCollect)); |
| | | } |
| | | |
| | | /** |
| | | * 通知收藏表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入articleCollect") |
| | | public R update(@Valid @RequestBody ArticleCollectEntity articleCollect) { |
| | | return R.status(articleCollectService.updateById(articleCollect)); |
| | | } |
| | | |
| | | /** |
| | | * 通知收藏表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入articleCollect") |
| | | public R submit(@Valid @RequestBody ArticleCollectEntity articleCollect) { |
| | | return R.status(articleCollectService.saveOrUpdate(articleCollect)); |
| | | } |
| | | |
| | | /** |
| | | * 通知收藏表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(articleCollectService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | |
| | | package org.springblade.modules.article.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.article.entity.ArticleCommentEntity; |
| | | import org.springblade.modules.article.service.IArticleCommentService; |
| | | import org.springblade.modules.article.vo.ArticleCommentVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 通知评论表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-articleComment/articleComment") |
| | | @Api(value = "通知评论表", tags = "通知评论表接口") |
| | | public class ArticleCommentController extends BladeController { |
| | | |
| | | private final IArticleCommentService articleCommentService; |
| | | |
| | | /** |
| | | * 通知评论表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入articleComment") |
| | | public R<ArticleCommentEntity> detail(ArticleCommentEntity articleComment) { |
| | | ArticleCommentEntity detail = articleCommentService.getOne(Condition.getQueryWrapper(articleComment)); |
| | | return R.data(detail); |
| | | } |
| | | /** |
| | | * 通知评论表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入articleComment") |
| | | public R<IPage<ArticleCommentEntity>> list(ArticleCommentEntity articleComment, Query query) { |
| | | IPage<ArticleCommentEntity> pages = articleCommentService.page(Condition.getPage(query), Condition.getQueryWrapper(articleComment)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 通知评论表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入articleComment") |
| | | public R<IPage<ArticleCommentVO>> page(ArticleCommentVO articleComment, Query query) { |
| | | IPage<ArticleCommentVO> pages = articleCommentService.selectArticleCommentPage(Condition.getPage(query), articleComment); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 通知评论表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入articleComment") |
| | | public R save(@Valid @RequestBody ArticleCommentEntity articleComment) { |
| | | return R.status(articleCommentService.save(articleComment)); |
| | | } |
| | | |
| | | /** |
| | | * 通知评论表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入articleComment") |
| | | public R update(@Valid @RequestBody ArticleCommentEntity articleComment) { |
| | | return R.status(articleCommentService.updateById(articleComment)); |
| | | } |
| | | |
| | | /** |
| | | * 通知评论表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入articleComment") |
| | | public R submit(@Valid @RequestBody ArticleCommentEntity articleComment) { |
| | | return R.status(articleCommentService.saveOrUpdate(articleComment)); |
| | | } |
| | | |
| | | /** |
| | | * 通知评论表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(articleCommentService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.article.entity.Article; |
| | | import org.springblade.modules.article.service.ArticleService; |
| | | import org.springblade.modules.article.vo.ArticleVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @title 资讯控制层 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/blade-article/article") |
| | | public class ArticleController { |
| | | |
| | | private final ArticleService articleService; |
| | | |
| | | /** |
| | | * 查询资讯分页信息 |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageWeb") |
| | | public R<IPage<Article>> pageWeb(ArticleVO article, Query query) { |
| | | return R.data(articleService.selectArticlePage(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息-app |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | public R<IPage<ArticleVO>> page(ArticleVO article, Query query) { |
| | | return R.data(articleService.selectArticlePageByApp(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | /** |
| | | * 敏感词预警 |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageWords") |
| | | public R<IPage<Article>> pageWords(ArticleVO article, Query query) { |
| | | return R.data(articleService.pageWords(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限) |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageDate") |
| | | public R<IPage<Article>> pageDate(ArticleVO article, Query query) { |
| | | return R.data(articleService.pageDate(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | @GetMapping("/pageCollectList") |
| | | public R<IPage<Article>> pageCollectList(ArticleVO article, Query query) { |
| | | return R.data(articleService.pageCollectList(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限)附带点赞评论数 |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageLikes") |
| | | public R<IPage<Article>> pageLikes(ArticleVO article, Query query) { |
| | | return R.data(articleService.pageLikes(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询已收藏的资讯 |
| | | */ |
| | | @GetMapping("/pageCollect") |
| | | public R<IPage<Article>> pageCollect(ArticleVO article, Query query) { |
| | | return R.data(articleService.pageCollect(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * |
| | | * @param article 资讯查询对象 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入articleoy") |
| | | public R<Article> detail(Article article) { |
| | | Article detail = articleService.getOne(Condition.getQueryWrapper(article)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 新增资讯信息 |
| | | * |
| | | * @param article 资讯对象 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入article") |
| | | public R save(@Valid Article article) { |
| | | return R.status(articleService.save(article)); |
| | | } |
| | | |
| | | /** |
| | | * 修改资讯信息 |
| | | * @param article 资讯对象 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入article") |
| | | public R update(@Valid @RequestBody Article article) { |
| | | return R.status(articleService.updateById(article)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改资讯信息 |
| | | * |
| | | * @param article 资讯对象信息 |
| | | */ |
| | | @PostMapping("/submit") |
| | | public R submit(@RequestBody ArticleVO article) { |
| | | if (null == article.getId()) { |
| | | if (null == article.getCreateTime()) { |
| | | article.setCreateTime(new Date()); |
| | | } |
| | | } |
| | | article.setUpdateTime(new Date()); |
| | | return R.status(articleService.saveOrUpdate(article)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除资讯信息 |
| | | * @param ids 资讯主键id,id集合 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(articleService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 批量修改评论区状态 |
| | | */ |
| | | @PostMapping("/upcomment") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, String type) { |
| | | String[] split = ids.split(","); |
| | | String strArrays = ""; |
| | | for (int i = 0; i < split.length; i++) { |
| | | strArrays += "'" + split[i] + "',"; |
| | | } |
| | | String code = strArrays.substring(0, strArrays.length() - 1); |
| | | return R.status(articleService.upcomment(code, type)); |
| | | } |
| | | |
| | | /** |
| | | * 查询个人资讯 |
| | | * @param article |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectArticleG") |
| | | public R<IPage<Article>> selectArticleG(ArticleVO article, Query query) { |
| | | return R.data(articleService.selectArticleG(Condition.getPage(query), article)); |
| | | } |
| | | |
| | | /** |
| | | * 通知公告表浏览数量加一 |
| | | */ |
| | | @PostMapping("/addNumber") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "添加浏览数量", notes = "传入notice") |
| | | public R addNumber(@Valid @RequestBody Article notice) { |
| | | UpdateWrapper<Article> objectUpdateWrapper = new UpdateWrapper<>(); |
| | | objectUpdateWrapper.setSql("view_number = view_number + 1"); |
| | | objectUpdateWrapper.eq("id",notice.getId()); |
| | | return R.status(articleService.update(null ,objectUpdateWrapper)); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.article.entity.ArticleLikeEntity; |
| | | import org.springblade.modules.article.service.IArticleLikeService; |
| | | import org.springblade.modules.article.vo.ArticleLikeVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 通知点赞表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-articleLike/articleLike") |
| | | @Api(value = "通知点赞表", tags = "通知点赞表接口") |
| | | public class ArticleLikeController extends BladeController { |
| | | |
| | | private final IArticleLikeService articleLikeService; |
| | | |
| | | /** |
| | | * 通知点赞表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入articleLike") |
| | | public R<ArticleLikeEntity> detail(ArticleLikeEntity articleLike) { |
| | | ArticleLikeEntity detail = articleLikeService.getOne(Condition.getQueryWrapper(articleLike)); |
| | | return R.data(detail); |
| | | } |
| | | /** |
| | | * 通知点赞表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入articleLike") |
| | | public R<IPage<ArticleLikeEntity>> list(ArticleLikeEntity articleLike, Query query) { |
| | | IPage<ArticleLikeEntity> pages = articleLikeService.page(Condition.getPage(query), Condition.getQueryWrapper(articleLike)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 通知点赞表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入articleLike") |
| | | public R<IPage<ArticleLikeVO>> page(ArticleLikeVO articleLike, Query query) { |
| | | IPage<ArticleLikeVO> pages = articleLikeService.selectArticleLikePage(Condition.getPage(query), articleLike); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 通知点赞表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入articleLike") |
| | | public R save(@Valid @RequestBody ArticleLikeEntity articleLike) { |
| | | UpdateWrapper<ArticleLikeEntity> objectUpdateWrapper = new UpdateWrapper<>(); |
| | | objectUpdateWrapper.eq("article_user_id", articleLike.getArticleUserId()); |
| | | objectUpdateWrapper.eq("article_id", articleLike.getArticleId()); |
| | | articleLike.setDeleteFlag(0); |
| | | return R.status(articleLikeService.saveOrUpdate(articleLike, objectUpdateWrapper)); |
| | | } |
| | | |
| | | /** |
| | | * 通知点赞表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入articleLike") |
| | | public R update(@Valid @RequestBody ArticleLikeEntity articleLike) { |
| | | return R.status(articleLikeService.updateById(articleLike)); |
| | | } |
| | | |
| | | /** |
| | | * 通知点赞表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入articleLike") |
| | | public R submit(@Valid @RequestBody ArticleLikeEntity articleLike) { |
| | | return R.status(articleLikeService.saveOrUpdate(articleLike)); |
| | | } |
| | | |
| | | /** |
| | | * 通知点赞表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(articleLikeService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-06-07 |
| | | * |
| | | */ |
| | | @Data |
| | | @TableName("jczz_article") |
| | | public class Article implements Serializable { |
| | | |
| | | /** |
| | | * 主键id,自增 |
| | | */ |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @NotNull(message = "标题不能为空") |
| | | private String title; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @NotNull(message = "类型") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * logo 图片url |
| | | */ |
| | | private String url; |
| | | |
| | | /** |
| | | * logo 图片url |
| | | */ |
| | | @TableField("video_url") |
| | | private String videoUrl; |
| | | |
| | | |
| | | /** |
| | | * 发布来源id |
| | | */ |
| | | @TableField("source_id") |
| | | private String sourceId; |
| | | |
| | | /** |
| | | * 发布来源名称 |
| | | */ |
| | | @TableField("source_name") |
| | | private String sourceName; |
| | | |
| | | /** |
| | | * 资讯类型,对应业务字典数据 articleType |
| | | */ |
| | | @TableField("article_type") |
| | | private String articleType; |
| | | |
| | | /** |
| | | * 是否推荐 1:推荐 2:不推荐 |
| | | */ |
| | | private Integer recommend; |
| | | |
| | | /** |
| | | * 发布状态 0:未发布 1:已发布 |
| | | */ |
| | | private String publish; |
| | | |
| | | /** |
| | | * 开启评论区 0:关闭 1:开启 |
| | | */ |
| | | private String iscomment; |
| | | /** |
| | | * 查看数量 |
| | | */ |
| | | @ApiModelProperty(value = "查看数量") |
| | | private Integer viewNumber; |
| | | |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("创建人") |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("更新人") |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("更新时间") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | @TableLogic |
| | | @ApiModelProperty("是否已删除 0:否 1:是") |
| | | private Integer isDeleted; |
| | | } |
| File was renamed from src/main/java/org/springblade/modules/notice/entity/NoticeCollectEntity.java |
| | |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * Redistributions of source code must retain the above copyright article, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * article, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.notice.entity; |
| | | package org.springblade.modules.article.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * 通知收藏表 实体类 |
| | |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_notice_collect") |
| | | @TableName("jczz_article_collect") |
| | | @ApiModel(value = "NoticeCollect对象", description = "通知收藏表") |
| | | public class NoticeCollectEntity implements Serializable { |
| | | public class ArticleCollectEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value = "收藏文章id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long noticeId; |
| | | private Long articleId; |
| | | /** |
| | | * 收藏人id |
| | | */ |
| File was renamed from src/main/java/org/springblade/modules/notice/entity/NoticeCommentEntity.java |
| | |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * Redistributions of source code must retain the above copyright article, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * article, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.notice.entity; |
| | | package org.springblade.modules.article.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * 通知评论表 实体类 |
| | |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_notice_comment") |
| | | @TableName("jczz_article_comment") |
| | | @ApiModel(value = "NoticeComment对象", description = "通知评论表") |
| | | public class NoticeCommentEntity implements Serializable { |
| | | public class ArticleCommentEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value = "公告id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long noticeId; |
| | | private Long articleId; |
| | | /** |
| | | * 评论内容 |
| | | */ |
| New file |
| | |
| | | package org.springblade.modules.article.entity; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 通知点赞表 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_article_like") |
| | | @ApiModel(value = "NoticeLike对象", description = "通知点赞表") |
| | | public class ArticleLikeEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("主键id") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | /** |
| | | * 点赞文章id |
| | | */ |
| | | @ApiModelProperty(value = "点赞文章id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long articleId; |
| | | /** |
| | | * 点赞用户id |
| | | */ |
| | | @ApiModelProperty(value = "点赞用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long articleUserId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("创建时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 是删除 |
| | | */ |
| | | @ApiModelProperty("是删除") |
| | | private Integer deleteFlag; |
| | | |
| | | } |
| File was renamed from src/main/java/org/springblade/modules/notice/mapper/NoticeCollectMapper.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.notice.mapper; |
| | | package org.springblade.modules.article.mapper; |
| | | |
| | | import org.springblade.modules.notice.entity.NoticeCollectEntity; |
| | | import org.springblade.modules.notice.vo.NoticeCollectVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.article.entity.ArticleCollectEntity; |
| | | import org.springblade.modules.article.vo.ArticleCollectVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | public interface NoticeCollectMapper extends BaseMapper<NoticeCollectEntity> { |
| | | public interface ArticleCollectMapper extends BaseMapper<ArticleCollectEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | * @param noticeCollect |
| | | * @return |
| | | */ |
| | | List<NoticeCollectVO> selectNoticeCollectPage(IPage page, NoticeCollectVO noticeCollect); |
| | | List<ArticleCollectVO> selectArticleCollectPage(IPage page, ArticleCollectVO noticeCollect); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.article.mapper.ArticleCollectMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="articleCollectResultMap" type="org.springblade.modules.article.entity.ArticleCollectEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="article_id" property="articleId"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="create_time" property="createTime"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectArticleCollectPage" resultMap="articleCollectResultMap"> |
| | | select * from jczz_article_collect where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.article.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.article.entity.ArticleCommentEntity; |
| | | import org.springblade.modules.article.vo.ArticleCommentVO; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 通知评论表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | public interface ArticleCommentMapper extends BaseMapper<ArticleCommentEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param noticeComment |
| | | * @return |
| | | */ |
| | | List<ArticleCommentVO> selectArticleCommentPage(IPage page, ArticleCommentVO noticeComment); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.article.mapper.ArticleCommentMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="articleCommentResultMap" type="org.springblade.modules.article.entity.ArticleCommentEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="article_id" property="articleId"/> |
| | | <result column="content" property="content"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="reply_id" property="replyId"/> |
| | | <result column="reply_time" property="replyTime"/> |
| | | <result column="topping" property="topping"/> |
| | | <result column="isexamine" property="isexamine"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectArticleCommentPage" resultMap="articleCommentResultMap"> |
| | | select * from jczz_article_comment where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.article.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.article.entity.ArticleLikeEntity; |
| | | import org.springblade.modules.article.vo.ArticleLikeVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 通知点赞表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | public interface ArticleLikeMapper extends BaseMapper<ArticleLikeEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param articleLike |
| | | * @return` |
| | | */ |
| | | List<ArticleLikeVO> selectArticleLikePage(IPage page, ArticleLikeVO articleLike); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.article.mapper.ArticleLikeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="articleLikeResultMap" type="org.springblade.modules.article.vo.ArticleLikeVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="article_id" property="articleId"/> |
| | | <result column="article_user_id" property="articleUserId"/> |
| | | <result column="create_time" property="createTime"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectArticleLikePage" resultMap="articleLikeResultMap"> |
| | | select * from jczz_article_like where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.article.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.article.entity.Article; |
| | | import org.springblade.modules.article.vo.ArticleVO; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * mapper 映射层 |
| | | */ |
| | | public interface ArticleMapper extends BaseMapper<Article> { |
| | | |
| | | /** |
| | | * 自定义分页-APP |
| | | * @param page |
| | | * @param article |
| | | * @return |
| | | */ |
| | | List<ArticleVO> selectArticlePageByApp(IPage page, ArticleVO article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | List<Article> selectArticlePage(IPage<Article> page, @Param("article") ArticleVO article); |
| | | List<Article> selectArticleG(IPage<Article> page, @Param("article") ArticleVO article); |
| | | /** |
| | | * 查询资讯分页信息(角色权限) |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | List<Article> pageDate(IPage<Article> page, @Param("article") ArticleVO article); |
| | | |
| | | List<Article> pageWords(IPage<Article> page, @Param("article") ArticleVO article); |
| | | |
| | | List<Article> pageCollectList(IPage<Article> page, @Param("article") ArticleVO article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限)附带评论点赞数量 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | List<Article> pageLikes(IPage<Article> page, @Param("article") ArticleVO article); |
| | | |
| | | List<Article> pageCollect(IPage<Article> page, @Param("article") ArticleVO article); |
| | | |
| | | Boolean upcomment(String ids, String type); |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.article.mapper.ArticleMapper"> |
| | | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="noticeResultMap" type="org.springblade.modules.article.vo.ArticleVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="title" property="title"/> |
| | | <result column="type" property="type"/> |
| | | <result column="content" property="content"/> |
| | | <result column="url" property="url"/> |
| | | <result column="video_url" property="videoUrl"/> |
| | | <result column="source_id" property="sourceId"/> |
| | | <result column="source_name" property="sourceName"/> |
| | | <result column="article_type" property="articleType"/> |
| | | <result column="recommend" property="recommend"/> |
| | | <result column="publish" property="publish"/> |
| | | <result column="iscomment" property="iscomment"/> |
| | | <result column="view_number" property="viewNumber"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | |
| | | <!-- <collection property="lickFlag" javaType="int"--> |
| | | <!-- column="id" select="selectStlLick">--> |
| | | <!-- </collection>--> |
| | | |
| | | <collection property="countNumber" column="id" javaType="int" select="selectStlCount"> |
| | | </collection> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- <select id="selectStlLick" parameterType="Long" resultType="int">--> |
| | | <!-- select IFNULL(jnl.id, 0) lickFlag--> |
| | | <!-- FROM jczz_notice jn--> |
| | | <!-- LEFT JOIN jczz_notice_like jnl ON jn.id = jnl.notice_id--> |
| | | <!-- WHERE jnl.notice_user_id = #{notice.userId}--> |
| | | <!-- and jn.is_deleted = 0--> |
| | | <!-- and jn.id = #{id}--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="selectStlCount" resultType="int"> |
| | | select count(1) countNumber |
| | | FROM jczz_article jn |
| | | LEFT JOIN jczz_article_like jnl ON jn.id = jnl.article_id |
| | | where jn.is_deleted = 0 |
| | | and jnl.delete_flag = 0 |
| | | and jn.id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectArticlePageByApp" resultMap="noticeResultMap"> |
| | | select id, |
| | | title, |
| | | type, |
| | | url, |
| | | video_url, |
| | | source_id, |
| | | source_name, |
| | | article_type, |
| | | recommend, |
| | | publish, |
| | | iscomment, |
| | | view_number, |
| | | create_time, |
| | | update_time, |
| | | update_user, |
| | | create_user, |
| | | is_deleted |
| | | from jczz_article |
| | | where is_deleted = 0 |
| | | and publish = 1 |
| | | </select> |
| | | |
| | | <!--查询资讯分页列表信息--> |
| | | <select id="selectArticlePage" resultType="org.springblade.modules.article.entity.Article"> |
| | | select * from jczz_article |
| | | where 1=1 |
| | | <if test="article.title!=null and article.title!=''"> |
| | | and title like concat('%',#{article.title},'%') |
| | | </if> |
| | | <if test="article.sourceName!=null and article.sourceName!=''"> |
| | | and source_name like concat('%',#{article.sourceName},'%') |
| | | </if> |
| | | <if test="article.startTime!=null and article.startTime!=''"> |
| | | and create_time>=#{article.startTime} |
| | | </if> |
| | | <if test="article.endTime!=null and article.endTime!=''"> |
| | | and create_time<=#{article.endTime} |
| | | </if> |
| | | <if test="article.publish!=null and article.publish!=''"> |
| | | and publish = #{article.publish} |
| | | </if> |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type like concat('%',#{article.articleType},'%') |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--查询资讯敏感词预警--> |
| | | <select id="pageWords" resultType="org.springblade.modules.article.entity.Article"> |
| | | select * from jczz_article |
| | | where 1=1 |
| | | <if test="article.title!=null and article.title!=''"> |
| | | and title like concat('%',#{article.title},'%') |
| | | </if> |
| | | <if test="article.sourceName!=null and article.sourceName!=''"> |
| | | and source_name like concat('%',#{article.sourceName},'%') |
| | | </if> |
| | | <if test="article.startTime!=null and article.startTime!=''"> |
| | | and create_time>=#{article.startTime} |
| | | </if> |
| | | <if test="article.endTime!=null and article.endTime!=''"> |
| | | and create_time<=#{article.endTime} |
| | | </if> |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type = #{article.articleType} |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | and iswords = "1" |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--查询资讯分页列表信息--> |
| | | <select id="pageDate" resultType="org.springblade.modules.article.entity.Article"> |
| | | select * from jczz_article |
| | | where 1=1 |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type LIKE CONCAT ('%', #{article.articleType},'%') |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')"> |
| | | AND publish = 1 |
| | | </if> |
| | | and iswords = "0" |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--查询收藏资讯分页列表信息--> |
| | | <select id="pageCollectList" resultType="org.springblade.modules.article.entity.Article"> |
| | | SELECT |
| | | art.* |
| | | FROM |
| | | sys_collect col |
| | | LEFT JOIN jczz_article art on art.id = col.collect_article |
| | | WHERE |
| | | 1 = 1 AND collect_user = #{article.userid} |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type LIKE CONCAT ('%', #{article.articleType},'%') |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')"> |
| | | AND publish = 1 |
| | | </if> |
| | | and iswords = "0" |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--查询资讯分页列表信息--> |
| | | <select id="pageLikes" resultType="org.springblade.modules.article.vo.ArticleVO"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_article art |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.likes_article, |
| | | COUNT( * ) AS count, |
| | | b.islikes |
| | | FROM |
| | | sys_likes a |
| | | LEFT JOIN ( SELECT likes_article, COUNT( * ) AS islikes FROM sys_likes WHERE 1 = 1 |
| | | <if test="article.userid!=null and article.userid!=''"> |
| | | and likes_user = #{article.userid} |
| | | </if> |
| | | GROUP BY likes_article ) b ON a.likes_article = b.likes_article |
| | | GROUP BY |
| | | likes_article, |
| | | b.islikes |
| | | ) likes ON art.id = likes.likes_article |
| | | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.collect_article, |
| | | COUNT( * ) AS collectcount, |
| | | b.iscollect |
| | | FROM |
| | | sys_collect a |
| | | LEFT JOIN ( SELECT collect_article, COUNT( * ) AS iscollect FROM sys_collect WHERE 1 = 1 |
| | | <if test="article.userid!=null and article.userid!=''"> |
| | | and collect_user = #{article.userid} |
| | | </if> |
| | | GROUP BY collect_article ) b ON a.collect_article = b.collect_article |
| | | GROUP BY |
| | | collect_article, |
| | | b.iscollect |
| | | ) collect ON art.id = collect.collect_article |
| | | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | article, |
| | | COUNT(*) as comments |
| | | FROM |
| | | sys_comment |
| | | GROUP BY article |
| | | ) com on com.article = art.id |
| | | WHERE |
| | | 1 = 1 |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type LIKE CONCAT ('%', #{article.articleType},'%') |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')"> |
| | | AND publish = 1 |
| | | </if> |
| | | and iswords = "0" |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--查询资讯分页列表信息--> |
| | | <select id="pageCollect" resultType="org.springblade.modules.article.vo.ArticleVO"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_article art |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.likes_article, |
| | | COUNT( * ) AS count, |
| | | b.islikes |
| | | FROM |
| | | sys_likes a |
| | | LEFT JOIN ( SELECT likes_article, COUNT( * ) AS islikes FROM sys_likes WHERE 1 = 1 |
| | | <if test="article.userid!=null and article.userid!=''"> |
| | | and likes_user = #{article.userid} |
| | | </if> |
| | | GROUP BY likes_article ) b ON a.likes_article = b.likes_article |
| | | GROUP BY |
| | | likes_article, |
| | | b.islikes |
| | | ) likes ON art.id = likes.likes_article |
| | | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.collect_article, |
| | | COUNT( * ) AS collectcount, |
| | | b.iscollect |
| | | FROM |
| | | sys_collect a |
| | | LEFT JOIN ( SELECT collect_article, COUNT( * ) AS iscollect FROM sys_collect WHERE 1 = 1 |
| | | <if test="article.userid!=null and article.userid!=''"> |
| | | and collect_user = #{article.userid} |
| | | </if> |
| | | GROUP BY collect_article ) b ON a.collect_article = b.collect_article |
| | | GROUP BY |
| | | collect_article, |
| | | b.iscollect |
| | | ) collect ON art.id = collect.collect_article |
| | | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | article, |
| | | COUNT(*) as comments |
| | | FROM |
| | | sys_comment |
| | | GROUP BY article |
| | | ) com on com.article = art.id |
| | | WHERE |
| | | 1 = 1 |
| | | AND iscollect = 1 |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type LIKE CONCAT ('%', #{article.articleType},'%') |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')"> |
| | | AND publish = 1 |
| | | </if> |
| | | and iswords = "0" |
| | | order by id desc |
| | | </select> |
| | | |
| | | <update id="upcomment"> |
| | | update jczz_article set iscomment = #{type} |
| | | where id in(${ids}) |
| | | </update> |
| | | |
| | | <!--个人资讯--> |
| | | <select id="selectArticleG" resultType="org.springblade.modules.article.entity.Article"> |
| | | select * from jczz_article |
| | | where 1=1 |
| | | <if test="article.title!=null and article.title!=''"> |
| | | and title like concat('%',#{article.title},'%') |
| | | </if> |
| | | <if test="article.sourceName!=null and article.sourceName!=''"> |
| | | and source_name like concat('%',#{article.sourceName},'%') |
| | | </if> |
| | | <if test="article.startTime!=null and article.startTime!=''"> |
| | | and create_time>=#{article.startTime} |
| | | </if> |
| | | <if test="article.endTime!=null and article.endTime!=''"> |
| | | and create_time<=#{article.endTime} |
| | | </if> |
| | | <if test="article.articleType!=null and article.articleType!=''"> |
| | | and article_type = #{article.articleType} |
| | | </if> |
| | | <if test="article.keyword!=null and article.keyword!=''"> |
| | | AND CONCAT(title,source_name) |
| | | LIKE CONCAT ('%', #{article.keyword},'%') |
| | | </if> |
| | | <if test="(article.rolename==null and article.rolename=='') or (article.rolename!='administrator' and article.rolename!='policeAdmin')"> |
| | | AND publish = 1 |
| | | </if> |
| | | and iswords = "0" and type!=1 |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.article.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.article.entity.Article; |
| | | import org.springblade.modules.article.vo.ArticleVO; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * 资讯服务接口层 |
| | | */ |
| | | public interface ArticleService extends IService<Article> { |
| | | |
| | | /** |
| | | * 查询资讯分页信息 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | IPage<Article> selectArticlePage(IPage<Article> page, ArticleVO article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息-app |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | IPage<ArticleVO> selectArticlePageByApp(IPage<ArticleVO> page, ArticleVO article); |
| | | |
| | | |
| | | IPage<Article> selectArticleG(IPage<Article> page, ArticleVO article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限) |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | IPage<Article> pageDate(IPage<Article> page, ArticleVO article); |
| | | |
| | | IPage<Article> pageWords(IPage<Article> page, ArticleVO article); |
| | | |
| | | IPage<Article> pageCollectList(IPage<Article> page, ArticleVO article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限)附带评论点赞数 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | IPage<Article> pageLikes(IPage<Article> page, ArticleVO article); |
| | | |
| | | /** |
| | | * 查看已收藏的资讯 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | IPage<Article> pageCollect(IPage<Article> page, ArticleVO article); |
| | | |
| | | Boolean upcomment(String ids, String type); |
| | | } |
| File was renamed from src/main/java/org/springblade/modules/notice/service/INoticeCollectService.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.notice.service; |
| | | package org.springblade.modules.article.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.notice.entity.NoticeCollectEntity; |
| | | import org.springblade.modules.notice.vo.NoticeCollectVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.article.entity.ArticleCollectEntity; |
| | | import org.springblade.modules.article.vo.ArticleCollectVO; |
| | | |
| | | /** |
| | | * 通知收藏表 服务类 |
| | |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | public interface INoticeCollectService extends IService<NoticeCollectEntity> { |
| | | public interface IArticleCollectService extends IService<ArticleCollectEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | * @param noticeCollect |
| | | * @return |
| | | */ |
| | | IPage<NoticeCollectVO> selectNoticeCollectPage(IPage<NoticeCollectVO> page, NoticeCollectVO noticeCollect); |
| | | IPage<ArticleCollectVO> selectArticleCollectPage(IPage<ArticleCollectVO> page, ArticleCollectVO noticeCollect); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.article.entity.ArticleCommentEntity; |
| | | import org.springblade.modules.article.vo.ArticleCommentVO; |
| | | |
| | | /** |
| | | * 通知评论表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | public interface IArticleCommentService extends IService<ArticleCommentEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param noticeComment |
| | | * @return |
| | | */ |
| | | IPage<ArticleCommentVO> selectArticleCommentPage(IPage<ArticleCommentVO> page, ArticleCommentVO noticeComment); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | |
| | | package org.springblade.modules.article.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.article.entity.ArticleLikeEntity; |
| | | import org.springblade.modules.article.vo.ArticleLikeVO; |
| | | |
| | | /** |
| | | * 通知点赞表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | public interface IArticleLikeService extends IService<ArticleLikeEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param noticeLike |
| | | * @return |
| | | */ |
| | | IPage<ArticleLikeVO> selectArticleLikePage(IPage<ArticleLikeVO> page, ArticleLikeVO noticeLike); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.article.entity.ArticleCollectEntity; |
| | | import org.springblade.modules.article.mapper.ArticleCollectMapper; |
| | | import org.springblade.modules.article.service.IArticleCollectService; |
| | | import org.springblade.modules.article.vo.ArticleCollectVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 通知收藏表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Service |
| | | public class ArticleCollectServiceImpl extends ServiceImpl<ArticleCollectMapper, ArticleCollectEntity> implements IArticleCollectService { |
| | | |
| | | @Override |
| | | public IPage<ArticleCollectVO> selectArticleCollectPage(IPage<ArticleCollectVO> page, ArticleCollectVO articleCollectVO) { |
| | | return page.setRecords(baseMapper.selectArticleCollectPage(page, articleCollectVO)); |
| | | } |
| | | |
| | | |
| | | } |
| File was renamed from src/main/java/org/springblade/modules/notice/service/impl/NoticeCommentServiceImpl.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.notice.service.impl; |
| | | package org.springblade.modules.article.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.notice.entity.NoticeCommentEntity; |
| | | import org.springblade.modules.notice.vo.NoticeCommentVO; |
| | | import org.springblade.modules.notice.mapper.NoticeCommentMapper; |
| | | import org.springblade.modules.notice.service.INoticeCommentService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.article.entity.ArticleCommentEntity; |
| | | import org.springblade.modules.article.mapper.ArticleCommentMapper; |
| | | import org.springblade.modules.article.service.IArticleCommentService; |
| | | import org.springblade.modules.article.vo.ArticleCommentVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 通知评论表 服务实现类 |
| | |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Service |
| | | public class NoticeCommentServiceImpl extends ServiceImpl<NoticeCommentMapper, NoticeCommentEntity> implements INoticeCommentService { |
| | | public class ArticleCommentServiceImpl extends ServiceImpl<ArticleCommentMapper, ArticleCommentEntity> implements IArticleCommentService { |
| | | |
| | | @Override |
| | | public IPage<NoticeCommentVO> selectNoticeCommentPage(IPage<NoticeCommentVO> page, NoticeCommentVO noticeComment) { |
| | | return page.setRecords(baseMapper.selectNoticeCommentPage(page, noticeComment)); |
| | | public IPage<ArticleCommentVO> selectArticleCommentPage(IPage<ArticleCommentVO> page, ArticleCommentVO noticeComment) { |
| | | return page.setRecords(baseMapper.selectArticleCommentPage(page, noticeComment)); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | |
| | | package org.springblade.modules.article.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.article.entity.ArticleLikeEntity; |
| | | import org.springblade.modules.article.mapper.ArticleLikeMapper; |
| | | import org.springblade.modules.article.service.IArticleLikeService; |
| | | import org.springblade.modules.article.vo.ArticleLikeVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 通知点赞表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Service |
| | | public class ArticleLikeServiceImpl extends ServiceImpl<ArticleLikeMapper, ArticleLikeEntity> implements IArticleLikeService { |
| | | |
| | | @Override |
| | | public IPage<ArticleLikeVO> selectArticleLikePage(IPage<ArticleLikeVO> page, ArticleLikeVO noticeLike) { |
| | | return page.setRecords(baseMapper.selectArticleLikePage(page, noticeLike)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.article.entity.Article; |
| | | import org.springblade.modules.article.mapper.ArticleMapper; |
| | | import org.springblade.modules.article.service.ArticleService; |
| | | import org.springblade.modules.article.vo.ArticleVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @title 资讯服务实现层 |
| | | */ |
| | | @Service |
| | | |
| | | public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService { |
| | | |
| | | /** |
| | | * 查询资讯分页信息 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<Article> selectArticlePage(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.selectArticlePage(page,article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ArticleVO> selectArticlePageByApp(IPage<ArticleVO> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.selectArticlePageByApp(page,article)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Article> selectArticleG(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.selectArticleG(page,article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限) |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<Article> pageDate(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.pageDate(page,article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息(敏感词预警) |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<Article> pageWords(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.pageWords(page,article)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Article> pageCollectList(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.pageCollectList(page,article)); |
| | | } |
| | | |
| | | /** |
| | | * 查询资讯分页信息(角色权限)附带评论点赞数 |
| | | * @param page |
| | | * @param article 资讯对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<Article> pageLikes(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.pageLikes(page,article)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Article> pageCollect(IPage<Article> page, ArticleVO article) { |
| | | return page.setRecords(baseMapper.pageCollect(page,article)); |
| | | } |
| | | |
| | | /** |
| | | * 批量更新 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean upcomment(String ids, String type) { |
| | | return baseMapper.upcomment(ids,type); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.article.entity.ArticleCollectEntity; |
| | | |
| | | /** |
| | | * 通知收藏表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ArticleCollectVO extends ArticleCollectEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.article.entity.ArticleCollectEntity; |
| | | |
| | | /** |
| | | * 通知评论表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ArticleCommentVO extends ArticleCollectEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.article.entity.ArticleLikeEntity; |
| | | |
| | | /** |
| | | * 通知点赞表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ArticleLikeVO extends ArticleLikeEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.article.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springblade.modules.article.entity.Article; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class ArticleVO extends Article implements Serializable { |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String endTime; |
| | | |
| | | /** |
| | | * 查询关键字 |
| | | */ |
| | | private String keyword; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String rolename; |
| | | |
| | | /** |
| | | * 点赞总数 |
| | | */ |
| | | private String count; |
| | | |
| | | /** |
| | | * 是否点赞 |
| | | */ |
| | | private String islikes; |
| | | |
| | | /** |
| | | * 收藏总数 |
| | | */ |
| | | private String collectcount; |
| | | |
| | | /** |
| | | * 是否收藏 |
| | | */ |
| | | private String iscollect; |
| | | |
| | | /** |
| | | * 评论总数 |
| | | */ |
| | | private String comments; |
| | | |
| | | /** |
| | | * 点赞标记 |
| | | */ |
| | | private Integer lickFlag; |
| | | |
| | | private Integer countNumber; |
| | | |
| | | private Long userId; |
| | | |
| | | } |
| | |
| | | |
| | | <!--查询区域数据-社区--> |
| | | <select id="getRegionListByGroupNei" resultType="org.springblade.common.node.TreeNode" > |
| | | select nei_code as id,nei_name as name from jczz_doorplate_address group by nei_code,nei_name |
| | | select nei_code as id,nei_name as name,town_street_code as parentId from jczz_doorplate_address group by nei_code,nei_name,town_street_code |
| | | </select> |
| | | |
| | | <!--根据社区名称查询小区集合--> |
| | |
| | | List<TreeNode> townList = baseMapper.getRegionListByGroupTwon(); |
| | | // 查询社区 |
| | | List<TreeNode> neiList = baseMapper.getRegionListByGroupNei(); |
| | | TreeNode node = townList.get(0); |
| | | node.setHasChildren(true); |
| | | // 遍历 |
| | | for (TreeNode treeNode : neiList) { |
| | | treeNode.setHasChildren(false); |
| | | node.getChildren().add(treeNode); |
| | | for (TreeNode treeNode : townList) { |
| | | // 遍历 |
| | | for (TreeNode node : neiList) { |
| | | if (treeNode.getId().equals(node.getParentId())){ |
| | | node.setHasChildren(false); |
| | | treeNode.getChildren().add(node); |
| | | } |
| | | } |
| | | } |
| | | // 查询区域数据,当前只有西市街道数据 |
| | | return townList; |
| | |
| | | */ |
| | | @PostMapping("/updatePlaceExt") |
| | | @ApiOperation(value = "自定义更新", notes = "传入placeExt") |
| | | public R updatePlaceExt(@RequestBody PlaceExtEntity placeExt) { |
| | | public R updatePlaceExt(@RequestBody PlaceExtVO placeExt) { |
| | | return R.status(placeExtService.updatePlaceExt(placeExt)); |
| | | } |
| | | |
| | |
| | | <select id="selectPlacePage" resultType="org.springblade.modules.place.vo.PlaceVO"> |
| | | select jp.*,bu.real_name as username,bu.phone as phone from jczz_place jp |
| | | left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0 |
| | | left join jczz_place_poi_label jppl on jppl.place_id = jp.id |
| | | left join ( |
| | | select a.* from jczz_place_poi_label a inner join |
| | | ( |
| | | select place_id,max(id) as id from jczz_place_poi_label b group by place_id |
| | | ) b on a.id = b.id |
| | | ) jppl on jppl.place_id = jp.id |
| | | where jp.is_deleted = 0 |
| | | <if test="place.placeName!=null and place.placeName!=''"> |
| | | and jp.place_name like concat('%',#{place.placeName},'%') |
| | |
| | | * @param placeExt |
| | | * @return |
| | | */ |
| | | boolean updatePlaceExt(PlaceExtEntity placeExt); |
| | | boolean updatePlaceExt(PlaceExtVO placeExt); |
| | | |
| | | /** |
| | | * 场所详情表 审核 |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.house.entity.HouseTenantEntity; |
| | | import org.springblade.modules.house.vo.HouseTenantVO; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.entity.PlaceExtEntity; |
| | | import org.springblade.modules.place.entity.PlacePractitionerEntity; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 场所详情表 服务实现类 |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updatePlaceExt(PlaceExtEntity placeExt) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updatePlaceExt(PlaceExtVO placeExt) { |
| | | // 设置参数 |
| | | placeExt.setUpdateTime(new Date()); |
| | | placeExt.setUpdateUser(AuthUtil.getUserId()); |
| | | // 更新 |
| | | return updateById(placeExt); |
| | | // 更新从业人员信息 |
| | | boolean addFlag = true; |
| | | boolean updateFlag = true; |
| | | boolean removeFlag = true; |
| | | //更新自身 |
| | | boolean update = updateById(placeExt); |
| | | // 查询对应已存在的从业人员 |
| | | QueryWrapper<PlacePractitionerEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("place_id",placeExt.getPlaceId()); |
| | | List<PlacePractitionerEntity> oldList = placePractitionerService.list(wrapper); |
| | | List<PlacePractitionerEntity> list = placeExt.getPlacePractitioner(); |
| | | // 申明新增,修改,删除集合 |
| | | List<PlacePractitionerEntity> newList = new ArrayList<>(); |
| | | List<PlacePractitionerEntity> addList = new ArrayList<>(); |
| | | List<PlacePractitionerEntity> updateList = new ArrayList<>(); |
| | | List<PlacePractitionerEntity> removeList = new ArrayList<>(); |
| | | // 找出需要新增的,否则组成新集合进行比对 |
| | | for (PlacePractitionerEntity practitionerEntity : list) { |
| | | practitionerEntity.setPlaceId(placeExt.getPlaceId()); |
| | | if (null==practitionerEntity.getId()){ |
| | | // 新增 |
| | | PlacePractitionerEntity placePractitionerEntity= new PlacePractitionerEntity(); |
| | | |
| | | placePractitionerEntity.setPlaceId(placeExt.getPlaceId()); |
| | | placePractitionerEntity.setName(practitionerEntity.getName()); |
| | | placePractitionerEntity.setTelephone(practitionerEntity.getTelephone()); |
| | | placePractitionerEntity.setTempAddress(practitionerEntity.getTempAddress()); |
| | | addList.add(placePractitionerEntity); |
| | | }else { |
| | | newList.add(practitionerEntity); |
| | | } |
| | | } |
| | | // 遍历去差集,判断是新增还是删除还是更新 |
| | | // 取旧数据和新提交数据差集--删除 |
| | | removeList = oldList.stream().filter(vo -> !newList.stream().map(e -> |
| | | e.getId()).collect(Collectors.toList()).contains(vo.getId())).collect(Collectors.toList()); |
| | | // 取旧数据和新提交数据交集--更新 |
| | | updateList = newList.stream().filter(vo -> oldList.stream().map(e -> |
| | | e.getId()).collect(Collectors.toList()).contains(vo.getId())).collect(Collectors.toList()); |
| | | |
| | | // 批量新增 |
| | | if (addList.size()>0) { |
| | | addFlag = placePractitionerService.saveBatch(addList); |
| | | } |
| | | // 批量修改 |
| | | if (updateList.size()>0) { |
| | | updateFlag = placePractitionerService.updateBatchById(updateList); |
| | | } |
| | | // 批量删除 |
| | | if (removeList.size()>0) { |
| | | removeFlag = placePractitionerService.removeBatchByIds(removeList); |
| | | } |
| | | // 返回 |
| | | return update && addFlag && updateFlag && removeFlag; |
| | | } |
| | | |
| | | /** |
| | |
| | | - /blade-chat/weixin |
| | | - /blade-desk/notice/submit |
| | | - /blade-flow/model/submit |
| | | - /blade-article/article/submit |
| | | #安全框架配置 |
| | | secure: |
| | | #接口放行 |
| | |
| | | - /blade-houseRental/houseRental/** |
| | | - /blade-resource/oss/** |
| | | - /blade-place/** |
| | | - /blade-taskReportForRepairs/** |
| | | - /blade-placeExt/** |
| | | #授权认证配置 |
| | | auth: |
| | | - method: ALL |