用户的功能迁移
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.controller.admin;
|
||||
|
||||
import cn.iocoder.common.framework.enums.MallConstants;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.biz.bo.user.UserBO;
|
||||
import cn.iocoder.mall.system.biz.service.user.UserService;
|
||||
import cn.iocoder.mall.system.rest.convert.admin.AdminsUserConvert;
|
||||
import cn.iocoder.mall.system.rest.request.admin.AdminsUserPageRequest;
|
||||
import cn.iocoder.mall.system.rest.request.admin.AdminsUserUpdateRequest;
|
||||
import cn.iocoder.mall.system.rest.request.admin.AdminsUserUpdateStatusRequest;
|
||||
import cn.iocoder.mall.system.rest.response.admin.AdminsUserPageResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @Author: jiangweifan
|
||||
* @Date: 2020/5/12
|
||||
* @Description: 管理员 - 用户信息
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(MallConstants.ROOT_PATH_ADMIN + "/user-info")
|
||||
@Api(tags = "管理员 - 用户信息 API")
|
||||
public class AdminsUserController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation(value = "用户分页列表")
|
||||
public CommonResult<PageResult<AdminsUserPageResponse>> page(AdminsUserPageRequest adminsUserPageRequest) {
|
||||
PageResult<UserBO> userPage = userService.getUserPage(AdminsUserConvert.INSTANCE.convertToPageDTO(adminsUserPageRequest));
|
||||
return success(AdminsUserConvert.INSTANCE.convertToPageResponse(userPage));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation(value = "更新用户基本信息")
|
||||
public CommonResult<Boolean> update(AdminsUserUpdateRequest adminsUserUpdateRequest) {
|
||||
return success(userService.updateUserInfo(AdminsUserConvert.INSTANCE.convertToUpdateDTO(adminsUserUpdateRequest)));
|
||||
}
|
||||
|
||||
@PostMapping("/update_status")
|
||||
@ApiOperation(value = "更新用户状态")
|
||||
public CommonResult<Boolean> updateStatus(AdminsUserUpdateStatusRequest adminsUserUpdateStatusRequest) {
|
||||
return success(userService.updateUserStatus(AdminsUserConvert.INSTANCE.convertToUpdateStatusDTO(adminsUserUpdateStatusRequest)));
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.convert.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.biz.bo.user.UserBO;
|
||||
import cn.iocoder.mall.system.biz.dto.user.UserPageDTO;
|
||||
import cn.iocoder.mall.system.biz.dto.user.UserUpdateDTO;
|
||||
import cn.iocoder.mall.system.biz.dto.user.UserUpdateStatusDTO;
|
||||
import cn.iocoder.mall.system.rest.request.admin.AdminsUserPageRequest;
|
||||
import cn.iocoder.mall.system.rest.request.admin.AdminsUserUpdateRequest;
|
||||
import cn.iocoder.mall.system.rest.request.admin.AdminsUserUpdateStatusRequest;
|
||||
import cn.iocoder.mall.system.rest.response.admin.AdminsUserPageResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @Author: jiangweifan
|
||||
* @Date: 2020/5/12
|
||||
* @Description: 管理后台 - 用户数据转换
|
||||
*/
|
||||
@Mapper
|
||||
public interface AdminsUserConvert {
|
||||
|
||||
AdminsUserConvert INSTANCE = Mappers.getMapper(AdminsUserConvert.class);
|
||||
|
||||
/**
|
||||
* 分页获取用户列表 - Request转DTO
|
||||
* @param adminsUserPageRequest
|
||||
* @return
|
||||
*/
|
||||
UserPageDTO convertToPageDTO(AdminsUserPageRequest adminsUserPageRequest);
|
||||
|
||||
/**
|
||||
* 更新用户信息 - Request转DTO
|
||||
* @param adminsUserUpdateRequest
|
||||
* @return
|
||||
*/
|
||||
UserUpdateDTO convertToUpdateDTO(AdminsUserUpdateRequest adminsUserUpdateRequest);
|
||||
|
||||
/**
|
||||
* 更新用户状态 - Request转DTO
|
||||
* @param adminsUserUpdateStatusRequest
|
||||
* @return
|
||||
*/
|
||||
UserUpdateStatusDTO convertToUpdateStatusDTO(AdminsUserUpdateStatusRequest adminsUserUpdateStatusRequest);
|
||||
|
||||
/**
|
||||
* 分页获取用户列表 - BO转Response
|
||||
* @param userPage
|
||||
* @return
|
||||
*/
|
||||
PageResult<AdminsUserPageResponse> convertToPageResponse(PageResult<UserBO> userPage);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.convert.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.biz.bo.systemlog.AccessLogBO;
|
||||
import cn.iocoder.mall.system.rest.response.systemlog.AccessLogPageResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author:ycjx
|
||||
* @descriptio
|
||||
* @create:2019-06-23 17:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface AccessLogConvert {
|
||||
|
||||
|
||||
AccessLogConvert INSTANCE = Mappers.getMapper(AccessLogConvert.class);
|
||||
|
||||
|
||||
@Mappings({}) // TODO FROM 芋艿 to 2447007062:注意空行哟;另外,如果不需要专门 mapping,可以不添加该注解,嘿嘿。
|
||||
PageResult<AccessLogPageResponse> convert(PageResult<AccessLogBO> result);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.request.errorcode;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("管理员 - 错误码模块 - 添加错误码 Request")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodeAddRequest {
|
||||
|
||||
@ApiModelProperty(value = "错误码信息", required = true, example = "系统管理员")
|
||||
@NotEmpty(message = "错误码信息不能为空")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "错误码编码", example = "SUPER_ADMIN")
|
||||
@NotEmpty(message = "错误码编码不能为空")
|
||||
private Integer code;
|
||||
|
||||
@ApiModelProperty(value = "错误码分组,字典表获取")
|
||||
@NotEmpty(message = "错误码分组不能为空")
|
||||
private Integer group;
|
||||
|
||||
@ApiModelProperty(value = "错误码角色,系统内置(枚举)还是自定义")
|
||||
@NotEmpty(message = "错误码角色不能空")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.request.errorcode;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
/**
|
||||
* @author ding
|
||||
*/
|
||||
@ApiModel("管理员 - 错误码模块 - 错误码分页 Request")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodePageRequest {
|
||||
|
||||
// TODO FROM 芋艿 to 鱿鱼须:分页参数?
|
||||
// TODO FROM 芋艿 to 鱿鱼须:对于 rest 的接口,要区分下是给 Admins 管理员还是 Users 用户的
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.request.errorcode;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 类 描 述:错误码模块
|
||||
* @author ding
|
||||
*/
|
||||
@ApiModel("管理员 - 错误码模块 - 修改错误码 Request")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodeUpdateRequest {
|
||||
@ApiModelProperty(value = "错误码编号", required = true, example = "1")
|
||||
@NotNull(message = "错误码不能为空")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "错误码信息", required = true, example = "系统管理员")
|
||||
@NotEmpty(message = "错误码信息不能为空")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "错误码编码", example = "SUPER_ADMIN")
|
||||
@NotEmpty(message = "错误码编码不能为空")
|
||||
private Integer code;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.response.authorization;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "管理员 - 授权模块 - 菜单资源树 Response", description = "一般用于首页菜单树")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminsAuthorizationMenuTreeResponse {
|
||||
|
||||
@ApiModelProperty(value = "菜单编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "菜单名", required = true, example = "商品管理")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "前端路由", required = true, example = "/order/list")
|
||||
private String route;
|
||||
@ApiModelProperty(value = "菜单图标", required = true, example = "user")
|
||||
private String icon;
|
||||
/**
|
||||
* 子节点数组
|
||||
*/
|
||||
private List<AdminsAuthorizationMenuTreeResponse> children;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.response.authorization;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "管理员 - 授权模块 - 角色拥有的资源树 Response")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminsAuthorizationRoleResourceTreeResponse {
|
||||
|
||||
@ApiModelProperty(value = "菜单编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "菜单名", required = true, example = "商品管理")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "是否分配", required = true, notes = "即角色是否拥有该资源")
|
||||
private Boolean assigned;
|
||||
/**
|
||||
* 子节点数组
|
||||
*/
|
||||
private List<AdminsAuthorizationRoleResourceTreeResponse> children;
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.response.authorization;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理员 - 授权模块 - 菜单资源树 Response")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminsResourceTreeResponse {
|
||||
|
||||
@ApiModelProperty(value = "菜单编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "菜单名", required = true, example = "商品管理")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "权限标识", example = "/order/list")
|
||||
private String permission;
|
||||
@ApiModelProperty(value = "资源类型", required = true, example = "1-菜单;2-按钮")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "排序", required = true, example = "1")
|
||||
private Integer sort;
|
||||
@ApiModelProperty(value = "父菜单编号", required = true, example = "1", notes = "如果无父菜单,则值为 0")
|
||||
private Integer pid;
|
||||
@ApiModelProperty(value = "前端路由", example = "/order/list")
|
||||
private String route;
|
||||
@ApiModelProperty(value = "菜单图标", example = "user")
|
||||
private String icon;
|
||||
/**
|
||||
* 子节点数组
|
||||
*/
|
||||
private List<AdminsResourceTreeResponse> children;
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.response.errorcode;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 类 描 述:错误码模块
|
||||
* @author ding
|
||||
*/
|
||||
@ApiModel("管理员 - 错误码模块 - 查询错误码 Request")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodePageResponse {
|
||||
/**
|
||||
* 错误码编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 错误码编码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 错误码错误信息
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package cn.iocoder.mall.system.rest.response.systemlog;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author mxc
|
||||
* @date 2020/5/11 22:11
|
||||
*/
|
||||
@ApiModel("访问日志 VO")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AccessLogPageResponse {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", required = true, example = "1")
|
||||
private String traceId;
|
||||
|
||||
@ApiModelProperty(value = "账号编号", required = true, example = "1")
|
||||
private Integer accountId;;
|
||||
|
||||
@ApiModelProperty(value = "应用名", required = true, example = "1")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "访问地址", required = true, example = "1")
|
||||
private String uri;
|
||||
|
||||
@ApiModelProperty(value = "请求参数", required = true, example = "1")
|
||||
private String queryString;
|
||||
|
||||
@ApiModelProperty(value = "http 请求方法", required = true, example = "1")
|
||||
private String method;
|
||||
|
||||
@ApiModelProperty(value = "User-Agent ", required = true, example = "1")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "ip", required = true, example = "1")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "请求时间", required = true, example = "1")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "响应时长", required = true, example = "1")
|
||||
private Integer responseTime;
|
||||
|
||||
@ApiModelProperty(value = "错误码", required = true, example = "1")
|
||||
private Integer errorCode;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user