公众号、评论/浏览记录等等
This commit is contained in:
parent
290576620d
commit
d78fc63077
|
|
@ -25,9 +25,8 @@ public class PlayletPublicUserAppController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation(value = "新增公众号用户信息")
|
@ApiOperation(value = "新增公众号用户信息")
|
||||||
public Result<String> addSave(@RequestBody PlayletPublicUser publicUser) {
|
public Result<PlayletPublicUser> addSave(@RequestBody PlayletPublicUser publicUser) {
|
||||||
publicUserAppService.addPublicUser(publicUser);
|
return Result.success(publicUserAppService.addPublicUser(publicUser));
|
||||||
return Result.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -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<String> add(@RequestBody PublicDetailComment detailComment) {
|
||||||
|
detailCommentAppService.add(detailComment);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation(value = "更新用户评论(后续点赞使用)")
|
||||||
|
public Result<String> update(@RequestBody PublicDetailComment detailComment) {
|
||||||
|
detailCommentAppService.update(detailComment);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/query")
|
||||||
|
@ApiOperation(value = "查询当前文章评论,需传文章id")
|
||||||
|
public Result<PageInfo<PublicDetailComment>> query(@RequestBody PublicDetailComment detailComment,
|
||||||
|
@RequestParam(value = "pageNum") Integer pageNum,
|
||||||
|
@RequestParam(value = "pageSize") Integer pageSize) {
|
||||||
|
|
||||||
|
return Result.success(detailCommentAppService.query(detailComment, pageNum, pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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<PublicUserRecord> addRecord(@RequestBody PublicUserRecord userRecord) {
|
||||||
|
publicUserRecordAppService.addRecord(userRecord);
|
||||||
|
return Result.success(userRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation(value = "更新用户浏览记录")
|
||||||
|
public Result<PublicUserRecord> updateRecord(@RequestBody PublicUserRecord userRecord) {
|
||||||
|
publicUserRecordAppService.updateRecord(userRecord);
|
||||||
|
return Result.success(userRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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<PublicDetailComment> 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<PublicDetailComment> list = publicDetailCommentService.selectPublicDetailCommentList(publicDetailComment);
|
||||||
|
ExcelUtil<PublicDetailComment> util = new ExcelUtil<PublicDetailComment>(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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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<PublicUserRecord> 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<PublicUserRecord> list = publicUserRecordService.selectPublicUserRecordList(publicUserRecord);
|
||||||
|
ExcelUtil<PublicUserRecord> util = new ExcelUtil<PublicUserRecord>(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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@ package com.playlet.web.service.app;
|
||||||
import com.playlet.system.domain.PlayletPublicUser;
|
import com.playlet.system.domain.PlayletPublicUser;
|
||||||
|
|
||||||
public interface PlayletPublicUserAppService {
|
public interface PlayletPublicUserAppService {
|
||||||
void addPublicUser(PlayletPublicUser publicUser);
|
PlayletPublicUser addPublicUser(PlayletPublicUser publicUser);
|
||||||
|
|
||||||
PlayletPublicUser findByUnionIdAndPublicId(PlayletPublicUser publicUser);
|
PlayletPublicUser findByUnionIdAndPublicId(PlayletPublicUser publicUser);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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<PublicDetailComment> query(PublicDetailComment detailComment, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -16,8 +16,9 @@ public class PlayletPublicUserAppServiceImpl implements PlayletPublicUserAppServ
|
||||||
private final IPlayletPublicUserService iPlayletPublicUserService;
|
private final IPlayletPublicUserService iPlayletPublicUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addPublicUser(PlayletPublicUser publicUser) {
|
public PlayletPublicUser addPublicUser(PlayletPublicUser publicUser) {
|
||||||
iPlayletPublicUserService.insertPlayletPublicUser(publicUser);
|
iPlayletPublicUserService.insertPlayletPublicUser(publicUser);
|
||||||
|
return publicUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -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<PublicDetailComment> query(PublicDetailComment detailComment, Integer pageNum, Integer pageSize) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<PublicDetailComment> comments = iPublicDetailCommentService.selectPublicDetailCommentList(detailComment);
|
||||||
|
return PageInfo.of(comments);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -45,7 +45,7 @@ public class WxServiceImpl implements WxService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOpenidByCode(String code, String appId, String secret) {
|
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);
|
log.info("调用微信获取openId,入参url:{}", url);
|
||||||
String result = HttpUtils.sendGet(url);
|
String result = HttpUtils.sendGet(url);
|
||||||
log.info("调用微信获取openId,响应内容:{}", result);
|
log.info("调用微信获取openId,响应内容:{}", result);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,100 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增文章评论')" />
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-comment-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">文章id:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="detailId" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户id【playlet_public_user_id】:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="userId" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户昵称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="userName" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评论内容:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" class="form-control" name="content">
|
||||||
|
<div class="summernote" id="content"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">点赞数:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="starCount" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">备注:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="remark" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/public/comment"
|
||||||
|
$("#form-comment-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-comment-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('.summernote').summernote({
|
||||||
|
lang: 'zh-CN',
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onChange: function(contents, $edittable) {
|
||||||
|
$("input[name='" + this.id + "']").val(contents);
|
||||||
|
},
|
||||||
|
onImageUpload: function(files) {
|
||||||
|
var obj = this;
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", files[0]);
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#' + obj.id).summernote('insertImage', result.url);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('文章评论列表')" />
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>文章id:</label>
|
||||||
|
<input type="text" name="detailId"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>用户id【playlet_public_user_id】:</label>
|
||||||
|
<input type="text" name="userId"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>用户昵称:</label>
|
||||||
|
<input type="text" name="userName"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>点赞数:</label>
|
||||||
|
<input type="text" name="starCount"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:comment:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:comment:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:comment:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:comment:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('public:comment:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('public:comment:remove')}]];
|
||||||
|
var prefix = ctx + "system/public/comment";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "文章评论",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键id',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'detailId',
|
||||||
|
title: '文章id'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'userId',
|
||||||
|
title: '用户id【playlet_public_user_id】'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'userName',
|
||||||
|
title: '用户昵称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'content',
|
||||||
|
title: '评论内容'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'starCount',
|
||||||
|
title: '点赞数'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '备注'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改文章评论')" />
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-comment-edit" th:object="${publicDetailComment}">
|
||||||
|
<input name="id" th:field="*{id}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">文章id:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="detailId" th:field="*{detailId}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户id【playlet_public_user_id】:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="userId" th:field="*{userId}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户昵称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="userName" th:field="*{userName}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评论内容:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" class="form-control" th:field="*{content}">
|
||||||
|
<div class="summernote" id="content"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">点赞数:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="starCount" th:field="*{starCount}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">备注:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="remark" th:field="*{remark}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/public/comment";
|
||||||
|
$("#form-comment-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-comment-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('.summernote').each(function(i) {
|
||||||
|
$('#' + this.id).summernote({
|
||||||
|
lang: 'zh-CN',
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onChange: function(contents, $edittable) {
|
||||||
|
$("input[name='" + this.id + "']").val(contents);
|
||||||
|
},
|
||||||
|
onImageUpload: function(files) {
|
||||||
|
var obj = this;
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", files[0]);
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#' + obj.id).summernote('insertImage', result.url);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var content = $("input[name='" + this.id + "']").val();
|
||||||
|
$('#' + this.id).summernote('code', content);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -30,6 +30,9 @@ public class PlayletPublicDetail extends BaseEntity
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 01.富文本 02.pdf")
|
||||||
|
private String type;
|
||||||
|
|
||||||
/** 公众号id */
|
/** 公众号id */
|
||||||
@Excel(name = "公众号id")
|
@Excel(name = "公众号id")
|
||||||
@ApiModelProperty(value = "公众号id")
|
@ApiModelProperty(value = "公众号id")
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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<PublicDetailComment>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询文章评论
|
||||||
|
*
|
||||||
|
* @param id 文章评论主键
|
||||||
|
* @return 文章评论
|
||||||
|
*/
|
||||||
|
public PublicDetailComment selectPublicDetailCommentById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文章评论列表
|
||||||
|
*
|
||||||
|
* @param publicDetailComment 文章评论
|
||||||
|
* @return 文章评论集合
|
||||||
|
*/
|
||||||
|
public List<PublicDetailComment> 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);
|
||||||
|
}
|
||||||
|
|
@ -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<PublicUserRecord>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询公众号用户浏览记录
|
||||||
|
*
|
||||||
|
* @param id 公众号用户浏览记录主键
|
||||||
|
* @return 公众号用户浏览记录
|
||||||
|
*/
|
||||||
|
public PublicUserRecord selectPublicUserRecordById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号用户浏览记录列表
|
||||||
|
*
|
||||||
|
* @param publicUserRecord 公众号用户浏览记录
|
||||||
|
* @return 公众号用户浏览记录集合
|
||||||
|
*/
|
||||||
|
public List<PublicUserRecord> 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);
|
||||||
|
}
|
||||||
|
|
@ -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<PublicDetailComment>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询文章评论
|
||||||
|
*
|
||||||
|
* @param id 文章评论主键
|
||||||
|
* @return 文章评论
|
||||||
|
*/
|
||||||
|
public PublicDetailComment selectPublicDetailCommentById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文章评论列表
|
||||||
|
*
|
||||||
|
* @param publicDetailComment 文章评论
|
||||||
|
* @return 文章评论集合
|
||||||
|
*/
|
||||||
|
public List<PublicDetailComment> 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);
|
||||||
|
}
|
||||||
|
|
@ -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<PublicUserRecord>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询公众号用户浏览记录
|
||||||
|
*
|
||||||
|
* @param id 公众号用户浏览记录主键
|
||||||
|
* @return 公众号用户浏览记录
|
||||||
|
*/
|
||||||
|
public PublicUserRecord selectPublicUserRecordById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号用户浏览记录列表
|
||||||
|
*
|
||||||
|
* @param publicUserRecord 公众号用户浏览记录
|
||||||
|
* @return 公众号用户浏览记录集合
|
||||||
|
*/
|
||||||
|
public List<PublicUserRecord> 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);
|
||||||
|
}
|
||||||
|
|
@ -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<PublicDetailCommentMapper, PublicDetailComment> 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<PublicDetailComment> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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<PublicUserRecordMapper, PublicUserRecord> 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<PublicUserRecord> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.playlet.system.mapper.PublicDetailCommentMapper">
|
||||||
|
|
||||||
|
<resultMap type="PublicDetailComment" id="PublicDetailCommentResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="detailId" column="detail_id" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="userName" column="user_name" />
|
||||||
|
<result property="content" column="content" />
|
||||||
|
<result property="starCount" column="star_count" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPublicDetailCommentVo">
|
||||||
|
select id, detail_id, user_id, user_name, content, star_count, create_by, create_time, update_by, update_time, remark from public_detail_comment
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPublicDetailCommentList" parameterType="PublicDetailComment" resultMap="PublicDetailCommentResult">
|
||||||
|
<include refid="selectPublicDetailCommentVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="detailId != null "> and detail_id = #{detailId}</if>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||||
|
<if test="starCount != null "> and star_count = #{starCount}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPublicDetailCommentById" parameterType="Long" resultMap="PublicDetailCommentResult">
|
||||||
|
<include refid="selectPublicDetailCommentVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPublicDetailComment" parameterType="PublicDetailComment" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into public_detail_comment
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="detailId != null">detail_id,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="userName != null">user_name,</if>
|
||||||
|
<if test="content != null">content,</if>
|
||||||
|
<if test="starCount != null">star_count,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="detailId != null">#{detailId},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="userName != null">#{userName},</if>
|
||||||
|
<if test="content != null">#{content},</if>
|
||||||
|
<if test="starCount != null">#{starCount},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePublicDetailComment" parameterType="PublicDetailComment">
|
||||||
|
update public_detail_comment
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="detailId != null">detail_id = #{detailId},</if>
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
<if test="userName != null">user_name = #{userName},</if>
|
||||||
|
<if test="content != null">content = #{content},</if>
|
||||||
|
<if test="starCount != null">star_count = #{starCount},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deletePublicDetailCommentById" parameterType="Long">
|
||||||
|
delete from public_detail_comment where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePublicDetailCommentByIds" parameterType="String">
|
||||||
|
delete from public_detail_comment where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.playlet.system.mapper.PublicUserRecordMapper">
|
||||||
|
|
||||||
|
<resultMap type="PublicUserRecord" id="PublicUserRecordResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="unionId" column="union_id" />
|
||||||
|
<result property="beginTime" column="begin_time" />
|
||||||
|
<result property="endTime" column="end_time" />
|
||||||
|
<result property="publicName" column="public_name" />
|
||||||
|
<result property="publicId" column="public_id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPublicUserRecordVo">
|
||||||
|
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
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPublicUserRecordList" parameterType="PublicUserRecord" resultMap="PublicUserRecordResult">
|
||||||
|
<include refid="selectPublicUserRecordVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
|
||||||
|
<if test="beginTime != null "> and begin_time = #{beginTime}</if>
|
||||||
|
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||||
|
<if test="publicName != null and publicName != ''"> and public_name like concat('%', #{publicName}, '%')</if>
|
||||||
|
<if test="publicId != null "> and public_id = #{publicId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPublicUserRecordById" parameterType="Long" resultMap="PublicUserRecordResult">
|
||||||
|
<include refid="selectPublicUserRecordVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPublicUserRecord" parameterType="PublicUserRecord" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into public_user_record
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="unionId != null">union_id,</if>
|
||||||
|
<if test="beginTime != null">begin_time,</if>
|
||||||
|
<if test="endTime != null">end_time,</if>
|
||||||
|
<if test="publicName != null">public_name,</if>
|
||||||
|
<if test="publicId != null">public_id,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">#{name},</if>
|
||||||
|
<if test="unionId != null">#{unionId},</if>
|
||||||
|
<if test="beginTime != null">#{beginTime},</if>
|
||||||
|
<if test="endTime != null">#{endTime},</if>
|
||||||
|
<if test="publicName != null">#{publicName},</if>
|
||||||
|
<if test="publicId != null">#{publicId},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePublicUserRecord" parameterType="PublicUserRecord">
|
||||||
|
update public_user_record
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="unionId != null">union_id = #{unionId},</if>
|
||||||
|
<if test="beginTime != null">begin_time = #{beginTime},</if>
|
||||||
|
<if test="endTime != null">end_time = #{endTime},</if>
|
||||||
|
<if test="publicName != null">public_name = #{publicName},</if>
|
||||||
|
<if test="publicId != null">public_id = #{publicId},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deletePublicUserRecordById" parameterType="Long">
|
||||||
|
delete from public_user_record where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePublicUserRecordByIds" parameterType="String">
|
||||||
|
delete from public_user_record where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue