修改登录

用户列表
全局配置
用户修改
同步用户表结构
This commit is contained in:
pan.wl.2 2024-10-15 00:01:18 +08:00
parent b8997b8062
commit 6e9cb97582
57 changed files with 646 additions and 622 deletions

View File

@ -1,94 +0,0 @@
package com.mdd.admin.controller;
import com.alibaba.fastjson2.JSONArray;
import com.mdd.admin.aop.Log;
import com.mdd.admin.service.IAlbumsService;
import com.mdd.admin.validate.album.AlbumCateValidate;
import com.mdd.admin.validate.album.AlbumMoveValidate;
import com.mdd.admin.validate.album.AlbumRenameValidate;
import com.mdd.admin.validate.album.AlbumSearchValidate;
import com.mdd.admin.validate.commons.IdValidate;
import com.mdd.admin.validate.commons.IdsValidate;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.vo.album.AlbumVo;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("api/albums")
@Api(tags = "相册数据管理")
public class AlbumsController {
@Resource
IAlbumsService iAlbumsService;
@GetMapping("/albumList")
@ApiOperation(value="相册文件列表")
public AjaxResult<PageResult<AlbumVo>> albumList(@Validated PageValidate pageValidate,
@Validated AlbumSearchValidate searchValidate) {
PageResult<AlbumVo> voPageResult = iAlbumsService.albumList(pageValidate, searchValidate);
return AjaxResult.success(voPageResult);
}
@Log(title = "相册文件重命名")
@PostMapping("/albumRename")
@ApiOperation(value="相册文件重命名")
public AjaxResult<Object> albumRename(@Validated @RequestBody AlbumRenameValidate renameValidate) {
iAlbumsService.albumRename(renameValidate.getId(), renameValidate.getName());
return AjaxResult.success();
}
@Log(title = "相册文件移动")
@PostMapping("/albumMove")
@ApiOperation(value="相册文件移动")
public AjaxResult<Object> albumMove(@Validated @RequestBody AlbumMoveValidate moveValidate) {
iAlbumsService.albumMove(moveValidate.getIds(), moveValidate.getCid());
return AjaxResult.success();
}
@Log(title = "相册文件删除")
@PostMapping("/albumDel")
@ApiOperation(value="相册文件删除")
public AjaxResult<Object> albumDel(@Validated @RequestBody IdsValidate idsValidate) {
iAlbumsService.albumDel(idsValidate.getIds());
return AjaxResult.success();
}
@GetMapping("/cateList")
@ApiOperation(value="相册分类列表")
public AjaxResult<JSONArray> cateList(@Validated AlbumSearchValidate searchValidate) {
JSONArray jsonArray = iAlbumsService.cateList(searchValidate);
return AjaxResult.success(jsonArray);
}
@Log(title = "相册分类新增")
@PostMapping("/cateAdd")
@ApiOperation(value="相册分类新增")
public AjaxResult<Object> cateAdd(@Validated @RequestBody AlbumCateValidate cateValidate) {
iAlbumsService.cateAdd(cateValidate);
return AjaxResult.success();
}
@Log(title = "相册分类重命名")
@PostMapping("/cateRename")
@ApiOperation(value="相册分类重命名")
public AjaxResult<Object> cateRename(@Validated @RequestBody AlbumRenameValidate renameValidate) {
iAlbumsService.cateRename(renameValidate.getId(), renameValidate.getName());
return AjaxResult.success();
}
@Log(title = "相册分类删除")
@PostMapping("/cateDel")
@ApiOperation(value="相册分类删除")
public AjaxResult<Object> cateDel(@Validated @RequestBody IdValidate idValidate) {
iAlbumsService.cateDel(idValidate.getId());
return AjaxResult.success();
}
}

View File

@ -21,7 +21,7 @@ import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("api/article/cate")
@RequestMapping("/adminapi/article/articleCate")
@Api(tags = "文章分类管理")
public class ArtCateController {
@ -36,7 +36,7 @@ public class ArtCateController {
return AjaxResult.success(list);
}
@GetMapping("/list")
@GetMapping("/lists")
@ApiOperation(value="分类列表")
public AjaxResult<PageResult<ArticleCateVo>> list(@Validated PageValidate pageValidate,
@Validated ArtCateSearchValidate searchValidate) {
@ -68,7 +68,7 @@ public class ArtCateController {
}
@Log(title = "文章分类删除")
@PostMapping("/del")
@PostMapping("/delete")
@ApiOperation(value="分类删除")
public AjaxResult<Object> del(@Validated @RequestBody IdValidate idValidate) {
iArtCateService.del(idValidate.getId());
@ -76,7 +76,7 @@ public class ArtCateController {
}
@Log(title = "文章分类状态")
@PostMapping("/change")
@PostMapping("/updateStatus")
@ApiOperation(value="分类状态")
public AjaxResult<Object> change(@Validated @RequestBody IdValidate idValidate) {
iArtCateService.change(idValidate.getId());

View File

@ -21,14 +21,14 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("api/article")
@RequestMapping("adminapi/article/article")
@Api(tags = "文章数据管理")
public class ArticleController {
@Resource
IArticleService iArticleService;
@GetMapping("/list")
@GetMapping("/lists")
@ApiOperation(value="文章列表")
public AjaxResult<PageResult<ArticleListedVo>> list(@Validated PageValidate pageValidate,
@Validated ArticleSearchValidate searchValidate) {
@ -60,7 +60,7 @@ public class ArticleController {
}
@Log(title = "文章删除")
@PostMapping("/del")
@PostMapping("/delete")
@ApiOperation(value="文章删除")
public AjaxResult<Object> del(@Validated @RequestBody IdValidate idValidate) {
iArticleService.del(idValidate.getId());
@ -68,7 +68,7 @@ public class ArticleController {
}
@Log(title = "文章状态")
@PostMapping("/change")
@PostMapping("/updateStatus")
@ApiOperation(value="文章状态")
public AjaxResult<Object> change(@Validated @RequestBody IdValidate idValidate) {
iArticleService.change(idValidate.getId());

View File

@ -0,0 +1,95 @@
package com.mdd.admin.controller;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.mdd.admin.aop.Log;
import com.mdd.admin.service.IFileService;
import com.mdd.admin.validate.file.FileCateValidate;
import com.mdd.admin.validate.file.FileMoveValidate;
import com.mdd.admin.validate.file.FileRenameValidate;
import com.mdd.admin.validate.file.FileSearchValidate;
import com.mdd.admin.validate.commons.IdValidate;
import com.mdd.admin.validate.commons.IdsValidate;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.vo.album.FileVo;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/adminapi/file")
@Api(tags = "文件数据管理")
public class FileController {
@Resource
IFileService fileService;
@GetMapping("/lists")
@ApiOperation(value="文件列表")
public AjaxResult<PageResult<FileVo>> fileList(@Validated PageValidate pageValidate,
@Validated FileSearchValidate searchValidate) {
PageResult<FileVo> voPageResult = fileService.fileList(pageValidate, searchValidate);
return AjaxResult.success(voPageResult);
}
@Log(title = "文件重命名")
@PostMapping("/rename")
@ApiOperation(value="文件重命名")
public AjaxResult<Object> rename(@Validated @RequestBody FileRenameValidate renameValidate) {
fileService.fileRename(renameValidate.getId(), renameValidate.getName());
return AjaxResult.success();
}
@Log(title = "文件移动")
@PostMapping("/move")
@ApiOperation(value="相册文件移动")
public AjaxResult<Object> move(@Validated @RequestBody FileMoveValidate moveValidate) {
fileService.fileMove(moveValidate.getIds(), moveValidate.getCid());
return AjaxResult.success();
}
@Log(title = "文件删除")
@PostMapping("/delete")
@ApiOperation(value="相册文件删除")
public AjaxResult<Object> del(@Validated @RequestBody IdsValidate idsValidate) {
fileService.fileDel(idsValidate.getIds());
return AjaxResult.success();
}
@GetMapping("/listCate")
@ApiOperation(value="文件分类列表")
public AjaxResult<JSONObject> cateList(@Validated FileSearchValidate searchValidate) {
JSONObject result = fileService.cateList(searchValidate);
return AjaxResult.success(result);
}
@Log(title = "分类新增")
@PostMapping("/addCate")
@ApiOperation(value="分类新增")
public AjaxResult<Object> cateAdd(@Validated @RequestBody FileCateValidate cateValidate) {
fileService.cateAdd(cateValidate);
return AjaxResult.success();
}
@Log(title = "相册分类重命名")
@PostMapping("/editCate")
@ApiOperation(value="相册分类重命名")
public AjaxResult<Object> cateRename(@Validated @RequestBody FileRenameValidate renameValidate) {
fileService.cateRename(renameValidate.getId(), renameValidate.getName());
return AjaxResult.success();
}
@Log(title = "相册分类删除")
@PostMapping("/delCate")
@ApiOperation(value="相册分类删除")
public AjaxResult<Object> cateDel(@Validated @RequestBody IdValidate idValidate) {
fileService.cateDel(idValidate.getId());
return AjaxResult.success();
}
}

View File

@ -3,7 +3,7 @@ package com.mdd.admin.controller;
import com.mdd.admin.LikeAdminThreadLocal;
import com.mdd.admin.aop.Log;
import com.mdd.admin.aop.aspect.RequestType;
import com.mdd.admin.service.IAlbumsService;
import com.mdd.admin.service.IFileService;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.enums.AlbumEnum;
import com.mdd.common.exception.OperateException;
@ -24,12 +24,12 @@ import java.util.LinkedHashMap;
import java.util.Map;
@RestController
@RequestMapping("api/upload")
@RequestMapping("/adminapi/upload")
@Api(tags = "上传文件管理")
public class UploadController {
@Resource
IAlbumsService iAlbumsService;
IFileService fileService;
@Log(title = "上传图片", requestType = RequestType.File)
@PostMapping("/image")
@ -54,11 +54,11 @@ public class UploadController {
album.put("aid", String.valueOf(LikeAdminThreadLocal.getAdminId()));
album.put("cid", cid);
album.put("type", String.valueOf(AlbumEnum.IMAGE.getCode()));
album.put("size", vo.getSize().toString());
album.put("ext", vo.getExt());
// album.put("size", vo.getSize().toString());
// album.put("ext", vo.getExt());
album.put("url", vo.getUrl());
album.put("name", vo.getName());
Integer id = iAlbumsService.albumAdd(album);
Integer id = fileService.fileAdd(album);
vo.setId(id);
return AjaxResult.success(vo);
@ -87,11 +87,11 @@ public class UploadController {
album.put("cid", cid);
album.put("aid", String.valueOf(LikeAdminThreadLocal.getAdminId()));
album.put("type", String.valueOf(AlbumEnum.Video.getCode()));
album.put("ext", vo.getExt());
album.put("size", vo.getSize().toString());
// album.put("ext", vo.getExt());
// album.put("size", vo.getSize().toString());
album.put("url", vo.getUrl());
album.put("name", vo.getName());
Integer id = iAlbumsService.albumAdd(album);
Integer id = fileService.fileAdd(album);
vo.setId(id);
return AjaxResult.success(vo);

View File

@ -12,21 +12,21 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("api/marketing/recharge")
@RequestMapping("adminapi/recharge/recharge")
@Api("营销充值管理")
public class MarketingRechargeController {
@Resource
IMarketingRechargeService iMarketingRechargeService;
@GetMapping("/detail")
@GetMapping("/getConfig")
@ApiModelProperty(value = "充值配置详情")
public AjaxResult<MarketingRechargeVo> detail() {
MarketingRechargeVo vo = iMarketingRechargeService.detail();
return AjaxResult.success(vo);
}
@PostMapping("/save")
@PostMapping("/setConfig")
@ApiModelProperty(value = "充值配置保存")
public AjaxResult<Object> save(@Validated @RequestBody MarketingRechargeValidate rechargeValidate) {
iMarketingRechargeService.save(rechargeValidate);

View File

@ -1,19 +1,20 @@
package com.mdd.admin.service;
import com.alibaba.fastjson2.JSONArray;
import com.mdd.admin.validate.album.AlbumCateValidate;
import com.mdd.admin.validate.album.AlbumSearchValidate;
import com.alibaba.fastjson2.JSONObject;
import com.mdd.admin.validate.file.FileCateValidate;
import com.mdd.admin.validate.file.FileSearchValidate;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.vo.album.AlbumVo;
import com.mdd.admin.vo.album.FileVo;
import com.mdd.common.core.PageResult;
import java.util.List;
import java.util.Map;
/**
* 相册服务接口类
* 文件服务接口类
*/
public interface IAlbumsService {
public interface IFileService {
/**
* 文件列表
@ -23,7 +24,7 @@ public interface IAlbumsService {
* @param searchValidate 其他搜索参数
* @return PageResult<AlbumVo>
*/
PageResult<AlbumVo> albumList(PageValidate pageValidate, AlbumSearchValidate searchValidate);
PageResult<FileVo> fileList(PageValidate pageValidate, FileSearchValidate searchValidate);
/**
* 文件重命名
@ -31,7 +32,7 @@ public interface IAlbumsService {
* @param id 文件ID
* @param name 文件名称
*/
void albumRename(Integer id, String name);
void fileRename(Integer id, String name);
/**
* 文件移动
@ -40,7 +41,7 @@ public interface IAlbumsService {
* @param ids 文件ID
* @param cid 类目ID
*/
void albumMove(List<Integer> ids, Integer cid);
void fileMove(List<Integer> ids, Integer cid);
/**
* 文件新增
@ -48,7 +49,7 @@ public interface IAlbumsService {
* @author fzr
* @param params 文件信息参数
*/
Integer albumAdd(Map<String, String> params);
Integer fileAdd(Map<String, String> params);
/**
* 文件删除
@ -56,7 +57,7 @@ public interface IAlbumsService {
* @author fzr
* @param ids 文件ID
*/
void albumDel(List<Integer> ids);
void fileDel(List<Integer> ids);
/**
* 分类列表
@ -65,7 +66,7 @@ public interface IAlbumsService {
* @param searchValidate 搜索参数
* @return JSONArray
*/
JSONArray cateList(AlbumSearchValidate searchValidate);
JSONObject cateList(FileSearchValidate searchValidate);
/**
* 分类新增
@ -73,7 +74,7 @@ public interface IAlbumsService {
* @author fzr
* @param cateValidate 分类参数
*/
void cateAdd(AlbumCateValidate cateValidate);
void cateAdd(FileCateValidate cateValidate);
/**
* 分类编辑

View File

@ -1,307 +0,0 @@
package com.mdd.admin.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mdd.admin.service.IAlbumsService;
import com.mdd.admin.validate.album.AlbumCateValidate;
import com.mdd.admin.validate.album.AlbumSearchValidate;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.vo.album.AlbumCateVo;
import com.mdd.admin.vo.album.AlbumVo;
import com.mdd.common.config.GlobalConfig;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.album.Album;
import com.mdd.common.entity.album.AlbumCate;
import com.mdd.common.mapper.album.AlbumCateMapper;
import com.mdd.common.mapper.album.AlbumMapper;
import com.mdd.common.util.*;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* 相册服务实现类
*/
@Service
public class AlbumsServiceImpl implements IAlbumsService {
@Resource
AlbumMapper albumMapper;
@Resource
AlbumCateMapper albumCateMapper;
/**
* 相册文件列表
*
* @author fzr
* @param pageValidate 分页参数
* @param searchValidate 搜索参数
* @return PageResult<AlbumVo>
*/
@Override
public PageResult<AlbumVo> albumList(PageValidate pageValidate, AlbumSearchValidate searchValidate) {
Integer page = pageValidate.getPageNo();
Integer limit = pageValidate.getPageSize();
QueryWrapper<Album> queryWrapper = new QueryWrapper<>();
queryWrapper.select(Album.class, info->
!info.getColumn().equals("type") &&
!info.getColumn().equals("aid") &&
!info.getColumn().equals("uid") &&
!info.getColumn().equals("is_delete") &&
!info.getColumn().equals("delete_time"))
.eq("is_delete", 0)
.orderByDesc("id");
if (StringUtils.isNotNull(searchValidate.getCid())) {
queryWrapper.eq("cid", searchValidate.getCid());
}
albumMapper.setSearch(queryWrapper, searchValidate, new String[]{
"=:type:int",
"like:keyword@name:str"
});
IPage<Album> iPage = albumMapper.selectPage(new Page<>(page, limit), queryWrapper);
String engine = ConfigUtils.get("storage", "default", "local");
engine = engine.equals("") ? "local" : engine;
List<AlbumVo> list = new ArrayList<>();
for (Album album : iPage.getRecords()) {
AlbumVo vo = new AlbumVo();
BeanUtils.copyProperties(album, vo);
if (engine.equals("local")) {
vo.setPath(GlobalConfig.publicPrefix + "/" + album.getUri());
} else {
vo.setPath(album.getUri());
}
vo.setUri(UrlUtils.toAbsoluteUrl(album.getUri()));
vo.setSize(ToolUtils.storageUnit(album.getSize()));
vo.setCreateTime(TimeUtils.timestampToDate(album.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(album.getUpdateTime()));
list.add(vo);
}
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), list);
}
/**
* 相册文件重命名
*
* @author fzr
* @param id 文件ID
* @param name 文件名称
*/
@Override
public void albumRename(Integer id, String name) {
Album album = albumMapper.selectOne(new QueryWrapper<Album>()
.select("id", "name")
.eq("id", id)
.eq("is_delete", 0));
Assert.notNull(album, "文件丢失!");
album.setName(name);
album.setUpdateTime(System.currentTimeMillis() / 1000);
albumMapper.updateById(album);
}
/**
* 相册文件移动
*
* @author fzr
* @param ids 文件ID
* @param cid 类目ID
*/
@Override
public void albumMove(List<Integer> ids, Integer cid) {
List<Album> albums = albumMapper.selectList(new QueryWrapper<Album>()
.select("id", "name")
.in("id", ids)
.eq("is_delete", 0));
Assert.notNull(albums, "文件丢失!");
if (cid > 0) {
Assert.notNull(albumCateMapper.selectOne(
new QueryWrapper<AlbumCate>()
.eq("id", cid)
.eq("is_delete", 0)
), "类目已不存在!");
}
for (Album album : albums) {
album.setCid(cid);
album.setUpdateTime(System.currentTimeMillis() / 1000);
albumMapper.updateById(album);
}
}
/**
* 相册文件新增
*
* @author fzr
* @param params 文件信息参数
*/
@Override
public Integer albumAdd(Map<String, String> params) {
String name = params.get("name");
if (name.length() >= 100) {
name = name.substring(0, 99);
}
Album album = new Album();
album.setCid(Integer.parseInt(params.get("cid") == null ? "0" : params.get("cid")));
album.setAid(Integer.parseInt(params.get("aid") == null ? "0" : params.get("aid")));
album.setUid(Integer.parseInt(params.get("uid") == null ? "0" : params.get("uid")));
album.setType(Integer.parseInt(params.get("type")));
album.setName(name);
album.setExt(params.get("ext"));
album.setUri(params.get("url"));
album.setSize(Long.parseLong(params.get("size")));
album.setCreateTime(System.currentTimeMillis() / 1000);
album.setUpdateTime(System.currentTimeMillis() / 1000);
albumMapper.insert(album);
return album.getId();
}
/**
* 相册文件删除
*
* @author fzr
* @param ids 文件ID
*/
@Override
public void albumDel(List<Integer> ids) {
List<Album> albums = albumMapper.selectList(new QueryWrapper<Album>()
.select("id", "name")
.in("id", ids)
.eq("is_delete", 0));
Assert.notNull(albums, "文件丢失!");
for (Album album : albums) {
album.setIsDelete(1);
album.setDeleteTime(System.currentTimeMillis() / 1000);
albumMapper.updateById(album);
}
}
/**
* 相册分类列表
*
* @param searchValidate 搜索参数
* @return JSONArray
*/
@Override
public JSONArray cateList(AlbumSearchValidate searchValidate) {
QueryWrapper<AlbumCate> queryWrapper = new QueryWrapper<>();
queryWrapper.select(AlbumCate.class, info->
!info.getColumn().equals("is_delete") &&
!info.getColumn().equals("delete_time"))
.eq("is_delete", 0)
.orderByDesc("id");
if (StringUtils.isNotNull(searchValidate.getType()) && searchValidate.getType() > 0) {
queryWrapper.eq("type", searchValidate.getType());
}
if (StringUtils.isNotNull(searchValidate.getKeyword()) && StringUtils.isNotEmpty(searchValidate.getKeyword())) {
queryWrapper.like("name", searchValidate.getKeyword());
}
List<AlbumCate> albumCateList = albumCateMapper.selectList(queryWrapper);
List<AlbumCateVo> lists = new LinkedList<>();
for (AlbumCate albumCate : albumCateList) {
AlbumCateVo vo = new AlbumCateVo();
BeanUtils.copyProperties(albumCate, vo);
vo.setCreateTime(TimeUtils.timestampToDate(albumCate.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(albumCate.getUpdateTime()));
lists.add(vo);
}
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(lists));
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
}
/**
* 分类新增
*
* @author fzr
* @param cateValidate 分类参数
*/
@Override
public void cateAdd(AlbumCateValidate cateValidate) {
AlbumCate albumCate = new AlbumCate();
albumCate.setType(cateValidate.getType());
albumCate.setPid(cateValidate.getPid());
albumCate.setName(cateValidate.getName());
albumCate.setCreateTime(System.currentTimeMillis() / 1000);
albumCate.setUpdateTime(System.currentTimeMillis() / 1000);
albumCateMapper.insert(albumCate);
}
/**
* 分类重命名
*
* @author fzr
* @param id 分类ID
* @param name 分类名称
*/
@Override
public void cateRename(Integer id, String name) {
AlbumCate albumCate = albumCateMapper.selectOne(
new QueryWrapper<AlbumCate>()
.select("id", "name")
.eq("id", id)
.eq("is_delete", 0));
Assert.notNull(albumCate, "分类已不存在!");
albumCate.setName(name);
albumCate.setUpdateTime(System.currentTimeMillis() / 1000);
albumCateMapper.updateById(albumCate);
}
/**
* 分类删除
*
* @author fzr
* @param id 分类ID
*/
@Override
public void cateDel(Integer id) {
AlbumCate albumCate = albumCateMapper.selectOne(
new QueryWrapper<AlbumCate>()
.select("id", "name")
.eq("id", id)
.eq("is_delete", 0));
Assert.notNull(albumCate, "分类已不存在!");
Assert.isNull(albumMapper.selectOne(new QueryWrapper<Album>()
.select("id", "cid", "name")
.eq("cid", id)
.eq("is_delete", 0)
.last("limit 1")
), "当前分类正被使用中,不能删除!");
albumCate.setIsDelete(1);
albumCate.setDeleteTime(System.currentTimeMillis() / 1000);
albumCateMapper.updateById(albumCate);
}
}

View File

@ -73,8 +73,8 @@ public class ArtCateServiceImpl implements IArtCateService {
*/
@Override
public PageResult<ArticleCateVo> list(PageValidate pageValidate, ArtCateSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<ArticleCate> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id", "name", "sort", "is_show", "create_time", "update_time")
@ -97,7 +97,7 @@ public class ArtCateServiceImpl implements IArtCateService {
.eq("cid", category.getId())
.isNull("delete_time"));
vo.setNumber(number);
vo.setArticleCount(number);
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(vo.getUpdateTime()));
list.add(vo);

View File

@ -49,20 +49,20 @@ public class ArticleServiceImpl implements IArticleService {
*/
@Override
public PageResult<ArticleListedVo> list(PageValidate pageValidate, ArticleSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
MPJQueryWrapper<Article> mpjQueryWrapper = new MPJQueryWrapper<Article>()
.selectAll(Article.class)
.select("ac.name as category")
.innerJoin("?_article_category ac ON ac.id=t.cid".replace("?_", GlobalConfig.tablePrefix))
.eq("t.is_delete", 0)
.select("ac.name as cateName")
.innerJoin("?_article_cate ac ON ac.id=t.cid".replace("?_", GlobalConfig.tablePrefix))
.isNull("t.delete_time")
.orderByDesc(Arrays.asList("t.sort", "t.id"));
articleMapper.setSearch(mpjQueryWrapper, searchValidate, new String[]{
"like:title@t.title:str",
"=:cid@t.cid:int",
"=:isShow@t.is_show:int",
"=:is_show@t.is_show:int",
"datetime:startTime-endTime@t.create_time:str"
});
@ -73,6 +73,15 @@ public class ArticleServiceImpl implements IArticleService {
for (ArticleListedVo vo : iPage.getRecords()) {
vo.setImage(UrlUtils.toAbsoluteUrl(vo.getImage()));
Integer clickActual = vo.getClickActual() != null ? vo.getClickActual() : 0;
Integer clickVirtual = vo.getClickVirtual() != null ? vo.getClickVirtual() : 0;
Integer click = clickActual + clickVirtual;
vo.setClick(click);
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(vo.getUpdateTime()));
}
@ -91,10 +100,9 @@ public class ArticleServiceImpl implements IArticleService {
Article model = articleMapper.selectOne(
new QueryWrapper<Article>()
.select(Article.class, info->
!info.getColumn().equals("is_delete") &&
!info.getColumn().equals("delete_time"))
.eq("id", id)
.eq("is_delete", 0));
.isNull("delete_time"));
Assert.notNull(model, "文章不存在");
@ -124,6 +132,9 @@ public class ArticleServiceImpl implements IArticleService {
model.setSort(createValidate.getSort());
model.setIsShow(createValidate.getIsShow());
model.setAuthor(createValidate.getAuthor());
model.setAbstractField(createValidate.getAbstractFied());
model.setDesc(createValidate.getDesc());
model.setCreateTime(TimeUtils.timestamp());
model.setUpdateTime(TimeUtils.timestamp());
articleMapper.insert(model);
@ -140,7 +151,7 @@ public class ArticleServiceImpl implements IArticleService {
Article model = articleMapper.selectOne(
new QueryWrapper<Article>()
.eq("id", updateValidate.getId())
.eq("is_delete", 0));
.isNull("delete_time"));
Assert.notNull(model, "文章不存在!");
@ -156,6 +167,8 @@ public class ArticleServiceImpl implements IArticleService {
model.setIsShow(updateValidate.getIsShow());
model.setAuthor(updateValidate.getAuthor());
model.setSort(updateValidate.getSort());
model.setAbstractField(updateValidate.getAbstractFied());
model.setDesc(updateValidate.getDesc());
model.setUpdateTime(TimeUtils.timestamp());
articleMapper.updateById(model);
}
@ -170,9 +183,9 @@ public class ArticleServiceImpl implements IArticleService {
public void del(Integer id) {
Article article = articleMapper.selectOne(
new QueryWrapper<Article>()
.select("id,is_show")
.select("id, is_show")
.eq("id", id)
.eq("is_delete", 0));
.isNull("delete_time"));
Assert.notNull(article, "文章不存在!");
article.setDeleteTime(TimeUtils.timestamp());
@ -189,13 +202,13 @@ public class ArticleServiceImpl implements IArticleService {
public void change(Integer id) {
Article article = articleMapper.selectOne(
new QueryWrapper<Article>()
.select("id,is_show")
.select("id, is_show")
.eq("id", id)
.eq("is_delete", 0));
.isNull("delete_time"));
Assert.notNull(article, "文章不存在!");
article.setIsShow(article.getIsShow()==0?1:0);
article.setIsShow(article.getIsShow() == 0 ? 1:0);
article.setUpdateTime(TimeUtils.timestamp());
articleMapper.updateById(article);
}

View File

@ -36,8 +36,8 @@ public class ChannelOaReplyDefaultServiceImpl implements IChannelOaReplyDefaultS
*/
@Override
public PageResult<ChannelRpDefaultVo> list(PageValidate pageValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
IPage<OfficialReply> iPage = officialReplyMapper.selectPage(new Page<>(pageNo, pageSize),
new QueryWrapper<OfficialReply>()

View File

@ -38,8 +38,8 @@ public class ChannelOaReplyFollowServiceImpl implements IChannelOaReplyFollowSer
*/
@Override
public PageResult<ChannelRpFollowsVo> list(PageValidate pageValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<OfficialReply> queryWrapper = new QueryWrapper<>();
queryWrapper

View File

@ -38,8 +38,8 @@ public class ChannelOaReplyKeywordServiceImpl implements IChannelOaReplyKeywordS
*/
@Override
public PageResult<ChannelRpKeywordVo> list(PageValidate pageValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
IPage<OfficialReply> iPage = officialReplyMapper.selectPage(new Page<>(pageNo, pageSize),
new QueryWrapper<OfficialReply>()

View File

@ -61,8 +61,8 @@ public class CrontabServiceImpl implements ICrontabService {
*/
@Override
public PageResult<CrontabListedVo> list(PageValidate pageValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
IPage<Crontab> iPage = crontabMapper.selectPage(new Page<>(pageNo, pageSize),
new QueryWrapper<Crontab>()

View File

@ -0,0 +1,300 @@
package com.mdd.admin.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mdd.admin.service.IFileService;
import com.mdd.admin.validate.file.FileCateValidate;
import com.mdd.admin.validate.file.FileSearchValidate;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.vo.album.FileCateVo;
import com.mdd.admin.vo.album.FileVo;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.file.File;
import com.mdd.common.entity.file.FileCate;
import com.mdd.common.mapper.album.FileCateMapper;
import com.mdd.common.mapper.album.FileMapper;
import com.mdd.common.util.*;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* 文件服务实现类
*/
@Service
public class FileServiceImpl implements IFileService {
@Resource
FileMapper fileMapper;
@Resource
FileCateMapper fileCateMapper;
/**
* 相册文件列表
*
* @author fzr
* @param pageValidate 分页参数
* @param searchValidate 搜索参数
* @return PageResult<AlbumVo>
*/
@Override
public PageResult<FileVo> fileList(PageValidate pageValidate, FileSearchValidate searchValidate) {
Integer page = pageValidate.getPage_no();
Integer limit = pageValidate.getPage_size();
QueryWrapper<File> queryWrapper = new QueryWrapper<>();
queryWrapper.select(File.class, info->
!info.getColumn().equals("type") &&
!info.getColumn().equals("aid") &&
!info.getColumn().equals("uid") &&
!info.getColumn().equals("delete_time"))
.isNull("delete_time")
.orderByDesc("id");
if (StringUtils.isNotNull(searchValidate.getCid())) {
queryWrapper.eq("cid", searchValidate.getCid());
}
fileMapper.setSearch(queryWrapper, searchValidate, new String[]{
"=:type:int",
"like:name@name:str",
"=:source:int"
});
IPage<File> iPage = fileMapper.selectPage(new Page<>(page, limit), queryWrapper);
// String engine = ConfigUtils.get("storage", "default", "local");
// engine = engine.equals("") ? "local" : engine;
List<FileVo> list = new ArrayList<>();
for (File file : iPage.getRecords()) {
FileVo vo = new FileVo();
BeanUtils.copyProperties(file, vo);
vo.setUrl(UrlUtils.toAbsoluteUrl(file.getUri()));
vo.setUri(file.getUri());
vo.setCreateTime(TimeUtils.timestampToDate(file.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(file.getUpdateTime()));
list.add(vo);
}
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), list);
}
/**
* 文件重命名
*
* @author fzr
* @param id 文件ID
* @param name 文件名称
*/
@Override
public void fileRename(Integer id, String name) {
File file = fileMapper.selectOne(new QueryWrapper<File>()
.select("id", "name")
.eq("id", id)
.isNull("delete_time"));
Assert.notNull(file, "文件丢失!");
file.setName(name);
file.setUpdateTime(System.currentTimeMillis() / 1000);
fileMapper.updateById(file);
}
/**
* 文件移动
*
* @author fzr
* @param ids 文件ID
* @param cid 类目ID
*/
@Override
public void fileMove(List<Integer> ids, Integer cid) {
List<File> files = fileMapper.selectList(new QueryWrapper<File>()
.select("id", "name")
.in("id", ids)
.isNull("delete_time"));
Assert.notNull(files, "文件丢失!");
if (cid > 0) {
Assert.notNull(fileCateMapper.selectOne(
new QueryWrapper<FileCate>()
.eq("id", cid)
.isNull("delete_time")
), "类目已不存在!");
}
for (File file : files) {
file.setCid(cid);
file.setUpdateTime(System.currentTimeMillis() / 1000);
fileMapper.updateById(file);
}
}
/**
* 文件新增
*
* @author fzr
* @param params 文件信息参数
*/
@Override
public Integer fileAdd(Map<String, String> params) {
String name = params.get("name");
if (name.length() >= 100) {
name = name.substring(0, 99);
}
File album = new File();
album.setCid(Integer.parseInt(params.get("cid") == null ? "0" : params.get("cid")));
album.setSourceId(Integer.parseInt(params.get("uid") == null ? "0" : params.get("uid")));
album.setType(Integer.parseInt(params.get("type")));
album.setName(name);
album.setUri(params.get("url"));
album.setCreateTime(System.currentTimeMillis() / 1000);
album.setUpdateTime(System.currentTimeMillis() / 1000);
fileMapper.insert(album);
return album.getId();
}
/**
* 相册文件删除
*
* @author fzr
* @param ids 文件ID
*/
@Override
public void fileDel(List<Integer> ids) {
List<File> files = fileMapper.selectList(new QueryWrapper<File>()
.select("id", "name")
.in("id", ids)
.isNull("delete_time"));
Assert.notNull(files, "文件丢失!");
for (File file : files) {
file.setDeleteTime(System.currentTimeMillis() / 1000);
fileMapper.updateById(file);
}
}
/**
* 相册分类列表
*
* @param searchValidate 搜索参数
* @return JSONArray
*/
@Override
public JSONObject cateList(FileSearchValidate searchValidate) {
QueryWrapper<FileCate> queryWrapper = new QueryWrapper<>();
queryWrapper.select(FileCate.class, info->
!info.getColumn().equals("delete_time"))
.isNull("delete_time")
.orderByDesc("id");
if (StringUtils.isNotNull(searchValidate.getType()) && searchValidate.getType() > 0) {
queryWrapper.eq("type", searchValidate.getType());
}
if (StringUtils.isNotNull(searchValidate.getName()) && StringUtils.isNotEmpty(searchValidate.getName())) {
queryWrapper.like("name", searchValidate.getName());
}
List<FileCate> fileCateList = fileCateMapper.selectList(queryWrapper);
List<FileCateVo> lists = new LinkedList<>();
for (FileCate fileCate : fileCateList) {
FileCateVo vo = new FileCateVo();
BeanUtils.copyProperties(fileCate, vo);
vo.setCreateTime(TimeUtils.timestampToDate(fileCate.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(fileCate.getUpdateTime()));
lists.add(vo);
}
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(lists));
JSONObject result = new JSONObject();
result.put("lists", ListUtils.listToTree(jsonArray, "id", "pid", "children"));
return result;
}
/**
* 分类新增
*
* @author fzr
* @param cateValidate 分类参数
*/
@Override
public void cateAdd(FileCateValidate cateValidate) {
FileCate albumCate = new FileCate();
albumCate.setType(cateValidate.getType());
albumCate.setPid(cateValidate.getPid());
albumCate.setName(cateValidate.getName());
albumCate.setCreateTime(System.currentTimeMillis() / 1000);
albumCate.setUpdateTime(System.currentTimeMillis() / 1000);
fileCateMapper.insert(albumCate);
}
/**
* 分类重命名
*
* @author fzr
* @param id 分类ID
* @param name 分类名称
*/
@Override
public void cateRename(Integer id, String name) {
FileCate fileCate = fileCateMapper.selectOne(
new QueryWrapper<FileCate>()
.select("id", "name")
.eq("id", id)
.isNull("delete_time"));
Assert.notNull(fileCate, "分类已不存在!");
fileCate.setName(name);
fileCate.setUpdateTime(System.currentTimeMillis() / 1000);
fileCateMapper.updateById(fileCate);
}
/**
* 分类删除
*
* @author fzr
* @param id 分类ID
*/
@Override
public void cateDel(Integer id) {
FileCate albumCate = fileCateMapper.selectOne(
new QueryWrapper<FileCate>()
.select("id", "name")
.eq("id", id)
.isNull("delete_time"));
Assert.notNull(albumCate, "分类已不存在!");
Assert.isNull(fileMapper.selectOne(new QueryWrapper<File>()
.select("id", "cid", "name")
.eq("cid", id)
.isNull("delete_time")
.last("limit 1")
), "当前分类正被使用中,不能删除!");
albumCate.setDeleteTime(System.currentTimeMillis() / 1000);
fileCateMapper.updateById(albumCate);
}
}

View File

@ -21,7 +21,7 @@ import com.mdd.common.exception.OperateException;
import com.mdd.common.mapper.RechargeOrderMapper;
import com.mdd.common.mapper.RefundLogMapper;
import com.mdd.common.mapper.RefundRecordMapper;
import com.mdd.common.mapper.log.LogMoneyMapper;
import com.mdd.common.mapper.log.UserAccountLogMapper;
import com.mdd.common.mapper.user.UserMapper;
import com.mdd.common.plugin.wechat.WxPayDriver;
import com.mdd.common.plugin.wechat.request.RefundRequestV3;
@ -50,7 +50,7 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
UserMapper userMapper;
@Resource
LogMoneyMapper logMoneyMapper;
UserAccountLogMapper logMoneyMapper;
@Resource
RefundRecordMapper refundRecordMapper;
@ -74,8 +74,8 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
*/
@Override
public PageResult<FinanceRechargeListVo> list(PageValidate pageValidate, FinanceRechargeSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
MPJQueryWrapper<RechargeOrder> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(RechargeOrder.class)

View File

@ -47,8 +47,8 @@ public class FinanceRefundServiceImpl implements IFinanceRefundService {
*/
@Override
public PageResult<FinanceRefundListVo> list(PageValidate pageValidate, FinanceRefundSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
MPJQueryWrapper<RefundRecord> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(RefundRecord.class)

View File

@ -9,9 +9,9 @@ import com.mdd.admin.validate.finance.FinanceWalletSearchValidate;
import com.mdd.admin.vo.finance.FinanceWalletListVo;
import com.mdd.common.config.GlobalConfig;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.log.LogMoney;
import com.mdd.common.entity.log.UserAccountLog;
import com.mdd.common.enums.LogMoneyEnum;
import com.mdd.common.mapper.log.LogMoneyMapper;
import com.mdd.common.mapper.log.UserAccountLogMapper;
import com.mdd.common.util.StringUtils;
import com.mdd.common.util.TimeUtils;
import com.mdd.common.util.UrlUtils;
@ -28,15 +28,15 @@ import java.util.Map;
public class FinanceWalletServiceImpl implements IFinanceWalletService {
@Resource
LogMoneyMapper logMoneyMapper;
UserAccountLogMapper logMoneyMapper;
@Override
public PageResult<FinanceWalletListVo> list(PageValidate pageValidate, FinanceWalletSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
MPJQueryWrapper<LogMoney> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(LogMoney.class)
MPJQueryWrapper<UserAccountLog> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(UserAccountLog.class)
.select("U.id as user_id,U.sn as user_sn,U.nickname,U.avatar")
.leftJoin("?_user U ON U.id=t.user_id".replace("?_", GlobalConfig.tablePrefix))
.orderByDesc("id");

View File

@ -26,8 +26,8 @@ public class MarketingRechargeServiceImpl implements IMarketingRechargeService {
Map<String, String> config = ConfigUtils.get("recharge");
MarketingRechargeVo vo = new MarketingRechargeVo();
vo.setOpenRecharge(Integer.parseInt(config.getOrDefault("openRecharge", "0")));
vo.setMinRechargeMoney(new BigDecimal(config.getOrDefault("minRechargeMoney", "0")));
vo.setStatus(Integer.parseInt(config.getOrDefault("status", "0")));
vo.setMinAmount(new BigDecimal(config.getOrDefault("min_amount", "0")));
return vo;
}
@ -39,8 +39,8 @@ public class MarketingRechargeServiceImpl implements IMarketingRechargeService {
*/
@Override
public void save(MarketingRechargeValidate rechargeValidate) {
ConfigUtils.set("recharge", "openRecharge", rechargeValidate.getOpenRecharge().toString());
ConfigUtils.set("recharge", "minRechargeMoney", rechargeValidate.getMinRechargeMoney().toString());
ConfigUtils.set("recharge", "status", rechargeValidate.getStatus().toString());
ConfigUtils.set("recharge", "min_amount", rechargeValidate.getMinAmount().toString());
}
}

View File

@ -87,8 +87,8 @@ public class SettingDictDataServiceImpl implements ISettingDictDataService {
*/
@Override
public PageResult<SettingDictDataVo> list(PageValidate pageValidate, Map<String, String> params) {
Integer page = pageValidate.getPageNo();
Integer limit = pageValidate.getPageSize();
Integer page = pageValidate.getPage_no();
Integer limit = pageValidate.getPage_size();
DictType dictType = dictTypeMapper.selectOne(new QueryWrapper<DictType>()
.eq("is_delete", 0)

View File

@ -68,8 +68,8 @@ public class SettingDictTypeServiceImpl implements ISettingDictTypeService {
*/
@Override
public PageResult<SettingDictTypeVo> list(PageValidate pageValidate, Map<String, String> params) {
Integer page = pageValidate.getPageNo();
Integer limit = pageValidate.getPageSize();
Integer page = pageValidate.getPage_no();
Integer limit = pageValidate.getPage_size();
QueryWrapper<DictType> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id,dict_name,dict_type,dict_remark,dict_status,create_time,update_time");

View File

@ -15,7 +15,7 @@ import com.mdd.common.entity.user.User;
import com.mdd.common.enums.ClientEnum;
import com.mdd.common.enums.LogMoneyEnum;
import com.mdd.common.exception.OperateException;
import com.mdd.common.mapper.log.LogMoneyMapper;
import com.mdd.common.mapper.log.UserAccountLogMapper;
import com.mdd.common.mapper.user.UserMapper;
import com.mdd.common.util.StringUtils;
import com.mdd.common.util.TimeUtils;
@ -40,7 +40,7 @@ public class UserServiceImpl implements IUserService {
UserMapper userMapper;
@Resource
LogMoneyMapper logMoneyMapper;
UserAccountLogMapper logMoneyMapper;
/**
* 用户列表
@ -52,8 +52,8 @@ public class UserServiceImpl implements IUserService {
*/
@Override
public PageResult<UserVo> list(PageValidate pageValidate, UserSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.isNull("delete_time");
@ -205,7 +205,7 @@ public class UserServiceImpl implements IUserService {
public void adjustWallet(UserWalletValidate userWalletValidate) {
User user = userMapper.selectOne(new QueryWrapper<User>()
.eq("id", userWalletValidate.getUserId())
.eq("is_delete", 0)
.isNull("delete_time")
.last("limit 1"));
Assert.notNull(user,"用户不存在!");
@ -215,7 +215,7 @@ public class UserServiceImpl implements IUserService {
BigDecimal surplusAmount;
int changeType;
if(userWalletValidate.getAction().equals(0) ){
if(userWalletValidate.getAction().equals(2) ){
surplusAmount = userMoney.subtract(amount);
if(surplusAmount.compareTo(BigDecimal.ZERO) < 0){
throw new OperateException("用户余额仅剩:"+ userMoney);

View File

@ -72,8 +72,8 @@ public class AdminServiceImpl implements IAdminService {
*/
@Override
public PageResult<SystemAuthAdminListedVo> list(PageValidate pageValidate, SystemAdminSearchValidate searchValidate) {
Integer page = pageValidate.getPageNo();
Integer limit = pageValidate.getPageSize();
Integer page = pageValidate.getPage_no();
Integer limit = pageValidate.getPage_size();
MPJQueryWrapper<Admin> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.select("t.id,t.username,t.nickname,t.avatar," +

View File

@ -47,8 +47,8 @@ public class SystemLogsServerImpl implements ISystemLogsServer {
*/
@Override
public PageResult<SystemLogOperateVo> operate(PageValidate pageValidate, SystemSearchOperateValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
MPJQueryWrapper<SystemLogOperate> mpjQueryWrapper = new MPJQueryWrapper<SystemLogOperate>()
.selectAll(SystemLogOperate.class)
@ -92,8 +92,8 @@ public class SystemLogsServerImpl implements ISystemLogsServer {
*/
@Override
public PageResult<SystemLogLoginVo> login(PageValidate pageValidate, SystemSearchLoginsValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<SystemLogLogin> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByDesc("id");

View File

@ -84,8 +84,8 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
*/
@Override
public PageResult<SystemAuthRoleVo> list(@Validated PageValidate pageValidate) {
Integer page = pageValidate.getPageNo();
Integer limit = pageValidate.getPageSize();
Integer page = pageValidate.getPage_no();
Integer limit = pageValidate.getPage_size();
QueryWrapper<SystemRole> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));

View File

@ -1,5 +1,6 @@
package com.mdd.admin.validate.article;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import io.swagger.annotations.ApiModel;
@ -29,7 +30,8 @@ public class ArticleCreateValidate implements Serializable {
@Length(max = 200, message = "简介不能超出200个字符")
@ApiModelProperty(value = "文章简介")
private String intro = "";
@JsonProperty("abstract")
private String abstractFied = "";
@Length(max = 200, message = "图片链接过长不能超200个字符")
@ApiModelProperty(value = "封面图片")
@ -53,10 +55,10 @@ public class ArticleCreateValidate implements Serializable {
private String content = "";
@ApiModelProperty(value = "文章描述")
private String summary = "";
private String desc = "";
@DecimalMin(value = "0", message = "初始浏览量不能少于0")
@ApiModelProperty(value = "浏览")
private Integer visit = 0;
@ApiModelProperty(value = "初始浏览量")
private Integer click_virtual = 0;
}

View File

@ -19,7 +19,7 @@ public class ArticleSearchValidate implements Serializable {
private Integer cid;
@ApiModelProperty(value = "是否显示")
private Integer isShow;
private Integer is_show;
@ApiModelProperty(value = "开始时间")
private String startTime;

View File

@ -1,5 +1,6 @@
package com.mdd.admin.validate.article;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import io.swagger.annotations.ApiModel;
@ -33,7 +34,8 @@ public class ArticleUpdateValidate implements Serializable {
@Length(max = 200, message = "简介不能超出200个字符")
@ApiModelProperty(value = "文章简介")
private String intro = "";
@JsonProperty("abstract")
private String abstractFied = "";
@Length(max = 200, message = "图片链接过长不能超200个字符")
@ApiModelProperty(value = "封面图片")
@ -57,10 +59,10 @@ public class ArticleUpdateValidate implements Serializable {
private String content = "";
@ApiModelProperty(value = "文章描述")
private String summary = "";
private String desc = "";
@DecimalMin(value = "0", message = "初始浏览量不能少于0")
@ApiModelProperty(value = "浏览")
private Integer visit = 0;
@ApiModelProperty(value = "初始浏览量")
private Integer click_virtual = 0;
}

View File

@ -15,11 +15,11 @@ public class PageValidate implements Serializable {
// 当前分页
@DecimalMin(value = "1", message = "pageNo参数必须大于0的数字")
public Integer pageNo = 1;
public Integer page_no = 1;
// 每页条数
@DecimalMin(value = "1", message = "pageSize参数必须是大于0的数字")
@DecimalMax(value = "60", message = "pageSize参数必须是小于60的数字")
private Integer pageSize = 20;
private Integer page_size = 20;
}

View File

@ -1,4 +1,4 @@
package com.mdd.admin.validate.album;
package com.mdd.admin.validate.file;
import com.mdd.common.validator.annotation.IntegerContains;
import io.swagger.annotations.ApiModel;
@ -13,7 +13,7 @@ import java.io.Serializable;
@Data
@ApiModel("附件分类参数")
public class AlbumCateValidate implements Serializable {
public class FileCateValidate implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -1,4 +1,4 @@
package com.mdd.admin.validate.album;
package com.mdd.admin.validate.file;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -10,7 +10,7 @@ import java.util.List;
@Data
@ApiModel("附件移动参数")
public class AlbumMoveValidate implements Serializable {
public class FileMoveValidate implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -1,4 +1,4 @@
package com.mdd.admin.validate.album;
package com.mdd.admin.validate.file;
import com.mdd.common.validator.annotation.IDMust;
import io.swagger.annotations.ApiModel;
@ -10,7 +10,7 @@ import java.io.Serializable;
@Data
@ApiModel("附件重命名参数")
public class AlbumRenameValidate implements Serializable {
public class FileRenameValidate implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -1,4 +1,4 @@
package com.mdd.admin.validate.album;
package com.mdd.admin.validate.file;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -8,7 +8,7 @@ import java.io.Serializable;
@Data
@ApiModel("附件搜索参数")
public class AlbumSearchValidate implements Serializable {
public class FileSearchValidate implements Serializable {
private static final long serialVersionUID = 1L;
@ -18,7 +18,10 @@ public class AlbumSearchValidate implements Serializable {
@ApiModelProperty(value = "类型")
private Integer type;
@ApiModelProperty(value = "来源")
private Integer source;
@ApiModelProperty(value = "关键词")
private String keyword;
private String name;
}

View File

@ -14,12 +14,12 @@ public class MarketingRechargeValidate implements Serializable {
private static final long serialVersionUID = 1L;
@NotNull(message = "openRecharge参数缺失")
@NotNull(message = "status参数缺失")
@ApiModelProperty("是否开启充值: 0=否,1=是")
private Integer openRecharge;
private Integer status;
@NotNull(message = "minRechargeMoney参数缺失")
@ApiModelProperty("最低充值金额")
private BigDecimal minRechargeMoney;
private BigDecimal minAmount;
}

View File

@ -18,7 +18,7 @@ public class UserWalletValidate implements Serializable {
private Integer userId;
@NotNull(message = "请输入变动类型")
@IntegerContains(values = {0,1}, message = "变动类型错误")
@IntegerContains(values = {2,1}, message = "变动类型错误")
private Integer action;
@NotNull(message = "请输入变动金额")

View File

@ -7,8 +7,8 @@ import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("相册分类Vo")
public class AlbumCateVo implements Serializable {
@ApiModel("文件分类Vo")
public class FileCateVo implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -7,8 +7,8 @@ import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("相册Vo")
public class AlbumVo implements Serializable {
@ApiModel("文件Vo")
public class FileVo implements Serializable {
private static final long serialVersionUID = 1L;
@ -18,21 +18,18 @@ public class AlbumVo implements Serializable {
@ApiModelProperty(value = "所属类目")
private Integer cid;
@ApiModelProperty(value = "类型")
private Integer type;
@ApiModelProperty(value = "文件名称")
private String name;
@ApiModelProperty(value = "相对路径")
private String path;
@ApiModelProperty(value = "文件路径")
private String url;
@ApiModelProperty(value = "相对路径")
private String uri;
@ApiModelProperty(value = "文件扩展")
private String ext;
@ApiModelProperty(value = "文件大小")
private String size;
@ApiModelProperty(value = "创建时间")
private String createTime;

View File

@ -19,7 +19,7 @@ public class ArticleCateVo implements Serializable {
private String name;
@ApiModelProperty(value = "文章数量")
private Long number;
private Long articleCount;
@ApiModelProperty(value = "排序编号")
private Integer sort;

View File

@ -1,5 +1,7 @@
package com.mdd.admin.vo.article;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -24,24 +26,32 @@ public class ArticleDetailVo implements Serializable {
@ApiModelProperty(value = "图片")
private String image;
@ApiModelProperty(value = "简介")
private String intro;
@ApiModelProperty(value = "摘要")
private String summary;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "作者")
private String author;
@ApiModelProperty("简介")
@TableField(value = "`desc`")
private String desc;
@ApiModelProperty("摘要")
@JsonProperty("abstract")
private String abstractField;
@ApiModelProperty(value = "访问")
private Integer visit;
private Integer click;
@ApiModelProperty("内容")
private String content;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty("虚拟浏览量")
private Integer clickVirtual;
@ApiModelProperty("实际浏览量")
private Integer clickActual;
@ApiModelProperty(value = "是否显示")
private Integer isShow;

View File

@ -1,5 +1,7 @@
package com.mdd.admin.vo.article;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -16,7 +18,7 @@ public class ArticleListedVo implements Serializable {
private Integer id;
@ApiModelProperty(value = "分类")
private String category;
private String cateName;
@ApiModelProperty(value = "标题")
private String title;
@ -27,12 +29,29 @@ public class ArticleListedVo implements Serializable {
@ApiModelProperty(value = "作者")
private String author;
@ApiModelProperty("简介")
@TableField(value = "`desc`")
private String desc;
@ApiModelProperty("摘要")
@JsonProperty("abstract")
private String abstractField;
@ApiModelProperty(value = "访问")
private Integer visit;
private Integer click;
@ApiModelProperty("内容")
private String content;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty("虚拟浏览量")
private Integer clickVirtual;
@ApiModelProperty("实际浏览量")
private Integer clickActual;
@ApiModelProperty(value = "是否显示")
private Integer isShow;

View File

@ -14,9 +14,9 @@ public class MarketingRechargeVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("是否开启充值: 0=否,1=是")
private Integer openRecharge;
private Integer status;
@ApiModelProperty("最低充值金额")
private BigDecimal minRechargeMoney;
private BigDecimal minAmount;
}

View File

@ -14,10 +14,10 @@ public class PageResult<T> {
private Long count;
/** 当前页码 **/
private Integer pageNo;
private Integer page_no;
/** 每页条数 **/
private Integer pageSize;
private Integer page_size;
/** 扩展字段 **/
private Map<String, Object> extend;
@ -37,8 +37,8 @@ public class PageResult<T> {
PageResult<T> pageResult = new PageResult<>();
PageInfo<T> pageInfo = new PageInfo<>(list);
pageResult.setCount(pageInfo.getTotal());
pageResult.setPageNo(pageInfo.getPageNum());
pageResult.setPageSize(pageInfo.getPageSize());
pageResult.setPage_no(pageInfo.getPageNum());
pageResult.setPage_size(pageInfo.getPageSize());
pageResult.setLists(pageInfo.getList());
return pageResult;
}
@ -55,8 +55,8 @@ public class PageResult<T> {
PageResult<T> pageResult = new PageResult<>();
PageInfo<T> pageInfo = new PageInfo<>(list);
pageResult.setCount(pageInfo.getTotal());
pageResult.setPageSize(pageInfo.getPageSize());
pageResult.setPageNo(pageInfo.getPageNum());
pageResult.setPage_no(pageInfo.getPageSize());
pageResult.setPage_size(pageInfo.getPageNum());
pageResult.setLists(data);
return pageResult;
}
@ -72,8 +72,8 @@ public class PageResult<T> {
public static <T> PageResult<T> iPageHandle(IPage<T> iPage) {
PageResult<T> pageResult = new PageResult<>();
pageResult.setCount(iPage.getTotal());
pageResult.setPageNo((int) iPage.getCurrent());
pageResult.setPageSize((int) iPage.getSize());
pageResult.setPage_no((int) iPage.getCurrent());
pageResult.setPage_size((int) iPage.getSize());
pageResult.setLists(iPage.getRecords());
return pageResult;
}
@ -92,8 +92,8 @@ public class PageResult<T> {
public static <T> PageResult<T> iPageHandle(Long total, Long pageNo, Long size, List<T> list) {
PageResult<T> pageResult = new PageResult<>();
pageResult.setCount(total);
pageResult.setPageNo(Math.toIntExact(pageNo));
pageResult.setPageSize(Math.toIntExact(size));
pageResult.setPage_no(Math.toIntExact(pageNo));
pageResult.setPage_size(Math.toIntExact(size));
pageResult.setLists(list);
return pageResult;
}
@ -112,8 +112,8 @@ public class PageResult<T> {
public static <T> PageResult<T> iPageHandle(Long total, Long pageNo, Long size, List<T> list, Map<String,Object> extend) {
PageResult<T> pageResult = new PageResult<>();
pageResult.setCount(total);
pageResult.setPageNo(Math.toIntExact(pageNo));
pageResult.setPageSize(Math.toIntExact(size));
pageResult.setPage_no(Math.toIntExact(pageNo));
pageResult.setPage_size(Math.toIntExact(size));
pageResult.setLists(list);
pageResult.setExtend(extend);
return pageResult;

View File

@ -1,4 +1,4 @@
package com.mdd.common.entity.album;
package com.mdd.common.entity.file;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
@ -9,8 +9,8 @@ import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("相册实体")
public class Album implements Serializable {
@ApiModel("文件实体")
public class File implements Serializable {
private static final long serialVersionUID = 1L;
@ -21,11 +21,8 @@ public class Album implements Serializable {
@ApiModelProperty("类目ID")
private Integer cid;
@ApiModelProperty("管理ID")
private Integer aid;
@ApiModelProperty("用户ID")
private Integer uid;
@ApiModelProperty("上传者id")
private Integer sourceId;
@ApiModelProperty("文件类型: [10=图片, 20=视频]")
private Integer type;
@ -36,15 +33,6 @@ public class Album implements Serializable {
@ApiModelProperty("文件路径")
private String uri;
@ApiModelProperty("文件扩展")
private String ext;
@ApiModelProperty("文件大小")
private Long size;
@ApiModelProperty("是否删除: [0=否, 1=是]")
private Integer isDelete;
@ApiModelProperty("创建时间")
private Long createTime;

View File

@ -1,4 +1,4 @@
package com.mdd.common.entity.album;
package com.mdd.common.entity.file;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
@ -9,8 +9,8 @@ import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("相册分类实体")
public class AlbumCate implements Serializable {
@ApiModel("文件分类实体")
public class FileCate implements Serializable {
private static final long serialVersionUID = 1L;
@ -27,9 +27,6 @@ public class AlbumCate implements Serializable {
@ApiModelProperty("分类名称")
private String name;
@ApiModelProperty("是否删除: [0=否,1=是]")
private Integer isDelete;
@ApiModelProperty("创建时间")
private Long createTime;

View File

@ -10,7 +10,7 @@ import java.math.BigDecimal;
@Data
@ApiModel("账户变动实体")
public class LogMoney {
public class UserAccountLog {
@TableId(value="id", type= IdType.AUTO)
@ApiModelProperty("主键")
@ -22,8 +22,8 @@ public class LogMoney {
@ApiModelProperty("用户ID")
private Integer userId;
@ApiModelProperty("关联ID")
private Integer sourceId;
@ApiModelProperty("变动对象")
private Integer changeObject;
@ApiModelProperty("关联单号")
private String sourceSn;

View File

@ -1,12 +1,12 @@
package com.mdd.common.mapper.album;
import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.album.AlbumCate;
import com.mdd.common.entity.file.FileCate;
import org.apache.ibatis.annotations.Mapper;
/**
* 相册分类
*/
@Mapper
public interface AlbumCateMapper extends IBaseMapper<AlbumCate> {
public interface FileCateMapper extends IBaseMapper<FileCate> {
}

View File

@ -1,12 +1,12 @@
package com.mdd.common.mapper.album;
import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.album.Album;
import com.mdd.common.entity.file.File;
import org.apache.ibatis.annotations.Mapper;
/**
* 相册
*/
@Mapper
public interface AlbumMapper extends IBaseMapper<Album> {
public interface FileMapper extends IBaseMapper<File> {
}

View File

@ -2,7 +2,7 @@ package com.mdd.common.mapper.log;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.log.LogMoney;
import com.mdd.common.entity.log.UserAccountLog;
import com.mdd.common.entity.user.User;
import com.mdd.common.mapper.user.UserMapper;
import com.mdd.common.util.SpringUtils;
@ -17,7 +17,7 @@ import java.math.BigDecimal;
* 账户变动Mapper
*/
@Mapper
public interface LogMoneyMapper extends IBaseMapper<LogMoney> {
public interface UserAccountLogMapper extends IBaseMapper<UserAccountLog> {
/**
* 增加
@ -41,11 +41,9 @@ public interface LogMoneyMapper extends IBaseMapper<LogMoney> {
}
BigDecimal leftAmount = user.getUserMoney().add(changeAmount);
LogMoney logMoney = new LogMoney();
UserAccountLog logMoney = new UserAccountLog();
logMoney.setSn(this.randMakeOrderSn());
logMoney.setUserId(userId);
logMoney.setSourceId(sourceId);
logMoney.setSourceSn(sourceSn);
logMoney.setChangeType(changeType);
logMoney.setChangeAmount(changeAmount);
@ -82,10 +80,9 @@ public interface LogMoneyMapper extends IBaseMapper<LogMoney> {
BigDecimal leftAmount = user.getUserMoney().subtract(changeAmount);
LogMoney logMoney = new LogMoney();
UserAccountLog logMoney = new UserAccountLog();
logMoney.setSn(this.randMakeOrderSn());
logMoney.setUserId(userId);
logMoney.setSourceId(sourceId);
logMoney.setSourceSn(sourceSn);
logMoney.setChangeType(changeType);
logMoney.setChangeAmount(changeAmount);
@ -110,8 +107,8 @@ public interface LogMoneyMapper extends IBaseMapper<LogMoney> {
String sn;
while (true) {
sn = date + ToolUtils.randomInt(12);
LogMoney snModel = this.selectOne(
new QueryWrapper<LogMoney>()
UserAccountLog snModel = this.selectOne(
new QueryWrapper<UserAccountLog>()
.select("id")
.eq("sn", sn)
.last("limit 1"));

View File

@ -107,6 +107,7 @@ public class ConfigUtils {
public static Map<String, String> getMap(String type, String name) {
String cache = ConfigCache.get(type, name);
if (!StringUtils.isNull(cache) && !StringUtils.isEmpty(cache)) {
cache = "[]".equals(cache) ? "{}" : cache;
return MapUtils.jsonToMap(cache);
}

View File

@ -82,8 +82,8 @@ public class ArticleServiceImpl implements IArticleService {
*/
@Override
public PageResult<ArticleListedVo> list( Integer userId, PageValidate pageValidate, ArticleSearchValidate searchValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<Article> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id,title,image,intro,visit,create_time");
@ -193,8 +193,8 @@ public class ArticleServiceImpl implements IArticleService {
*/
@Override
public PageResult<ArticleCollectVo> collect(PageValidate pageValidate, Integer userId) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
MPJQueryWrapper<ArticleCollect> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.select("t.id,t.article_id,a.title,a.image,a.intro,a.visit,a.create_time")

View File

@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.log.LogMoney;
import com.mdd.common.entity.log.UserAccountLog;
import com.mdd.common.enums.LogMoneyEnum;
import com.mdd.common.mapper.log.LogMoneyMapper;
import com.mdd.common.mapper.log.UserAccountLogMapper;
import com.mdd.common.util.TimeUtils;
import com.mdd.front.service.ILogsService;
import com.mdd.front.validate.common.PageValidate;
@ -21,24 +21,24 @@ import java.util.List;
public class LogsServiceImpl implements ILogsService {
@Resource
LogMoneyMapper logMoneyMapper;
UserAccountLogMapper userAccountLogMapper;
@Override
public PageResult<RechargeRecordVo> userMoney(PageValidate pageValidate, Integer userId, Integer type) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<LogMoney> queryWrapper = new QueryWrapper<>();
QueryWrapper<UserAccountLog> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", userId);
queryWrapper.orderByDesc("id");
if (type > 0) {
queryWrapper.eq("action", type);
}
IPage<LogMoney> iPage = logMoneyMapper.selectPage(new Page<>(pageNo, pageSize), queryWrapper);
IPage<UserAccountLog> iPage = userAccountLogMapper.selectPage(new Page<>(pageNo, pageSize), queryWrapper);
List<RechargeRecordVo> list = new LinkedList<>();
for (LogMoney logMoney : iPage.getRecords()) {
for (UserAccountLog logMoney : iPage.getRecords()) {
RechargeRecordVo vo = new RechargeRecordVo();
vo.setId(logMoney.getId());

View File

@ -11,7 +11,7 @@ import com.mdd.common.enums.LogMoneyEnum;
import com.mdd.common.enums.PaymentEnum;
import com.mdd.common.exception.OperateException;
import com.mdd.common.exception.PaymentException;
import com.mdd.common.mapper.log.LogMoneyMapper;
import com.mdd.common.mapper.log.UserAccountLogMapper;
import com.mdd.common.mapper.RechargeOrderMapper;
import com.mdd.common.mapper.setting.DevPayConfigMapper;
import com.mdd.common.mapper.setting.DevPayWayMapper;
@ -53,7 +53,7 @@ public class PayServiceImpl implements IPayService {
RechargeOrderMapper rechargeOrderMapper;
@Resource
LogMoneyMapper logMoneyMapper;
UserAccountLogMapper logMoneyMapper;
/**
* 支付方式

View File

@ -67,8 +67,8 @@ public class RechargeServiceImpl implements IRechargeService {
*/
@Override
public PageResult<RechargeRecordVo> record(Integer userId, PageValidate pageValidate) {
Integer pageNo = pageValidate.getPageNo();
Integer pageSize = pageValidate.getPageSize();
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
QueryWrapper<RechargeOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", userId);

View File

@ -15,11 +15,11 @@ public class PageValidate implements Serializable {
// 当前分页
@DecimalMin(value = "1", message = "pageNo参数必须大于0的数字")
public Integer pageNo = 1;
public Integer page_no = 1;
// 每页条数
@DecimalMin(value = "1", message = "pageSize参数必须是大于0的数字")
@DecimalMax(value = "60", message = "pageSize参数必须是小于60的数字")
private Integer pageSize = 20;
private Integer page_size = 20;
}

View File

@ -75,8 +75,8 @@ public class GenerateServiceImpl implements IGenerateService {
*/
@Override
public PageResult<DbTableVo> db(PageParam pageParam, Map<String, String> params) {
Integer page = pageParam.getPageNo();
Integer limit = pageParam.getPageSize();
Integer page = pageParam.getPage_no();
Integer limit = pageParam.getPage_size();
PageHelper.startPage(page, limit);
List<DbTableVo> tables = genTableMapper.selectDbTableList(params);
@ -140,8 +140,8 @@ public class GenerateServiceImpl implements IGenerateService {
*/
@Override
public PageResult<GenTableVo> list(PageParam pageParam, Map<String, String> params) {
Integer page = pageParam.getPageNo();
Integer limit = pageParam.getPageSize();
Integer page = pageParam.getPage_no();
Integer limit = pageParam.getPage_size();
QueryWrapper<GenTable> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByDesc("id");

View File

@ -18,11 +18,11 @@ public class PageParam implements Serializable {
// 当前分页
@DecimalMin(value = "1", message = "pageNo参数必须大于0的数字")
public Integer pageNo = 1;
public Integer page_no = 1;
// 每页条数
@DecimalMin(value = "1", message = "pageSize参数必须是大于0的数字")
@DecimalMax(value = "60", message = "pageSize参数必须是小于60的数字")
private Integer pageSize = 20;
private Integer page_size = 20;
}

View File

@ -85,8 +85,8 @@ public class ${EntityName}ServiceImpl implements I${EntityName}Service {
@Override
public $genTpl list($genParam) {
#if($table.genTpl.equals("crud"))
Integer page = pageValidate.getPageNo();
Integer limit = pageValidate.getPageSize();
Integer page = pageValidate.getPage_no();
Integer limit = pageValidate.getPage_size();
#end
#if(!$table.subTableName.equals("") && !$table.subTableFk.equals(""))