refactor: 💥 调整后端请求、响应参数模型命名风格
XxxRequest => XxxReq XxxVO => XxxResp
This commit is contained in:
parent
598dd3991c
commit
87f90567db
@ -41,15 +41,15 @@ import top.charles7c.cnadmin.common.annotation.NoResponseAdvice;
|
||||
import top.charles7c.cnadmin.common.constant.StringConsts;
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.query.SortQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.common.model.resp.R;
|
||||
|
||||
/**
|
||||
* 控制器基类
|
||||
*
|
||||
* @param <S>
|
||||
* 业务接口
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表信息
|
||||
* @param <D>
|
||||
* 详情信息
|
||||
@ -61,7 +61,7 @@ import top.charles7c.cnadmin.common.model.vo.R;
|
||||
* @since 2023/1/26 10:45
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
public abstract class BaseController<S extends BaseService<V, D, Q, C>, V, D, Q, C extends BaseRequest> {
|
||||
public abstract class BaseController<S extends BaseService<L, D, Q, C>, L, D, Q, C extends BaseReq> {
|
||||
|
||||
@Autowired
|
||||
protected S baseService;
|
||||
@ -78,7 +78,7 @@ public abstract class BaseController<S extends BaseService<V, D, Q, C>, V, D, Q,
|
||||
@Operation(summary = "分页查询列表", description = "分页查询列表")
|
||||
@ResponseBody
|
||||
@GetMapping
|
||||
public PageDataVO<V> page(Q query, @Validated PageQuery pageQuery) {
|
||||
public PageDataResp<L> page(Q query, @Validated PageQuery pageQuery) {
|
||||
this.checkPermission(Api.LIST);
|
||||
return baseService.page(query, pageQuery);
|
||||
}
|
||||
@ -112,7 +112,7 @@ public abstract class BaseController<S extends BaseService<V, D, Q, C>, V, D, Q,
|
||||
@Operation(summary = "查询列表", description = "查询列表")
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
public List<V> list(Q query, SortQuery sortQuery) {
|
||||
public List<L> list(Q query, SortQuery sortQuery) {
|
||||
this.checkPermission(Api.LIST);
|
||||
return baseService.list(query, sortQuery);
|
||||
}
|
||||
@ -136,23 +136,23 @@ public abstract class BaseController<S extends BaseService<V, D, Q, C>, V, D, Q,
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param request
|
||||
* @param req
|
||||
* 创建信息
|
||||
* @return 自增 ID
|
||||
*/
|
||||
@Operation(summary = "新增数据", description = "新增数据")
|
||||
@ResponseBody
|
||||
@PostMapping
|
||||
public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody C request) {
|
||||
public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody C req) {
|
||||
this.checkPermission(Api.ADD);
|
||||
Long id = baseService.add(request);
|
||||
Long id = baseService.add(req);
|
||||
return R.ok("新增成功", id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param request
|
||||
* @param req
|
||||
* 修改信息
|
||||
* @param id
|
||||
* ID
|
||||
@ -162,9 +162,9 @@ public abstract class BaseController<S extends BaseService<V, D, Q, C>, V, D, Q,
|
||||
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
|
||||
@ResponseBody
|
||||
@PutMapping("/{id}")
|
||||
public R update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C request, @PathVariable Long id) {
|
||||
public R update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C req, @PathVariable Long id) {
|
||||
this.checkPermission(Api.UPDATE);
|
||||
baseService.update(request, id);
|
||||
baseService.update(req, id);
|
||||
return R.ok("修改成功");
|
||||
}
|
||||
|
||||
|
@ -26,13 +26,13 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* 详情 VO 基类
|
||||
* 详情响应基类
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/1/26 10:40
|
||||
*/
|
||||
@Data
|
||||
public class BaseDetailVO extends BaseVO {
|
||||
public class BaseDetailResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -21,13 +21,13 @@ import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Request 基类
|
||||
* 请求基类
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/1/30 21:51
|
||||
*/
|
||||
@Data
|
||||
public class BaseRequest implements Serializable {
|
||||
public class BaseReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -28,13 +28,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
/**
|
||||
* VO 基类
|
||||
* 响应基类
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/1/26 10:40
|
||||
*/
|
||||
@Data
|
||||
public class BaseVO implements Serializable {
|
||||
public class BaseResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -24,12 +24,12 @@ import cn.hutool.core.lang.tree.Tree;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.query.SortQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
|
||||
/**
|
||||
* 业务接口基类
|
||||
*
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表信息
|
||||
* @param <D>
|
||||
* 详情信息
|
||||
@ -40,7 +40,7 @@ import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
* @author Charles7c
|
||||
* @since 2023/1/26 16:54
|
||||
*/
|
||||
public interface BaseService<V, D, Q, C extends BaseRequest> {
|
||||
public interface BaseService<L, D, Q, C extends BaseReq> {
|
||||
|
||||
/**
|
||||
* 分页查询列表
|
||||
@ -51,7 +51,7 @@ public interface BaseService<V, D, Q, C extends BaseRequest> {
|
||||
* 分页查询条件
|
||||
* @return 分页列表信息
|
||||
*/
|
||||
PageDataVO<V> page(Q query, PageQuery pageQuery);
|
||||
PageDataResp<L> page(Q query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询树列表
|
||||
@ -75,7 +75,7 @@ public interface BaseService<V, D, Q, C extends BaseRequest> {
|
||||
* 排序查询条件
|
||||
* @return 列表信息
|
||||
*/
|
||||
List<V> list(Q query, SortQuery sortQuery);
|
||||
List<L> list(Q query, SortQuery sortQuery);
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
@ -89,21 +89,21 @@ public interface BaseService<V, D, Q, C extends BaseRequest> {
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param request
|
||||
* @param req
|
||||
* 创建信息
|
||||
* @return 自增 ID
|
||||
*/
|
||||
Long add(C request);
|
||||
Long add(C req);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param request
|
||||
* @param req
|
||||
* 修改信息
|
||||
* @param id
|
||||
* ID
|
||||
*/
|
||||
void update(C request, Long id);
|
||||
void update(C req, Long id);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
@ -44,7 +44,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
import top.charles7c.cnadmin.common.annotation.TreeField;
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.query.SortQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.common.service.CommonUserService;
|
||||
import top.charles7c.cnadmin.common.util.ExcelUtils;
|
||||
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
||||
@ -60,7 +60,7 @@ import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
* Mapper 接口
|
||||
* @param <T>
|
||||
* 实体类
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表信息
|
||||
* @param <D>
|
||||
* 详情信息
|
||||
@ -71,41 +71,41 @@ import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
* @author Charles7c
|
||||
* @since 2023/1/26 21:52
|
||||
*/
|
||||
public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO, V, D, Q, C extends BaseRequest>
|
||||
implements BaseService<V, D, Q, C> {
|
||||
public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO, L, D, Q, C extends BaseReq>
|
||||
implements BaseService<L, D, Q, C> {
|
||||
|
||||
@Autowired
|
||||
protected M baseMapper;
|
||||
|
||||
private final Class<T> entityClass;
|
||||
private final Class<V> voClass;
|
||||
private final Class<D> detailVoClass;
|
||||
private final Class<L> listClass;
|
||||
private final Class<D> detailClass;
|
||||
|
||||
protected BaseServiceImpl() {
|
||||
this.entityClass = (Class<T>)ClassUtil.getTypeArgument(this.getClass(), 1);
|
||||
this.voClass = (Class<V>)ClassUtil.getTypeArgument(this.getClass(), 2);
|
||||
this.detailVoClass = (Class<D>)ClassUtil.getTypeArgument(this.getClass(), 3);
|
||||
this.listClass = (Class<L>)ClassUtil.getTypeArgument(this.getClass(), 2);
|
||||
this.detailClass = (Class<D>)ClassUtil.getTypeArgument(this.getClass(), 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageDataVO<V> page(Q query, PageQuery pageQuery) {
|
||||
public PageDataResp<L> page(Q query, PageQuery pageQuery) {
|
||||
QueryWrapper<T> queryWrapper = QueryHelper.build(query);
|
||||
IPage<T> page = baseMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
PageDataVO<V> pageDataVO = PageDataVO.build(page, voClass);
|
||||
pageDataVO.getList().forEach(this::fill);
|
||||
return pageDataVO;
|
||||
PageDataResp<L> pageDataResp = PageDataResp.build(page, listClass);
|
||||
pageDataResp.getList().forEach(this::fill);
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tree<Long>> tree(Q query, SortQuery sortQuery, boolean isSimple) {
|
||||
List<V> list = this.list(query, sortQuery);
|
||||
List<L> list = this.list(query, sortQuery);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
|
||||
// 如果构建简单树结构,则不包含基本树结构之外的扩展字段
|
||||
TreeNodeConfig treeNodeConfig = TreeUtils.DEFAULT_CONFIG;
|
||||
TreeField treeField = voClass.getDeclaredAnnotation(TreeField.class);
|
||||
TreeField treeField = listClass.getDeclaredAnnotation(TreeField.class);
|
||||
if (!isSimple) {
|
||||
// 根据 @TreeField 配置生成树结构配置
|
||||
treeNodeConfig = TreeUtils.genTreeNodeConfig(treeField);
|
||||
@ -119,7 +119,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
tree.setName(ReflectUtil.invoke(node, StrUtil.genGetter(treeField.nameKey())));
|
||||
tree.setWeight(ReflectUtil.invoke(node, StrUtil.genGetter(treeField.weightKey())));
|
||||
if (!isSimple) {
|
||||
List<Field> fieldList = ReflectUtils.getNonStaticFields(voClass);
|
||||
List<Field> fieldList = ReflectUtils.getNonStaticFields(listClass);
|
||||
fieldList.removeIf(f -> StrUtil.containsAnyIgnoreCase(f.getName(), treeField.value(),
|
||||
treeField.parentIdKey(), treeField.nameKey(), treeField.weightKey(), treeField.childrenKey()));
|
||||
fieldList
|
||||
@ -129,8 +129,8 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<V> list(Q query, SortQuery sortQuery) {
|
||||
List<V> list = this.list(query, sortQuery, voClass);
|
||||
public List<L> list(Q query, SortQuery sortQuery) {
|
||||
List<L> list = this.list(query, sortQuery, listClass);
|
||||
list.forEach(this::fill);
|
||||
return list;
|
||||
}
|
||||
@ -174,27 +174,27 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
@Override
|
||||
public D get(Long id) {
|
||||
T entity = this.getById(id);
|
||||
D detailVO = BeanUtil.copyProperties(entity, detailVoClass);
|
||||
this.fillDetail(detailVO);
|
||||
return detailVO;
|
||||
D detail = BeanUtil.copyProperties(entity, detailClass);
|
||||
this.fillDetail(detail);
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long add(C request) {
|
||||
if (null == request) {
|
||||
public Long add(C req) {
|
||||
if (null == req) {
|
||||
return 0L;
|
||||
}
|
||||
T entity = BeanUtil.copyProperties(request, entityClass);
|
||||
T entity = BeanUtil.copyProperties(req, entityClass);
|
||||
baseMapper.insert(entity);
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(C request, Long id) {
|
||||
public void update(C req, Long id) {
|
||||
T entity = this.getById(id);
|
||||
BeanUtil.copyProperties(request, entity, CopyOptions.create().ignoreNullValue());
|
||||
BeanUtil.copyProperties(req, entity, CopyOptions.create().ignoreNullValue());
|
||||
baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@ -206,9 +206,9 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
|
||||
@Override
|
||||
public void export(Q query, SortQuery sortQuery, HttpServletResponse response) {
|
||||
List<D> list = this.list(query, sortQuery, detailVoClass);
|
||||
List<D> list = this.list(query, sortQuery, detailClass);
|
||||
list.forEach(this::fillDetail);
|
||||
ExcelUtils.export(list, "导出数据", detailVoClass, response);
|
||||
ExcelUtils.export(list, "导出数据", detailClass, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -231,14 +231,14 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
* 待填充列表信息
|
||||
*/
|
||||
protected void fill(Object baseObj) {
|
||||
if (baseObj instanceof BaseVO) {
|
||||
BaseVO baseVO = (BaseVO)baseObj;
|
||||
Long createUser = baseVO.getCreateUser();
|
||||
if (baseObj instanceof BaseResp) {
|
||||
BaseResp baseResp = (BaseResp)baseObj;
|
||||
Long createUser = baseResp.getCreateUser();
|
||||
if (null == createUser) {
|
||||
return;
|
||||
}
|
||||
CommonUserService userService = SpringUtil.getBean(CommonUserService.class);
|
||||
baseVO.setCreateUserString(ExceptionUtils.exToNull(() -> userService.getNicknameById(createUser)));
|
||||
baseResp.setCreateUserString(ExceptionUtils.exToNull(() -> userService.getNicknameById(createUser)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,16 +249,16 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
* 待填充详情信息
|
||||
*/
|
||||
public void fillDetail(Object detailObj) {
|
||||
if (detailObj instanceof BaseDetailVO) {
|
||||
BaseDetailVO detailVO = (BaseDetailVO)detailObj;
|
||||
this.fill(detailVO);
|
||||
if (detailObj instanceof BaseDetailResp) {
|
||||
BaseDetailResp detail = (BaseDetailResp)detailObj;
|
||||
this.fill(detail);
|
||||
|
||||
Long updateUser = detailVO.getUpdateUser();
|
||||
Long updateUser = detail.getUpdateUser();
|
||||
if (null == updateUser) {
|
||||
return;
|
||||
}
|
||||
CommonUserService userService = SpringUtil.getBean(CommonUserService.class);
|
||||
detailVO.setUpdateUserString(ExceptionUtils.exToNull(() -> userService.getNicknameById(updateUser)));
|
||||
detail.setUpdateUserString(ExceptionUtils.exToNull(() -> userService.getNicknameById(updateUser)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,12 @@ import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
/**
|
||||
* 枚举接口
|
||||
*
|
||||
* @param <V>
|
||||
* @param <T>
|
||||
* value 类型
|
||||
* @author Charles7c
|
||||
* @since 2023/2/5 20:44
|
||||
*/
|
||||
public interface IBaseEnum<V extends Serializable> extends IEnum<V> {
|
||||
public interface IBaseEnum<T extends Serializable> extends IEnum<T> {
|
||||
|
||||
/**
|
||||
* 枚举描述
|
||||
|
@ -64,7 +64,7 @@ public class SysConsts {
|
||||
public static final String LOGOUT_URI = "/auth/logout";
|
||||
|
||||
/**
|
||||
* VO 描述类字段后缀
|
||||
* 描述类字段后缀
|
||||
*/
|
||||
public static final String VO_DESCRIPTION_FIELD_SUFFIX = "String";
|
||||
public static final String DESCRIPTION_FIELD_SUFFIX = "String";
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.common.model.resp.R;
|
||||
|
||||
/**
|
||||
* 全局错误处理器
|
||||
|
@ -42,7 +42,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.exception.BadRequestException;
|
||||
import top.charles7c.cnadmin.common.exception.ServiceException;
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.common.model.resp.R;
|
||||
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
||||
import top.charles7c.cnadmin.common.util.StreamUtils;
|
||||
import top.charles7c.cnadmin.common.util.holder.LogContextHolder;
|
||||
|
@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.annotation.NoResponseAdvice;
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.common.model.resp.R;
|
||||
|
||||
/**
|
||||
* 全局响应结果处理器
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.common.model.request;
|
||||
package top.charles7c.cnadmin.common.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -34,7 +34,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "修改状态信息")
|
||||
public class UpdateStatusRequest implements Serializable {
|
||||
public class UpdateStatusReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.common.model.vo;
|
||||
package top.charles7c.cnadmin.common.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -32,7 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "验证码信息")
|
||||
public class CaptchaVO implements Serializable {
|
||||
public class CaptchaResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.common.model.vo;
|
||||
package top.charles7c.cnadmin.common.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -28,14 +28,14 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
/**
|
||||
* 键值对信息
|
||||
*
|
||||
* @param <V>
|
||||
* @param <T>
|
||||
* @author Charles7c
|
||||
* @since 2023/2/24 22:02
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "键值对信息")
|
||||
public class LabelValueVO<V> implements Serializable {
|
||||
public class LabelValueResp<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -49,7 +49,7 @@ public class LabelValueVO<V> implements Serializable {
|
||||
* 值
|
||||
*/
|
||||
@Schema(description = "值", example = "1")
|
||||
private V value;
|
||||
private T value;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
@ -58,12 +58,12 @@ public class LabelValueVO<V> implements Serializable {
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private String color;
|
||||
|
||||
public LabelValueVO(String label, V value) {
|
||||
public LabelValueResp(String label, T value) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public LabelValueVO(String label, V value, String color) {
|
||||
public LabelValueResp(String label, T value, String color) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
this.color = color;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.common.model.vo;
|
||||
package top.charles7c.cnadmin.common.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@ -32,14 +32,14 @@ import cn.hutool.core.collection.CollUtil;
|
||||
/**
|
||||
* 分页信息
|
||||
*
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表数据类型
|
||||
* @author Charles7c
|
||||
* @since 2023/1/14 23:40
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "分页信息")
|
||||
public class PageDataVO<V> implements Serializable {
|
||||
public class PageDataResp<L> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -47,7 +47,7 @@ public class PageDataVO<V> implements Serializable {
|
||||
* 列表数据
|
||||
*/
|
||||
@Schema(description = "列表数据")
|
||||
private List<V> list;
|
||||
private List<L> list;
|
||||
|
||||
/**
|
||||
* 总记录数
|
||||
@ -64,18 +64,18 @@ public class PageDataVO<V> implements Serializable {
|
||||
* 目标类型 Class 对象
|
||||
* @param <T>
|
||||
* 源列表数据类型
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 目标列表数据类型
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <T, V> PageDataVO<V> build(IPage<T> page, Class<V> targetClass) {
|
||||
public static <T, L> PageDataResp<L> build(IPage<T> page, Class<L> targetClass) {
|
||||
if (null == page) {
|
||||
return empty();
|
||||
}
|
||||
PageDataVO<V> pageDataVO = new PageDataVO<>();
|
||||
pageDataVO.setList(BeanUtil.copyToList(page.getRecords(), targetClass));
|
||||
pageDataVO.setTotal(page.getTotal());
|
||||
return pageDataVO;
|
||||
PageDataResp<L> pageDataResp = new PageDataResp<>();
|
||||
pageDataResp.setList(BeanUtil.copyToList(page.getRecords(), targetClass));
|
||||
pageDataResp.setTotal(page.getTotal());
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,18 +83,18 @@ public class PageDataVO<V> implements Serializable {
|
||||
*
|
||||
* @param page
|
||||
* MyBatis Plus 分页数据
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表数据类型
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <V> PageDataVO<V> build(IPage<V> page) {
|
||||
public static <L> PageDataResp<L> build(IPage<L> page) {
|
||||
if (null == page) {
|
||||
return empty();
|
||||
}
|
||||
PageDataVO<V> pageDataVO = new PageDataVO<>();
|
||||
pageDataVO.setList(page.getRecords());
|
||||
pageDataVO.setTotal(page.getTotal());
|
||||
return pageDataVO;
|
||||
PageDataResp<L> pageDataResp = new PageDataResp<>();
|
||||
pageDataResp.setList(page.getRecords());
|
||||
pageDataResp.setTotal(page.getTotal());
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,39 +106,39 @@ public class PageDataVO<V> implements Serializable {
|
||||
* 每页条数
|
||||
* @param list
|
||||
* 列表数据
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表数据类型
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <V> PageDataVO<V> build(int page, int size, List<V> list) {
|
||||
public static <L> PageDataResp<L> build(int page, int size, List<L> list) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return empty();
|
||||
}
|
||||
PageDataVO<V> pageDataVO = new PageDataVO<>();
|
||||
pageDataVO.setTotal(list.size());
|
||||
PageDataResp<L> pageDataResp = new PageDataResp<>();
|
||||
pageDataResp.setTotal(list.size());
|
||||
// 对列表数据进行分页
|
||||
int fromIndex = (page - 1) * size;
|
||||
int toIndex = page * size + size;
|
||||
if (fromIndex > list.size()) {
|
||||
pageDataVO.setList(new ArrayList<>(0));
|
||||
pageDataResp.setList(new ArrayList<>(0));
|
||||
} else if (toIndex >= list.size()) {
|
||||
pageDataVO.setList(list.subList(fromIndex, list.size()));
|
||||
pageDataResp.setList(list.subList(fromIndex, list.size()));
|
||||
} else {
|
||||
pageDataVO.setList(list.subList(fromIndex, toIndex));
|
||||
pageDataResp.setList(list.subList(fromIndex, toIndex));
|
||||
}
|
||||
return pageDataVO;
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 空分页信息
|
||||
*
|
||||
* @param <V>
|
||||
* @param <L>
|
||||
* 列表数据类型
|
||||
* @return 分页信息
|
||||
*/
|
||||
private static <V> PageDataVO<V> empty() {
|
||||
PageDataVO<V> pageDataVO = new PageDataVO<>();
|
||||
pageDataVO.setList(new ArrayList<>(0));
|
||||
return pageDataVO;
|
||||
private static <L> PageDataResp<L> empty() {
|
||||
PageDataResp<L> pageDataResp = new PageDataResp<>();
|
||||
pageDataResp.setList(new ArrayList<>(0));
|
||||
return pageDataResp;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.common.model.vo;
|
||||
package top.charles7c.cnadmin.common.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -37,7 +37,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
@Data
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
@Schema(description = "响应信息")
|
||||
public class R<V> implements Serializable {
|
||||
public class R<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -53,9 +53,9 @@ public class R<V> implements Serializable {
|
||||
@Schema(description = "业务状态信息", example = "操作成功")
|
||||
private String msg;
|
||||
|
||||
/** 返回数据 */
|
||||
@Schema(description = "返回数据")
|
||||
private V data;
|
||||
/** 响应数据 */
|
||||
@Schema(description = "响应数据")
|
||||
private T data;
|
||||
|
||||
/** 时间戳 */
|
||||
@Schema(description = "时间戳", example = "1691453288")
|
||||
@ -66,46 +66,46 @@ public class R<V> implements Serializable {
|
||||
/** 失败状态码 */
|
||||
private static final int FAIL_CODE = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
|
||||
private R(boolean success, int code, String msg, V data) {
|
||||
private R(boolean success, int code, String msg, T data) {
|
||||
this.success = success;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static <V> R<V> ok() {
|
||||
public static <T> R<T> ok() {
|
||||
return new R<>(true, SUCCESS_CODE, "操作成功", null);
|
||||
}
|
||||
|
||||
public static <V> R<V> ok(V data) {
|
||||
public static <T> R<T> ok(T data) {
|
||||
return new R<>(true, SUCCESS_CODE, "操作成功", data);
|
||||
}
|
||||
|
||||
public static <V> R<V> ok(String msg) {
|
||||
public static <T> R<T> ok(String msg) {
|
||||
return new R<>(true, SUCCESS_CODE, msg, null);
|
||||
}
|
||||
|
||||
public static <V> R<V> ok(String msg, V data) {
|
||||
public static <T> R<T> ok(String msg, T data) {
|
||||
return new R<>(true, SUCCESS_CODE, msg, data);
|
||||
}
|
||||
|
||||
public static <V> R<V> fail() {
|
||||
public static <T> R<T> fail() {
|
||||
return new R<>(false, FAIL_CODE, "操作失败", null);
|
||||
}
|
||||
|
||||
public static <V> R<V> fail(String msg) {
|
||||
public static <T> R<T> fail(String msg) {
|
||||
return new R<>(false, FAIL_CODE, msg, null);
|
||||
}
|
||||
|
||||
public static <V> R<V> fail(V data) {
|
||||
public static <T> R<T> fail(T data) {
|
||||
return new R<>(false, FAIL_CODE, "操作失败", data);
|
||||
}
|
||||
|
||||
public static <V> R<V> fail(String msg, V data) {
|
||||
public static <T> R<T> fail(String msg, T data) {
|
||||
return new R<>(false, FAIL_CODE, msg, data);
|
||||
}
|
||||
|
||||
public static <V> R<V> fail(int code, String msg) {
|
||||
public static <T> R<T> fail(int code, String msg) {
|
||||
return new R<>(false, code, msg, null);
|
||||
}
|
||||
}
|
@ -57,7 +57,7 @@ public class ExcelUtils {
|
||||
* @param response
|
||||
* 响应对象
|
||||
*/
|
||||
public static <V> void export(List<V> list, String fileName, Class<V> clazz, HttpServletResponse response) {
|
||||
public static <T> void export(List<T> list, String fileName, Class<T> clazz, HttpServletResponse response) {
|
||||
export(list, fileName, "Sheet1", clazz, response);
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public class ExcelUtils {
|
||||
* @param response
|
||||
* 响应对象
|
||||
*/
|
||||
public static <V> void export(List<V> list, String fileName, String sheetName, Class<V> clazz,
|
||||
public static <T> void export(List<T> list, String fileName, String sheetName, Class<T> clazz,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
fileName =
|
||||
|
@ -61,7 +61,7 @@ public class ServletUtils {
|
||||
* 获取浏览器及其版本信息
|
||||
*
|
||||
* @param request
|
||||
* 请求信息
|
||||
* 请求对象
|
||||
* @return 浏览器及其版本信息
|
||||
*/
|
||||
public static String getBrowser(HttpServletRequest request) {
|
||||
|
@ -50,11 +50,11 @@ import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import top.charles7c.cnadmin.auth.model.request.AccountLoginRequest;
|
||||
import top.charles7c.cnadmin.auth.model.req.AccountLoginReq;
|
||||
import top.charles7c.cnadmin.common.constant.StringConsts;
|
||||
import top.charles7c.cnadmin.common.constant.SysConsts;
|
||||
import top.charles7c.cnadmin.common.model.dto.LogContext;
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.common.model.resp.R;
|
||||
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
||||
import top.charles7c.cnadmin.common.util.IpUtils;
|
||||
import top.charles7c.cnadmin.common.util.ServletUtils;
|
||||
@ -225,9 +225,9 @@ public class LogInterceptor implements HandlerInterceptor {
|
||||
logDO.setCreateUser(null);
|
||||
}
|
||||
if (null == logDO.getCreateUser() && SysConsts.LOGIN_URI.equals(requestURI)) {
|
||||
AccountLoginRequest loginRequest = JSONUtil.toBean(requestBody, AccountLoginRequest.class);
|
||||
AccountLoginReq loginReq = JSONUtil.toBean(requestBody, AccountLoginReq.class);
|
||||
logDO.setCreateUser(
|
||||
ExceptionUtils.exToNull(() -> userService.getByUsername(loginRequest.getUsername()).getId()));
|
||||
ExceptionUtils.exToNull(() -> userService.getByUsername(loginReq.getUsername()).getId()));
|
||||
}
|
||||
if (StrUtil.isNotBlank(requestBody)) {
|
||||
if (JSONUtil.isTypeJSONObject(requestBody)) {
|
||||
|
@ -23,9 +23,9 @@ import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseMapper;
|
||||
import top.charles7c.cnadmin.monitor.model.entity.LogDO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardAccessTrendVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardPopularModuleVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardAccessTrendResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardPopularModuleResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardTotalResp;
|
||||
|
||||
/**
|
||||
* 系统日志 Mapper
|
||||
@ -40,7 +40,7 @@ public interface LogMapper extends BaseMapper<LogDO> {
|
||||
*
|
||||
* @return 仪表盘总计信息
|
||||
*/
|
||||
DashboardTotalVO selectDashboardTotal();
|
||||
DashboardTotalResp selectDashboardTotal();
|
||||
|
||||
/**
|
||||
* 查询仪表盘访问趋势信息
|
||||
@ -50,14 +50,14 @@ public interface LogMapper extends BaseMapper<LogDO> {
|
||||
*
|
||||
* @return 仪表盘访问趋势信息
|
||||
*/
|
||||
List<DashboardAccessTrendVO> selectListDashboardAccessTrend(@Param("days") Integer days);
|
||||
List<DashboardAccessTrendResp> selectListDashboardAccessTrend(@Param("days") Integer days);
|
||||
|
||||
/**
|
||||
* 查询仪表盘热门模块列表
|
||||
*
|
||||
* @return 仪表盘热门模块列表
|
||||
*/
|
||||
List<DashboardPopularModuleVO> selectListDashboardPopularModule();
|
||||
List<DashboardPopularModuleResp> selectListDashboardPopularModule();
|
||||
|
||||
/**
|
||||
* 查询仪表盘访客地域分布信息
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "仪表盘-访问趋势信息")
|
||||
public class DashboardAccessTrendVO implements Serializable {
|
||||
public class DashboardAccessTrendResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -32,7 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "仪表盘-访客地域分布信息")
|
||||
public class DashboardGeoDistributionVO implements Serializable {
|
||||
public class DashboardGeoDistributionResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "仪表盘-热门模块信息")
|
||||
public class DashboardPopularModuleVO implements Serializable {
|
||||
public class DashboardPopularModuleResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "仪表盘-总计信息")
|
||||
public class DashboardTotalVO implements Serializable {
|
||||
public class DashboardTotalResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
* @since 2023/1/17 21:43
|
||||
*/
|
||||
@Data
|
||||
public class LogVO implements Serializable {
|
||||
public class LogResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -30,7 +30,7 @@ import top.charles7c.cnadmin.monitor.enums.LogStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "登录日志信息")
|
||||
public class LoginLogVO extends LogVO {
|
||||
public class LoginLogResp extends LogResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -30,7 +30,7 @@ import top.charles7c.cnadmin.monitor.enums.LogStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "操作日志信息")
|
||||
public class OperationLogVO extends LogVO {
|
||||
public class OperationLogResp extends LogResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -28,7 +28,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "系统日志详情信息")
|
||||
public class SystemLogDetailVO extends LogVO {
|
||||
public class SystemLogDetailResp extends LogResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
package top.charles7c.cnadmin.monitor.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -28,7 +28,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "系统日志信息")
|
||||
public class SystemLogVO extends LogVO {
|
||||
public class SystemLogResp extends LogResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -18,11 +18,11 @@ package top.charles7c.cnadmin.monitor.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardAccessTrendVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardGeoDistributionVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardPopularModuleVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardAccessTrendResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardGeoDistributionResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardPopularModuleResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardTotalResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DashboardAnnouncementResp;
|
||||
|
||||
/**
|
||||
* 仪表盘业务接口
|
||||
@ -37,7 +37,7 @@ public interface DashboardService {
|
||||
*
|
||||
* @return 总计信息
|
||||
*/
|
||||
DashboardTotalVO getTotal();
|
||||
DashboardTotalResp getTotal();
|
||||
|
||||
/**
|
||||
* 查询访问趋势信息
|
||||
@ -46,26 +46,26 @@ public interface DashboardService {
|
||||
* 日期数
|
||||
* @return 访问趋势信息
|
||||
*/
|
||||
List<DashboardAccessTrendVO> listAccessTrend(Integer days);
|
||||
List<DashboardAccessTrendResp> listAccessTrend(Integer days);
|
||||
|
||||
/**
|
||||
* 查询热门模块列表
|
||||
*
|
||||
* @return 热门模块列表
|
||||
*/
|
||||
List<DashboardPopularModuleVO> listPopularModule();
|
||||
List<DashboardPopularModuleResp> listPopularModule();
|
||||
|
||||
/**
|
||||
* 查询访客地域分布信息
|
||||
*
|
||||
* @return 访客地域分布信息
|
||||
*/
|
||||
DashboardGeoDistributionVO getGeoDistribution();
|
||||
DashboardGeoDistributionResp getGeoDistribution();
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @return 公告列表
|
||||
*/
|
||||
List<DashboardAnnouncementVO> listAnnouncement();
|
||||
List<DashboardAnnouncementResp> listAnnouncement();
|
||||
}
|
||||
|
@ -20,11 +20,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.monitor.model.query.LoginLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.query.OperationLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.query.SystemLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.*;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.*;
|
||||
|
||||
/**
|
||||
* 系统日志业务接口
|
||||
@ -43,7 +43,7 @@ public interface LogService {
|
||||
* 分页查询条件
|
||||
* @return 操作日志分页信息
|
||||
*/
|
||||
PageDataVO<OperationLogVO> page(OperationLogQuery query, PageQuery pageQuery);
|
||||
PageDataResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 分页查询登录日志列表
|
||||
@ -54,7 +54,7 @@ public interface LogService {
|
||||
* 分页查询条件
|
||||
* @return 登录日志分页信息
|
||||
*/
|
||||
PageDataVO<LoginLogVO> page(LoginLogQuery query, PageQuery pageQuery);
|
||||
PageDataResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 分页查询系统日志列表
|
||||
@ -65,7 +65,7 @@ public interface LogService {
|
||||
* 分页查询条件
|
||||
* @return 系统日志分页信息
|
||||
*/
|
||||
PageDataVO<SystemLogVO> page(SystemLogQuery query, PageQuery pageQuery);
|
||||
PageDataResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查看系统日志详情
|
||||
@ -74,28 +74,28 @@ public interface LogService {
|
||||
* 日志 ID
|
||||
* @return 系统日志详情
|
||||
*/
|
||||
SystemLogDetailVO get(Long logId);
|
||||
SystemLogDetailResp get(Long logId);
|
||||
|
||||
/**
|
||||
* 查询仪表盘总计信息
|
||||
*
|
||||
* @return 仪表盘总计信息
|
||||
*/
|
||||
DashboardTotalVO getDashboardTotal();
|
||||
DashboardTotalResp getDashboardTotal();
|
||||
|
||||
/**
|
||||
* 查询仪表盘访问趋势信息
|
||||
*
|
||||
* @return 仪表盘访问趋势信息
|
||||
*/
|
||||
List<DashboardAccessTrendVO> listDashboardAccessTrend(Integer days);
|
||||
List<DashboardAccessTrendResp> listDashboardAccessTrend(Integer days);
|
||||
|
||||
/**
|
||||
* 查询仪表盘热门模块列表
|
||||
*
|
||||
* @return 仪表盘热门模块列表
|
||||
*/
|
||||
List<DashboardPopularModuleVO> listDashboardPopularModule();
|
||||
List<DashboardPopularModuleResp> listDashboardPopularModule();
|
||||
|
||||
/**
|
||||
* 查询仪表盘访客地域分布信息
|
||||
|
@ -31,13 +31,13 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.constant.CacheConsts;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardAccessTrendVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardGeoDistributionVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardPopularModuleVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardAccessTrendResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardGeoDistributionResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardPopularModuleResp;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.DashboardTotalResp;
|
||||
import top.charles7c.cnadmin.monitor.service.DashboardService;
|
||||
import top.charles7c.cnadmin.monitor.service.LogService;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.resp.DashboardAnnouncementResp;
|
||||
import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
|
||||
/**
|
||||
@ -55,27 +55,27 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
private final AnnouncementService announcementService;
|
||||
|
||||
@Override
|
||||
public DashboardTotalVO getTotal() {
|
||||
DashboardTotalVO totalVO = logService.getDashboardTotal();
|
||||
Long todayPvCount = totalVO.getTodayPvCount();
|
||||
Long yesterdayPvCount = totalVO.getYesterdayPvCount();
|
||||
public DashboardTotalResp getTotal() {
|
||||
DashboardTotalResp totalResp = logService.getDashboardTotal();
|
||||
Long todayPvCount = totalResp.getTodayPvCount();
|
||||
Long yesterdayPvCount = totalResp.getYesterdayPvCount();
|
||||
BigDecimal newPvCountFromYesterday = NumberUtil.sub(todayPvCount, yesterdayPvCount);
|
||||
BigDecimal newPvFromYesterday = (0 == yesterdayPvCount) ? BigDecimal.valueOf(100)
|
||||
: NumberUtil.round(NumberUtil.mul(NumberUtil.div(newPvCountFromYesterday, yesterdayPvCount), 100), 1);
|
||||
totalVO.setNewPvFromYesterday(newPvFromYesterday);
|
||||
return totalVO;
|
||||
totalResp.setNewPvFromYesterday(newPvFromYesterday);
|
||||
return totalResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(key = "#days")
|
||||
public List<DashboardAccessTrendVO> listAccessTrend(Integer days) {
|
||||
public List<DashboardAccessTrendResp> listAccessTrend(Integer days) {
|
||||
return logService.listDashboardAccessTrend(days);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DashboardPopularModuleVO> listPopularModule() {
|
||||
List<DashboardPopularModuleVO> popularModuleList = logService.listDashboardPopularModule();
|
||||
for (DashboardPopularModuleVO popularModule : popularModuleList) {
|
||||
public List<DashboardPopularModuleResp> listPopularModule() {
|
||||
List<DashboardPopularModuleResp> popularModuleList = logService.listDashboardPopularModule();
|
||||
for (DashboardPopularModuleResp popularModule : popularModuleList) {
|
||||
Long todayPvCount = popularModule.getTodayPvCount();
|
||||
Long yesterdayPvCount = popularModule.getYesterdayPvCount();
|
||||
BigDecimal newPvCountFromYesterday = NumberUtil.sub(todayPvCount, yesterdayPvCount);
|
||||
@ -87,9 +87,9 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DashboardGeoDistributionVO getGeoDistribution() {
|
||||
public DashboardGeoDistributionResp getGeoDistribution() {
|
||||
List<Map<String, Object>> locationIpStatistics = logService.listDashboardGeoDistribution();
|
||||
DashboardGeoDistributionVO geoDistribution = new DashboardGeoDistributionVO();
|
||||
DashboardGeoDistributionResp geoDistribution = new DashboardGeoDistributionResp();
|
||||
geoDistribution.setLocationIpStatistics(locationIpStatistics);
|
||||
geoDistribution.setLocations(
|
||||
locationIpStatistics.stream().map(m -> Convert.toStr(m.get("name"))).collect(Collectors.toList()));
|
||||
@ -97,7 +97,7 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DashboardAnnouncementVO> listAnnouncement() {
|
||||
public List<DashboardAnnouncementResp> listAnnouncement() {
|
||||
return announcementService.listDashboard();
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.constant.SysConsts;
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.common.service.CommonUserService;
|
||||
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
||||
import top.charles7c.cnadmin.common.util.ReflectUtils;
|
||||
@ -46,7 +46,7 @@ import top.charles7c.cnadmin.monitor.model.entity.LogDO;
|
||||
import top.charles7c.cnadmin.monitor.model.query.LoginLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.query.OperationLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.query.SystemLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.*;
|
||||
import top.charles7c.cnadmin.monitor.model.resp.*;
|
||||
import top.charles7c.cnadmin.monitor.service.LogService;
|
||||
|
||||
/**
|
||||
@ -70,93 +70,93 @@ public class LogServiceImpl implements LogService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageDataVO<OperationLogVO> page(OperationLogQuery query, PageQuery pageQuery) {
|
||||
public PageDataResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query);
|
||||
|
||||
// 限定查询信息
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(OperationLogVO.class);
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(OperationLogResp.class);
|
||||
List<String> columnNameList =
|
||||
fieldNameList.stream().filter(n -> !n.endsWith(SysConsts.VO_DESCRIPTION_FIELD_SUFFIX))
|
||||
fieldNameList.stream().filter(n -> !n.endsWith(SysConsts.DESCRIPTION_FIELD_SUFFIX))
|
||||
.map(StrUtil::toUnderlineCase).collect(Collectors.toList());
|
||||
queryWrapper.select(columnNameList);
|
||||
|
||||
// 分页查询
|
||||
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
PageDataVO<OperationLogVO> pageDataVO = PageDataVO.build(page, OperationLogVO.class);
|
||||
PageDataResp<OperationLogResp> pageDataResp = PageDataResp.build(page, OperationLogResp.class);
|
||||
|
||||
// 填充数据(如果是查询个人操作日志,只查询一次用户信息即可)
|
||||
if (null != query.getUid()) {
|
||||
String nickname = ExceptionUtils.exToNull(() -> commonUserService.getNicknameById(query.getUid()));
|
||||
pageDataVO.getList().forEach(o -> o.setCreateUserString(nickname));
|
||||
pageDataResp.getList().forEach(o -> o.setCreateUserString(nickname));
|
||||
} else {
|
||||
pageDataVO.getList().forEach(this::fill);
|
||||
pageDataResp.getList().forEach(this::fill);
|
||||
}
|
||||
return pageDataVO;
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageDataVO<LoginLogVO> page(LoginLogQuery query, PageQuery pageQuery) {
|
||||
public PageDataResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query);
|
||||
queryWrapper.eq("module", "登录");
|
||||
|
||||
// 限定查询信息
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(LoginLogVO.class);
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(LoginLogResp.class);
|
||||
List<String> columnNameList =
|
||||
fieldNameList.stream().filter(n -> !n.endsWith(SysConsts.VO_DESCRIPTION_FIELD_SUFFIX))
|
||||
fieldNameList.stream().filter(n -> !n.endsWith(SysConsts.DESCRIPTION_FIELD_SUFFIX))
|
||||
.map(StrUtil::toUnderlineCase).collect(Collectors.toList());
|
||||
queryWrapper.select(columnNameList);
|
||||
|
||||
// 分页查询
|
||||
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
PageDataVO<LoginLogVO> pageDataVO = PageDataVO.build(page, LoginLogVO.class);
|
||||
PageDataResp<LoginLogResp> pageDataResp = PageDataResp.build(page, LoginLogResp.class);
|
||||
|
||||
// 填充数据
|
||||
pageDataVO.getList().forEach(this::fill);
|
||||
return pageDataVO;
|
||||
pageDataResp.getList().forEach(this::fill);
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageDataVO<SystemLogVO> page(SystemLogQuery query, PageQuery pageQuery) {
|
||||
public PageDataResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query);
|
||||
|
||||
// 限定查询信息
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(SystemLogVO.class);
|
||||
List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(SystemLogResp.class);
|
||||
List<String> columnNameList =
|
||||
fieldNameList.stream().filter(n -> !n.endsWith(SysConsts.VO_DESCRIPTION_FIELD_SUFFIX))
|
||||
fieldNameList.stream().filter(n -> !n.endsWith(SysConsts.DESCRIPTION_FIELD_SUFFIX))
|
||||
.map(StrUtil::toUnderlineCase).collect(Collectors.toList());
|
||||
queryWrapper.select(columnNameList);
|
||||
|
||||
// 分页查询
|
||||
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
PageDataVO<SystemLogVO> pageDataVO = PageDataVO.build(page, SystemLogVO.class);
|
||||
PageDataResp<SystemLogResp> pageDataResp = PageDataResp.build(page, SystemLogResp.class);
|
||||
|
||||
// 填充数据
|
||||
pageDataVO.getList().forEach(this::fill);
|
||||
return pageDataVO;
|
||||
pageDataResp.getList().forEach(this::fill);
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemLogDetailVO get(Long id) {
|
||||
public SystemLogDetailResp get(Long id) {
|
||||
LogDO logDO = logMapper.selectById(id);
|
||||
CheckUtils.throwIfNotExists(logDO, "LogDO", "ID", id);
|
||||
|
||||
SystemLogDetailVO detailVO = BeanUtil.copyProperties(logDO, SystemLogDetailVO.class);
|
||||
SystemLogDetailResp detailVO = BeanUtil.copyProperties(logDO, SystemLogDetailResp.class);
|
||||
this.fill(detailVO);
|
||||
return detailVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DashboardTotalVO getDashboardTotal() {
|
||||
public DashboardTotalResp getDashboardTotal() {
|
||||
return logMapper.selectDashboardTotal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DashboardAccessTrendVO> listDashboardAccessTrend(Integer days) {
|
||||
public List<DashboardAccessTrendResp> listDashboardAccessTrend(Integer days) {
|
||||
return logMapper.selectListDashboardAccessTrend(days);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DashboardPopularModuleVO> listDashboardPopularModule() {
|
||||
public List<DashboardPopularModuleResp> listDashboardPopularModule() {
|
||||
return logMapper.selectListDashboardPopularModule();
|
||||
}
|
||||
|
||||
@ -168,14 +168,14 @@ public class LogServiceImpl implements LogService {
|
||||
/**
|
||||
* 填充数据
|
||||
*
|
||||
* @param logVO
|
||||
* @param logResp
|
||||
* 日志信息
|
||||
*/
|
||||
private void fill(LogVO logVO) {
|
||||
Long createUser = logVO.getCreateUser();
|
||||
private void fill(LogResp logResp) {
|
||||
Long createUser = logResp.getCreateUser();
|
||||
if (null == createUser) {
|
||||
return;
|
||||
}
|
||||
logVO.setCreateUserString(ExceptionUtils.exToNull(() -> commonUserService.getNicknameById(createUser)));
|
||||
logResp.setCreateUserString(ExceptionUtils.exToNull(() -> commonUserService.getNicknameById(createUser)));
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="top.charles7c.cnadmin.monitor.mapper.LogMapper">
|
||||
<select id="selectDashboardTotal" resultType="top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO">
|
||||
<select id="selectDashboardTotal" resultType="top.charles7c.cnadmin.monitor.model.resp.DashboardTotalResp">
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM `sys_log`) AS pvCount,
|
||||
(SELECT COUNT(DISTINCT `client_ip`) FROM `sys_log`) AS ipCount,
|
||||
@ -10,7 +10,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardAccessTrend"
|
||||
resultType="top.charles7c.cnadmin.monitor.model.vo.DashboardAccessTrendVO">
|
||||
resultType="top.charles7c.cnadmin.monitor.model.resp.DashboardAccessTrendResp">
|
||||
SELECT
|
||||
DATE(`create_time`) AS date,
|
||||
COUNT(*) AS pvCount,
|
||||
@ -23,7 +23,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectListDashboardPopularModule"
|
||||
resultType="top.charles7c.cnadmin.monitor.model.vo.DashboardPopularModuleVO">
|
||||
resultType="top.charles7c.cnadmin.monitor.model.resp.DashboardPopularModuleResp">
|
||||
SELECT
|
||||
`module`,
|
||||
COUNT(*) AS pvCount,
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.request;
|
||||
package top.charles7c.cnadmin.auth.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -32,7 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账号登录信息")
|
||||
public class AccountLoginRequest implements Serializable {
|
||||
public class AccountLoginReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.request;
|
||||
package top.charles7c.cnadmin.auth.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -37,7 +37,7 @@ import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "邮箱登录信息")
|
||||
public class EmailLoginRequest implements Serializable {
|
||||
public class EmailLoginReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.request;
|
||||
package top.charles7c.cnadmin.auth.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -37,7 +37,7 @@ import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "手机号登录信息")
|
||||
public class PhoneLoginRequest implements Serializable {
|
||||
public class PhoneLoginReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.vo;
|
||||
package top.charles7c.cnadmin.auth.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -32,7 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "令牌信息")
|
||||
public class LoginVO implements Serializable {
|
||||
public class LoginResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.vo;
|
||||
package top.charles7c.cnadmin.auth.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "元数据信息")
|
||||
public class MetaVO implements Serializable {
|
||||
public class MetaResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.vo;
|
||||
package top.charles7c.cnadmin.auth.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@ -31,7 +31,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "在线用户信息")
|
||||
public class OnlineUserVO implements Serializable {
|
||||
public class OnlineUserResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.vo;
|
||||
package top.charles7c.cnadmin.auth.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -34,7 +34,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
@Data
|
||||
@Schema(description = "路由信息")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
public class RouteVO implements Serializable {
|
||||
public class RouteResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -60,11 +60,11 @@ public class RouteVO implements Serializable {
|
||||
* 元数据
|
||||
*/
|
||||
@Schema(description = "元数据")
|
||||
private MetaVO meta;
|
||||
private MetaResp meta;
|
||||
|
||||
/**
|
||||
* 子路由列表
|
||||
*/
|
||||
@Schema(description = "子路由列表")
|
||||
private List<RouteVO> children;
|
||||
private List<RouteResp> children;
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.model.vo;
|
||||
package top.charles7c.cnadmin.auth.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
@ -39,7 +39,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户信息")
|
||||
public class UserInfoVO implements Serializable {
|
||||
public class UserInfoResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -18,7 +18,7 @@ package top.charles7c.cnadmin.auth.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.auth.model.vo.RouteVO;
|
||||
import top.charles7c.cnadmin.auth.model.resp.RouteResp;
|
||||
|
||||
import me.zhyd.oauth.model.AuthUser;
|
||||
|
||||
@ -75,5 +75,5 @@ public interface LoginService {
|
||||
* 用户 ID
|
||||
* @return 路由树
|
||||
*/
|
||||
List<RouteVO> buildRouteTree(Long userId);
|
||||
List<RouteResp> buildRouteTree(Long userId);
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ package top.charles7c.cnadmin.auth.service;
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.auth.model.query.OnlineUserQuery;
|
||||
import top.charles7c.cnadmin.auth.model.vo.OnlineUserVO;
|
||||
import top.charles7c.cnadmin.auth.model.resp.OnlineUserResp;
|
||||
import top.charles7c.cnadmin.common.model.dto.LoginUser;
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
|
||||
/**
|
||||
* 在线用户业务接口
|
||||
@ -41,7 +41,7 @@ public interface OnlineUserService {
|
||||
* 分页查询条件
|
||||
* @return 分页列表信息
|
||||
*/
|
||||
PageDataVO<OnlineUserVO> page(OnlineUserQuery query, PageQuery pageQuery);
|
||||
PageDataResp<OnlineUserResp> page(OnlineUserQuery query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
|
@ -34,8 +34,8 @@ import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import top.charles7c.cnadmin.auth.model.vo.MetaVO;
|
||||
import top.charles7c.cnadmin.auth.model.vo.RouteVO;
|
||||
import top.charles7c.cnadmin.auth.model.resp.MetaResp;
|
||||
import top.charles7c.cnadmin.auth.model.resp.RouteResp;
|
||||
import top.charles7c.cnadmin.auth.service.LoginService;
|
||||
import top.charles7c.cnadmin.auth.service.PermissionService;
|
||||
import top.charles7c.cnadmin.common.annotation.TreeField;
|
||||
@ -55,9 +55,9 @@ import top.charles7c.cnadmin.system.enums.MessageTemplateEnum;
|
||||
import top.charles7c.cnadmin.system.model.entity.RoleDO;
|
||||
import top.charles7c.cnadmin.system.model.entity.UserDO;
|
||||
import top.charles7c.cnadmin.system.model.entity.UserSocialDO;
|
||||
import top.charles7c.cnadmin.system.model.request.MessageRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.DeptDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.MenuVO;
|
||||
import top.charles7c.cnadmin.system.model.req.MessageReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.DeptDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.MenuResp;
|
||||
import top.charles7c.cnadmin.system.service.*;
|
||||
|
||||
import me.zhyd.oauth.model.AuthUser;
|
||||
@ -150,22 +150,22 @@ public class LoginServiceImpl implements LoginService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RouteVO> buildRouteTree(Long userId) {
|
||||
public List<RouteResp> buildRouteTree(Long userId) {
|
||||
Set<String> roleCodeSet = permissionService.listRoleCodeByUserId(userId);
|
||||
if (CollUtil.isEmpty(roleCodeSet)) {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
// 查询菜单列表
|
||||
Set<MenuVO> menuSet = new LinkedHashSet<>();
|
||||
Set<MenuResp> menuSet = new LinkedHashSet<>();
|
||||
if (roleCodeSet.contains(SysConsts.ADMIN_ROLE_CODE)) {
|
||||
menuSet.addAll(menuService.list());
|
||||
} else {
|
||||
roleCodeSet.forEach(roleCode -> menuSet.addAll(menuService.listByRoleCode(roleCode)));
|
||||
}
|
||||
List<MenuVO> menuList =
|
||||
List<MenuResp> menuList =
|
||||
menuSet.stream().filter(m -> !MenuTypeEnum.BUTTON.equals(m.getType())).collect(Collectors.toList());
|
||||
// 构建路由树
|
||||
TreeField treeField = MenuVO.class.getDeclaredAnnotation(TreeField.class);
|
||||
TreeField treeField = MenuResp.class.getDeclaredAnnotation(TreeField.class);
|
||||
TreeNodeConfig treeNodeConfig = TreeUtils.genTreeNodeConfig(treeField);
|
||||
List<Tree<Long>> treeList = TreeUtils.build(menuList, treeNodeConfig, (m, tree) -> {
|
||||
tree.setId(m.getId());
|
||||
@ -175,15 +175,15 @@ public class LoginServiceImpl implements LoginService {
|
||||
tree.putExtra("path", m.getPath());
|
||||
tree.putExtra("name", m.getName());
|
||||
tree.putExtra("component", m.getComponent());
|
||||
MetaVO metaVO = new MetaVO();
|
||||
metaVO.setLocale(m.getTitle());
|
||||
metaVO.setIcon(m.getIcon());
|
||||
metaVO.setIgnoreCache(!m.getIsCache());
|
||||
metaVO.setHideInMenu(m.getIsHidden());
|
||||
metaVO.setOrder(m.getSort());
|
||||
tree.putExtra("meta", metaVO);
|
||||
MetaResp metaResp = new MetaResp();
|
||||
metaResp.setLocale(m.getTitle());
|
||||
metaResp.setIcon(m.getIcon());
|
||||
metaResp.setIgnoreCache(!m.getIsCache());
|
||||
metaResp.setHideInMenu(m.getIsHidden());
|
||||
metaResp.setOrder(m.getSort());
|
||||
tree.putExtra("meta", metaResp);
|
||||
});
|
||||
return BeanUtil.copyToList(treeList, RouteVO.class);
|
||||
return BeanUtil.copyToList(treeList, RouteResp.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -210,8 +210,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
*/
|
||||
private void checkUserStatus(UserDO user) {
|
||||
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, user.getStatus(), "此账号已被禁用,如有疑问,请联系管理员");
|
||||
DeptDetailVO deptDetailVO = deptService.get(user.getDeptId());
|
||||
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, deptDetailVO.getStatus(), "此账号所属部门已被禁用,如有疑问,请联系管理员");
|
||||
DeptDetailResp deptDetailResp = deptService.get(user.getDeptId());
|
||||
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, deptDetailResp.getStatus(), "此账号所属部门已被禁用,如有疑问,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -221,11 +221,11 @@ public class LoginServiceImpl implements LoginService {
|
||||
* 用户信息
|
||||
*/
|
||||
private void sendSystemMsg(UserDO user) {
|
||||
MessageRequest request = new MessageRequest();
|
||||
MessageReq req = new MessageReq();
|
||||
MessageTemplateEnum socialRegister = MessageTemplateEnum.SOCIAL_REGISTER;
|
||||
request.setTitle(StrUtil.format(socialRegister.getTitle(), projectProperties.getName()));
|
||||
request.setContent(StrUtil.format(socialRegister.getContent(), user.getNickname()));
|
||||
request.setType(MessageTypeEnum.SYSTEM);
|
||||
messageService.add(request, CollUtil.toList(user.getId()));
|
||||
req.setTitle(StrUtil.format(socialRegister.getTitle(), projectProperties.getName()));
|
||||
req.setContent(StrUtil.format(socialRegister.getContent(), user.getNickname()));
|
||||
req.setType(MessageTypeEnum.SYSTEM);
|
||||
messageService.add(req, CollUtil.toList(user.getId()));
|
||||
}
|
||||
}
|
||||
|
@ -32,12 +32,12 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import top.charles7c.cnadmin.auth.model.query.OnlineUserQuery;
|
||||
import top.charles7c.cnadmin.auth.model.vo.OnlineUserVO;
|
||||
import top.charles7c.cnadmin.auth.model.resp.OnlineUserResp;
|
||||
import top.charles7c.cnadmin.auth.service.OnlineUserService;
|
||||
import top.charles7c.cnadmin.common.constant.StringConsts;
|
||||
import top.charles7c.cnadmin.common.model.dto.LoginUser;
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.common.util.helper.LoginHelper;
|
||||
|
||||
/**
|
||||
@ -51,12 +51,12 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper;
|
||||
public class OnlineUserServiceImpl implements OnlineUserService {
|
||||
|
||||
@Override
|
||||
public PageDataVO<OnlineUserVO> page(OnlineUserQuery query, PageQuery pageQuery) {
|
||||
public PageDataResp<OnlineUserResp> page(OnlineUserQuery query, PageQuery pageQuery) {
|
||||
List<LoginUser> loginUserList = this.list(query);
|
||||
List<OnlineUserVO> list = BeanUtil.copyToList(loginUserList, OnlineUserVO.class);
|
||||
PageDataVO<OnlineUserVO> pageDataVO = PageDataVO.build(pageQuery.getPage(), pageQuery.getSize(), list);
|
||||
pageDataVO.getList().forEach(u -> u.setNickname(LoginHelper.getNickname(u.getId())));
|
||||
return pageDataVO;
|
||||
List<OnlineUserResp> list = BeanUtil.copyToList(loginUserList, OnlineUserResp.class);
|
||||
PageDataResp<OnlineUserResp> pageDataResp = PageDataResp.build(pageQuery.getPage(), pageQuery.getSize(), list);
|
||||
pageDataResp.getList().forEach(u -> u.setNickname(LoginHelper.getNickname(u.getId())));
|
||||
return pageDataResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.AnnouncementDO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.resp.DashboardAnnouncementResp;
|
||||
|
||||
/**
|
||||
* 公告 Mapper
|
||||
@ -35,5 +35,5 @@ public interface AnnouncementMapper extends BaseMapper<AnnouncementDO> {
|
||||
*
|
||||
* @return 仪表盘公告列表
|
||||
*/
|
||||
List<DashboardAnnouncementVO> selectDashboardList();
|
||||
List<DashboardAnnouncementResp> selectDashboardList();
|
||||
}
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseMapper;
|
||||
import top.charles7c.cnadmin.common.model.vo.LabelValueVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.LabelValueResp;
|
||||
import top.charles7c.cnadmin.system.model.entity.DictItemDO;
|
||||
|
||||
/**
|
||||
@ -39,5 +39,5 @@ public interface DictItemMapper extends BaseMapper<DictItemDO> {
|
||||
* 字典编码
|
||||
* @return 字典项列表
|
||||
*/
|
||||
List<LabelValueVO> listByDictCode(@Param("dictCode") String dictCode);
|
||||
List<LabelValueResp> listByDictCode(@Param("dictCode") String dictCode);
|
||||
}
|
@ -24,7 +24,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.MessageDO;
|
||||
import top.charles7c.cnadmin.system.model.vo.MessageVO;
|
||||
import top.charles7c.cnadmin.system.model.resp.MessageResp;
|
||||
|
||||
/**
|
||||
* 消息 Mapper
|
||||
@ -43,6 +43,6 @@ public interface MessageMapper extends BaseMapper<MessageDO> {
|
||||
* 查询条件
|
||||
* @return 分页信息
|
||||
*/
|
||||
IPage<MessageVO> selectVoPage(@Param("page") IPage<Object> page,
|
||||
IPage<MessageResp> selectPageByUserId(@Param("page") IPage<Object> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<MessageDO> queryWrapper);
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -26,7 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改公告信息
|
||||
@ -36,7 +36,7 @@ import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改公告信息")
|
||||
public class AnnouncementRequest extends BaseRequest {
|
||||
public class AnnouncementReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -27,7 +27,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
import top.charles7c.cnadmin.common.base.ValidateGroup;
|
||||
import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
@ -40,7 +40,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改部门信息")
|
||||
public class DeptRequest extends BaseRequest {
|
||||
public class DeptReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
|
||||
/**
|
||||
* 创建或修改字典项信息
|
||||
@ -34,7 +34,7 @@ import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改字典项信息")
|
||||
public class DictItemRequest extends BaseRequest {
|
||||
public class DictItemReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
|
||||
/**
|
||||
@ -35,7 +35,7 @@ import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改字典信息")
|
||||
public class DictRequest extends BaseRequest {
|
||||
public class DictReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -27,7 +27,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.cnadmin.common.enums.MenuTypeEnum;
|
||||
@ -40,7 +40,7 @@ import top.charles7c.cnadmin.common.enums.MenuTypeEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改菜单信息")
|
||||
public class MenuRequest extends BaseRequest {
|
||||
public class MenuReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
import top.charles7c.cnadmin.common.enums.MessageTypeEnum;
|
||||
|
||||
/**
|
||||
@ -36,7 +36,7 @@ import top.charles7c.cnadmin.common.enums.MessageTypeEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建消息信息")
|
||||
public class MessageRequest extends BaseRequest {
|
||||
public class MessageReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
|
||||
/**
|
||||
* 修改参数信息
|
||||
@ -34,7 +34,7 @@ import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "修改参数信息")
|
||||
public class OptionRequest extends BaseRequest {
|
||||
public class OptionReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -33,7 +33,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "参数重置信息")
|
||||
public class OptionResetValueRequest implements Serializable {
|
||||
public class OptionResetValueReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -29,7 +29,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
import top.charles7c.cnadmin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
@ -42,7 +42,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改角色信息")
|
||||
public class RoleRequest extends BaseRequest {
|
||||
public class RoleReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -37,7 +37,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户基础信息修改信息")
|
||||
public class UserBasicInfoUpdateRequest implements Serializable {
|
||||
public class UserBasicInfoUpdateReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -32,7 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户密码修改信息")
|
||||
public class UserPasswordUpdateRequest implements Serializable {
|
||||
public class UserPasswordUpdateReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -37,7 +37,7 @@ import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户手机号修改信息")
|
||||
public class UserPhoneUpdateRequest implements Serializable {
|
||||
public class UserPhoneUpdateReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -29,7 +29,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseRequest;
|
||||
import top.charles7c.cnadmin.common.base.BaseReq;
|
||||
import top.charles7c.cnadmin.common.constant.RegexConsts;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.cnadmin.common.enums.GenderEnum;
|
||||
@ -42,7 +42,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改用户信息")
|
||||
public class UserRequest extends BaseRequest {
|
||||
public class UserReq extends BaseReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.request;
|
||||
package top.charles7c.cnadmin.system.model.req;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -33,7 +33,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户角色修改信息")
|
||||
public class UserRoleUpdateRequest implements Serializable {
|
||||
public class UserRoleUpdateReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 公告详情信息
|
||||
@ -36,7 +36,7 @@ import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "公告详情信息")
|
||||
public class AnnouncementDetailVO extends BaseDetailVO {
|
||||
public class AnnouncementDetailResp extends BaseDetailResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -22,7 +22,7 @@ import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
import top.charles7c.cnadmin.system.enums.AnnouncementStatusEnum;
|
||||
|
||||
/**
|
||||
@ -33,7 +33,7 @@ import top.charles7c.cnadmin.system.enums.AnnouncementStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "公告信息")
|
||||
public class AnnouncementVO extends BaseVO {
|
||||
public class AnnouncementResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -32,7 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "头像信息")
|
||||
public class AvatarVO implements Serializable {
|
||||
public class AvatarResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "仪表盘-公告信息")
|
||||
public class DashboardAnnouncementVO implements Serializable {
|
||||
public class DashboardAnnouncementResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -24,7 +24,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailResp;
|
||||
import top.charles7c.cnadmin.common.config.easyexcel.ExcelBaseEnumConverter;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
|
||||
@ -37,7 +37,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "部门详情信息")
|
||||
public class DeptDetailVO extends BaseDetailVO {
|
||||
public class DeptDetailResp extends BaseDetailResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.common.annotation.TreeField;
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
|
||||
/**
|
||||
@ -33,7 +33,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
@Data
|
||||
@TreeField(value = "id", nameKey = "name")
|
||||
@Schema(description = "部门信息")
|
||||
public class DeptVO extends BaseVO {
|
||||
public class DeptResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 字典详情信息
|
||||
@ -30,7 +30,7 @@ import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典详情信息")
|
||||
public class DictDetailVO extends BaseDetailVO {
|
||||
public class DictDetailResp extends BaseDetailResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -23,7 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailResp;
|
||||
|
||||
/**
|
||||
* 字典项详情信息
|
||||
@ -34,7 +34,7 @@ import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "字典项详情信息")
|
||||
public class DictItemDetailVO extends BaseDetailVO {
|
||||
public class DictItemDetailResp extends BaseDetailResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
|
||||
/**
|
||||
* 字典项信息
|
||||
@ -30,7 +30,7 @@ import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典项信息")
|
||||
public class DictItemVO extends BaseVO {
|
||||
public class DictItemResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
|
||||
/**
|
||||
* 字典信息
|
||||
@ -30,7 +30,7 @@ import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典信息")
|
||||
public class DictVO extends BaseVO {
|
||||
public class DictResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -24,7 +24,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.charles7c.cnadmin.common.annotation.TreeField;
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
import top.charles7c.cnadmin.common.config.easyexcel.ExcelBaseEnumConverter;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.cnadmin.common.enums.MenuTypeEnum;
|
||||
@ -39,7 +39,7 @@ import top.charles7c.cnadmin.common.enums.MenuTypeEnum;
|
||||
@TreeField(value = "id")
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "菜单信息")
|
||||
public class MenuVO extends BaseVO {
|
||||
public class MenuResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@ -35,7 +35,7 @@ import top.charles7c.cnadmin.common.enums.MessageTypeEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "消息信息")
|
||||
public class MessageVO implements Serializable {
|
||||
public class MessageResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -32,7 +32,7 @@ import top.charles7c.cnadmin.common.enums.MessageTypeEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "各类型未读消息信息")
|
||||
public class MessageTypeUnreadVO implements Serializable {
|
||||
public class MessageTypeUnreadResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -34,7 +34,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
@Data
|
||||
@Schema(description = "未读消息信息")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
public class MessageUnreadVO implements Serializable {
|
||||
public class MessageUnreadResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -48,5 +48,5 @@ public class MessageUnreadVO implements Serializable {
|
||||
* 各类型未读消息数量
|
||||
*/
|
||||
@Schema(description = "各类型未读消息数量")
|
||||
private List<MessageTypeUnreadVO> details;
|
||||
private List<MessageTypeUnreadResp> details;
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -34,7 +34,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "参数信息")
|
||||
public class OptionVO implements Serializable {
|
||||
public class OptionResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailResp;
|
||||
import top.charles7c.cnadmin.common.config.easyexcel.ExcelBaseEnumConverter;
|
||||
import top.charles7c.cnadmin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
@ -39,7 +39,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "角色详情信息")
|
||||
public class RoleDetailVO extends BaseDetailVO {
|
||||
public class RoleDetailResp extends BaseDetailResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
import top.charles7c.cnadmin.common.enums.DataScopeEnum;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
|
||||
@ -32,7 +32,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "角色信息")
|
||||
public class RoleVO extends BaseVO {
|
||||
public class RoleResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@ -27,7 +27,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseDetailResp;
|
||||
import top.charles7c.cnadmin.common.config.easyexcel.ExcelBaseEnumConverter;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.cnadmin.common.enums.GenderEnum;
|
||||
@ -42,7 +42,7 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "用户详情信息")
|
||||
public class UserDetailVO extends BaseDetailVO {
|
||||
public class UserDetailResp extends BaseDetailResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseVO;
|
||||
import top.charles7c.cnadmin.common.base.BaseResp;
|
||||
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
|
||||
import top.charles7c.cnadmin.common.enums.GenderEnum;
|
||||
import top.charles7c.cnadmin.common.util.helper.LoginHelper;
|
||||
@ -37,7 +37,7 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户信息")
|
||||
public class UserVO extends BaseVO {
|
||||
public class UserResp extends BaseResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.system.model.vo;
|
||||
package top.charles7c.cnadmin.system.model.resp;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "第三方账号绑定信息")
|
||||
public class UserSocialBindVO implements Serializable {
|
||||
public class UserSocialBindResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -20,10 +20,10 @@ import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.system.model.query.AnnouncementQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.AnnouncementRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.req.AnnouncementReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.AnnouncementDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.AnnouncementResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DashboardAnnouncementResp;
|
||||
|
||||
/**
|
||||
* 公告业务接口
|
||||
@ -32,12 +32,12 @@ import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
* @since 2023/8/20 10:55
|
||||
*/
|
||||
public interface AnnouncementService
|
||||
extends BaseService<AnnouncementVO, AnnouncementDetailVO, AnnouncementQuery, AnnouncementRequest> {
|
||||
extends BaseService<AnnouncementResp, AnnouncementDetailResp, AnnouncementQuery, AnnouncementReq> {
|
||||
|
||||
/**
|
||||
* 查询仪表盘公告列表
|
||||
*
|
||||
* @return 仪表盘公告列表
|
||||
*/
|
||||
List<DashboardAnnouncementVO> listDashboard();
|
||||
List<DashboardAnnouncementResp> listDashboard();
|
||||
}
|
@ -18,9 +18,9 @@ package top.charles7c.cnadmin.system.service;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.system.model.query.DeptQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.DeptRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.DeptDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DeptVO;
|
||||
import top.charles7c.cnadmin.system.model.req.DeptReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.DeptDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DeptResp;
|
||||
|
||||
/**
|
||||
* 部门业务接口
|
||||
@ -28,4 +28,4 @@ import top.charles7c.cnadmin.system.model.vo.DeptVO;
|
||||
* @author Charles7c
|
||||
* @since 2023/1/22 17:54
|
||||
*/
|
||||
public interface DeptService extends BaseService<DeptVO, DeptDetailVO, DeptQuery, DeptRequest> {}
|
||||
public interface DeptService extends BaseService<DeptResp, DeptDetailResp, DeptQuery, DeptReq> {}
|
||||
|
@ -19,11 +19,11 @@ package top.charles7c.cnadmin.system.service;
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.common.model.vo.LabelValueVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.LabelValueResp;
|
||||
import top.charles7c.cnadmin.system.model.query.DictItemQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.DictItemRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.DictItemDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DictItemVO;
|
||||
import top.charles7c.cnadmin.system.model.req.DictItemReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.DictItemDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DictItemResp;
|
||||
|
||||
/**
|
||||
* 字典项业务接口
|
||||
@ -31,7 +31,7 @@ import top.charles7c.cnadmin.system.model.vo.DictItemVO;
|
||||
* @author Charles7c
|
||||
* @since 2023/9/11 21:29
|
||||
*/
|
||||
public interface DictItemService extends BaseService<DictItemVO, DictItemDetailVO, DictItemQuery, DictItemRequest> {
|
||||
public interface DictItemService extends BaseService<DictItemResp, DictItemDetailResp, DictItemQuery, DictItemReq> {
|
||||
|
||||
/**
|
||||
* 根据字典 ID 查询
|
||||
@ -40,7 +40,7 @@ public interface DictItemService extends BaseService<DictItemVO, DictItemDetailV
|
||||
* 字典 ID
|
||||
* @return 字典项列表
|
||||
*/
|
||||
List<DictItemDetailVO> listByDictId(Long dictId);
|
||||
List<DictItemDetailResp> listByDictId(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据字典编码查询
|
||||
@ -49,7 +49,7 @@ public interface DictItemService extends BaseService<DictItemVO, DictItemDetailV
|
||||
* 字典编码
|
||||
* @return 字典项列表
|
||||
*/
|
||||
List<LabelValueVO> listByDictCode(String dictCode);
|
||||
List<LabelValueResp> listByDictCode(String dictCode);
|
||||
|
||||
/**
|
||||
* 根据字典 ID 列表删除
|
||||
|
@ -18,9 +18,9 @@ package top.charles7c.cnadmin.system.service;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.system.model.query.DictQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.DictRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.DictDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DictVO;
|
||||
import top.charles7c.cnadmin.system.model.req.DictReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.DictDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DictResp;
|
||||
|
||||
/**
|
||||
* 字典业务接口
|
||||
@ -28,4 +28,4 @@ import top.charles7c.cnadmin.system.model.vo.DictVO;
|
||||
* @author Charles7c
|
||||
* @since 2023/9/11 21:29
|
||||
*/
|
||||
public interface DictService extends BaseService<DictVO, DictDetailVO, DictQuery, DictRequest> {}
|
||||
public interface DictService extends BaseService<DictResp, DictDetailResp, DictQuery, DictReq> {}
|
@ -21,8 +21,8 @@ import java.util.Set;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.system.model.query.MenuQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.MenuRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.MenuVO;
|
||||
import top.charles7c.cnadmin.system.model.req.MenuReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.MenuResp;
|
||||
|
||||
/**
|
||||
* 菜单业务接口
|
||||
@ -30,7 +30,7 @@ import top.charles7c.cnadmin.system.model.vo.MenuVO;
|
||||
* @author Charles7c
|
||||
* @since 2023/2/15 20:30
|
||||
*/
|
||||
public interface MenuService extends BaseService<MenuVO, MenuVO, MenuQuery, MenuRequest> {
|
||||
public interface MenuService extends BaseService<MenuResp, MenuResp, MenuQuery, MenuReq> {
|
||||
|
||||
/**
|
||||
* 根据用户 ID 查询
|
||||
@ -48,12 +48,12 @@ public interface MenuService extends BaseService<MenuVO, MenuVO, MenuQuery, Menu
|
||||
* 角色编码
|
||||
* @return 菜单列表
|
||||
*/
|
||||
List<MenuVO> listByRoleCode(String roleCode);
|
||||
List<MenuResp> listByRoleCode(String roleCode);
|
||||
|
||||
/**
|
||||
* 查询所有菜单
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
List<MenuVO> list();
|
||||
List<MenuResp> list();
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ package top.charles7c.cnadmin.system.service;
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.system.model.query.MessageQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.MessageRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.MessageVO;
|
||||
import top.charles7c.cnadmin.system.model.req.MessageReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.MessageResp;
|
||||
|
||||
/**
|
||||
* 消息业务接口
|
||||
@ -41,17 +41,17 @@ public interface MessageService {
|
||||
* 分页查询条件
|
||||
* @return 分页列表信息
|
||||
*/
|
||||
PageDataVO<MessageVO> page(MessageQuery query, PageQuery pageQuery);
|
||||
PageDataResp<MessageResp> page(MessageQuery query, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param request
|
||||
* 消息
|
||||
* @param req
|
||||
* 新增信息
|
||||
* @param userIdList
|
||||
* 接收人列表
|
||||
*/
|
||||
void add(MessageRequest request, List<Long> userIdList);
|
||||
void add(MessageReq req, List<Long> userIdList);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
@ -18,7 +18,7 @@ package top.charles7c.cnadmin.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.system.model.vo.MessageUnreadVO;
|
||||
import top.charles7c.cnadmin.system.model.resp.MessageUnreadResp;
|
||||
|
||||
/**
|
||||
* 消息和用户关联业务接口
|
||||
@ -37,7 +37,7 @@ public interface MessageUserService {
|
||||
* 是否查询详情
|
||||
* @return 未读消息信息
|
||||
*/
|
||||
MessageUnreadVO countUnreadMessageByUserId(Long userId, Boolean isDetail);
|
||||
MessageUnreadResp countUnreadMessageByUserId(Long userId, Boolean isDetail);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
@ -19,9 +19,9 @@ package top.charles7c.cnadmin.system.service;
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.system.model.query.OptionQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.OptionRequest;
|
||||
import top.charles7c.cnadmin.system.model.request.OptionResetValueRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.OptionVO;
|
||||
import top.charles7c.cnadmin.system.model.req.OptionReq;
|
||||
import top.charles7c.cnadmin.system.model.req.OptionResetValueReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.OptionResp;
|
||||
|
||||
/**
|
||||
* 参数业务接口
|
||||
@ -38,21 +38,21 @@ public interface OptionService {
|
||||
* 查询条件
|
||||
* @return 列表信息
|
||||
*/
|
||||
List<OptionVO> list(OptionQuery query);
|
||||
List<OptionResp> list(OptionQuery query);
|
||||
|
||||
/**
|
||||
* 修改参数
|
||||
*
|
||||
* @param request
|
||||
* @param req
|
||||
* 参数信息
|
||||
*/
|
||||
void update(List<OptionRequest> request);
|
||||
void update(List<OptionReq> req);
|
||||
|
||||
/**
|
||||
* 重置参数
|
||||
*
|
||||
* @param request
|
||||
* @param req
|
||||
* 重置信息
|
||||
*/
|
||||
void resetValue(OptionResetValueRequest request);
|
||||
void resetValue(OptionResetValueReq req);
|
||||
}
|
@ -21,12 +21,12 @@ import java.util.Set;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.common.model.dto.RoleDTO;
|
||||
import top.charles7c.cnadmin.common.model.vo.LabelValueVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.LabelValueResp;
|
||||
import top.charles7c.cnadmin.system.model.entity.RoleDO;
|
||||
import top.charles7c.cnadmin.system.model.query.RoleQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.RoleRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.RoleDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.RoleVO;
|
||||
import top.charles7c.cnadmin.system.model.req.RoleReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.RoleDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.RoleResp;
|
||||
|
||||
/**
|
||||
* 角色业务接口
|
||||
@ -34,7 +34,7 @@ import top.charles7c.cnadmin.system.model.vo.RoleVO;
|
||||
* @author Charles7c
|
||||
* @since 2023/2/8 23:15
|
||||
*/
|
||||
public interface RoleService extends BaseService<RoleVO, RoleDetailVO, RoleQuery, RoleRequest> {
|
||||
public interface RoleService extends BaseService<RoleResp, RoleDetailResp, RoleQuery, RoleReq> {
|
||||
|
||||
/**
|
||||
* 构建字典
|
||||
@ -43,7 +43,7 @@ public interface RoleService extends BaseService<RoleVO, RoleDetailVO, RoleQuery
|
||||
* 原始列表数据
|
||||
* @return 字典列表
|
||||
*/
|
||||
List<LabelValueVO<Long>> buildDict(List<RoleVO> list);
|
||||
List<LabelValueResp<Long>> buildDict(List<RoleResp> list);
|
||||
|
||||
/**
|
||||
* 根据 ID 列表查询
|
||||
|
@ -23,11 +23,11 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.system.model.entity.UserDO;
|
||||
import top.charles7c.cnadmin.system.model.query.UserQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.UserBasicInfoUpdateRequest;
|
||||
import top.charles7c.cnadmin.system.model.request.UserRequest;
|
||||
import top.charles7c.cnadmin.system.model.request.UserRoleUpdateRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.UserDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.UserVO;
|
||||
import top.charles7c.cnadmin.system.model.req.UserBasicInfoUpdateReq;
|
||||
import top.charles7c.cnadmin.system.model.req.UserReq;
|
||||
import top.charles7c.cnadmin.system.model.req.UserRoleUpdateReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.UserDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.UserResp;
|
||||
|
||||
/**
|
||||
* 用户业务接口
|
||||
@ -35,7 +35,7 @@ import top.charles7c.cnadmin.system.model.vo.UserVO;
|
||||
* @author Charles7c
|
||||
* @since 2022/12/21 21:48
|
||||
*/
|
||||
public interface UserService extends BaseService<UserVO, UserDetailVO, UserQuery, UserRequest> {
|
||||
public interface UserService extends BaseService<UserResp, UserDetailResp, UserQuery, UserReq> {
|
||||
|
||||
/**
|
||||
* 保存用户信息
|
||||
@ -60,12 +60,12 @@ public interface UserService extends BaseService<UserVO, UserDetailVO, UserQuery
|
||||
/**
|
||||
* 修改基础信息
|
||||
*
|
||||
* @param updateRequest
|
||||
* @param updateReq
|
||||
* 修改信息
|
||||
* @param id
|
||||
* ID
|
||||
*/
|
||||
void updateBasicInfo(UserBasicInfoUpdateRequest updateRequest, Long id);
|
||||
void updateBasicInfo(UserBasicInfoUpdateReq updateReq, Long id);
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
@ -114,12 +114,12 @@ public interface UserService extends BaseService<UserVO, UserDetailVO, UserQuery
|
||||
/**
|
||||
* 修改角色
|
||||
*
|
||||
* @param updateRequest
|
||||
* @param updateReq
|
||||
* 修改信息
|
||||
* @param id
|
||||
* ID
|
||||
*/
|
||||
void updateRole(UserRoleUpdateRequest updateRequest, Long id);
|
||||
void updateRole(UserRoleUpdateReq updateReq, Long id);
|
||||
|
||||
/**
|
||||
* 根据用户名查询
|
||||
|
@ -26,10 +26,10 @@ import top.charles7c.cnadmin.common.base.BaseServiceImpl;
|
||||
import top.charles7c.cnadmin.system.mapper.AnnouncementMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.AnnouncementDO;
|
||||
import top.charles7c.cnadmin.system.model.query.AnnouncementQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.AnnouncementRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.req.AnnouncementReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.AnnouncementDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.AnnouncementResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DashboardAnnouncementResp;
|
||||
import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
|
||||
/**
|
||||
@ -40,11 +40,11 @@ import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AnnouncementServiceImpl extends BaseServiceImpl<AnnouncementMapper, AnnouncementDO, AnnouncementVO,
|
||||
AnnouncementDetailVO, AnnouncementQuery, AnnouncementRequest> implements AnnouncementService {
|
||||
public class AnnouncementServiceImpl extends BaseServiceImpl<AnnouncementMapper, AnnouncementDO, AnnouncementResp,
|
||||
AnnouncementDetailResp, AnnouncementQuery, AnnouncementReq> implements AnnouncementService {
|
||||
|
||||
@Override
|
||||
public List<DashboardAnnouncementVO> listDashboard() {
|
||||
public List<DashboardAnnouncementResp> listDashboard() {
|
||||
return baseMapper.selectDashboardList();
|
||||
}
|
||||
}
|
@ -39,9 +39,9 @@ import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
import top.charles7c.cnadmin.system.mapper.DeptMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.DeptDO;
|
||||
import top.charles7c.cnadmin.system.model.query.DeptQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.DeptRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.DeptDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DeptVO;
|
||||
import top.charles7c.cnadmin.system.model.req.DeptReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.DeptDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DeptResp;
|
||||
import top.charles7c.cnadmin.system.service.DeptService;
|
||||
import top.charles7c.cnadmin.system.service.RoleDeptService;
|
||||
import top.charles7c.cnadmin.system.service.UserService;
|
||||
@ -54,7 +54,7 @@ import top.charles7c.cnadmin.system.service.UserService;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptVO, DeptDetailVO, DeptQuery, DeptRequest>
|
||||
public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptResp, DeptDetailResp, DeptQuery, DeptReq>
|
||||
implements DeptService {
|
||||
|
||||
private final RoleDeptService roleDeptService;
|
||||
@ -63,28 +63,28 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptVO,
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long add(DeptRequest request) {
|
||||
String name = request.getName();
|
||||
boolean isExists = this.isNameExists(name, request.getParentId(), null);
|
||||
public Long add(DeptReq req) {
|
||||
String name = req.getName();
|
||||
boolean isExists = this.isNameExists(name, req.getParentId(), null);
|
||||
CheckUtils.throwIf(isExists, "新增失败,[{}] 已存在", name);
|
||||
request.setAncestors(this.getAncestors(request.getParentId()));
|
||||
request.setStatus(DisEnableStatusEnum.DISABLE);
|
||||
return super.add(request);
|
||||
req.setAncestors(this.getAncestors(req.getParentId()));
|
||||
req.setStatus(DisEnableStatusEnum.DISABLE);
|
||||
return super.add(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(DeptRequest request, Long id) {
|
||||
String name = request.getName();
|
||||
boolean isExists = this.isNameExists(name, request.getParentId(), id);
|
||||
public void update(DeptReq req, Long id) {
|
||||
String name = req.getName();
|
||||
boolean isExists = this.isNameExists(name, req.getParentId(), id);
|
||||
CheckUtils.throwIf(isExists, "修改失败,[{}] 已存在", name);
|
||||
DeptDO oldDept = super.getById(id);
|
||||
String oldName = oldDept.getName();
|
||||
DisEnableStatusEnum newStatus = request.getStatus();
|
||||
DisEnableStatusEnum newStatus = req.getStatus();
|
||||
Long oldParentId = oldDept.getParentId();
|
||||
if (oldDept.getIsSystem()) {
|
||||
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, newStatus, "[{}] 是系统内置部门,不允许禁用", oldName);
|
||||
CheckUtils.throwIfNotEqual(request.getParentId(), oldParentId, "[{}] 是系统内置部门,不允许变更上级部门", oldName);
|
||||
CheckUtils.throwIfNotEqual(req.getParentId(), oldParentId, "[{}] 是系统内置部门,不允许变更上级部门", oldName);
|
||||
}
|
||||
// 启用/禁用部门
|
||||
if (ObjectUtil.notEqual(newStatus, oldDept.getStatus())) {
|
||||
@ -98,14 +98,14 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptVO,
|
||||
&& DisEnableStatusEnum.DISABLE.equals(oldParentDept.getStatus()), "启用 [{}] 前,请先启用其所有上级部门", oldName);
|
||||
}
|
||||
// 变更上级部门
|
||||
if (ObjectUtil.notEqual(request.getParentId(), oldParentId)) {
|
||||
if (ObjectUtil.notEqual(req.getParentId(), oldParentId)) {
|
||||
// 更新祖级列表
|
||||
String newAncestors = this.getAncestors(request.getParentId());
|
||||
request.setAncestors(newAncestors);
|
||||
String newAncestors = this.getAncestors(req.getParentId());
|
||||
req.setAncestors(newAncestors);
|
||||
// 更新子级的祖级列表
|
||||
this.updateChildrenAncestors(newAncestors, oldDept.getAncestors(), id);
|
||||
}
|
||||
super.update(request, id);
|
||||
super.update(req, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -127,12 +127,12 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptVO,
|
||||
@Override
|
||||
public void fillDetail(Object detailObj) {
|
||||
super.fillDetail(detailObj);
|
||||
if (detailObj instanceof DeptDetailVO) {
|
||||
DeptDetailVO detailVO = (DeptDetailVO)detailObj;
|
||||
if (Objects.equals(SysConsts.SUPER_PARENT_ID, detailVO.getParentId())) {
|
||||
if (detailObj instanceof DeptDetailResp) {
|
||||
DeptDetailResp detail = (DeptDetailResp)detailObj;
|
||||
if (Objects.equals(SysConsts.SUPER_PARENT_ID, detail.getParentId())) {
|
||||
return;
|
||||
}
|
||||
detailVO.setParentName(ExceptionUtils.exToNull(() -> this.get(detailVO.getParentId()).getName()));
|
||||
detail.setParentName(ExceptionUtils.exToNull(() -> this.get(detail.getParentId()).getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,14 +28,14 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import top.charles7c.cnadmin.common.base.BaseServiceImpl;
|
||||
import top.charles7c.cnadmin.common.constant.CacheConsts;
|
||||
import top.charles7c.cnadmin.common.model.query.SortQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.LabelValueVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.LabelValueResp;
|
||||
import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
import top.charles7c.cnadmin.system.mapper.DictItemMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.DictItemDO;
|
||||
import top.charles7c.cnadmin.system.model.query.DictItemQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.DictItemRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.DictItemDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DictItemVO;
|
||||
import top.charles7c.cnadmin.system.model.req.DictItemReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.DictItemDetailResp;
|
||||
import top.charles7c.cnadmin.system.model.resp.DictItemResp;
|
||||
import top.charles7c.cnadmin.system.service.DictItemService;
|
||||
|
||||
/**
|
||||
@ -48,40 +48,40 @@ import top.charles7c.cnadmin.system.service.DictItemService;
|
||||
@RequiredArgsConstructor
|
||||
@CacheConfig(cacheNames = CacheConsts.DICT_KEY_PREFIX)
|
||||
public class DictItemServiceImpl
|
||||
extends BaseServiceImpl<DictItemMapper, DictItemDO, DictItemVO, DictItemDetailVO, DictItemQuery, DictItemRequest>
|
||||
extends BaseServiceImpl<DictItemMapper, DictItemDO, DictItemResp, DictItemDetailResp, DictItemQuery, DictItemReq>
|
||||
implements DictItemService {
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long add(DictItemRequest request) {
|
||||
String value = request.getValue();
|
||||
CheckUtils.throwIf(this.isValueExists(value, null, request.getDictId()), "新增失败,字典值 [{}] 已存在", value);
|
||||
return super.add(request);
|
||||
public Long add(DictItemReq req) {
|
||||
String value = req.getValue();
|
||||
CheckUtils.throwIf(this.isValueExists(value, null, req.getDictId()), "新增失败,字典值 [{}] 已存在", value);
|
||||
return super.add(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(DictItemRequest request, Long id) {
|
||||
String value = request.getValue();
|
||||
CheckUtils.throwIf(this.isValueExists(value, id, request.getDictId()), "修改失败,字典值 [{}] 已存在", value);
|
||||
super.update(request, id);
|
||||
public void update(DictItemReq req, Long id) {
|
||||
String value = req.getValue();
|
||||
CheckUtils.throwIf(this.isValueExists(value, id, req.getDictId()), "修改失败,字典值 [{}] 已存在", value);
|
||||
super.update(req, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictItemDetailVO> listByDictId(Long dictId) {
|
||||
public List<DictItemDetailResp> listByDictId(Long dictId) {
|
||||
DictItemQuery dictItemQuery = new DictItemQuery();
|
||||
dictItemQuery.setDictId(dictId);
|
||||
SortQuery sortQuery = new SortQuery();
|
||||
sortQuery.setSort(new String[] {"sort,asc"});
|
||||
List<DictItemDetailVO> detailList = super.list(dictItemQuery, sortQuery, DictItemDetailVO.class);
|
||||
List<DictItemDetailResp> detailList = super.list(dictItemQuery, sortQuery, DictItemDetailResp.class);
|
||||
detailList.forEach(super::fillDetail);
|
||||
return detailList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabelValueVO> listByDictCode(String dictCode) {
|
||||
public List<LabelValueResp> listByDictCode(String dictCode) {
|
||||
return baseMapper.listByDictCode(dictCode);
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,8 @@ import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
import top.charles7c.cnadmin.system.mapper.DictMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.DictDO;
|
||||
import top.charles7c.cnadmin.system.model.query.DictQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.DictRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.*;
|
||||
import top.charles7c.cnadmin.system.model.req.DictReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.*;
|
||||
import top.charles7c.cnadmin.system.service.DictItemService;
|
||||
import top.charles7c.cnadmin.system.service.DictService;
|
||||
|
||||
@ -47,34 +47,33 @@ import top.charles7c.cnadmin.system.service.DictService;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DictServiceImpl extends BaseServiceImpl<DictMapper, DictDO, DictVO, DictDetailVO, DictQuery, DictRequest>
|
||||
public class DictServiceImpl extends BaseServiceImpl<DictMapper, DictDO, DictResp, DictDetailResp, DictQuery, DictReq>
|
||||
implements DictService {
|
||||
|
||||
private final DictItemService dictItemService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long add(DictRequest request) {
|
||||
String name = request.getName();
|
||||
public Long add(DictReq req) {
|
||||
String name = req.getName();
|
||||
CheckUtils.throwIf(this.isNameExists(name, null), "新增失败,[{}] 已存在", name);
|
||||
String code = request.getCode();
|
||||
String code = req.getCode();
|
||||
CheckUtils.throwIf(this.isCodeExists(code, null), "新增失败,[{}] 已存在", code);
|
||||
return super.add(request);
|
||||
return super.add(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(DictRequest request, Long id) {
|
||||
String name = request.getName();
|
||||
public void update(DictReq req, Long id) {
|
||||
String name = req.getName();
|
||||
CheckUtils.throwIf(this.isNameExists(name, id), "修改失败,[{}] 已存在", name);
|
||||
String code = request.getCode();
|
||||
String code = req.getCode();
|
||||
CheckUtils.throwIf(this.isCodeExists(code, id), "修改失败,[{}] 已存在", code);
|
||||
DictDO oldDict = super.getById(id);
|
||||
if (oldDict.getIsSystem()) {
|
||||
CheckUtils.throwIfNotEqual(request.getCode(), oldDict.getCode(), "[{}] 是系统内置字典,不允许修改字典编码",
|
||||
oldDict.getName());
|
||||
CheckUtils.throwIfNotEqual(req.getCode(), oldDict.getCode(), "[{}] 是系统内置字典,不允许修改字典编码", oldDict.getName());
|
||||
}
|
||||
super.update(request, id);
|
||||
super.update(req, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,17 +90,17 @@ public class DictServiceImpl extends BaseServiceImpl<DictMapper, DictDO, DictVO,
|
||||
|
||||
@Override
|
||||
public void export(DictQuery query, SortQuery sortQuery, HttpServletResponse response) {
|
||||
List<DictVO> dictList = this.list(query, sortQuery);
|
||||
List<DictItemDetailVO> dictItemList = new ArrayList<>();
|
||||
for (DictVO dict : dictList) {
|
||||
List<DictItemDetailVO> tempDictItemList = dictItemService.listByDictId(dict.getId());
|
||||
for (DictItemDetailVO dictItem : tempDictItemList) {
|
||||
List<DictResp> dictList = this.list(query, sortQuery);
|
||||
List<DictItemDetailResp> dictItemList = new ArrayList<>();
|
||||
for (DictResp dict : dictList) {
|
||||
List<DictItemDetailResp> tempDictItemList = dictItemService.listByDictId(dict.getId());
|
||||
for (DictItemDetailResp dictItem : tempDictItemList) {
|
||||
dictItem.setDictName(dict.getName());
|
||||
dictItem.setDictCode(dict.getCode());
|
||||
dictItemList.add(dictItem);
|
||||
}
|
||||
}
|
||||
ExcelUtils.export(dictItemList, "导出数据", DictItemDetailVO.class, response);
|
||||
ExcelUtils.export(dictItemList, "导出数据", DictItemDetailResp.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,8 +35,8 @@ import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
import top.charles7c.cnadmin.system.mapper.MenuMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.MenuDO;
|
||||
import top.charles7c.cnadmin.system.model.query.MenuQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.MenuRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.MenuVO;
|
||||
import top.charles7c.cnadmin.system.model.req.MenuReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.MenuResp;
|
||||
import top.charles7c.cnadmin.system.service.MenuService;
|
||||
|
||||
/**
|
||||
@ -48,26 +48,26 @@ import top.charles7c.cnadmin.system.service.MenuService;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@CacheConfig(cacheNames = CacheConsts.MENU_KEY_PREFIX)
|
||||
public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, MenuDO, MenuVO, MenuVO, MenuQuery, MenuRequest>
|
||||
public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, MenuDO, MenuResp, MenuResp, MenuQuery, MenuReq>
|
||||
implements MenuService {
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long add(MenuRequest request) {
|
||||
String title = request.getTitle();
|
||||
CheckUtils.throwIf(this.isNameExists(title, request.getParentId(), null), "新增失败,[{}] 已存在", title);
|
||||
request.setStatus(DisEnableStatusEnum.ENABLE);
|
||||
return super.add(request);
|
||||
public Long add(MenuReq req) {
|
||||
String title = req.getTitle();
|
||||
CheckUtils.throwIf(this.isNameExists(title, req.getParentId(), null), "新增失败,[{}] 已存在", title);
|
||||
req.setStatus(DisEnableStatusEnum.ENABLE);
|
||||
return super.add(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MenuRequest request, Long id) {
|
||||
String title = request.getTitle();
|
||||
CheckUtils.throwIf(this.isNameExists(title, request.getParentId(), id), "修改失败,[{}] 已存在", title);
|
||||
super.update(request, id);
|
||||
public void update(MenuReq req, Long id) {
|
||||
String title = req.getTitle();
|
||||
CheckUtils.throwIf(this.isNameExists(title, req.getParentId(), id), "修改失败,[{}] 已存在", title);
|
||||
super.update(req, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -85,16 +85,16 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, MenuDO, MenuVO,
|
||||
|
||||
@Override
|
||||
@Cacheable(key = "#roleCode")
|
||||
public List<MenuVO> listByRoleCode(String roleCode) {
|
||||
public List<MenuResp> listByRoleCode(String roleCode) {
|
||||
List<MenuDO> menuList = baseMapper.selectListByRoleCode(roleCode);
|
||||
List<MenuVO> list = BeanUtil.copyToList(menuList, MenuVO.class);
|
||||
List<MenuResp> list = BeanUtil.copyToList(menuList, MenuResp.class);
|
||||
list.forEach(this::fill);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(key = "'ALL'")
|
||||
public List<MenuVO> list() {
|
||||
public List<MenuResp> list() {
|
||||
MenuQuery menuQuery = new MenuQuery();
|
||||
menuQuery.setStatus(DisEnableStatusEnum.ENABLE.getValue());
|
||||
return super.list(menuQuery, null);
|
||||
|
@ -31,7 +31,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
|
||||
import top.charles7c.cnadmin.common.service.CommonUserService;
|
||||
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
||||
import top.charles7c.cnadmin.common.util.helper.QueryHelper;
|
||||
@ -39,8 +39,8 @@ import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
import top.charles7c.cnadmin.system.mapper.MessageMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.MessageDO;
|
||||
import top.charles7c.cnadmin.system.model.query.MessageQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.MessageRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.MessageVO;
|
||||
import top.charles7c.cnadmin.system.model.req.MessageReq;
|
||||
import top.charles7c.cnadmin.system.model.resp.MessageResp;
|
||||
import top.charles7c.cnadmin.system.service.MessageService;
|
||||
import top.charles7c.cnadmin.system.service.MessageUserService;
|
||||
|
||||
@ -58,19 +58,19 @@ public class MessageServiceImpl implements MessageService {
|
||||
private final MessageUserService messageUserService;
|
||||
|
||||
@Override
|
||||
public PageDataVO<MessageVO> page(MessageQuery query, PageQuery pageQuery) {
|
||||
public PageDataResp<MessageResp> page(MessageQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<MessageDO> queryWrapper = QueryHelper.build(query);
|
||||
queryWrapper.apply(null != query.getUserId(), "t2.user_id={0}", query.getUserId())
|
||||
.apply(null != query.getIsRead(), "t2.is_read={0}", query.getIsRead());
|
||||
IPage<MessageVO> page = baseMapper.selectVoPage(pageQuery.toPage(), queryWrapper);
|
||||
IPage<MessageResp> page = baseMapper.selectPageByUserId(pageQuery.toPage(), queryWrapper);
|
||||
page.getRecords().forEach(this::fill);
|
||||
return PageDataVO.build(page);
|
||||
return PageDataResp.build(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(MessageRequest request, List<Long> userIdList) {
|
||||
public void add(MessageReq req, List<Long> userIdList) {
|
||||
CheckUtils.throwIf(() -> CollUtil.isEmpty(userIdList), "消息接收人不能为空");
|
||||
MessageDO message = BeanUtil.copyProperties(request, MessageDO.class);
|
||||
MessageDO message = BeanUtil.copyProperties(req, MessageDO.class);
|
||||
baseMapper.insert(message);
|
||||
messageUserService.add(message.getId(), userIdList);
|
||||
}
|
||||
@ -88,7 +88,7 @@ public class MessageServiceImpl implements MessageService {
|
||||
* @param message
|
||||
* 待填充信息
|
||||
*/
|
||||
private void fill(MessageVO message) {
|
||||
private void fill(MessageResp message) {
|
||||
Long createUser = message.getCreateUser();
|
||||
if (null == createUser) {
|
||||
return;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user