公众号模块
This commit is contained in:
parent
7b7963c12d
commit
9368e5e0d9
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.playlet.web.controller.app;
|
||||||
|
|
||||||
|
import com.playlet.common.core.domain.Result;
|
||||||
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
import com.playlet.web.service.app.PlayletPublicAccountAppService;
|
||||||
|
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")
|
||||||
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
|
public class PlayletPublicAccountAppController {
|
||||||
|
|
||||||
|
private final PlayletPublicAccountAppService playletPublicAccountAppService;
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/getById")
|
||||||
|
@ApiOperation(value = "通过id查询详情")
|
||||||
|
public Result<PlayletPublicAccount> getById(@RequestParam(value = "id") Long id) {
|
||||||
|
return Result.success(playletPublicAccountAppService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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.PlayletPublicAccount;
|
||||||
|
import com.playlet.system.service.IPlayletPublicAccountService;
|
||||||
|
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-04-07
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/playlet/account")
|
||||||
|
public class PlayletPublicAccountController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "system/playlet/account";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPlayletPublicAccountService playletPublicAccountService;
|
||||||
|
|
||||||
|
@RequiresPermissions("playlet:account:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String account()
|
||||||
|
{
|
||||||
|
return prefix + "/account";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号列列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("playlet:account:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<PlayletPublicAccount> list = playletPublicAccountService.selectPlayletPublicAccountList(playletPublicAccount);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出公众号列列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("playlet:account:export")
|
||||||
|
@Log(title = "公众号列", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
List<PlayletPublicAccount> list = playletPublicAccountService.selectPlayletPublicAccountList(playletPublicAccount);
|
||||||
|
ExcelUtil<PlayletPublicAccount> util = new ExcelUtil<PlayletPublicAccount>(PlayletPublicAccount.class);
|
||||||
|
return util.exportExcel(list, "公众号列数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公众号列
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存公众号列
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("playlet:account:add")
|
||||||
|
@Log(title = "公众号列", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
return toAjax(playletPublicAccountService.insertPlayletPublicAccount(playletPublicAccount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公众号列
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("playlet:account:edit")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
PlayletPublicAccount playletPublicAccount = playletPublicAccountService.selectPlayletPublicAccountById(id);
|
||||||
|
mmap.put("playletPublicAccount", playletPublicAccount);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存公众号列
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("playlet:account:edit")
|
||||||
|
@Log(title = "公众号列", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
return toAjax(playletPublicAccountService.updatePlayletPublicAccount(playletPublicAccount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公众号列
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("playlet:account:remove")
|
||||||
|
@Log(title = "公众号列", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(playletPublicAccountService.deletePlayletPublicAccountByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.playlet.web.service.app;
|
||||||
|
|
||||||
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
|
||||||
|
public interface PlayletPublicAccountAppService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id 主键id
|
||||||
|
* @return 通过id查询详情
|
||||||
|
*/
|
||||||
|
PlayletPublicAccount getById(Long id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.playlet.web.service.app.impl;
|
||||||
|
|
||||||
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
import com.playlet.system.service.IPlayletPublicAccountService;
|
||||||
|
import com.playlet.web.service.app.PlayletPublicAccountAppService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
|
public class PlayletPublicAccountAppServiceImpl implements PlayletPublicAccountAppService {
|
||||||
|
|
||||||
|
private final IPlayletPublicAccountService iPlayletPublicAccountService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlayletPublicAccount getById(Long id) {
|
||||||
|
PlayletPublicAccount playletPublicAccount = iPlayletPublicAccountService.getById(id);
|
||||||
|
if(playletPublicAccount != null){
|
||||||
|
// todo
|
||||||
|
}
|
||||||
|
return playletPublicAccount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
<!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>公众号名称:</label>
|
||||||
|
<input type="text" name="name"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>简介:</label>
|
||||||
|
<input type="text" name="introduction"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>作者花名:</label>
|
||||||
|
<input type="text" name="authorAlias"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>头像:</label>
|
||||||
|
<input type="text" name="logoUrl"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>地址:</label>
|
||||||
|
<input type="text" name="address"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>原创片数:</label>
|
||||||
|
<input type="text" name="originalContentCount"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>关注人数:</label>
|
||||||
|
<input type="text" name="followersCount"/>
|
||||||
|
</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="playlet:account:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="playlet:account:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="playlet:account:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="playlet:account: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('playlet:account:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('playlet:account:remove')}]];
|
||||||
|
var prefix = ctx + "system/playlet/account";
|
||||||
|
|
||||||
|
$(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: '主键',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'name',
|
||||||
|
title: '公众号名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'introduction',
|
||||||
|
title: '简介'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'authorAlias',
|
||||||
|
title: '作者花名'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'logoUrl',
|
||||||
|
title: '头像'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'address',
|
||||||
|
title: '地址'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'originalContentCount',
|
||||||
|
title: '原创片数'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'followersCount',
|
||||||
|
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,73 @@
|
||||||
|
<!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-account-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">公众号名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="name" 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="introduction" 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="authorAlias" 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="logoUrl" 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="address" 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="originalContentCount" 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="followersCount" 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" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/playlet/account"
|
||||||
|
$("#form-account-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-account-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!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-account-edit" th:object="${playletPublicAccount}">
|
||||||
|
<input name="id" th:field="*{id}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">公众号名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="name" th:field="*{name}" 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="introduction" th:field="*{introduction}" 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="authorAlias" th:field="*{authorAlias}" 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="logoUrl" th:field="*{logoUrl}" 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="address" th:field="*{address}" 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="originalContentCount" th:field="*{originalContentCount}" 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="followersCount" th:field="*{followersCount}" 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" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/playlet/account";
|
||||||
|
$("#form-account-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-account-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -13,7 +13,7 @@ public class SqlUtil
|
||||||
/**
|
/**
|
||||||
* 定义常用的 sql关键字
|
* 定义常用的 sql关键字
|
||||||
*/
|
*/
|
||||||
public static String SQL_REGEX = "and |extractvalue|updatexml|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |+|user()";
|
public static String SQL_REGEX = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
|
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号列对象 playlet_public_account
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName(value = "playlet_public_account")
|
||||||
|
@ApiModel(value = "公众号列对象")
|
||||||
|
public class PlayletPublicAccount extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
@ApiModelProperty(value = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 公众号名称 */
|
||||||
|
@Excel(name = "公众号名称")
|
||||||
|
@ApiModelProperty(value = "公众号名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 简介 */
|
||||||
|
@Excel(name = "简介")
|
||||||
|
@ApiModelProperty(value = "简介")
|
||||||
|
private String introduction;
|
||||||
|
|
||||||
|
/** 作者花名 */
|
||||||
|
@Excel(name = "作者花名")
|
||||||
|
@ApiModelProperty(value = "作者花名")
|
||||||
|
private String authorAlias;
|
||||||
|
|
||||||
|
/** 头像 */
|
||||||
|
@Excel(name = "头像")
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
private String logoUrl;
|
||||||
|
|
||||||
|
/** 地址 */
|
||||||
|
@Excel(name = "地址")
|
||||||
|
@ApiModelProperty(value = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 原创片数 */
|
||||||
|
@Excel(name = "原创片数")
|
||||||
|
@ApiModelProperty(value = "原创片数")
|
||||||
|
private Long originalContentCount;
|
||||||
|
|
||||||
|
/** 关注人数 */
|
||||||
|
@Excel(name = "关注人数")
|
||||||
|
@ApiModelProperty(value = "关注人数")
|
||||||
|
private Long followersCount;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.playlet.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号列Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
public interface PlayletPublicAccountMapper extends BaseMapper<PlayletPublicAccount>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询公众号列
|
||||||
|
*
|
||||||
|
* @param id 公众号列主键
|
||||||
|
* @return 公众号列
|
||||||
|
*/
|
||||||
|
public PlayletPublicAccount selectPlayletPublicAccountById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号列列表
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 公众号列集合
|
||||||
|
*/
|
||||||
|
public List<PlayletPublicAccount> selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公众号列
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公众号列
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公众号列
|
||||||
|
*
|
||||||
|
* @param id 公众号列主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletPublicAccountById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公众号列
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletPublicAccountByIds(String[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.playlet.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号列Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
public interface IPlayletPublicAccountService extends IService<PlayletPublicAccount>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询公众号列
|
||||||
|
*
|
||||||
|
* @param id 公众号列主键
|
||||||
|
* @return 公众号列
|
||||||
|
*/
|
||||||
|
public PlayletPublicAccount selectPlayletPublicAccountById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号列列表
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 公众号列集合
|
||||||
|
*/
|
||||||
|
public List<PlayletPublicAccount> selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公众号列
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公众号列
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公众号列
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的公众号列主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletPublicAccountByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公众号列信息
|
||||||
|
*
|
||||||
|
* @param id 公众号列主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletPublicAccountById(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.PlayletPublicAccountMapper;
|
||||||
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
import com.playlet.system.service.IPlayletPublicAccountService;
|
||||||
|
import com.playlet.common.core.text.Convert;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号列Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PlayletPublicAccountServiceImpl extends ServiceImpl<PlayletPublicAccountMapper, PlayletPublicAccount> implements IPlayletPublicAccountService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private PlayletPublicAccountMapper playletPublicAccountMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号列
|
||||||
|
*
|
||||||
|
* @param id 公众号列主键
|
||||||
|
* @return 公众号列
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PlayletPublicAccount selectPlayletPublicAccountById(Long id)
|
||||||
|
{
|
||||||
|
return playletPublicAccountMapper.selectPlayletPublicAccountById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公众号列列表
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 公众号列
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PlayletPublicAccount> selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
return playletPublicAccountMapper.selectPlayletPublicAccountList(playletPublicAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公众号列
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
playletPublicAccount.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return playletPublicAccountMapper.insertPlayletPublicAccount(playletPublicAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公众号列
|
||||||
|
*
|
||||||
|
* @param playletPublicAccount 公众号列
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount)
|
||||||
|
{
|
||||||
|
playletPublicAccount.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return playletPublicAccountMapper.updatePlayletPublicAccount(playletPublicAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公众号列
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的公众号列主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePlayletPublicAccountByIds(String ids)
|
||||||
|
{
|
||||||
|
return playletPublicAccountMapper.deletePlayletPublicAccountByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公众号列信息
|
||||||
|
*
|
||||||
|
* @param id 公众号列主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePlayletPublicAccountById(Long id)
|
||||||
|
{
|
||||||
|
return playletPublicAccountMapper.deletePlayletPublicAccountById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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.PlayletPublicAccountMapper">
|
||||||
|
|
||||||
|
<resultMap type="PlayletPublicAccount" id="PlayletPublicAccountResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="introduction" column="introduction" />
|
||||||
|
<result property="authorAlias" column="author_alias" />
|
||||||
|
<result property="logoUrl" column="logo_url" />
|
||||||
|
<result property="address" column="address" />
|
||||||
|
<result property="originalContentCount" column="original_content_count" />
|
||||||
|
<result property="followersCount" column="followers_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="selectPlayletPublicAccountVo">
|
||||||
|
select id, name, introduction, author_alias, logo_url, address, original_content_count, followers_count, create_by, create_time, update_by, update_time, remark from playlet_public_account
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPlayletPublicAccountList" parameterType="PlayletPublicAccount" resultMap="PlayletPublicAccountResult">
|
||||||
|
<include refid="selectPlayletPublicAccountVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
|
||||||
|
<if test="authorAlias != null and authorAlias != ''"> and author_alias = #{authorAlias}</if>
|
||||||
|
<if test="logoUrl != null and logoUrl != ''"> and logo_url = #{logoUrl}</if>
|
||||||
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||||
|
<if test="originalContentCount != null "> and original_content_count = #{originalContentCount}</if>
|
||||||
|
<if test="followersCount != null "> and followers_count = #{followersCount}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPlayletPublicAccountById" parameterType="Long" resultMap="PlayletPublicAccountResult">
|
||||||
|
<include refid="selectPlayletPublicAccountVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPlayletPublicAccount" parameterType="PlayletPublicAccount" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into playlet_public_account
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="introduction != null">introduction,</if>
|
||||||
|
<if test="authorAlias != null">author_alias,</if>
|
||||||
|
<if test="logoUrl != null">logo_url,</if>
|
||||||
|
<if test="address != null">address,</if>
|
||||||
|
<if test="originalContentCount != null">original_content_count,</if>
|
||||||
|
<if test="followersCount != null">followers_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="name != null">#{name},</if>
|
||||||
|
<if test="introduction != null">#{introduction},</if>
|
||||||
|
<if test="authorAlias != null">#{authorAlias},</if>
|
||||||
|
<if test="logoUrl != null">#{logoUrl},</if>
|
||||||
|
<if test="address != null">#{address},</if>
|
||||||
|
<if test="originalContentCount != null">#{originalContentCount},</if>
|
||||||
|
<if test="followersCount != null">#{followersCount},</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="updatePlayletPublicAccount" parameterType="PlayletPublicAccount">
|
||||||
|
update playlet_public_account
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="introduction != null">introduction = #{introduction},</if>
|
||||||
|
<if test="authorAlias != null">author_alias = #{authorAlias},</if>
|
||||||
|
<if test="logoUrl != null">logo_url = #{logoUrl},</if>
|
||||||
|
<if test="address != null">address = #{address},</if>
|
||||||
|
<if test="originalContentCount != null">original_content_count = #{originalContentCount},</if>
|
||||||
|
<if test="followersCount != null">followers_count = #{followersCount},</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="deletePlayletPublicAccountById" parameterType="Long">
|
||||||
|
delete from playlet_public_account where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePlayletPublicAccountByIds" parameterType="String">
|
||||||
|
delete from playlet_public_account where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue