优化swagger

This commit is contained in:
阿沐 2022-04-23 23:01:54 +08:00
parent 5831de27d9
commit c7a9460b61
42 changed files with 201 additions and 195 deletions

View File

@ -12,14 +12,14 @@ import java.util.List;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "分页数据")
@Schema(description = "分页数据")
public class PageResult<T> implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "总记录数")
@Schema(description = "总记录数")
private int total;
@Schema(name = "列表数据")
@Schema(description = "列表数据")
private List<T> list;
/**

View File

@ -16,17 +16,17 @@ import javax.validation.constraints.NotNull;
public class Query {
@NotNull(message = "页码不能为空")
@Min(value = 1, message = "页码最小值为 1")
@Schema(name = "当前页码", required = true)
@Schema(description = "当前页码", required = true)
Integer page;
@NotNull(message = "每页条数不能为空")
@Range(min = 1, max = 1000, message = "每页条数,取值范围 1-1000")
@Schema(name = "每页条数", required = true)
@Schema(description = "每页条数", required = true)
Integer limit;
@Schema(name = "排序字段")
@Schema(description = "排序字段")
String order;
@Schema(name = "是否升序")
@Schema(description = "是否升序")
boolean asc;
}

View File

@ -10,15 +10,15 @@ import net.maku.framework.common.exception.ErrorCode;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "响应")
@Schema(description = "响应")
public class Result<T> {
@Schema(name = "编码", description = "0表示成功其他值表示失败")
@Schema(description = "编码 0表示成功其他值表示失败")
private int code = 0;
@Schema(name = "消息内容")
@Schema(description = "消息内容")
private String msg = "success";
@Schema(name = "响应数据")
@Schema(description = "响应数据")
private T data;
public static <T> Result<T> ok() {

View File

@ -12,6 +12,7 @@ import net.maku.system.vo.dict.data.SysDictDataPostVO;
import net.maku.system.vo.dict.data.SysDictDataPutVO;
import net.maku.system.vo.dict.data.SysDictDataQuery;
import net.maku.system.vo.dict.data.SysDictDataVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -31,7 +32,7 @@ public class SysDictDataController {
@GetMapping("page")
@Operation(summary = "分页")
//@PreAuthorize("hasAuthority('sys:dict:page')")
@PreAuthorize("hasAuthority('sys:dict:page')")
public Result<PageResult<SysDictDataVO>> page(@Valid SysDictDataQuery query){
PageResult<SysDictDataVO> page = sysDictDataService.page(query);
@ -40,7 +41,7 @@ public class SysDictDataController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:dict:info')")
@PreAuthorize("hasAuthority('sys:dict:info')")
public Result<SysDictDataVO> get(@PathVariable("id") Long id){
SysDictDataEntity entity = sysDictDataService.getById(id);
@ -49,7 +50,7 @@ public class SysDictDataController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:dict:save')")
@PreAuthorize("hasAuthority('sys:dict:save')")
public Result<String> save(@RequestBody @Valid SysDictDataPostVO vo){
sysDictDataService.save(vo);
@ -58,7 +59,7 @@ public class SysDictDataController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:dict:update')")
@PreAuthorize("hasAuthority('sys:dict:update')")
public Result<String> update(@RequestBody @Valid SysDictDataPutVO vo){
sysDictDataService.update(vo);
@ -67,7 +68,7 @@ public class SysDictDataController {
@DeleteMapping
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:dict:delete')")
@PreAuthorize("hasAuthority('sys:dict:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
sysDictDataService.delete(idList);

View File

@ -13,6 +13,7 @@ import net.maku.system.vo.dict.type.SysDictTypePostVO;
import net.maku.system.vo.dict.type.SysDictTypePutVO;
import net.maku.system.vo.dict.type.SysDictTypeQuery;
import net.maku.system.vo.dict.type.SysDictTypeVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -32,7 +33,7 @@ public class SysDictTypeController {
@GetMapping("page")
@Operation(summary = "分页")
//@PreAuthorize("hasAuthority('sys:dict:page')")
@PreAuthorize("hasAuthority('sys:dict:page')")
public Result<PageResult<SysDictTypeVO>> page(@Valid SysDictTypeQuery query){
PageResult<SysDictTypeVO> page = sysDictTypeService.page(query);
@ -41,7 +42,7 @@ public class SysDictTypeController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:dict:info')")
@PreAuthorize("hasAuthority('sys:dict:info')")
public Result<SysDictTypeVO> get(@PathVariable("id") Long id){
SysDictTypeEntity entity = sysDictTypeService.getById(id);
@ -50,7 +51,7 @@ public class SysDictTypeController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:dict:save')")
@PreAuthorize("hasAuthority('sys:dict:save')")
public Result<String> save(@RequestBody @Valid SysDictTypePostVO vo){
sysDictTypeService.save(vo);
@ -59,7 +60,7 @@ public class SysDictTypeController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:dict:update')")
@PreAuthorize("hasAuthority('sys:dict:update')")
public Result<String> update(@RequestBody @Valid SysDictTypePutVO vo){
sysDictTypeService.update(vo);
@ -68,7 +69,7 @@ public class SysDictTypeController {
@DeleteMapping
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:dict:delete')")
@PreAuthorize("hasAuthority('sys:dict:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
sysDictTypeService.delete(idList);

View File

@ -14,6 +14,7 @@ import net.maku.system.service.SysMenuService;
import net.maku.system.vo.menu.SysMenuPostVO;
import net.maku.system.vo.menu.SysMenuPutVO;
import net.maku.system.vo.menu.SysMenuVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -61,7 +62,7 @@ public class SysMenuController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:menu:info')")
@PreAuthorize("hasAuthority('sys:menu:info')")
public Result<SysMenuVO> get(@PathVariable("id") Long id){
SysMenuEntity entity = sysMenuService.getById(id);
@ -70,7 +71,7 @@ public class SysMenuController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:menu:save')")
@PreAuthorize("hasAuthority('sys:menu:save')")
public Result<String> save(@RequestBody @Valid SysMenuPostVO vo){
sysMenuService.save(vo);
@ -79,7 +80,7 @@ public class SysMenuController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:menu:update')")
@PreAuthorize("hasAuthority('sys:menu:update')")
public Result<String> update(@RequestBody @Valid SysMenuPutVO vo){
sysMenuService.update(vo);
@ -88,7 +89,7 @@ public class SysMenuController {
@DeleteMapping("{id}")
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:menu:delete')")
@PreAuthorize("hasAuthority('sys:menu:delete')")
public Result<String> delete(@PathVariable("id") Long id){
// 判断是否有子菜单或按钮
Long count = sysMenuService.getSubMenuCount(id);

View File

@ -12,6 +12,7 @@ import net.maku.system.service.SysOauthClientService;
import net.maku.system.vo.oauth.SysOauthClientPostVO;
import net.maku.system.vo.oauth.SysOauthClientPutVO;
import net.maku.system.vo.oauth.SysOauthClientVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -31,7 +32,7 @@ public class SysOauthClientController {
@GetMapping("page")
@Operation(summary = "分页")
//@PreAuthorize("hasAuthority('sys:client:page')")
@PreAuthorize("hasAuthority('sys:client:page')")
public Result<PageResult<SysOauthClientVO>> page(@Valid Query query){
PageResult<SysOauthClientVO> page = sysOauthClientService.page(query);
@ -40,7 +41,7 @@ public class SysOauthClientController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:client:info')")
@PreAuthorize("hasAuthority('sys:client:info')")
public Result<SysOauthClientVO> get(@PathVariable("id") Long id){
SysOauthClientEntity entity = sysOauthClientService.getById(id);
@ -49,7 +50,7 @@ public class SysOauthClientController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:client:save')")
@PreAuthorize("hasAuthority('sys:client:save')")
public Result<String> save(@RequestBody SysOauthClientPostVO vo){
sysOauthClientService.save(vo);
@ -58,7 +59,7 @@ public class SysOauthClientController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:client:update')")
@PreAuthorize("hasAuthority('sys:client:update')")
public Result<String> update(@RequestBody @Valid SysOauthClientPutVO vo){
sysOauthClientService.update(vo);
@ -67,7 +68,7 @@ public class SysOauthClientController {
@DeleteMapping
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:client:delete')")
@PreAuthorize("hasAuthority('sys:client:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
sysOauthClientService.delete(idList);

View File

@ -10,6 +10,7 @@ import net.maku.system.service.SysOrgService;
import net.maku.system.vo.org.SysOrgPostVO;
import net.maku.system.vo.org.SysOrgPutVO;
import net.maku.system.vo.org.SysOrgVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -29,7 +30,7 @@ public class SysOrgController {
@GetMapping("list")
@Operation(summary = "列表")
//@PreAuthorize("hasAuthority('sys:org:list')")
@PreAuthorize("hasAuthority('sys:org:list')")
public Result<List<SysOrgVO>> list(){
List<SysOrgVO> list = sysOrgService.getList();
@ -38,7 +39,7 @@ public class SysOrgController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:org:info')")
@PreAuthorize("hasAuthority('sys:org:info')")
public Result<SysOrgVO> get(@PathVariable("id") Long id){
SysOrgEntity entity = sysOrgService.getById(id);
@ -47,7 +48,7 @@ public class SysOrgController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:org:save')")
@PreAuthorize("hasAuthority('sys:org:save')")
public Result<String> save(@RequestBody @Valid SysOrgPostVO vo){
sysOrgService.save(vo);
@ -56,7 +57,7 @@ public class SysOrgController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:org:update')")
@PreAuthorize("hasAuthority('sys:org:update')")
public Result<String> update(@RequestBody @Valid SysOrgPutVO vo){
sysOrgService.update(vo);
@ -65,7 +66,7 @@ public class SysOrgController {
@DeleteMapping("{id}")
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:org:delete')")
@PreAuthorize("hasAuthority('sys:org:delete')")
public Result<String> delete(@PathVariable("id") Long id){
sysOrgService.delete(id);

View File

@ -12,6 +12,7 @@ import net.maku.system.vo.post.SysPostPostVO;
import net.maku.system.vo.post.SysPostPutVO;
import net.maku.system.vo.post.SysPostQuery;
import net.maku.system.vo.post.SysPostVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -32,7 +33,7 @@ public class SysPostController {
@GetMapping("page")
@Operation(summary = "分页")
//@PreAuthorize("hasAuthority('sys:post:page')")
@PreAuthorize("hasAuthority('sys:post:page')")
public Result<PageResult<SysPostVO>> page(@Valid SysPostQuery query){
PageResult<SysPostVO> page = sysPostService.page(query);
@ -49,7 +50,7 @@ public class SysPostController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:post:info')")
@PreAuthorize("hasAuthority('sys:post:info')")
public Result<SysPostVO> get(@PathVariable("id") Long id){
SysPostEntity entity = sysPostService.getById(id);
@ -58,7 +59,7 @@ public class SysPostController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:post:save')")
@PreAuthorize("hasAuthority('sys:post:save')")
public Result<String> save(@RequestBody SysPostPostVO vo){
sysPostService.save(vo);
@ -67,7 +68,7 @@ public class SysPostController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:post:update')")
@PreAuthorize("hasAuthority('sys:post:update')")
public Result<String> update(@RequestBody @Valid SysPostPutVO vo){
sysPostService.update(vo);
@ -76,7 +77,7 @@ public class SysPostController {
@DeleteMapping
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:post:delete')")
@PreAuthorize("hasAuthority('sys:post:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
sysPostService.delete(idList);

View File

@ -18,6 +18,7 @@ import net.maku.system.vo.role.SysRolePostVO;
import net.maku.system.vo.role.SysRolePutVO;
import net.maku.system.vo.role.SysRoleQuery;
import net.maku.system.vo.role.SysRoleVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -40,7 +41,7 @@ public class SysRoleController {
@GetMapping("page")
@Operation(summary = "分页")
//@PreAuthorize("hasAuthority('sys:role:page')")
@PreAuthorize("hasAuthority('sys:role:page')")
public Result<PageResult<SysRoleVO>> page(@Valid SysRoleQuery query){
PageResult<SysRoleVO> page = sysRoleService.page(query);
@ -49,7 +50,7 @@ public class SysRoleController {
@GetMapping("list")
@Operation(summary = "列表")
//@PreAuthorize("hasAuthority('sys:role:list')")
@PreAuthorize("hasAuthority('sys:role:list')")
public Result<List<SysRoleVO>> list(){
List<SysRoleVO> list = sysRoleService.getList(new SysRoleQuery());
@ -58,7 +59,7 @@ public class SysRoleController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:role:info')")
@PreAuthorize("hasAuthority('sys:role:info')")
public Result<SysRolePostVO> get(@PathVariable("id") Long id){
SysRoleEntity entity = sysRoleService.getById(id);
@ -77,10 +78,9 @@ public class SysRoleController {
}
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:role:save')")
@Operation(summary = "保存", hidden = true)
@PreAuthorize("hasAuthority('sys:role:save')")
public Result<String> save(@RequestBody @Valid SysRolePostVO vo){
sysRoleService.save(vo);
return Result.ok();
@ -88,7 +88,7 @@ public class SysRoleController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:role:update')")
@PreAuthorize("hasAuthority('sys:role:update')")
public Result<String> update(@RequestBody @Valid SysRolePutVO vo){
sysRoleService.update(vo);
@ -97,7 +97,7 @@ public class SysRoleController {
@DeleteMapping
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:role:delete')")
@PreAuthorize("hasAuthority('sys:role:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
sysRoleService.delete(idList);
@ -106,7 +106,7 @@ public class SysRoleController {
@GetMapping("menu")
@Operation(summary = "角色菜单")
//@PreAuthorize("hasAuthority('sys:role:menu')")
@PreAuthorize("hasAuthority('sys:role:menu')")
public Result<List<SysMenuVO>> menu(){
UserDetail user = SecurityUser.getUser();
List<SysMenuVO> list = sysMenuService.getUserMenuList(user, null);

View File

@ -14,6 +14,7 @@ import net.maku.system.service.SysUserPostService;
import net.maku.system.service.SysUserRoleService;
import net.maku.system.service.SysUserService;
import net.maku.system.vo.user.*;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.*;
@ -46,7 +47,7 @@ public class SysUserController {
@GetMapping("{id}")
@Operation(summary = "信息")
//@PreAuthorize("hasAuthority('sys:user:info')")
@PreAuthorize("hasAuthority('sys:user:info')")
public Result<SysUserVO> get(@PathVariable("id") Long id){
SysUserEntity entity = sysUserService.getById(id);
@ -88,7 +89,7 @@ public class SysUserController {
@PostMapping
@Operation(summary = "保存")
//@PreAuthorize("hasAuthority('sys:user:save')")
@PreAuthorize("hasAuthority('sys:user:save')")
public Result<String> save(@RequestBody @Valid SysUserPostVO vo){
// 新增密码不能为空
if (StrUtil.isBlank(vo.getPassword())){
@ -106,7 +107,7 @@ public class SysUserController {
@PutMapping
@Operation(summary = "修改")
//@PreAuthorize("hasAuthority('sys:user:update')")
@PreAuthorize("hasAuthority('sys:user:update')")
public Result<String> update(@RequestBody @Valid SysUserPutVO vo){
// 如果密码不为空则进行加密处理
if(StrUtil.isBlank(vo.getPassword())){
@ -122,7 +123,7 @@ public class SysUserController {
@DeleteMapping
@Operation(summary = "删除")
//@PreAuthorize("hasAuthority('sys:user:delete')")
@PreAuthorize("hasAuthority('sys:user:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
sysUserService.delete(idList);

View File

@ -13,22 +13,22 @@ import java.util.List;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "全部字典")
@Schema(description = "全部字典")
public class SysDictVO {
@Schema(name = "字典类型")
@Schema(description = "字典类型")
private String dictType;
@Schema(name = "字典数据列表")
@Schema(description = "字典数据列表")
private List<DictData> dataList = new ArrayList<>();
@Data
@AllArgsConstructor
@Schema(name = "字典数据")
@Schema(description = "字典数据")
public static class DictData {
@Schema(name = "字典标签")
@Schema(description = "字典标签")
private String dictLabel;
@Schema(name = "字典值")
@Schema(description = "字典值")
private String dictValue;
}
}

View File

@ -14,25 +14,25 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "字典数据新增")
@Schema(description = "字典数据新增")
public class SysDictDataPostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "字典类型ID", required = true)
@Schema(description = "字典类型ID", required = true)
@NotNull(message = "字典类型ID不能为空")
private Long dictTypeId;
@Schema(name = "字典标签", required = true)
@Schema(description = "字典标签", required = true)
@NotBlank(message = "字典标签不能为空")
private String dictLabel;
@Schema(name = "字典值")
@Schema(description = "字典值")
private String dictValue;
@Schema(name = "备注")
@Schema(description = "备注")
private String remark;
@Schema(name = "排序", required = true)
@Schema(description = "排序", required = true)
@Min(value = 0, message = "排序值不能小于0")
private Integer sort;
}

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "字典数据更新")
@Schema(description = "字典数据更新")
public class SysDictDataPutVO extends SysDictDataPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "id不能为空")
private Long id;

View File

@ -12,9 +12,9 @@ import net.maku.framework.common.query.Query;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "字典数据查询")
@Schema(description = "字典数据查询")
public class SysDictDataQuery extends Query {
@Schema(name = "字典类型ID", required = true)
@Schema(description = "字典类型ID", required = true)
private Long dictTypeId;
}

View File

@ -15,16 +15,16 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "字典数据")
@Schema(description = "字典数据")
public class SysDictDataVO extends SysDictDataPostVO {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
@Schema(name = "更新时间")
@Schema(description = "更新时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date updateTime;
}

View File

@ -13,22 +13,22 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "字典类型新增")
@Schema(description = "字典类型新增")
public class SysDictTypePostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "字典类型", required = true)
@Schema(description = "字典类型", required = true)
@NotBlank(message = "字典类型不能为空")
private String dictType;
@Schema(name = "字典名称", required = true)
@Schema(description = "字典名称", required = true)
@NotBlank(message = "字典名称不能为空")
private String dictName;
@Schema(name = "备注")
@Schema(description = "备注")
private String remark;
@Schema(name = "排序", required = true)
@Schema(description = "排序", required = true)
@Min(value = 0, message = "排序值不能小于0")
private Integer sort;
}

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "字典类型更新")
@Schema(description = "字典类型更新")
public class SysDictTypePutVO extends SysDictTypePostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "id不能为空")
private Long id;

View File

@ -12,12 +12,12 @@ import net.maku.framework.common.query.Query;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "字典类型查询")
@Schema(description = "字典类型查询")
public class SysDictTypeQuery extends Query {
@Schema(name = "字典类型")
@Schema(description = "字典类型")
private String dictType;
@Schema(name = "字典名称")
@Schema(description = "字典名称")
private String dictName;
}

View File

@ -15,17 +15,16 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "字典类型")
@Schema(description = "字典类型")
public class SysDictTypeVO extends SysDictTypePostVO {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
@Schema(name = "更新时间")
@Schema(description = "更新时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date updateTime;
}

View File

@ -15,36 +15,36 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "菜单新增")
@Schema(description = "菜单新增")
public class SysMenuPostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "上级ID")
@Schema(description = "上级ID")
@NotNull(message = "上级ID不能为空")
private Long pid;
@Schema(name = "菜单名称")
@Schema(description = "菜单名称")
@NotBlank(message = "菜单名称不能为空")
private String name;
@Schema(name = "菜单URL")
@Schema(description = "菜单URL")
private String url;
@Schema(name = "类型 0菜单 1按钮 2接口")
@Schema(description = "类型 0菜单 1按钮 2接口")
@Range(min = 0, max = 2, message = "类型不正确")
private Integer type;
@Schema(name = "打开方式 0内部 1外部")
@Schema(description = "打开方式 0内部 1外部")
@Range(min = 0, max = 1, message = "打开方式不正确")
private Integer openStyle;
@Schema(name = "菜单图标")
@Schema(description = "菜单图标")
private String icon;
@Schema(name = "授权标识(多个用逗号分隔sys:menu:list,sys:menu:save)")
@Schema(description = "授权标识(多个用逗号分隔sys:menu:list,sys:menu:save)")
private String authority;
@Schema(name = "排序")
@Schema(description = "排序")
@Min(value = 0, message = "排序值不能小于0")
private Integer sort;
}

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "菜单更新")
@Schema(description = "菜单更新")
public class SysMenuPutVO extends SysMenuPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "id不能为空")
private Long id;

View File

@ -16,39 +16,39 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "菜单")
@Schema(description = "菜单")
public class SysMenuVO extends TreeNode<SysMenuVO> {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "上级ID")
@Schema(description = "上级ID")
private Long pid;
@Schema(name = "菜单名称")
@Schema(description = "菜单名称")
private String name;
@Schema(name = "菜单URL")
@Schema(description = "菜单URL")
private String url;
@Schema(name = "类型 0菜单 1按钮 2接口")
@Schema(description = "类型 0菜单 1按钮 2接口")
private Integer type;
@Schema(name = "打开方式 0内部 1外部")
@Schema(description = "打开方式 0内部 1外部")
private Integer openStyle;
@Schema(name = "菜单图标")
@Schema(description = "菜单图标")
private String icon;
@Schema(name = "授权标识(多个用逗号分隔sys:menu:list,sys:menu:save)")
@Schema(description = "授权标识(多个用逗号分隔sys:menu:list,sys:menu:save)")
private String authority;
@Schema(name = "排序")
@Schema(description = "排序")
private Integer sort;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
@Schema(name = "上级菜单名称")
@Schema(description = "上级菜单名称")
private String parentName;
}

View File

@ -13,46 +13,46 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "客户端管理新增")
@Schema(description = "客户端管理新增")
public class SysOauthClientPostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "客户端ID", required = true)
@Schema(description = "客户端ID", required = true)
@NotBlank(message = "客户端ID不能为空")
private String clientId;
@Schema(name = "客户端密钥", required = true)
@Schema(description = "客户端密钥", required = true)
@NotBlank(message = "客户端密钥不能为空")
private String clientSecret;
@Schema(name = "资源ids")
@Schema(description = "资源ids")
private String resourceIds;
@Schema(name = "授权范围", required = true)
@Schema(description = "授权范围", required = true)
@NotBlank(message = "授权范围不能为空")
private String scope;
@Schema(name = "授权类型")
@Schema(description = "授权类型")
private String[] authorizedGrantTypes;
@Schema(name = "回调地址")
@Schema(description = "回调地址")
private String webServerRedirectUri;
@Schema(name = "权限标识")
@Schema(description = "权限标识")
private String authorities;
@Schema(name = "访问令牌有效期", required = true)
@Schema(description = "访问令牌有效期", required = true)
@Min(value = 0, message = "访问令牌有效期不能小于0")
private Integer accessTokenValidity;
@Schema(name = "刷新令牌有效期", required = true)
@Schema(description = "刷新令牌有效期", required = true)
@Min(value = 0, message = "刷新令牌有效期不能小于0")
private Integer refreshTokenValidity;
@Schema(name = "附加信息")
@Schema(description = "附加信息")
private String additionalInformation;
@Schema(name = "自动授权", required = true)
@Schema(description = "自动授权", required = true)
@NotBlank(message = "自动授权不能为空")
private String autoapprove;
}

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "客户端管理更新")
@Schema(description = "客户端管理更新")
public class SysOauthClientPutVO extends SysOauthClientPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "id不能为空")
private Long id;

View File

@ -15,12 +15,12 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "客户端管理")
@Schema(description = "客户端管理")
public class SysOauthClientVO extends SysOauthClientPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
private Long id;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
}

View File

@ -14,19 +14,19 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "机构新增")
@Schema(description = "机构新增")
public class SysOrgPostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "上级ID", required = true)
@Schema(description = "上级ID", required = true)
@NotNull(message = "上级ID不能为空")
private Long pid;
@Schema(name = "机构名称", required = true)
@Schema(description = "机构名称", required = true)
@NotBlank(message = "机构名称不能为空")
private String name;
@Schema(name = "排序", required = true)
@Schema(description = "排序", required = true)
@Min(value = 0, message = "排序值不能小于0")
private Integer sort;

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "机构更新")
@Schema(description = "机构更新")
public class SysOrgPutVO extends SysOrgPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "ID不能为空")
private Long id;

View File

@ -16,25 +16,25 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "机构")
@Schema(description = "机构")
public class SysOrgVO extends TreeNode<SysOrgVO> {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "上级ID")
@Schema(description = "上级ID")
private Long pid;
@Schema(name = "机构名称")
@Schema(description = "机构名称")
private String name;
@Schema(name = "排序")
@Schema(description = "排序")
private Integer sort;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
@Schema(name = "上级名称")
@Schema(description = "上级名称")
private String parentName;
}

View File

@ -14,23 +14,23 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "岗位管理新增")
@Schema(description = "岗位管理新增")
public class SysPostPostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "岗位编码", required = true)
@Schema(description = "岗位编码", required = true)
@NotBlank(message = "岗位编码不能为空")
private String postCode;
@Schema(name = "岗位名称", required = true)
@Schema(description = "岗位名称", required = true)
@NotBlank(message = "岗位名称不能为空")
private String postName;
@Schema(name = "排序", required = true)
@Schema(description = "排序", required = true)
@Min(value = 0, message = "排序值不能小于0")
private Integer sort;
@Schema(name = "状态 0停用 1正常", required = true)
@Schema(description = "状态 0停用 1正常", required = true)
@Range(min = 0, max = 1, message = "状态不正确")
private Integer status;

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "岗位管理更新")
@Schema(description = "岗位管理更新")
public class SysPostPutVO extends SysPostPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "ID不能为空")
private Long id;

View File

@ -12,15 +12,15 @@ import net.maku.framework.common.query.Query;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "岗位管理查询")
@Schema(description = "岗位管理查询")
public class SysPostQuery extends Query {
@Schema(name = "岗位编码")
@Schema(description = "岗位编码")
private String postCode;
@Schema(name = "岗位名称")
@Schema(description = "岗位名称")
private String postName;
@Schema(name = "状态 0停用 1正常")
@Schema(description = "状态 0停用 1正常")
private Integer status;
}

View File

@ -15,12 +15,12 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "岗位管理")
@Schema(description = "岗位管理")
public class SysPostVO extends SysPostPostVO {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;

View File

@ -13,24 +13,24 @@ import java.util.List;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "角色新增")
@Schema(description = "角色新增")
public class SysRolePostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "角色名称")
@Schema(description = "角色名称")
@NotBlank(message = "角色名称不能为空")
private String name;
@Schema(name = "备注")
@Schema(description = "备注")
private String remark;
@Schema(name = "数据范围", description = "0全部数据 1本部门及子部门数据 2本部门数据 3本人数据 4自定义数据")
@Schema(description = "数据范围 0全部数据 1本部门及子部门数据 2本部门数据 3本人数据 4自定义数据")
private Integer dataScope;
@Schema(name = "菜单ID列表")
@Schema(description = "菜单ID列表")
private List<Long> menuIdList;
@Schema(name = "机构ID列表")
@Schema(description = "机构ID列表")
private List<Long> orgIdList;
}

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "角色更新")
@Schema(description = "角色更新")
public class SysRolePutVO extends SysRolePostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "id不能为空")
private Long id;

View File

@ -12,9 +12,9 @@ import net.maku.framework.common.query.Query;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "角色查询")
@Schema(description = "角色查询")
public class SysRoleQuery extends Query {
@Schema(name = "角色名称")
@Schema(description = "角色名称")
private String name;
}

View File

@ -15,12 +15,12 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "角色")
@Schema(description = "角色")
public class SysRoleVO extends SysRolePostVO {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;

View File

@ -13,15 +13,15 @@ import java.io.Serializable;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "用户修改密码")
@Schema(description = "用户修改密码")
public class SysUserPasswordVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "原密码", required = true)
@Schema(description = "原密码", required = true)
@NotBlank(message = "原密码不能为空")
private String password;
@Schema(name = "新密码", required = true, description = "密码长度为 4-20 位")
@Schema(description = "新密码,密码长度为 4-20 位", required = true)
@Length(min = 4, max = 20, message = "新密码长度为 4-20 位")
private String newPassword;

View File

@ -17,49 +17,49 @@ import java.util.List;
* @author 阿沐 babamu@126.com
*/
@Data
@Schema(name = "用户新增")
@Schema(description = "用户新增")
public class SysUserPostVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(name = "用户名", required = true)
@Schema(description = "用户名", required = true)
@NotBlank(message = "用户名不能为空")
private String username;
@Schema(name = "密码")
@Schema(description = "密码")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String password;
@Schema(name = "姓名", required = true)
@Schema(description = "姓名", required = true)
@NotBlank(message = "姓名不能为空")
private String realName;
@Schema(name = "头像")
@Schema(description = "头像")
private String avatar;
@Schema(name = "性别 0男 1", required = true)
@Schema(description = "性别 0男 1", required = true)
@Range(min = 0, max = 1, message = "性别不正确")
private Integer gender;
@Schema(name = "邮箱")
@Schema(description = "邮箱")
@Email(message = "邮箱格式不正确")
private String email;
@Schema(name = "手机号", required = true)
@Schema(description = "手机号", required = true)
@NotBlank(message = "手机号不能为空")
private String mobile;
@Schema(name = "机构ID", required = true)
@Schema(description = "机构ID", required = true)
@NotNull(message = "机构ID不能为空")
private Long orgId;
@Schema(name = "状态 0停用 1正常", required = true)
@Schema(description = "状态 0停用 1正常", required = true)
@Range(min = 0, max = 1, message = "用户状态不正确")
private Integer status;
@Schema(name = "角色ID列表")
@Schema(description = "角色ID列表")
private List<Long> roleIdList;
@Schema(name = "岗位ID列表")
@Schema(description = "岗位ID列表")
private List<Long> postIdList;
}

View File

@ -13,9 +13,9 @@ import javax.validation.constraints.NotNull;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "用户更新")
@Schema(description = "用户更新")
public class SysUserPutVO extends SysUserPostVO {
@Schema(name = "id", required = true)
@Schema(description = "id", required = true)
@NotNull(message = "id不能为空")
private Long id;

View File

@ -12,18 +12,18 @@ import net.maku.framework.common.query.Query;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "用户查询")
@Schema(description = "用户查询")
public class SysUserQuery extends Query {
@Schema(name = "用户名")
@Schema(description = "用户名")
private String username;
@Schema(name = "手机号")
@Schema(description = "手机号")
private String mobile;
@Schema(name = "性别")
@Schema(description = "性别")
private Integer gender;
@Schema(name = "机构ID")
@Schema(description = "机构ID")
private Long orgId;
}

View File

@ -15,18 +15,18 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "用户")
@Schema(description = "用户")
public class SysUserVO extends SysUserPostVO {
@Schema(name = "id")
@Schema(description = "id")
private Long id;
@Schema(name = "超级管理员 0否 1")
@Schema(description = "超级管理员 0否 1")
private Integer superAdmin;
@Schema(name = "机构名称")
@Schema(description = "机构名称")
private String orgName;
@Schema(name = "创建时间")
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
}