公众号模块功能开发完成
This commit is contained in:
parent
fc82043cb5
commit
32cd403596
|
|
@ -0,0 +1,30 @@
|
|||
package com.playlet.web.controller.app;
|
||||
|
||||
import com.playlet.common.core.domain.Result;
|
||||
import com.playlet.system.domain.PublicDetailShare;
|
||||
import com.playlet.web.service.app.PublicDetailShareAppService;
|
||||
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/share")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PublicDetailShareAppController {
|
||||
|
||||
private final PublicDetailShareAppService publicDetailShareAppService;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value = "新增用户分享记录")
|
||||
public Result<String> addRecord(@RequestBody PublicDetailShare publicDetailShare) {
|
||||
publicDetailShareAppService.addRecord(publicDetailShare);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.playlet.web.controller.system;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.playlet.system.domain.PublicDetailComment;
|
||||
import com.playlet.system.service.IPublicDetailCommentService;
|
||||
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.PublicCommentResponse;
|
||||
import com.playlet.system.service.IPublicCommentResponseService;
|
||||
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-20
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/public/response")
|
||||
public class PublicCommentResponseController extends BaseController
|
||||
{
|
||||
private String prefix = "system/public/response";
|
||||
|
||||
@Autowired
|
||||
private IPublicCommentResponseService publicCommentResponseService;
|
||||
@Autowired
|
||||
private IPublicDetailCommentService publicDetailCommentService;
|
||||
|
||||
@RequiresPermissions("public:response:view")
|
||||
@GetMapping()
|
||||
public String response()
|
||||
{
|
||||
return prefix + "/response";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作者回复评论记录列表
|
||||
*/
|
||||
@RequiresPermissions("public:response:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
startPage();
|
||||
List<PublicCommentResponse> list = publicCommentResponseService.selectPublicCommentResponseList(publicCommentResponse);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作者回复评论记录列表
|
||||
*/
|
||||
@RequiresPermissions("public:response:export")
|
||||
@Log(title = "作者回复评论记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
List<PublicCommentResponse> list = publicCommentResponseService.selectPublicCommentResponseList(publicCommentResponse);
|
||||
ExcelUtil<PublicCommentResponse> util = new ExcelUtil<PublicCommentResponse>(PublicCommentResponse.class);
|
||||
return util.exportExcel(list, "作者回复评论记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作者回复评论记录
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存作者回复评论记录
|
||||
*/
|
||||
@RequiresPermissions("public:response:add")
|
||||
@Log(title = "作者回复评论记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
PublicCommentResponse model = publicCommentResponseService.lambdaQuery()
|
||||
.eq(PublicCommentResponse::getCommentId, publicCommentResponse.getCommentId())
|
||||
.one();
|
||||
if(model != null){
|
||||
model.setResponseContent(publicCommentResponse.getResponseContent());
|
||||
model.setCreateTime(new Date());
|
||||
publicCommentResponseService.updateById(model);
|
||||
}else {
|
||||
publicCommentResponse.setCreateBy(getLoginName());
|
||||
publicCommentResponseService.insertPublicCommentResponse(publicCommentResponse);
|
||||
}
|
||||
PublicDetailComment comment = publicDetailCommentService.getById(publicCommentResponse.getCommentId());
|
||||
if(comment != null){
|
||||
comment.setRemark("已回复,回复时间:" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm"));
|
||||
publicDetailCommentService.updateById(comment);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作者回复评论记录
|
||||
*/
|
||||
@RequiresPermissions("public:response:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
PublicCommentResponse publicCommentResponse = publicCommentResponseService.selectPublicCommentResponseById(id);
|
||||
mmap.put("publicCommentResponse", publicCommentResponse);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存作者回复评论记录
|
||||
*/
|
||||
@RequiresPermissions("public:response:edit")
|
||||
@Log(title = "作者回复评论记录", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
return toAjax(publicCommentResponseService.updatePublicCommentResponse(publicCommentResponse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作者回复评论记录
|
||||
*/
|
||||
@RequiresPermissions("public:response:remove")
|
||||
@Log(title = "作者回复评论记录", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(publicCommentResponseService.deletePublicCommentResponseByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
package com.playlet.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.playlet.system.domain.PlayletPublicDetail;
|
||||
import com.playlet.system.domain.PublicCommentResponse;
|
||||
import com.playlet.system.service.IPlayletPublicDetailService;
|
||||
import com.playlet.system.service.IPublicCommentResponseService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -33,6 +38,10 @@ public class PublicDetailCommentController extends BaseController
|
|||
|
||||
@Autowired
|
||||
private IPublicDetailCommentService publicDetailCommentService;
|
||||
@Autowired
|
||||
private IPlayletPublicDetailService publicDetailService;
|
||||
@Autowired
|
||||
private IPublicCommentResponseService publicCommentResponseService;
|
||||
|
||||
@RequiresPermissions("public:comment:view")
|
||||
@GetMapping()
|
||||
|
|
@ -51,6 +60,13 @@ public class PublicDetailCommentController extends BaseController
|
|||
{
|
||||
startPage();
|
||||
List<PublicDetailComment> list = publicDetailCommentService.selectPublicDetailCommentList(publicDetailComment);
|
||||
list.forEach(model->{
|
||||
PlayletPublicDetail playletPublicDetail = publicDetailService.selectPlayletPublicDetailById(model.getDetailId());
|
||||
if(playletPublicDetail != null){
|
||||
model.setDetailName(playletPublicDetail.getTitle());
|
||||
model.setAuthorAlias(playletPublicDetail.getAuthorAlias());
|
||||
}
|
||||
});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -92,13 +108,19 @@ public class PublicDetailCommentController extends BaseController
|
|||
/**
|
||||
* 修改文章评论
|
||||
*/
|
||||
@RequiresPermissions("public:comment:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
@GetMapping("/responseComment/{id}")
|
||||
public String responseComment(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
PublicDetailComment publicDetailComment = publicDetailCommentService.selectPublicDetailCommentById(id);
|
||||
mmap.put("publicDetailComment", publicDetailComment);
|
||||
return prefix + "/edit";
|
||||
PublicCommentResponse publicCommentResponse = publicCommentResponseService.lambdaQuery()
|
||||
.eq(PublicCommentResponse::getCommentId, id).one();
|
||||
if(publicCommentResponse == null){
|
||||
publicCommentResponse = new PublicCommentResponse();
|
||||
publicCommentResponse.setResponseContent("");
|
||||
}
|
||||
mmap.put("comment", publicDetailComment);
|
||||
mmap.put("commentResponse", publicCommentResponse);
|
||||
return prefix + "/responseComment";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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.PublicDetailShare;
|
||||
import com.playlet.system.service.IPublicDetailShareService;
|
||||
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-20
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/public/share")
|
||||
public class PublicDetailShareController extends BaseController
|
||||
{
|
||||
private String prefix = "system/public/share";
|
||||
|
||||
@Autowired
|
||||
private IPublicDetailShareService publicDetailShareService;
|
||||
|
||||
@RequiresPermissions("public:share:view")
|
||||
@GetMapping()
|
||||
public String share()
|
||||
{
|
||||
return prefix + "/share";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分享记录列表
|
||||
*/
|
||||
@RequiresPermissions("public:share:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
startPage();
|
||||
List<PublicDetailShare> list = publicDetailShareService.selectPublicDetailShareList(publicDetailShare);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文章分享记录列表
|
||||
*/
|
||||
@RequiresPermissions("public:share:export")
|
||||
@Log(title = "文章分享记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
List<PublicDetailShare> list = publicDetailShareService.selectPublicDetailShareList(publicDetailShare);
|
||||
ExcelUtil<PublicDetailShare> util = new ExcelUtil<PublicDetailShare>(PublicDetailShare.class);
|
||||
return util.exportExcel(list, "文章分享记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章分享记录
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存文章分享记录
|
||||
*/
|
||||
@RequiresPermissions("public:share:add")
|
||||
@Log(title = "文章分享记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
return toAjax(publicDetailShareService.insertPublicDetailShare(publicDetailShare));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分享记录
|
||||
*/
|
||||
@RequiresPermissions("public:share:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
PublicDetailShare publicDetailShare = publicDetailShareService.selectPublicDetailShareById(id);
|
||||
mmap.put("publicDetailShare", publicDetailShare);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存文章分享记录
|
||||
*/
|
||||
@RequiresPermissions("public:share:edit")
|
||||
@Log(title = "文章分享记录", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
return toAjax(publicDetailShareService.updatePublicDetailShare(publicDetailShare));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分享记录
|
||||
*/
|
||||
@RequiresPermissions("public:share:remove")
|
||||
@Log(title = "文章分享记录", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(publicDetailShareService.deletePublicDetailShareByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.playlet.web.service.app;
|
||||
|
||||
import com.playlet.system.domain.PublicDetailShare;
|
||||
|
||||
/**
|
||||
* <p>文章分享记录</p>
|
||||
* @author clunt
|
||||
*/
|
||||
public interface PublicDetailShareAppService {
|
||||
|
||||
|
||||
void addRecord(PublicDetailShare publicDetailShare);
|
||||
|
||||
}
|
||||
|
|
@ -2,7 +2,9 @@ package com.playlet.web.service.app.impl;
|
|||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.playlet.system.domain.PublicCommentResponse;
|
||||
import com.playlet.system.domain.PublicDetailComment;
|
||||
import com.playlet.system.service.IPublicCommentResponseService;
|
||||
import com.playlet.system.service.IPublicDetailCommentService;
|
||||
import com.playlet.web.service.app.PublicDetailCommentAppService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -19,6 +21,8 @@ public class PublicDetailCommentAppServiceImpl implements PublicDetailCommentApp
|
|||
|
||||
private final IPublicDetailCommentService iPublicDetailCommentService;
|
||||
|
||||
private final IPublicCommentResponseService iPublicCommentResponseService;
|
||||
|
||||
@Override
|
||||
public void add(PublicDetailComment detailComment) {
|
||||
iPublicDetailCommentService.save(detailComment);
|
||||
|
|
@ -33,6 +37,9 @@ public class PublicDetailCommentAppServiceImpl implements PublicDetailCommentApp
|
|||
public PageInfo<PublicDetailComment> query(PublicDetailComment detailComment, Integer pageNum, Integer pageSize) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<PublicDetailComment> comments = iPublicDetailCommentService.selectPublicDetailCommentList(detailComment);
|
||||
comments.forEach(model->{
|
||||
model.setCommentResponse(iPublicCommentResponseService.lambdaQuery().eq(PublicCommentResponse::getCommentId, model.getId()).one());
|
||||
});
|
||||
return PageInfo.of(comments);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.playlet.web.service.app.impl;
|
||||
|
||||
import com.playlet.system.domain.PublicDetailShare;
|
||||
import com.playlet.system.service.IPublicDetailShareService;
|
||||
import com.playlet.web.service.app.PublicDetailShareAppService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PublicDetailShareAppServiceImpl implements PublicDetailShareAppService {
|
||||
|
||||
private final IPublicDetailShareService iPublicDetailShareService;
|
||||
|
||||
@Override
|
||||
public void addRecord(PublicDetailShare publicDetailShare) {
|
||||
publicDetailShare.setCreateTime(new Date());
|
||||
iPublicDetailShareService.insertPublicDetailShare(publicDetailShare);
|
||||
}
|
||||
}
|
||||
|
|
@ -136,6 +136,12 @@
|
|||
<input name="itemTen" 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="detailTag" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
|
|
|
|||
|
|
@ -101,6 +101,10 @@
|
|||
else {return '<a>无<a/>'}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'detailTag',
|
||||
title: '文章标签'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@
|
|||
<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="detailTag" th:field="*{detailTag}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
|
|
|
|||
|
|
@ -10,22 +10,10 @@
|
|||
<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>
|
||||
|
|
@ -36,12 +24,12 @@
|
|||
</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-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>
|
||||
|
|
@ -78,11 +66,21 @@
|
|||
},
|
||||
{
|
||||
field: 'detailId',
|
||||
title: '文章id'
|
||||
title: '文章id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'detailName',
|
||||
title: '文章标题'
|
||||
},
|
||||
{
|
||||
field: 'authorAlias',
|
||||
title: '作者花名'
|
||||
},
|
||||
{
|
||||
field: 'userId',
|
||||
title: '用户id【playlet_public_user_id】'
|
||||
title: '用户id【playlet_public_user_id】',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'userName',
|
||||
|
|
@ -94,18 +92,20 @@
|
|||
},
|
||||
{
|
||||
field: 'starCount',
|
||||
title: '点赞数'
|
||||
title: '点赞数',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
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-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-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="responseComment(\'' + 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('');
|
||||
}
|
||||
|
|
@ -113,6 +113,13 @@
|
|||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
|
||||
function responseComment(id){
|
||||
var url = ctx + 'system/public/comment/responseComment/' + id;
|
||||
$.modal.open("回复评论", url, '770', '380');
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('回复评论')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-response-comment">
|
||||
<input name="commentId" type="hidden" th:value="${comment.id}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">评论人:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" name="userName" th:value="${comment.userName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">评论内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" readonly="true" name="content" th:value="${comment.content}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">回复内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="responseContent" th:value="${commentResponse.responseContent}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script type="text/javascript">
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(ctx + "system/public/response/add", $('#form-response-comment').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
|
@ -20,6 +22,7 @@ public class PlayletPlatformFlow extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 平台类型 01.抖音 02.快手 03.视频号 */
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ public class PlayletPublicDetail extends BaseEntity
|
|||
@TableField(exist = false)
|
||||
private String pdfUrl;
|
||||
|
||||
@ApiModelProperty(value = "文章标签")
|
||||
private String detailTag;
|
||||
|
||||
@ApiModelProperty(value = "点赞数")
|
||||
private String starCount;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
|
@ -22,6 +24,7 @@ public class PlayletPublicUser extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 公众号id */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.playlet.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 作者回复评论记录对象 public_comment_response
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "public_comment_response")
|
||||
public class PublicCommentResponse extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 评论id */
|
||||
@Excel(name = "评论id")
|
||||
private Long commentId;
|
||||
|
||||
/** 回复内容 */
|
||||
@Excel(name = "回复内容")
|
||||
private String responseContent;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
|
@ -23,6 +26,7 @@ public class PublicDetailComment extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 文章id */
|
||||
|
|
@ -30,6 +34,12 @@ public class PublicDetailComment extends BaseEntity
|
|||
@ApiModelProperty(value = "文章id")
|
||||
private Long detailId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String authorAlias;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String detailName;
|
||||
|
||||
/** 用户id【playlet_public_user_id】 */
|
||||
@Excel(name = "用户id【playlet_public_user_id】")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
|
|
@ -53,4 +63,8 @@ public class PublicDetailComment extends BaseEntity
|
|||
@ApiModelProperty(value = "点赞数")
|
||||
private Long starCount;
|
||||
|
||||
@ApiModelProperty(value = "作者回复记录")
|
||||
@TableField(exist = false)
|
||||
private PublicCommentResponse commentResponse;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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_share
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "public_detail_share")
|
||||
@ApiModel(value = "文章分享记录")
|
||||
public class PublicDetailShare extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 文章id */
|
||||
@Excel(name = "文章id")
|
||||
@ApiModelProperty(value = "文章id")
|
||||
private Long detailId;
|
||||
|
||||
/** 作者id */
|
||||
@Excel(name = "作者id")
|
||||
@ApiModelProperty(value = "作者id")
|
||||
private Long authorId;
|
||||
|
||||
/** 作者名称 */
|
||||
@Excel(name = "作者名称")
|
||||
@ApiModelProperty(value = "作者名称")
|
||||
private String authorName;
|
||||
|
||||
/** 分享人id */
|
||||
@Excel(name = "分享人id")
|
||||
@ApiModelProperty(value = "分享人id")
|
||||
private Long readerOneId;
|
||||
|
||||
/** 分享人名称 */
|
||||
@Excel(name = "分享人名称")
|
||||
@ApiModelProperty(value = "分享人名称")
|
||||
private String readerOneName;
|
||||
|
||||
/** 被分享人id */
|
||||
@Excel(name = "被分享人id")
|
||||
@ApiModelProperty(value = "被分享人id")
|
||||
private Long readerTwoId;
|
||||
|
||||
/** 被分享人名称 */
|
||||
@Excel(name = "被分享人名称")
|
||||
@ApiModelProperty(value = "被分享人名称")
|
||||
private String readerTwoName;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
|
@ -25,6 +28,7 @@ public class PublicUserRecord extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 用户昵称 */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.playlet.system.domain.PublicCommentResponse;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 作者回复评论记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface PublicCommentResponseMapper extends BaseMapper<PublicCommentResponse>
|
||||
{
|
||||
/**
|
||||
* 查询作者回复评论记录
|
||||
*
|
||||
* @param id 作者回复评论记录主键
|
||||
* @return 作者回复评论记录
|
||||
*/
|
||||
public PublicCommentResponse selectPublicCommentResponseById(Long id);
|
||||
|
||||
/**
|
||||
* 查询作者回复评论记录列表
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 作者回复评论记录集合
|
||||
*/
|
||||
public List<PublicCommentResponse> selectPublicCommentResponseList(PublicCommentResponse publicCommentResponse);
|
||||
|
||||
/**
|
||||
* 新增作者回复评论记录
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPublicCommentResponse(PublicCommentResponse publicCommentResponse);
|
||||
|
||||
/**
|
||||
* 修改作者回复评论记录
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePublicCommentResponse(PublicCommentResponse publicCommentResponse);
|
||||
|
||||
/**
|
||||
* 删除作者回复评论记录
|
||||
*
|
||||
* @param id 作者回复评论记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicCommentResponseById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除作者回复评论记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicCommentResponseByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.playlet.system.domain.PublicDetailShare;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 文章分享记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface PublicDetailShareMapper extends BaseMapper<PublicDetailShare>
|
||||
{
|
||||
/**
|
||||
* 查询文章分享记录
|
||||
*
|
||||
* @param id 文章分享记录主键
|
||||
* @return 文章分享记录
|
||||
*/
|
||||
public PublicDetailShare selectPublicDetailShareById(Long id);
|
||||
|
||||
/**
|
||||
* 查询文章分享记录列表
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 文章分享记录集合
|
||||
*/
|
||||
public List<PublicDetailShare> selectPublicDetailShareList(PublicDetailShare publicDetailShare);
|
||||
|
||||
/**
|
||||
* 新增文章分享记录
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPublicDetailShare(PublicDetailShare publicDetailShare);
|
||||
|
||||
/**
|
||||
* 修改文章分享记录
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePublicDetailShare(PublicDetailShare publicDetailShare);
|
||||
|
||||
/**
|
||||
* 删除文章分享记录
|
||||
*
|
||||
* @param id 文章分享记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicDetailShareById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除文章分享记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicDetailShareByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.playlet.system.domain.PublicCommentResponse;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 作者回复评论记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface IPublicCommentResponseService extends IService<PublicCommentResponse>
|
||||
{
|
||||
/**
|
||||
* 查询作者回复评论记录
|
||||
*
|
||||
* @param id 作者回复评论记录主键
|
||||
* @return 作者回复评论记录
|
||||
*/
|
||||
public PublicCommentResponse selectPublicCommentResponseById(Long id);
|
||||
|
||||
/**
|
||||
* 查询作者回复评论记录列表
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 作者回复评论记录集合
|
||||
*/
|
||||
public List<PublicCommentResponse> selectPublicCommentResponseList(PublicCommentResponse publicCommentResponse);
|
||||
|
||||
/**
|
||||
* 新增作者回复评论记录
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPublicCommentResponse(PublicCommentResponse publicCommentResponse);
|
||||
|
||||
/**
|
||||
* 修改作者回复评论记录
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePublicCommentResponse(PublicCommentResponse publicCommentResponse);
|
||||
|
||||
/**
|
||||
* 批量删除作者回复评论记录
|
||||
*
|
||||
* @param ids 需要删除的作者回复评论记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicCommentResponseByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除作者回复评论记录信息
|
||||
*
|
||||
* @param id 作者回复评论记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicCommentResponseById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.playlet.system.domain.PublicDetailShare;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 文章分享记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface IPublicDetailShareService extends IService<PublicDetailShare>
|
||||
{
|
||||
/**
|
||||
* 查询文章分享记录
|
||||
*
|
||||
* @param id 文章分享记录主键
|
||||
* @return 文章分享记录
|
||||
*/
|
||||
public PublicDetailShare selectPublicDetailShareById(Long id);
|
||||
|
||||
/**
|
||||
* 查询文章分享记录列表
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 文章分享记录集合
|
||||
*/
|
||||
public List<PublicDetailShare> selectPublicDetailShareList(PublicDetailShare publicDetailShare);
|
||||
|
||||
/**
|
||||
* 新增文章分享记录
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPublicDetailShare(PublicDetailShare publicDetailShare);
|
||||
|
||||
/**
|
||||
* 修改文章分享记录
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePublicDetailShare(PublicDetailShare publicDetailShare);
|
||||
|
||||
/**
|
||||
* 批量删除文章分享记录
|
||||
*
|
||||
* @param ids 需要删除的文章分享记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicDetailShareByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除文章分享记录信息
|
||||
*
|
||||
* @param id 文章分享记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePublicDetailShareById(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.PublicCommentResponseMapper;
|
||||
import com.playlet.system.domain.PublicCommentResponse;
|
||||
import com.playlet.system.service.IPublicCommentResponseService;
|
||||
import com.playlet.common.core.text.Convert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* 作者回复评论记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Service
|
||||
public class PublicCommentResponseServiceImpl extends ServiceImpl<PublicCommentResponseMapper, PublicCommentResponse> implements IPublicCommentResponseService
|
||||
{
|
||||
@Autowired
|
||||
private PublicCommentResponseMapper publicCommentResponseMapper;
|
||||
|
||||
/**
|
||||
* 查询作者回复评论记录
|
||||
*
|
||||
* @param id 作者回复评论记录主键
|
||||
* @return 作者回复评论记录
|
||||
*/
|
||||
@Override
|
||||
public PublicCommentResponse selectPublicCommentResponseById(Long id)
|
||||
{
|
||||
return publicCommentResponseMapper.selectPublicCommentResponseById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作者回复评论记录列表
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 作者回复评论记录
|
||||
*/
|
||||
@Override
|
||||
public List<PublicCommentResponse> selectPublicCommentResponseList(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
return publicCommentResponseMapper.selectPublicCommentResponseList(publicCommentResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作者回复评论记录
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPublicCommentResponse(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
publicCommentResponse.setCreateTime(DateUtils.getNowDate());
|
||||
return publicCommentResponseMapper.insertPublicCommentResponse(publicCommentResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作者回复评论记录
|
||||
*
|
||||
* @param publicCommentResponse 作者回复评论记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePublicCommentResponse(PublicCommentResponse publicCommentResponse)
|
||||
{
|
||||
publicCommentResponse.setUpdateTime(DateUtils.getNowDate());
|
||||
return publicCommentResponseMapper.updatePublicCommentResponse(publicCommentResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除作者回复评论记录
|
||||
*
|
||||
* @param ids 需要删除的作者回复评论记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePublicCommentResponseByIds(String ids)
|
||||
{
|
||||
return publicCommentResponseMapper.deletePublicCommentResponseByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作者回复评论记录信息
|
||||
*
|
||||
* @param id 作者回复评论记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePublicCommentResponseById(Long id)
|
||||
{
|
||||
return publicCommentResponseMapper.deletePublicCommentResponseById(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.PublicDetailShareMapper;
|
||||
import com.playlet.system.domain.PublicDetailShare;
|
||||
import com.playlet.system.service.IPublicDetailShareService;
|
||||
import com.playlet.common.core.text.Convert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* 文章分享记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Service
|
||||
public class PublicDetailShareServiceImpl extends ServiceImpl<PublicDetailShareMapper, PublicDetailShare> implements IPublicDetailShareService
|
||||
{
|
||||
@Autowired
|
||||
private PublicDetailShareMapper publicDetailShareMapper;
|
||||
|
||||
/**
|
||||
* 查询文章分享记录
|
||||
*
|
||||
* @param id 文章分享记录主键
|
||||
* @return 文章分享记录
|
||||
*/
|
||||
@Override
|
||||
public PublicDetailShare selectPublicDetailShareById(Long id)
|
||||
{
|
||||
return publicDetailShareMapper.selectPublicDetailShareById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分享记录列表
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 文章分享记录
|
||||
*/
|
||||
@Override
|
||||
public List<PublicDetailShare> selectPublicDetailShareList(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
return publicDetailShareMapper.selectPublicDetailShareList(publicDetailShare);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章分享记录
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPublicDetailShare(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
publicDetailShare.setCreateTime(DateUtils.getNowDate());
|
||||
return publicDetailShareMapper.insertPublicDetailShare(publicDetailShare);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分享记录
|
||||
*
|
||||
* @param publicDetailShare 文章分享记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePublicDetailShare(PublicDetailShare publicDetailShare)
|
||||
{
|
||||
publicDetailShare.setUpdateTime(DateUtils.getNowDate());
|
||||
return publicDetailShareMapper.updatePublicDetailShare(publicDetailShare);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章分享记录
|
||||
*
|
||||
* @param ids 需要删除的文章分享记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePublicDetailShareByIds(String ids)
|
||||
{
|
||||
return publicDetailShareMapper.deletePublicDetailShareByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分享记录信息
|
||||
*
|
||||
* @param id 文章分享记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePublicDetailShareById(Long id)
|
||||
{
|
||||
return publicDetailShareMapper.deletePublicDetailShareById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
<result property="id" column="id" />
|
||||
<result property="publicId" column="public_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="detailTag" column="detail_tag" />
|
||||
<result property="readCount" column="read_count" />
|
||||
<result property="content" column="content" />
|
||||
<result property="starCount" column="star_count" />
|
||||
|
|
@ -37,7 +38,7 @@
|
|||
item_one,item_two,item_three,item_four,item_five,
|
||||
item_six,item_seven,item_eight,item_nine,item_ten,
|
||||
title,type,author_alias,img_url, content, create_by, create_time,
|
||||
update_by, update_time, remark from playlet_public_detail
|
||||
update_by, update_time, detail_tag, remark from playlet_public_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectPlayletPublicDetailList" parameterType="PlayletPublicDetail" resultMap="PlayletPublicDetailResult">
|
||||
|
|
@ -80,6 +81,7 @@
|
|||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="detailTag != null">detail_tag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -106,6 +108,7 @@
|
|||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="detailTag != null">#{detailTag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -136,6 +139,7 @@
|
|||
<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="detailTag != null">detail_tag = #{detailTag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
<?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.PublicCommentResponseMapper">
|
||||
|
||||
<resultMap type="PublicCommentResponse" id="PublicCommentResponseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="commentId" column="comment_id" />
|
||||
<result property="responseContent" column="response_content" />
|
||||
<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="selectPublicCommentResponseVo">
|
||||
select id, comment_id, response_content, create_by, create_time, update_by, update_time, remark from public_comment_response
|
||||
</sql>
|
||||
|
||||
<select id="selectPublicCommentResponseList" parameterType="PublicCommentResponse" resultMap="PublicCommentResponseResult">
|
||||
<include refid="selectPublicCommentResponseVo"/>
|
||||
<where>
|
||||
<if test="commentId != null "> and comment_id = #{commentId}</if>
|
||||
<if test="responseContent != null and responseContent != ''"> and response_content = #{responseContent}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPublicCommentResponseById" parameterType="Long" resultMap="PublicCommentResponseResult">
|
||||
<include refid="selectPublicCommentResponseVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPublicCommentResponse" parameterType="PublicCommentResponse" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into public_comment_response
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="commentId != null">comment_id,</if>
|
||||
<if test="responseContent != null">response_content,</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="commentId != null">#{commentId},</if>
|
||||
<if test="responseContent != null">#{responseContent},</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="updatePublicCommentResponse" parameterType="PublicCommentResponse">
|
||||
update public_comment_response
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="commentId != null">comment_id = #{commentId},</if>
|
||||
<if test="responseContent != null">response_content = #{responseContent},</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="deletePublicCommentResponseById" parameterType="Long">
|
||||
delete from public_comment_response where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePublicCommentResponseByIds" parameterType="String">
|
||||
delete from public_comment_response where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
<?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.PublicDetailShareMapper">
|
||||
|
||||
<resultMap type="PublicDetailShare" id="PublicDetailShareResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="detailId" column="detail_id" />
|
||||
<result property="authorId" column="author_id" />
|
||||
<result property="authorName" column="author_name" />
|
||||
<result property="readerOneId" column="reader_one_id" />
|
||||
<result property="readerOneName" column="reader_one_name" />
|
||||
<result property="readerTwoId" column="reader_two_id" />
|
||||
<result property="readerTwoName" column="reader_two_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPublicDetailShareVo">
|
||||
select id, detail_id, author_id, author_name, reader_one_id, reader_one_name, reader_two_id, reader_two_name, create_time, create_by, update_by, update_time, remark from public_detail_share
|
||||
</sql>
|
||||
|
||||
<select id="selectPublicDetailShareList" parameterType="PublicDetailShare" resultMap="PublicDetailShareResult">
|
||||
<include refid="selectPublicDetailShareVo"/>
|
||||
<where>
|
||||
<if test="detailId != null "> and detail_id = #{detailId}</if>
|
||||
<if test="authorId != null "> and author_id = #{authorId}</if>
|
||||
<if test="authorName != null and authorName != ''"> and author_name like concat('%', #{authorName}, '%')</if>
|
||||
<if test="readerOneId != null "> and reader_one_id = #{readerOneId}</if>
|
||||
<if test="readerOneName != null and readerOneName != ''"> and reader_one_name like concat('%', #{readerOneName}, '%')</if>
|
||||
<if test="readerTwoId != null "> and reader_two_id = #{readerTwoId}</if>
|
||||
<if test="readerTwoName != null and readerTwoName != ''"> and reader_two_name like concat('%', #{readerTwoName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPublicDetailShareById" parameterType="Long" resultMap="PublicDetailShareResult">
|
||||
<include refid="selectPublicDetailShareVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPublicDetailShare" parameterType="PublicDetailShare" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into public_detail_share
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="detailId != null">detail_id,</if>
|
||||
<if test="authorId != null">author_id,</if>
|
||||
<if test="authorName != null">author_name,</if>
|
||||
<if test="readerOneId != null">reader_one_id,</if>
|
||||
<if test="readerOneName != null">reader_one_name,</if>
|
||||
<if test="readerTwoId != null">reader_two_id,</if>
|
||||
<if test="readerTwoName != null">reader_two_name,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</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="authorId != null">#{authorId},</if>
|
||||
<if test="authorName != null">#{authorName},</if>
|
||||
<if test="readerOneId != null">#{readerOneId},</if>
|
||||
<if test="readerOneName != null">#{readerOneName},</if>
|
||||
<if test="readerTwoId != null">#{readerTwoId},</if>
|
||||
<if test="readerTwoName != null">#{readerTwoName},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePublicDetailShare" parameterType="PublicDetailShare">
|
||||
update public_detail_share
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="detailId != null">detail_id = #{detailId},</if>
|
||||
<if test="authorId != null">author_id = #{authorId},</if>
|
||||
<if test="authorName != null">author_name = #{authorName},</if>
|
||||
<if test="readerOneId != null">reader_one_id = #{readerOneId},</if>
|
||||
<if test="readerOneName != null">reader_one_name = #{readerOneName},</if>
|
||||
<if test="readerTwoId != null">reader_two_id = #{readerTwoId},</if>
|
||||
<if test="readerTwoName != null">reader_two_name = #{readerTwoName},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</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="deletePublicDetailShareById" parameterType="Long">
|
||||
delete from public_detail_share where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePublicDetailShareByIds" parameterType="String">
|
||||
delete from public_detail_share where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue