feat():将operLog和notice以DDD的形式进项编码
parent
9a4819aa9d
commit
33161db8c9
|
@ -3,12 +3,7 @@ package com.muyu.common.system.domain;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import lombok.*;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -18,11 +13,10 @@ import java.util.Date;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
public class SysOperLog {
|
||||||
public class SysOperLog extends BaseEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,11 +37,6 @@ public class SysOperLog extends BaseEntity {
|
||||||
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
|
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
|
||||||
private Integer businessType;
|
private Integer businessType;
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务类型数组
|
|
||||||
*/
|
|
||||||
private Integer[] businessTypes;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求方法
|
* 请求方法
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,8 +9,11 @@ import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.system.domain.SysNotice;
|
import com.muyu.system.domain.SysNotice;
|
||||||
import com.muyu.system.domain.model.SysNoticePageQueryModel;
|
import com.muyu.system.domain.model.*;
|
||||||
|
import com.muyu.system.domain.rep.SysNoticeAddReq;
|
||||||
import com.muyu.system.domain.rep.SysNoticeListReq;
|
import com.muyu.system.domain.rep.SysNoticeListReq;
|
||||||
|
import com.muyu.system.domain.rep.SysNoticeUpdReq;
|
||||||
|
import com.muyu.system.domain.resp.SysNoticeDetailResp;
|
||||||
import com.muyu.system.service.SysNoticeService;
|
import com.muyu.system.service.SysNoticeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -34,8 +37,8 @@ public class SysNoticeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:notice:list")
|
@RequiresPermissions("system:notice:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public Result<DataPageResp<SysNotice>> list (@RequestBody SysNoticeListReq sysNoticeListReq) {
|
public Result<DataPageResp<SysNoticeListModel>> list (@RequestBody SysNoticeListReq sysNoticeListReq) {
|
||||||
PageQueryModel<SysNotice> sysNoticePageQueryModel = noticeService.pageQuery(SysNoticePageQueryModel.reqBuild(sysNoticeListReq));
|
PageQueryModel<SysNoticeListModel> sysNoticePageQueryModel = noticeService.pageQuery(SysNoticePageQueryModel.reqBuild(sysNoticeListReq));
|
||||||
return Result.success(
|
return Result.success(
|
||||||
DataPageResp.of(sysNoticePageQueryModel)
|
DataPageResp.of(sysNoticePageQueryModel)
|
||||||
);
|
);
|
||||||
|
@ -46,8 +49,9 @@ public class SysNoticeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:notice:query")
|
@RequiresPermissions("system:notice:query")
|
||||||
@GetMapping(value = "/{noticeId}")
|
@GetMapping(value = "/{noticeId}")
|
||||||
public Result getInfo (@PathVariable("noticeId") Long noticeId) {
|
public Result<SysNoticeDetailResp> getInfo (@PathVariable("noticeId") Long noticeId) {
|
||||||
return success(noticeService.selectNoticeById(noticeId));
|
SysNoticeDetailModel sysNoticeDetailModel = noticeService.selectNoticeById(noticeId);
|
||||||
|
return Result.success(SysNoticeDetailResp.detailModelBuildToResp(sysNoticeDetailModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,9 +60,8 @@ public class SysNoticeController extends BaseController {
|
||||||
@RequiresPermissions("system:notice:add")
|
@RequiresPermissions("system:notice:add")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<String> add (@Validated @RequestBody SysNotice notice) {
|
public Result<String> add (@Validated @RequestBody SysNoticeAddReq sysNoticeAddReq) {
|
||||||
notice.setCreateBy(SecurityUtils.getUsername());
|
noticeService.insertNotice(SysNoticeAddModel.addReqBuildToModel(sysNoticeAddReq,SecurityUtils::getUsername));
|
||||||
noticeService.insertNotice(notice);
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,10 +70,9 @@ public class SysNoticeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:notice:edit")
|
@RequiresPermissions("system:notice:edit")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping("/{id}")
|
||||||
public Result<String> edit (@Validated @RequestBody SysNotice notice) {
|
public Result<String> edit (@PathVariable("id") Long id,@Validated @RequestBody SysNoticeUpdReq sysNoticeUpdReq) {
|
||||||
notice.setUpdateBy(SecurityUtils.getUsername());
|
noticeService.updateNotice(id, SysNoticeUpdModel.updReqBuildToModel(sysNoticeUpdReq,SecurityUtils::getUsername));
|
||||||
noticeService.updateNotice(notice);
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,13 @@ import com.muyu.common.log.annotation.Log;
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.InnerAuth;
|
import com.muyu.common.security.annotation.InnerAuth;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.common.system.domain.SysOperLog;
|
import com.muyu.system.domain.model.SysOperLogAddModel;
|
||||||
import com.muyu.system.domain.model.SysOperlogPageQueryModel;
|
import com.muyu.system.domain.model.SysOperlogPageQueryModel;
|
||||||
|
import com.muyu.system.domain.rep.SysOperLogAddReq;
|
||||||
import com.muyu.system.domain.rep.SysOperlogListReq;
|
import com.muyu.system.domain.rep.SysOperlogListReq;
|
||||||
|
import com.muyu.system.domain.resp.SysOperlogListResp;
|
||||||
import com.muyu.system.service.SysOperLogService;
|
import com.muyu.system.service.SysOperLogService;
|
||||||
|
import io.jsonwebtoken.lang.Arrays;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -27,30 +30,51 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/operlog")
|
@RequestMapping("/operlog")
|
||||||
public class SysOperlogController extends BaseController {
|
public class SysOperlogController extends BaseController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录 服务对象
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysOperLogService operLogService;
|
private SysOperLogService operLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录列表
|
||||||
|
*
|
||||||
|
* @param sysOperlogListReq 操作日志记录列表查询请求对象
|
||||||
|
* @return 列表数据
|
||||||
|
*/
|
||||||
@RequiresPermissions("system:operlog:list")
|
@RequiresPermissions("system:operlog:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public Result<DataPageResp<SysOperLog>> list (@RequestBody SysOperlogListReq sysOperlogListReq) {
|
public Result<DataPageResp<SysOperlogListResp>> list (@RequestBody SysOperlogListReq sysOperlogListReq) {
|
||||||
PageQueryModel<SysOperLog> sysOperLogPageQueryModel = operLogService.pageQuery(
|
PageQueryModel<SysOperlogListResp> sysOperLogPageQueryModel = operLogService.pageQuery(
|
||||||
SysOperlogPageQueryModel.reqBuild(sysOperlogListReq)
|
SysOperlogPageQueryModel.reqBuild(sysOperlogListReq)
|
||||||
);
|
);
|
||||||
return Result.success(DataPageResp.of(sysOperLogPageQueryModel));
|
return Result.success(DataPageResp.of(sysOperLogPageQueryModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录导出
|
||||||
|
*
|
||||||
|
* @param response 响应对象
|
||||||
|
* @param sysOperlogListReq 操作日志记录列表查询请求对象
|
||||||
|
*/
|
||||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("system:operlog:export")
|
@RequiresPermissions("system:operlog:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export (HttpServletResponse response, SysOperlogListReq sysOperlogListReq) {
|
public void export (HttpServletResponse response, SysOperlogListReq sysOperlogListReq) {
|
||||||
// TODO 导出需要重新编写
|
// TODO 导出需要重新编写
|
||||||
PageQueryModel<SysOperLog> sysOperLogPageQueryModel = operLogService.pageQuery(
|
PageQueryModel<SysOperlogListResp> sysOperLogPageQueryModel = operLogService.pageQuery(
|
||||||
SysOperlogPageQueryModel.reqBuild(sysOperlogListReq)
|
SysOperlogPageQueryModel.reqBuild(sysOperlogListReq)
|
||||||
);
|
);
|
||||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
ExcelUtil<SysOperlogListResp> util = new ExcelUtil<>(SysOperlogListResp.class);
|
||||||
util.exportExcel(response, sysOperLogPageQueryModel.getDataList(), "操作日志");
|
util.exportExcel(response, sysOperLogPageQueryModel.getDataList(), "操作日志");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除操作日志记录
|
||||||
|
*
|
||||||
|
* @param operIds 操作日志记录的id集合
|
||||||
|
*/
|
||||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||||
@RequiresPermissions("system:operlog:remove")
|
@RequiresPermissions("system:operlog:remove")
|
||||||
@DeleteMapping("/{operIds}")
|
@DeleteMapping("/{operIds}")
|
||||||
|
@ -59,7 +83,10 @@ public class SysOperlogController extends BaseController {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("system:operlog:remove")
|
/**
|
||||||
|
* 清空操作日志记录
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:operlog:clean")
|
||||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||||
@DeleteMapping("/clean")
|
@DeleteMapping("/clean")
|
||||||
public Result<String> clean () {
|
public Result<String> clean () {
|
||||||
|
@ -67,10 +94,15 @@ public class SysOperlogController extends BaseController {
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增操作日志记录
|
||||||
|
*
|
||||||
|
* @param operLogAddReq 操作日志记录新增请求对象
|
||||||
|
*/
|
||||||
@InnerAuth
|
@InnerAuth
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<String> add (@RequestBody SysOperLog operLog) {
|
public Result<String> add (@RequestBody SysOperLogAddReq operLogAddReq) {
|
||||||
operLogService.insertOperlog(operLog);
|
operLogService.insertOperlog(SysOperLogAddModel.addReqBuildToModel(operLogAddReq));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.common.core.xss.Xss;
|
import com.muyu.system.domain.model.SysNoticeAddModel;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import com.muyu.system.domain.model.SysNoticeDetailModel;
|
||||||
import jakarta.validation.constraints.Size;
|
import com.muyu.system.domain.model.SysNoticeUpdModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -53,10 +53,48 @@ public class SysNotice extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Xss(message = "公告标题不能包含脚本字符")
|
/**
|
||||||
@NotBlank(message = "公告标题不能为空")
|
* 范围scope
|
||||||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
*/
|
||||||
public String getNoticeTitle () {
|
private String scope;
|
||||||
return noticeTitle;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将通知公告添加模型构建成原生实体类
|
||||||
|
*
|
||||||
|
* @param sysNoticeAddModel 通知公告添加模型
|
||||||
|
* @return 原生实体类
|
||||||
|
*/
|
||||||
|
public static SysNotice addModelBuildToInfo(SysNoticeAddModel sysNoticeAddModel){
|
||||||
|
return SysNotice.builder()
|
||||||
|
.noticeId(sysNoticeAddModel.getNoticeId())
|
||||||
|
.noticeTitle(sysNoticeAddModel.getNoticeTitle())
|
||||||
|
.noticeType(sysNoticeAddModel.getNoticeType())
|
||||||
|
.noticeContent(sysNoticeAddModel.getNoticeContent())
|
||||||
|
.status(sysNoticeAddModel.getStatus())
|
||||||
|
.scope(sysNoticeAddModel.getScope())
|
||||||
|
.createBy(sysNoticeAddModel.getCreateBy())
|
||||||
|
.createTime(sysNoticeAddModel.getCreateTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将通知公告更新模型构建成原生实体类
|
||||||
|
*
|
||||||
|
* @param id 通知公告ID
|
||||||
|
* @param sysNoticeUpdModel 通知公告更新模型
|
||||||
|
* @return 原生实体类
|
||||||
|
*/
|
||||||
|
public static SysNotice updReqBuildToInfo(Long id, SysNoticeUpdModel sysNoticeUpdModel){
|
||||||
|
return SysNotice.builder()
|
||||||
|
.noticeId(id)
|
||||||
|
.noticeTitle(sysNoticeUpdModel.getNoticeTitle())
|
||||||
|
.noticeType(sysNoticeUpdModel.getNoticeType())
|
||||||
|
.noticeContent(sysNoticeUpdModel.getNoticeContent())
|
||||||
|
.status(sysNoticeUpdModel.getStatus())
|
||||||
|
.updateBy(sysNoticeUpdModel.getUpdateBy())
|
||||||
|
.updateTime(sysNoticeUpdModel.getUpdateTime())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.muyu.system.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.common.core.xss.Xss;
|
||||||
|
import com.muyu.system.domain.rep.SysNoticeAddReq;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告添加模型
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 12:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysNoticeAddModel extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告ID
|
||||||
|
*/
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
@Xss(message = "公告标题不能包含脚本字符")
|
||||||
|
@NotBlank(message = "公告标题不能为空")
|
||||||
|
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 范围scope
|
||||||
|
*/
|
||||||
|
private String scope;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将通知公告添加请求对象构建成模型
|
||||||
|
*
|
||||||
|
* @param sysNoticeAddReq 通知公告添加请求对象
|
||||||
|
* @param creatBy 创建人
|
||||||
|
* @return 通知公告添加模型
|
||||||
|
*/
|
||||||
|
public static SysNoticeAddModel addReqBuildToModel(SysNoticeAddReq sysNoticeAddReq, Supplier<String> creatBy) {
|
||||||
|
return SysNoticeAddModel.builder()
|
||||||
|
.noticeTitle(sysNoticeAddReq.getNoticeTitle())
|
||||||
|
.noticeType(sysNoticeAddReq.getNoticeType())
|
||||||
|
.noticeContent(sysNoticeAddReq.getNoticeContent())
|
||||||
|
.status(sysNoticeAddReq.getStatus())
|
||||||
|
.scope("若依框架")
|
||||||
|
.createBy(creatBy.get())
|
||||||
|
.createTime(new Date())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.muyu.system.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.system.domain.SysNotice;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告详情模型
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 19:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysNoticeDetailModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告ID
|
||||||
|
*/
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将通知公告信息转换为详情模型
|
||||||
|
*
|
||||||
|
* @param sysNotice 通知公告信息
|
||||||
|
* @return 详情模型
|
||||||
|
*/
|
||||||
|
public static SysNoticeDetailModel infoBuildToDetailModel(SysNotice sysNotice) {
|
||||||
|
return SysNoticeDetailModel.builder()
|
||||||
|
.noticeId(sysNotice.getNoticeId())
|
||||||
|
.noticeTitle(sysNotice.getNoticeTitle())
|
||||||
|
.noticeType(sysNotice.getNoticeType())
|
||||||
|
.noticeContent(sysNotice.getNoticeContent())
|
||||||
|
.status(sysNotice.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.muyu.system.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.system.domain.SysNotice;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告列表模型
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 12:01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysNoticeListModel extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告ID
|
||||||
|
*/
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将公告通知原生实体类构建成列表响应对象
|
||||||
|
*
|
||||||
|
* @param sysNotice 公告通知原生实体类
|
||||||
|
* @return 列表模型
|
||||||
|
*/
|
||||||
|
public static SysNoticeListModel listInfoBuildToModel(SysNotice sysNotice){
|
||||||
|
return SysNoticeListModel.builder()
|
||||||
|
.noticeId(sysNotice.getNoticeId())
|
||||||
|
.noticeTitle(sysNotice.getNoticeTitle())
|
||||||
|
.noticeType(sysNotice.getNoticeType())
|
||||||
|
.noticeContent(sysNotice.getNoticeContent())
|
||||||
|
.status(sysNotice.getStatus())
|
||||||
|
.createBy(sysNotice.getCreateBy())
|
||||||
|
.createTime(sysNotice.getCreateTime())
|
||||||
|
.remark(sysNotice.getRemark())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.muyu.system.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.common.core.xss.Xss;
|
||||||
|
import com.muyu.system.domain.rep.SysNoticeUpdReq;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告修改模型
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 15:58
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysNoticeUpdModel extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
@Xss(message = "公告标题不能包含脚本字符")
|
||||||
|
@NotBlank(message = "公告标题不能为空")
|
||||||
|
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将通知公告修改请求对象构建成通知公告修改模型
|
||||||
|
*
|
||||||
|
* @param sysNoticeUpdReq 通知公告修改请求对象
|
||||||
|
* @param updateBy 通知公告修改模型
|
||||||
|
* @return 通知公告修改模型
|
||||||
|
*/
|
||||||
|
public static SysNoticeUpdModel updReqBuildToModel(SysNoticeUpdReq sysNoticeUpdReq, Supplier<String> updateBy){
|
||||||
|
return SysNoticeUpdModel.builder()
|
||||||
|
.noticeTitle(sysNoticeUpdReq.getNoticeTitle())
|
||||||
|
.noticeType(sysNoticeUpdReq.getNoticeType())
|
||||||
|
.noticeContent(sysNoticeUpdReq.getNoticeContent())
|
||||||
|
.status(sysNoticeUpdReq.getStatus())
|
||||||
|
.remark(sysNoticeUpdReq.getRemark())
|
||||||
|
.updateBy(updateBy.get())
|
||||||
|
.updateTime(new Date())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
package com.muyu.system.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.system.domain.rep.SysOperLogAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录添加模型
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/23 22:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysOperLogAddModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志主键
|
||||||
|
*/
|
||||||
|
private Long operId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作模块
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方法
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
|
*/
|
||||||
|
private Integer operatorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求url
|
||||||
|
*/
|
||||||
|
private String operUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作地址
|
||||||
|
*/
|
||||||
|
private String operIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
private String operParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数
|
||||||
|
*/
|
||||||
|
private String jsonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作状态(0正常 1异常)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date operTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗时间
|
||||||
|
*/
|
||||||
|
private Long costTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将操作日志记录添加请求对象构建成操作日志记录添加模型
|
||||||
|
*
|
||||||
|
* @param sysOperLogAddReq 操作日志记录添加请求对象
|
||||||
|
* @return 操作日志记录添加模型
|
||||||
|
*/
|
||||||
|
public static SysOperLogAddModel addReqBuildToModel(SysOperLogAddReq sysOperLogAddReq){
|
||||||
|
return SysOperLogAddModel.builder()
|
||||||
|
.operId(sysOperLogAddReq.getOperId())
|
||||||
|
.title(sysOperLogAddReq.getTitle())
|
||||||
|
.businessType(sysOperLogAddReq.getBusinessType())
|
||||||
|
.method(sysOperLogAddReq.getMethod())
|
||||||
|
.requestMethod(sysOperLogAddReq.getRequestMethod())
|
||||||
|
.operatorType(sysOperLogAddReq.getOperatorType())
|
||||||
|
.operName(sysOperLogAddReq.getOperName())
|
||||||
|
.deptName(sysOperLogAddReq.getDeptName())
|
||||||
|
.operUrl(sysOperLogAddReq.getOperUrl())
|
||||||
|
.operIp(sysOperLogAddReq.getOperIp())
|
||||||
|
.operParam(sysOperLogAddReq.getOperParam())
|
||||||
|
.jsonResult(sysOperLogAddReq.getJsonResult())
|
||||||
|
.status(sysOperLogAddReq.getStatus())
|
||||||
|
.errorMsg(sysOperLogAddReq.getErrorMsg())
|
||||||
|
.operTime(new Date())
|
||||||
|
.costTime(sysOperLogAddReq.getCostTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.muyu.system.domain.rep;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.common.core.xss.Xss;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告新增请求对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 12:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysNoticeAddReq extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告ID
|
||||||
|
*/
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
@Xss(message = "公告标题不能包含脚本字符")
|
||||||
|
@NotBlank(message = "公告标题不能为空")
|
||||||
|
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 范围scope
|
||||||
|
*/
|
||||||
|
private String scope;
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.muyu.system.domain.rep;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.common.core.xss.Xss;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告修改请求对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 15:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysNoticeUpdReq extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
@Xss(message = "公告标题不能包含脚本字符")
|
||||||
|
@NotBlank(message = "公告标题不能为空")
|
||||||
|
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.muyu.system.domain.rep;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志添加请求对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/23 22:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysOperLogAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志主键
|
||||||
|
*/
|
||||||
|
private Long operId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作模块
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方法
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
|
*/
|
||||||
|
private Integer operatorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求url
|
||||||
|
*/
|
||||||
|
private String operUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作地址
|
||||||
|
*/
|
||||||
|
private String operIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
private String operParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数
|
||||||
|
*/
|
||||||
|
private String jsonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作状态(0正常 1异常)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date operTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗时间
|
||||||
|
*/
|
||||||
|
private Long costTime;
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.muyu.system.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.system.domain.model.SysNoticeDetailModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告详情响应对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 19:37
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysNoticeDetailResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告ID
|
||||||
|
*/
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情模型构建响应对象
|
||||||
|
* @param sysNoticeDetailModel 详情模型
|
||||||
|
* @return 详情响应对象
|
||||||
|
*/
|
||||||
|
public static SysNoticeDetailResp detailModelBuildToResp(SysNoticeDetailModel sysNoticeDetailModel){
|
||||||
|
return SysNoticeDetailResp.builder()
|
||||||
|
.noticeId(sysNoticeDetailModel.getNoticeId())
|
||||||
|
.noticeTitle(sysNoticeDetailModel.getNoticeTitle())
|
||||||
|
.noticeType(sysNoticeDetailModel.getNoticeType())
|
||||||
|
.noticeContent(sysNoticeDetailModel.getNoticeContent())
|
||||||
|
.status(sysNoticeDetailModel.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.muyu.system.domain.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知公告列表响应对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/24 11:58
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysNoticeListResp extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告ID
|
||||||
|
*/
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告标题
|
||||||
|
*/
|
||||||
|
private String noticeTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告类型(1通知 2公告)
|
||||||
|
*/
|
||||||
|
private String noticeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告状态(0正常 1关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.muyu.system.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录详情响应对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/23 22:34
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysOperLogDetailResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志主键
|
||||||
|
*/
|
||||||
|
private Long operId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作模块
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方法
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
|
*/
|
||||||
|
private Integer operatorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求url
|
||||||
|
*/
|
||||||
|
private String operUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作地址
|
||||||
|
*/
|
||||||
|
private String operIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
private String operParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数
|
||||||
|
*/
|
||||||
|
private String jsonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作状态(0正常 1异常)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date operTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗时间
|
||||||
|
*/
|
||||||
|
private Long costTime;
|
||||||
|
}
|
|
@ -0,0 +1,126 @@
|
||||||
|
package com.muyu.system.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.system.domain.SysOperLog;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录列表响应对象
|
||||||
|
*
|
||||||
|
* @author 夜は眠れるかい?
|
||||||
|
* @Date 2025/2/23 19:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysOperlogListResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志主键
|
||||||
|
*/
|
||||||
|
private Long operId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作模块
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方法
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
|
*/
|
||||||
|
private Integer operatorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求url
|
||||||
|
*/
|
||||||
|
private String operUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作地址
|
||||||
|
*/
|
||||||
|
private String operIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
private String operParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数
|
||||||
|
*/
|
||||||
|
private String jsonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作状态(0正常 1异常)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date operTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗时间
|
||||||
|
*/
|
||||||
|
private Long costTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将操作日志记录原生实体类构建成列表响应对象
|
||||||
|
*/
|
||||||
|
public static SysOperlogListResp infoBuildToResp(SysOperLog sysOperLog){
|
||||||
|
return SysOperlogListResp.builder()
|
||||||
|
.operId(sysOperLog.getOperId())
|
||||||
|
.title(sysOperLog.getTitle())
|
||||||
|
.businessType(sysOperLog.getBusinessType())
|
||||||
|
.method(sysOperLog.getMethod())
|
||||||
|
.requestMethod(sysOperLog.getRequestMethod())
|
||||||
|
.operatorType(sysOperLog.getOperatorType())
|
||||||
|
.operName(sysOperLog.getOperName())
|
||||||
|
.deptName(sysOperLog.getDeptName())
|
||||||
|
.operUrl(sysOperLog.getOperUrl())
|
||||||
|
.operIp(sysOperLog.getOperIp())
|
||||||
|
.operParam(sysOperLog.getOperParam())
|
||||||
|
.jsonResult(sysOperLog.getJsonResult())
|
||||||
|
.status(sysOperLog.getStatus())
|
||||||
|
.errorMsg(sysOperLog.getErrorMsg())
|
||||||
|
.operTime(sysOperLog.getOperTime())
|
||||||
|
.costTime(sysOperLog.getCostTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,8 @@ package com.muyu.system.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.core.web.page.PageQueryModel;
|
import com.muyu.common.core.web.page.PageQueryModel;
|
||||||
import com.muyu.system.domain.SysNotice;
|
import com.muyu.system.domain.SysNotice;
|
||||||
import com.muyu.system.domain.model.SysNoticePageQueryModel;
|
import com.muyu.system.domain.model.*;
|
||||||
|
import com.muyu.system.domain.rep.SysNoticeUpdReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ public interface SysNoticeService extends IService<SysNotice> {
|
||||||
* @param sysNoticePageQueryModel 分页查询模型
|
* @param sysNoticePageQueryModel 分页查询模型
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
PageQueryModel<SysNotice> pageQuery(SysNoticePageQueryModel sysNoticePageQueryModel);
|
PageQueryModel<SysNoticeListModel> pageQuery(SysNoticePageQueryModel sysNoticePageQueryModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公告信息
|
* 查询公告信息
|
||||||
|
@ -29,25 +30,24 @@ public interface SysNoticeService extends IService<SysNotice> {
|
||||||
*
|
*
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
public SysNotice selectNoticeById (Long noticeId);
|
public SysNoticeDetailModel selectNoticeById (Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增公告
|
* 新增公告
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param sysNoticeAddModel 通知公告添加模型
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void insertNotice (SysNotice notice);
|
public void insertNotice (SysNoticeAddModel sysNoticeAddModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公告
|
* 修改公告
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param sysNoticeUpdModel 公告信息修改模型
|
||||||
*
|
* @param id 通知公告id
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
public void updateNotice (SysNotice notice);
|
public void updateNotice (Long id, SysNoticeUpdModel sysNoticeUpdModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除公告信息
|
* 删除公告信息
|
||||||
|
|
|
@ -3,7 +3,9 @@ package com.muyu.system.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.core.web.page.PageQueryModel;
|
import com.muyu.common.core.web.page.PageQueryModel;
|
||||||
import com.muyu.common.system.domain.SysOperLog;
|
import com.muyu.common.system.domain.SysOperLog;
|
||||||
|
import com.muyu.system.domain.model.SysOperLogAddModel;
|
||||||
import com.muyu.system.domain.model.SysOperlogPageQueryModel;
|
import com.muyu.system.domain.model.SysOperlogPageQueryModel;
|
||||||
|
import com.muyu.system.domain.resp.SysOperlogListResp;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -16,18 +18,18 @@ public interface SysOperLogService extends IService<SysOperLog> {
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param sysOperLogAddModel 操作日志对象
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void insertOperlog (SysOperLog operLog);
|
public void insertOperlog (SysOperLogAddModel sysOperLogAddModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志 分页查询
|
* 操作日志 分页查询
|
||||||
* @param sysOperlogPageQueryModel 分页模型查询
|
* @param sysOperlogPageQueryModel 分页模型查询
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
PageQueryModel<SysOperLog> pageQuery(SysOperlogPageQueryModel sysOperlogPageQueryModel);
|
PageQueryModel<SysOperlogListResp> pageQuery(SysOperlogPageQueryModel sysOperlogPageQueryModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统操作日志
|
* 批量删除系统操作日志
|
||||||
|
|
|
@ -6,7 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.PageQueryModel;
|
import com.muyu.common.core.web.page.PageQueryModel;
|
||||||
import com.muyu.system.domain.SysNotice;
|
import com.muyu.system.domain.SysNotice;
|
||||||
import com.muyu.system.domain.model.SysNoticePageQueryModel;
|
import com.muyu.system.domain.model.*;
|
||||||
|
import com.muyu.system.domain.rep.SysNoticeUpdReq;
|
||||||
import com.muyu.system.mapper.SysNoticeMapper;
|
import com.muyu.system.mapper.SysNoticeMapper;
|
||||||
import com.muyu.system.service.SysNoticeService;
|
import com.muyu.system.service.SysNoticeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -21,9 +22,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
|
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
|
||||||
@Autowired
|
|
||||||
private SysNoticeMapper noticeMapper;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告份也查询
|
* 通知公告份也查询
|
||||||
|
@ -31,13 +29,20 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageQueryModel<SysNotice> pageQuery(SysNoticePageQueryModel sysNoticePageQueryModel) {
|
public PageQueryModel<SysNoticeListModel> pageQuery(SysNoticePageQueryModel sysNoticePageQueryModel) {
|
||||||
LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(sysNoticePageQueryModel.getNoticeTitle()),SysNotice::getNoticeTitle, sysNoticePageQueryModel.getNoticeTitle());
|
queryWrapper.like(StringUtils.isNotEmpty(sysNoticePageQueryModel.getNoticeTitle()),SysNotice::getNoticeTitle, sysNoticePageQueryModel.getNoticeTitle());
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(sysNoticePageQueryModel.getNoticeType()),SysNotice::getNoticeType, sysNoticePageQueryModel.getNoticeType());
|
queryWrapper.eq(StringUtils.isNotEmpty(sysNoticePageQueryModel.getNoticeType()),SysNotice::getNoticeType, sysNoticePageQueryModel.getNoticeType());
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(sysNoticePageQueryModel.getCreateBy()),SysNotice::getCreateBy, sysNoticePageQueryModel.getCreateBy());
|
queryWrapper.like(StringUtils.isNotEmpty(sysNoticePageQueryModel.getCreateBy()),SysNotice::getCreateBy, sysNoticePageQueryModel.getCreateBy());
|
||||||
Page<SysNotice> page = this.page(sysNoticePageQueryModel.buildPage(), queryWrapper);
|
Page<SysNotice> page = this.page(sysNoticePageQueryModel.buildPage(), queryWrapper);
|
||||||
return PageQueryModel.of(page);
|
List<SysNoticeListModel> noticeListModels = page.getRecords().stream()
|
||||||
|
.map(SysNoticeListModel::listInfoBuildToModel)
|
||||||
|
.toList();
|
||||||
|
Page<SysNoticeListModel> modelPage = new Page<>(page.getCurrent(), page.getSize());
|
||||||
|
modelPage.setRecords(noticeListModels);
|
||||||
|
modelPage.setTotal(page.getTotal());
|
||||||
|
modelPage.setOrders(page.orders());
|
||||||
|
return PageQueryModel.of(modelPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,40 +53,36 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysNotice selectNoticeById (Long noticeId) {
|
public SysNoticeDetailModel selectNoticeById (Long noticeId) {
|
||||||
return this.getById(noticeId);
|
SysNotice sysNotice = this.getById(noticeId);
|
||||||
|
return SysNoticeDetailModel.infoBuildToDetailModel(sysNotice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增公告
|
* 新增公告
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param sysNoticeAddModel 通知公告添加模型
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertNotice (SysNotice notice) {
|
public void insertNotice (SysNoticeAddModel sysNoticeAddModel) {
|
||||||
this.save(notice);
|
this.save(SysNotice.addModelBuildToInfo(sysNoticeAddModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公告
|
* 修改公告
|
||||||
*
|
*
|
||||||
* @param notice 公告信息
|
* @param id 通知公告id
|
||||||
*
|
* @param sysNoticeUpdModel 公告信息修改模型
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateNotice (SysNotice notice) {
|
public void updateNotice (Long id, SysNoticeUpdModel sysNoticeUpdModel) {
|
||||||
this.updateById(notice);
|
this.updateById(SysNotice.updReqBuildToInfo(id, sysNoticeUpdModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除公告对象
|
* 删除公告对象
|
||||||
*
|
*
|
||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteNoticeById (Long noticeId) {
|
public void deleteNoticeById (Long noticeId) {
|
||||||
|
@ -92,8 +93,6 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||||
* 批量删除公告信息
|
* 批量删除公告信息
|
||||||
*
|
*
|
||||||
* @param noticeIds 需要删除的公告ID
|
* @param noticeIds 需要删除的公告ID
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteNoticeByIds (List<Long> noticeIds) {
|
public void deleteNoticeByIds (List<Long> noticeIds) {
|
||||||
|
|
|
@ -6,12 +6,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.PageQueryModel;
|
import com.muyu.common.core.web.page.PageQueryModel;
|
||||||
import com.muyu.common.system.domain.SysOperLog;
|
import com.muyu.common.system.domain.SysOperLog;
|
||||||
|
import com.muyu.system.domain.model.SysOperLogAddModel;
|
||||||
import com.muyu.system.domain.model.SysOperlogPageQueryModel;
|
import com.muyu.system.domain.model.SysOperlogPageQueryModel;
|
||||||
|
import com.muyu.system.domain.resp.SysOperlogListResp;
|
||||||
import com.muyu.system.mapper.SysOperLogMapper;
|
import com.muyu.system.mapper.SysOperLogMapper;
|
||||||
import com.muyu.system.service.SysOperLogService;
|
import com.muyu.system.service.SysOperLogService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -28,13 +32,30 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param sysOperLogAddModel 操作日志记录添加模型
|
||||||
*
|
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertOperlog (SysOperLog operLog) {
|
public void insertOperlog (SysOperLogAddModel sysOperLogAddModel) {
|
||||||
this.save(operLog);
|
this.save(
|
||||||
|
SysOperLog.builder()
|
||||||
|
.operId(sysOperLogAddModel.getOperId())
|
||||||
|
.title(sysOperLogAddModel.getTitle())
|
||||||
|
.businessType(sysOperLogAddModel.getBusinessType())
|
||||||
|
.method(sysOperLogAddModel.getMethod())
|
||||||
|
.requestMethod(sysOperLogAddModel.getRequestMethod())
|
||||||
|
.operatorType(sysOperLogAddModel.getOperatorType())
|
||||||
|
.operName(sysOperLogAddModel.getOperName())
|
||||||
|
.deptName(sysOperLogAddModel.getDeptName())
|
||||||
|
.operUrl(sysOperLogAddModel.getOperUrl())
|
||||||
|
.operIp(sysOperLogAddModel.getOperIp())
|
||||||
|
.operParam(sysOperLogAddModel.getOperParam())
|
||||||
|
.jsonResult(sysOperLogAddModel.getJsonResult())
|
||||||
|
.status(sysOperLogAddModel.getStatus())
|
||||||
|
.errorMsg(sysOperLogAddModel.getErrorMsg())
|
||||||
|
.operTime(sysOperLogAddModel.getOperTime())
|
||||||
|
.costTime(sysOperLogAddModel.getCostTime())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +65,7 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageQueryModel<SysOperLog> pageQuery(SysOperlogPageQueryModel sysOperlogPageQueryModel) {
|
public PageQueryModel<SysOperlogListResp> pageQuery(SysOperlogPageQueryModel sysOperlogPageQueryModel) {
|
||||||
LambdaQueryWrapper<SysOperLog> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysOperLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(sysOperlogPageQueryModel.getOperIp()),SysOperLog::getOperIp, sysOperlogPageQueryModel.getOperIp());
|
queryWrapper.like(StringUtils.isNotEmpty(sysOperlogPageQueryModel.getOperIp()),SysOperLog::getOperIp, sysOperlogPageQueryModel.getOperIp());
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(sysOperlogPageQueryModel.getTitle()),SysOperLog::getTitle, sysOperlogPageQueryModel.getTitle());
|
queryWrapper.like(StringUtils.isNotEmpty(sysOperlogPageQueryModel.getTitle()),SysOperLog::getTitle, sysOperlogPageQueryModel.getTitle());
|
||||||
|
@ -54,7 +75,14 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
||||||
queryWrapper.gt(Objects.nonNull(sysOperlogPageQueryModel.getBeginTime()),SysOperLog::getOperTime, sysOperlogPageQueryModel.getBeginTime());
|
queryWrapper.gt(Objects.nonNull(sysOperlogPageQueryModel.getBeginTime()),SysOperLog::getOperTime, sysOperlogPageQueryModel.getBeginTime());
|
||||||
queryWrapper.lt(Objects.nonNull(sysOperlogPageQueryModel.getEndTime()),SysOperLog::getOperTime, sysOperlogPageQueryModel.getEndTime());
|
queryWrapper.lt(Objects.nonNull(sysOperlogPageQueryModel.getEndTime()),SysOperLog::getOperTime, sysOperlogPageQueryModel.getEndTime());
|
||||||
Page<SysOperLog> page = this.page(sysOperlogPageQueryModel.buildPage(), queryWrapper);
|
Page<SysOperLog> page = this.page(sysOperlogPageQueryModel.buildPage(), queryWrapper);
|
||||||
return PageQueryModel.of(page);
|
List<SysOperlogListResp> sysOperlogListResp = page.getRecords().stream()
|
||||||
|
.map(SysOperlogListResp::infoBuildToResp)
|
||||||
|
.toList();
|
||||||
|
Page<SysOperlogListResp> respPage = new Page<>(page.getCurrent(),page.getSize());
|
||||||
|
respPage.setRecords(sysOperlogListResp);
|
||||||
|
respPage.setTotal(page.getTotal());
|
||||||
|
respPage.setOrders(page.orders());
|
||||||
|
return PageQueryModel.of(respPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue