diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicUserAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicUserAppController.java index cefe5b1..2821e9a 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicUserAppController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicUserAppController.java @@ -25,9 +25,8 @@ public class PlayletPublicUserAppController { @ResponseBody @PostMapping("/add") @ApiOperation(value = "新增公众号用户信息") - public Result addSave(@RequestBody PlayletPublicUser publicUser) { - publicUserAppService.addPublicUser(publicUser); - return Result.success(); + public Result addSave(@RequestBody PlayletPublicUser publicUser) { + return Result.success(publicUserAppService.addPublicUser(publicUser)); } @ResponseBody diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PublicDetailCommentAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PublicDetailCommentAppController.java new file mode 100644 index 0000000..1c6ac2a --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PublicDetailCommentAppController.java @@ -0,0 +1,49 @@ +package com.playlet.web.controller.app; + +import com.github.pagehelper.PageInfo; +import com.playlet.common.core.domain.Result; +import com.playlet.system.domain.PublicDetailComment; +import com.playlet.web.service.app.PublicDetailCommentAppService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@Slf4j +@Api(tags = "公众号*用户评论接口") +@RestController +@RequestMapping(value = "/app/public/comment") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class PublicDetailCommentAppController { + + private final PublicDetailCommentAppService detailCommentAppService; + + @ResponseBody + @PostMapping("/add") + @ApiOperation(value = "新增用户评论") + public Result add(@RequestBody PublicDetailComment detailComment) { + detailCommentAppService.add(detailComment); + return Result.success(); + } + + @ResponseBody + @PostMapping("/update") + @ApiOperation(value = "更新用户评论(后续点赞使用)") + public Result update(@RequestBody PublicDetailComment detailComment) { + detailCommentAppService.update(detailComment); + return Result.success(); + } + + @ResponseBody + @PostMapping("/query") + @ApiOperation(value = "查询当前文章评论,需传文章id") + public Result> query(@RequestBody PublicDetailComment detailComment, + @RequestParam(value = "pageNum") Integer pageNum, + @RequestParam(value = "pageSize") Integer pageSize) { + + return Result.success(detailCommentAppService.query(detailComment, pageNum, pageSize)); + } + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PublicUserRecordAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PublicUserRecordAppController.java new file mode 100644 index 0000000..4b97ea7 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PublicUserRecordAppController.java @@ -0,0 +1,39 @@ +package com.playlet.web.controller.app; + +import com.playlet.common.core.domain.Result; +import com.playlet.system.domain.PlayletPublicUser; +import com.playlet.system.domain.PublicUserRecord; +import com.playlet.web.service.app.PublicUserRecordAppService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@Slf4j +@Api(tags = "公众号*用户浏览记录接口") +@RestController +@RequestMapping(value = "/app/public/record") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class PublicUserRecordAppController { + + private final PublicUserRecordAppService publicUserRecordAppService; + + @ResponseBody + @PostMapping("/add") + @ApiOperation(value = "新增用户浏览记录") + public Result addRecord(@RequestBody PublicUserRecord userRecord) { + publicUserRecordAppService.addRecord(userRecord); + return Result.success(userRecord); + } + + @ResponseBody + @PostMapping("/update") + @ApiOperation(value = "更新用户浏览记录") + public Result updateRecord(@RequestBody PublicUserRecord userRecord) { + publicUserRecordAppService.updateRecord(userRecord); + return Result.success(userRecord); + } + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java new file mode 100644 index 0000000..f939e36 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java @@ -0,0 +1,127 @@ +package com.playlet.web.controller.system; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.playlet.common.annotation.Log; +import com.playlet.common.enums.BusinessType; +import com.playlet.system.domain.PublicDetailComment; +import com.playlet.system.service.IPublicDetailCommentService; +import com.playlet.common.core.controller.BaseController; +import com.playlet.common.core.domain.AjaxResult; +import com.playlet.common.utils.poi.ExcelUtil; +import com.playlet.common.core.page.TableDataInfo; + +/** + * 文章评论Controller + * + * @author ruoyi + * @date 2024-06-18 + */ +@Controller +@RequestMapping("/system/public/comment") +public class PublicDetailCommentController extends BaseController +{ + private String prefix = "system/public/comment"; + + @Autowired + private IPublicDetailCommentService publicDetailCommentService; + + @RequiresPermissions("public:comment:view") + @GetMapping() + public String comment() + { + return prefix + "/comment"; + } + + /** + * 查询文章评论列表 + */ + @RequiresPermissions("public:comment:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PublicDetailComment publicDetailComment) + { + startPage(); + List list = publicDetailCommentService.selectPublicDetailCommentList(publicDetailComment); + return getDataTable(list); + } + + /** + * 导出文章评论列表 + */ + @RequiresPermissions("public:comment:export") + @Log(title = "文章评论", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(PublicDetailComment publicDetailComment) + { + List list = publicDetailCommentService.selectPublicDetailCommentList(publicDetailComment); + ExcelUtil util = new ExcelUtil(PublicDetailComment.class); + return util.exportExcel(list, "文章评论数据"); + } + + /** + * 新增文章评论 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存文章评论 + */ + @RequiresPermissions("public:comment:add") + @Log(title = "文章评论", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(PublicDetailComment publicDetailComment) + { + return toAjax(publicDetailCommentService.insertPublicDetailComment(publicDetailComment)); + } + + /** + * 修改文章评论 + */ + @RequiresPermissions("public:comment:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + PublicDetailComment publicDetailComment = publicDetailCommentService.selectPublicDetailCommentById(id); + mmap.put("publicDetailComment", publicDetailComment); + return prefix + "/edit"; + } + + /** + * 修改保存文章评论 + */ + @RequiresPermissions("public:comment:edit") + @Log(title = "文章评论", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(PublicDetailComment publicDetailComment) + { + return toAjax(publicDetailCommentService.updatePublicDetailComment(publicDetailComment)); + } + + /** + * 删除文章评论 + */ + @RequiresPermissions("public:comment:remove") + @Log(title = "文章评论", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(publicDetailCommentService.deletePublicDetailCommentByIds(ids)); + } +} diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicUserRecordController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicUserRecordController.java new file mode 100644 index 0000000..85e3833 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicUserRecordController.java @@ -0,0 +1,127 @@ +package com.playlet.web.controller.system; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.playlet.common.annotation.Log; +import com.playlet.common.enums.BusinessType; +import com.playlet.system.domain.PublicUserRecord; +import com.playlet.system.service.IPublicUserRecordService; +import com.playlet.common.core.controller.BaseController; +import com.playlet.common.core.domain.AjaxResult; +import com.playlet.common.utils.poi.ExcelUtil; +import com.playlet.common.core.page.TableDataInfo; + +/** + * 公众号用户浏览记录Controller + * + * @author ruoyi + * @date 2024-06-15 + */ +@Controller +@RequestMapping("/system/public/record") +public class PublicUserRecordController extends BaseController +{ + private String prefix = "system/public/record"; + + @Autowired + private IPublicUserRecordService publicUserRecordService; + + @RequiresPermissions("public:record:view") + @GetMapping() + public String record() + { + return prefix + "/record"; + } + + /** + * 查询公众号用户浏览记录列表 + */ + @RequiresPermissions("public:record:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PublicUserRecord publicUserRecord) + { + startPage(); + List list = publicUserRecordService.selectPublicUserRecordList(publicUserRecord); + return getDataTable(list); + } + + /** + * 导出公众号用户浏览记录列表 + */ + @RequiresPermissions("public:record:export") + @Log(title = "公众号用户浏览记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(PublicUserRecord publicUserRecord) + { + List list = publicUserRecordService.selectPublicUserRecordList(publicUserRecord); + ExcelUtil util = new ExcelUtil(PublicUserRecord.class); + return util.exportExcel(list, "公众号用户浏览记录数据"); + } + + /** + * 新增公众号用户浏览记录 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存公众号用户浏览记录 + */ + @RequiresPermissions("public:record:add") + @Log(title = "公众号用户浏览记录", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(PublicUserRecord publicUserRecord) + { + return toAjax(publicUserRecordService.insertPublicUserRecord(publicUserRecord)); + } + + /** + * 修改公众号用户浏览记录 + */ + @RequiresPermissions("public:record:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + PublicUserRecord publicUserRecord = publicUserRecordService.selectPublicUserRecordById(id); + mmap.put("publicUserRecord", publicUserRecord); + return prefix + "/edit"; + } + + /** + * 修改保存公众号用户浏览记录 + */ + @RequiresPermissions("public:record:edit") + @Log(title = "公众号用户浏览记录", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(PublicUserRecord publicUserRecord) + { + return toAjax(publicUserRecordService.updatePublicUserRecord(publicUserRecord)); + } + + /** + * 删除公众号用户浏览记录 + */ + @RequiresPermissions("public:record:remove") + @Log(title = "公众号用户浏览记录", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(publicUserRecordService.deletePublicUserRecordByIds(ids)); + } +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicUserAppService.java b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicUserAppService.java index b323964..ca69ed5 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicUserAppService.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicUserAppService.java @@ -3,7 +3,7 @@ package com.playlet.web.service.app; import com.playlet.system.domain.PlayletPublicUser; public interface PlayletPublicUserAppService { - void addPublicUser(PlayletPublicUser publicUser); + PlayletPublicUser addPublicUser(PlayletPublicUser publicUser); PlayletPublicUser findByUnionIdAndPublicId(PlayletPublicUser publicUser); diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/PublicDetailCommentAppService.java b/playlet-admin/src/main/java/com/playlet/web/service/app/PublicDetailCommentAppService.java new file mode 100644 index 0000000..2ef1e8c --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/PublicDetailCommentAppService.java @@ -0,0 +1,15 @@ +package com.playlet.web.service.app; + +import com.github.pagehelper.PageInfo; +import com.playlet.system.domain.PublicDetailComment; + +public interface PublicDetailCommentAppService { + + + void add(PublicDetailComment detailComment); + + void update(PublicDetailComment detailComment); + + PageInfo query(PublicDetailComment detailComment, Integer pageNum, Integer pageSize); + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/PublicUserRecordAppService.java b/playlet-admin/src/main/java/com/playlet/web/service/app/PublicUserRecordAppService.java new file mode 100644 index 0000000..cfaec90 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/PublicUserRecordAppService.java @@ -0,0 +1,10 @@ +package com.playlet.web.service.app; + +import com.playlet.system.domain.PublicUserRecord; + +public interface PublicUserRecordAppService { + void addRecord(PublicUserRecord userRecord); + + void updateRecord(PublicUserRecord userRecord); + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicUserAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicUserAppServiceImpl.java index cccd459..e0873e7 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicUserAppServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicUserAppServiceImpl.java @@ -16,8 +16,9 @@ public class PlayletPublicUserAppServiceImpl implements PlayletPublicUserAppServ private final IPlayletPublicUserService iPlayletPublicUserService; @Override - public void addPublicUser(PlayletPublicUser publicUser) { + public PlayletPublicUser addPublicUser(PlayletPublicUser publicUser) { iPlayletPublicUserService.insertPlayletPublicUser(publicUser); + return publicUser; } @Override diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailCommentAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailCommentAppServiceImpl.java new file mode 100644 index 0000000..b600fc0 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailCommentAppServiceImpl.java @@ -0,0 +1,39 @@ +package com.playlet.web.service.app.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.playlet.system.domain.PublicDetailComment; +import com.playlet.system.service.IPublicDetailCommentService; +import com.playlet.web.service.app.PublicDetailCommentAppService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class PublicDetailCommentAppServiceImpl implements PublicDetailCommentAppService { + + private final IPublicDetailCommentService iPublicDetailCommentService; + + @Override + public void add(PublicDetailComment detailComment) { + iPublicDetailCommentService.save(detailComment); + } + + @Override + public void update(PublicDetailComment detailComment) { + iPublicDetailCommentService.updateById(detailComment); + } + + @Override + public PageInfo query(PublicDetailComment detailComment, Integer pageNum, Integer pageSize) { + PageHelper.startPage(pageNum, pageSize); + List comments = iPublicDetailCommentService.selectPublicDetailCommentList(detailComment); + return PageInfo.of(comments); + } + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicUserRecordAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicUserRecordAppServiceImpl.java new file mode 100644 index 0000000..015ab8e --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicUserRecordAppServiceImpl.java @@ -0,0 +1,27 @@ +package com.playlet.web.service.app.impl; + +import com.playlet.system.domain.PublicUserRecord; +import com.playlet.system.service.IPublicUserRecordService; +import com.playlet.web.service.app.PublicUserRecordAppService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class PublicUserRecordAppServiceImpl implements PublicUserRecordAppService { + + private final IPublicUserRecordService iPublicUserRecordService; + + @Override + public void addRecord(PublicUserRecord userRecord) { + iPublicUserRecordService.insertPublicUserRecord(userRecord); + } + + @Override + public void updateRecord(PublicUserRecord userRecord) { + iPublicUserRecordService.updateById(userRecord); + } +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java index f2fe2b4..8c15c90 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/impl/WxServiceImpl.java @@ -45,7 +45,7 @@ public class WxServiceImpl implements WxService { @Override public String getOpenidByCode(String code, String appId, String secret) { - String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+ appId + "&secret=" + secret + "&js_code=" + code + "&grant_type=authorization_code"; + String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="+ appId + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code"; log.info("调用微信获取openId,入参url:{}", url); String result = HttpUtils.sendGet(url); log.info("调用微信获取openId,响应内容:{}", result); diff --git a/playlet-admin/src/main/resources/templates/system/public/comment/add.html b/playlet-admin/src/main/resources/templates/system/public/comment/add.html new file mode 100644 index 0000000..6156366 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/public/comment/add.html @@ -0,0 +1,100 @@ + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/public/comment/comment.html b/playlet-admin/src/main/resources/templates/system/public/comment/comment.html new file mode 100644 index 0000000..4f29d23 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/public/comment/comment.html @@ -0,0 +1,118 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/public/comment/edit.html b/playlet-admin/src/main/resources/templates/system/public/comment/edit.html new file mode 100644 index 0000000..f71fd12 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/public/comment/edit.html @@ -0,0 +1,105 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java index df355a9..4df4924 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicDetail.java @@ -30,6 +30,9 @@ public class PlayletPublicDetail extends BaseEntity @TableId(value = "id", type = IdType.AUTO) private Long id; + @ApiModelProperty(value = "类型 01.富文本 02.pdf") + private String type; + /** 公众号id */ @Excel(name = "公众号id") @ApiModelProperty(value = "公众号id") diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PublicDetailComment.java b/playlet-system/src/main/java/com/playlet/system/domain/PublicDetailComment.java new file mode 100644 index 0000000..30cd1ee --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/domain/PublicDetailComment.java @@ -0,0 +1,53 @@ +package com.playlet.system.domain; + +import com.playlet.common.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.playlet.common.annotation.Excel; + +/** + * 文章评论对象 public_detail_comment + * + * @author ruoyi + * @date 2024-06-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "public_detail_comment") +@ApiModel(value = "公众号文章评论") +public class PublicDetailComment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 文章id */ + @Excel(name = "文章id") + @ApiModelProperty(value = "文章id") + private Long detailId; + + /** 用户id【playlet_public_user_id】 */ + @Excel(name = "用户id【playlet_public_user_id】") + @ApiModelProperty(value = "用户id") + private Long userId; + + /** 用户昵称 */ + @Excel(name = "用户昵称") + @ApiModelProperty(value = "用户昵称") + private String userName; + + /** 评论内容 */ + @Excel(name = "评论内容") + @ApiModelProperty(value = "评论内容") + private String content; + + /** 点赞数 */ + @Excel(name = "点赞数") + @ApiModelProperty(value = "点赞数") + private Long starCount; + +} diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PublicUserRecord.java b/playlet-system/src/main/java/com/playlet/system/domain/PublicUserRecord.java new file mode 100644 index 0000000..d62c2de --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/domain/PublicUserRecord.java @@ -0,0 +1,62 @@ +package com.playlet.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.playlet.common.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.playlet.common.annotation.Excel; + +/** + * 公众号用户浏览记录对象 public_user_record + * + * @author ruoyi + * @date 2024-06-15 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "public_user_record") +@ApiModel(value = "用户浏览记录") +public class PublicUserRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 用户昵称 */ + @Excel(name = "用户昵称") + @ApiModelProperty(value = "用户昵称") + private String name; + + /** 微信union_id */ + @Excel(name = "微信union_id") + @ApiModelProperty(value = "微信union_id") + private String unionId; + + /** 开始阅读时间 */ +// @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "开始阅读时间") + @Excel(name = "开始阅读时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date beginTime; + + /** 结束阅读时间 */ +// @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "结束阅读时间") + @Excel(name = "结束阅读时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** 公众号昵称 */ + @Excel(name = "公众号昵称") + @ApiModelProperty(value = "公众号昵称") + private String publicName; + + /** 公众号id */ + @Excel(name = "公众号id") + @ApiModelProperty(value = "公众号id") + private Long publicId; + +} diff --git a/playlet-system/src/main/java/com/playlet/system/mapper/PublicDetailCommentMapper.java b/playlet-system/src/main/java/com/playlet/system/mapper/PublicDetailCommentMapper.java new file mode 100644 index 0000000..c9bc1b8 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/mapper/PublicDetailCommentMapper.java @@ -0,0 +1,62 @@ +package com.playlet.system.mapper; + +import java.util.List; +import com.playlet.system.domain.PublicDetailComment; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 文章评论Mapper接口 + * + * @author ruoyi + * @date 2024-06-18 + */ +public interface PublicDetailCommentMapper extends BaseMapper +{ + /** + * 查询文章评论 + * + * @param id 文章评论主键 + * @return 文章评论 + */ + public PublicDetailComment selectPublicDetailCommentById(Long id); + + /** + * 查询文章评论列表 + * + * @param publicDetailComment 文章评论 + * @return 文章评论集合 + */ + public List selectPublicDetailCommentList(PublicDetailComment publicDetailComment); + + /** + * 新增文章评论 + * + * @param publicDetailComment 文章评论 + * @return 结果 + */ + public int insertPublicDetailComment(PublicDetailComment publicDetailComment); + + /** + * 修改文章评论 + * + * @param publicDetailComment 文章评论 + * @return 结果 + */ + public int updatePublicDetailComment(PublicDetailComment publicDetailComment); + + /** + * 删除文章评论 + * + * @param id 文章评论主键 + * @return 结果 + */ + public int deletePublicDetailCommentById(Long id); + + /** + * 批量删除文章评论 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePublicDetailCommentByIds(String[] ids); +} diff --git a/playlet-system/src/main/java/com/playlet/system/mapper/PublicUserRecordMapper.java b/playlet-system/src/main/java/com/playlet/system/mapper/PublicUserRecordMapper.java new file mode 100644 index 0000000..49ebc56 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/mapper/PublicUserRecordMapper.java @@ -0,0 +1,62 @@ +package com.playlet.system.mapper; + +import java.util.List; +import com.playlet.system.domain.PublicUserRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 公众号用户浏览记录Mapper接口 + * + * @author ruoyi + * @date 2024-06-15 + */ +public interface PublicUserRecordMapper extends BaseMapper +{ + /** + * 查询公众号用户浏览记录 + * + * @param id 公众号用户浏览记录主键 + * @return 公众号用户浏览记录 + */ + public PublicUserRecord selectPublicUserRecordById(Long id); + + /** + * 查询公众号用户浏览记录列表 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 公众号用户浏览记录集合 + */ + public List selectPublicUserRecordList(PublicUserRecord publicUserRecord); + + /** + * 新增公众号用户浏览记录 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 结果 + */ + public int insertPublicUserRecord(PublicUserRecord publicUserRecord); + + /** + * 修改公众号用户浏览记录 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 结果 + */ + public int updatePublicUserRecord(PublicUserRecord publicUserRecord); + + /** + * 删除公众号用户浏览记录 + * + * @param id 公众号用户浏览记录主键 + * @return 结果 + */ + public int deletePublicUserRecordById(Long id); + + /** + * 批量删除公众号用户浏览记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePublicUserRecordByIds(String[] ids); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPublicDetailCommentService.java b/playlet-system/src/main/java/com/playlet/system/service/IPublicDetailCommentService.java new file mode 100644 index 0000000..da77dd3 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/IPublicDetailCommentService.java @@ -0,0 +1,62 @@ +package com.playlet.system.service; + +import java.util.List; +import com.playlet.system.domain.PublicDetailComment; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 文章评论Service接口 + * + * @author ruoyi + * @date 2024-06-18 + */ +public interface IPublicDetailCommentService extends IService +{ + /** + * 查询文章评论 + * + * @param id 文章评论主键 + * @return 文章评论 + */ + public PublicDetailComment selectPublicDetailCommentById(Long id); + + /** + * 查询文章评论列表 + * + * @param publicDetailComment 文章评论 + * @return 文章评论集合 + */ + public List selectPublicDetailCommentList(PublicDetailComment publicDetailComment); + + /** + * 新增文章评论 + * + * @param publicDetailComment 文章评论 + * @return 结果 + */ + public int insertPublicDetailComment(PublicDetailComment publicDetailComment); + + /** + * 修改文章评论 + * + * @param publicDetailComment 文章评论 + * @return 结果 + */ + public int updatePublicDetailComment(PublicDetailComment publicDetailComment); + + /** + * 批量删除文章评论 + * + * @param ids 需要删除的文章评论主键集合 + * @return 结果 + */ + public int deletePublicDetailCommentByIds(String ids); + + /** + * 删除文章评论信息 + * + * @param id 文章评论主键 + * @return 结果 + */ + public int deletePublicDetailCommentById(Long id); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPublicUserRecordService.java b/playlet-system/src/main/java/com/playlet/system/service/IPublicUserRecordService.java new file mode 100644 index 0000000..7cebba9 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/IPublicUserRecordService.java @@ -0,0 +1,62 @@ +package com.playlet.system.service; + +import java.util.List; +import com.playlet.system.domain.PublicUserRecord; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 公众号用户浏览记录Service接口 + * + * @author ruoyi + * @date 2024-06-15 + */ +public interface IPublicUserRecordService extends IService +{ + /** + * 查询公众号用户浏览记录 + * + * @param id 公众号用户浏览记录主键 + * @return 公众号用户浏览记录 + */ + public PublicUserRecord selectPublicUserRecordById(Long id); + + /** + * 查询公众号用户浏览记录列表 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 公众号用户浏览记录集合 + */ + public List selectPublicUserRecordList(PublicUserRecord publicUserRecord); + + /** + * 新增公众号用户浏览记录 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 结果 + */ + public int insertPublicUserRecord(PublicUserRecord publicUserRecord); + + /** + * 修改公众号用户浏览记录 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 结果 + */ + public int updatePublicUserRecord(PublicUserRecord publicUserRecord); + + /** + * 批量删除公众号用户浏览记录 + * + * @param ids 需要删除的公众号用户浏览记录主键集合 + * @return 结果 + */ + public int deletePublicUserRecordByIds(String ids); + + /** + * 删除公众号用户浏览记录信息 + * + * @param id 公众号用户浏览记录主键 + * @return 结果 + */ + public int deletePublicUserRecordById(Long id); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/impl/PublicDetailCommentServiceImpl.java b/playlet-system/src/main/java/com/playlet/system/service/impl/PublicDetailCommentServiceImpl.java new file mode 100644 index 0000000..bc73caf --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/impl/PublicDetailCommentServiceImpl.java @@ -0,0 +1,98 @@ +package com.playlet.system.service.impl; + +import java.util.List; +import com.playlet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.playlet.system.mapper.PublicDetailCommentMapper; +import com.playlet.system.domain.PublicDetailComment; +import com.playlet.system.service.IPublicDetailCommentService; +import com.playlet.common.core.text.Convert; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 文章评论Service业务层处理 + * + * @author ruoyi + * @date 2024-06-18 + */ +@Service +public class PublicDetailCommentServiceImpl extends ServiceImpl implements IPublicDetailCommentService +{ + @Autowired + private PublicDetailCommentMapper publicDetailCommentMapper; + + /** + * 查询文章评论 + * + * @param id 文章评论主键 + * @return 文章评论 + */ + @Override + public PublicDetailComment selectPublicDetailCommentById(Long id) + { + return publicDetailCommentMapper.selectPublicDetailCommentById(id); + } + + /** + * 查询文章评论列表 + * + * @param publicDetailComment 文章评论 + * @return 文章评论 + */ + @Override + public List selectPublicDetailCommentList(PublicDetailComment publicDetailComment) + { + return publicDetailCommentMapper.selectPublicDetailCommentList(publicDetailComment); + } + + /** + * 新增文章评论 + * + * @param publicDetailComment 文章评论 + * @return 结果 + */ + @Override + public int insertPublicDetailComment(PublicDetailComment publicDetailComment) + { + publicDetailComment.setCreateTime(DateUtils.getNowDate()); + return publicDetailCommentMapper.insertPublicDetailComment(publicDetailComment); + } + + /** + * 修改文章评论 + * + * @param publicDetailComment 文章评论 + * @return 结果 + */ + @Override + public int updatePublicDetailComment(PublicDetailComment publicDetailComment) + { + publicDetailComment.setUpdateTime(DateUtils.getNowDate()); + return publicDetailCommentMapper.updatePublicDetailComment(publicDetailComment); + } + + /** + * 批量删除文章评论 + * + * @param ids 需要删除的文章评论主键 + * @return 结果 + */ + @Override + public int deletePublicDetailCommentByIds(String ids) + { + return publicDetailCommentMapper.deletePublicDetailCommentByIds(Convert.toStrArray(ids)); + } + + /** + * 删除文章评论信息 + * + * @param id 文章评论主键 + * @return 结果 + */ + @Override + public int deletePublicDetailCommentById(Long id) + { + return publicDetailCommentMapper.deletePublicDetailCommentById(id); + } +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/impl/PublicUserRecordServiceImpl.java b/playlet-system/src/main/java/com/playlet/system/service/impl/PublicUserRecordServiceImpl.java new file mode 100644 index 0000000..88a85c5 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/impl/PublicUserRecordServiceImpl.java @@ -0,0 +1,98 @@ +package com.playlet.system.service.impl; + +import java.util.List; +import com.playlet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.playlet.system.mapper.PublicUserRecordMapper; +import com.playlet.system.domain.PublicUserRecord; +import com.playlet.system.service.IPublicUserRecordService; +import com.playlet.common.core.text.Convert; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 公众号用户浏览记录Service业务层处理 + * + * @author ruoyi + * @date 2024-06-15 + */ +@Service +public class PublicUserRecordServiceImpl extends ServiceImpl implements IPublicUserRecordService +{ + @Autowired + private PublicUserRecordMapper publicUserRecordMapper; + + /** + * 查询公众号用户浏览记录 + * + * @param id 公众号用户浏览记录主键 + * @return 公众号用户浏览记录 + */ + @Override + public PublicUserRecord selectPublicUserRecordById(Long id) + { + return publicUserRecordMapper.selectPublicUserRecordById(id); + } + + /** + * 查询公众号用户浏览记录列表 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 公众号用户浏览记录 + */ + @Override + public List selectPublicUserRecordList(PublicUserRecord publicUserRecord) + { + return publicUserRecordMapper.selectPublicUserRecordList(publicUserRecord); + } + + /** + * 新增公众号用户浏览记录 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 结果 + */ + @Override + public int insertPublicUserRecord(PublicUserRecord publicUserRecord) + { + publicUserRecord.setCreateTime(DateUtils.getNowDate()); + return publicUserRecordMapper.insertPublicUserRecord(publicUserRecord); + } + + /** + * 修改公众号用户浏览记录 + * + * @param publicUserRecord 公众号用户浏览记录 + * @return 结果 + */ + @Override + public int updatePublicUserRecord(PublicUserRecord publicUserRecord) + { + publicUserRecord.setUpdateTime(DateUtils.getNowDate()); + return publicUserRecordMapper.updatePublicUserRecord(publicUserRecord); + } + + /** + * 批量删除公众号用户浏览记录 + * + * @param ids 需要删除的公众号用户浏览记录主键 + * @return 结果 + */ + @Override + public int deletePublicUserRecordByIds(String ids) + { + return publicUserRecordMapper.deletePublicUserRecordByIds(Convert.toStrArray(ids)); + } + + /** + * 删除公众号用户浏览记录信息 + * + * @param id 公众号用户浏览记录主键 + * @return 结果 + */ + @Override + public int deletePublicUserRecordById(Long id) + { + return publicUserRecordMapper.deletePublicUserRecordById(id); + } +} diff --git a/playlet-system/src/main/resources/mapper/system/PublicDetailCommentMapper.xml b/playlet-system/src/main/resources/mapper/system/PublicDetailCommentMapper.xml new file mode 100644 index 0000000..d5dbac0 --- /dev/null +++ b/playlet-system/src/main/resources/mapper/system/PublicDetailCommentMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + select id, detail_id, user_id, user_name, content, star_count, create_by, create_time, update_by, update_time, remark from public_detail_comment + + + + + + + + insert into public_detail_comment + + detail_id, + user_id, + user_name, + content, + star_count, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{detailId}, + #{userId}, + #{userName}, + #{content}, + #{starCount}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update public_detail_comment + + detail_id = #{detailId}, + user_id = #{userId}, + user_name = #{userName}, + content = #{content}, + star_count = #{starCount}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from public_detail_comment where id = #{id} + + + + delete from public_detail_comment where id in + + #{id} + + + + \ No newline at end of file diff --git a/playlet-system/src/main/resources/mapper/system/PublicUserRecordMapper.xml b/playlet-system/src/main/resources/mapper/system/PublicUserRecordMapper.xml new file mode 100644 index 0000000..4cf42ce --- /dev/null +++ b/playlet-system/src/main/resources/mapper/system/PublicUserRecordMapper.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + select id, name, union_id, begin_time, end_time, public_name, public_id, create_by, create_time, update_by, update_time, remark from public_user_record + + + + + + + + insert into public_user_record + + name, + union_id, + begin_time, + end_time, + public_name, + public_id, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{name}, + #{unionId}, + #{beginTime}, + #{endTime}, + #{publicName}, + #{publicId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update public_user_record + + name = #{name}, + union_id = #{unionId}, + begin_time = #{beginTime}, + end_time = #{endTime}, + public_name = #{publicName}, + public_id = #{publicId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from public_user_record where id = #{id} + + + + delete from public_user_record where id in + + #{id} + + + + \ No newline at end of file