feat(framework): 添加springboot4版本

This commit is contained in:
2026-02-27 16:10:26 +08:00
parent 1b1bb10089
commit f9a8c58b68
304 changed files with 23942 additions and 0 deletions
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cutejava-springboot4</artifactId>
<groupId>cn.odboy</groupId>
<version>1.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cutejava-module-system</artifactId>
<name>核心模块</name>
<dependencies>
<dependency>
<groupId>cn.odboy</groupId>
<artifactId>cutejava-framework</artifactId>
<version>1.5.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.minio/minio -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.17</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application;
import cn.odboy.system.application.model.CuteDeptTreeVo;
import cn.odboy.system.application.service.CuteDeptTreeService;
import cn.odboy.system.dal.model.request.SystemQueryDeptArgs;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Api(tags = "系统组件:CuteDeptTree")
@RequestMapping("/api/component/CuteDeptTree")
public class CuteDeptTreeApi {
@Autowired
private CuteDeptTreeService cuteDeptTreeService;
@ApiOperation("查询部门")
@PostMapping(value = "/listMetadata")
public ResponseEntity<List<CuteDeptTreeVo>> listMetadata(@Validated @RequestBody SystemQueryDeptArgs args) throws Exception {
List<CuteDeptTreeVo> depts = cuteDeptTreeService.listMetadata(args);
return ResponseEntity.ok(depts);
}
}
@@ -0,0 +1,59 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application;
import cn.odboy.system.application.service.CuteFileUploadService;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemOssStorageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
@Api(tags = "系统组件:CuteFileUpload")
@RequestMapping("/api/component/CuteFileUpload")
public class CuteFileUploadApi {
@Autowired
private CuteFileUploadService cuteFileUploadService;
@Autowired
private SystemOssStorageService systemOssStorageService;
@OperationLog
@ApiOperation("上传文件到服务器本地")
@PostMapping(value = "/uploadLocal")
@PreAuthorize("@el.check()")
public ResponseEntity<String> uploadLocal(@RequestParam("file") MultipartFile file) {
String fileUrl = cuteFileUploadService.uploadLocal(file);
return ResponseEntity.ok(fileUrl);
}
@OperationLog
@ApiOperation("上传文件到OSS")
@PostMapping(value = "/uploadOSS")
@PreAuthorize("@el.check()")
public ResponseEntity<String> uploadOSS(@RequestParam("file") MultipartFile file) {
String fileUrl = systemOssStorageService.uploadFile(file);
return ResponseEntity.ok(fileUrl);
}
}
@@ -0,0 +1,42 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application;
import cn.odboy.system.application.service.CuteProductLineSelectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "系统组件:CuteProductLineSelect")
@RequestMapping("/api/component/CuteProductLineSelect")
public class CuteProductLineSelectApi {
@Autowired
private CuteProductLineSelectService cuteProductLineSelectService;
@ApiOperation("查询部门下拉选择数据源")
@PostMapping(value = "/listMetadata")
@PreAuthorize("@el.check()")
public ResponseEntity<?> listMetadata() {
return ResponseEntity.ok(cuteProductLineSelectService.listMetadata());
}
}
@@ -0,0 +1,42 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application;
import cn.odboy.system.application.service.CuteProductLineSelectProService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "系统组件:CuteProductLineSelectPro")
@RequestMapping("/api/component/CuteProductLineSelectPro")
public class CuteProductLineSelectProApi {
@Autowired
private CuteProductLineSelectProService cuteProductLineSelectProService;
@ApiOperation("查询部门下拉选择Pro数据源")
@PostMapping(value = "/listMetadata")
@PreAuthorize("@el.check()")
public ResponseEntity<?> listMetadata() {
return ResponseEntity.ok(cuteProductLineSelectProService.listMetadata());
}
}
@@ -0,0 +1,56 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application;
import cn.odboy.system.application.model.CuteUserSelectVo;
import cn.odboy.system.application.service.CuteUserSelectService;
import cn.odboy.system.dal.model.request.SystemQueryUserArgs;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Api(tags = "系统组件:CuteUserSelect")
@RequestMapping("/api/component/CuteUserSelect")
public class CuteUserSelectApi {
@Autowired
private CuteUserSelectService cuteUserSelectService;
@ApiOperation("查询用户基础数据")
@PostMapping(value = "/listMetadata")
@PreAuthorize("@el.check()")
public ResponseEntity<List<CuteUserSelectVo>> listMetadata(@Validated @RequestBody SystemQueryUserArgs args) {
List<CuteUserSelectVo> collect = cuteUserSelectService.listMetadata(args);
return ResponseEntity.ok(collect);
}
@ApiOperation("根据用户名称集合查询用户基础数据")
@PostMapping(value = "/listMetadataByUsernames")
@PreAuthorize("@el.check()")
public ResponseEntity<List<CuteUserSelectVo>> listMetadataByUsernames(@RequestBody List<String> usernameList) {
List<CuteUserSelectVo> collect = cuteUserSelectService.listMetadataByUsernames(usernameList);
return ResponseEntity.ok(collect);
}
}
@@ -0,0 +1,63 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.model;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class CuteDeptTreeVo extends KitObject {
/**
* 部门ID
*/
private String id;
/**
* 部门名称
*/
private String name;
/**
* 上级部门ID
*/
private String pid;
/**
* 子节点数目
*/
private Integer subCount = 0;
/**
* 是否有子节点
*/
public Boolean getHasChildren() {
return subCount > 0;
}
/**
* 是否为叶子
*/
public Boolean getLeaf() {
return subCount <= 0;
}
/**
* 标签名称
*/
public String getLabel() {
return name;
}
}
@@ -0,0 +1,35 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.model;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class CuteProductLineSelectProVo extends KitObject {
/**
* 部门ID(select的value)
*/
private String value;
/**
* 产品线,如"研发部/华南分部/devops组"
*/
private String label;
private List<CuteProductLineSelectProVo> children;
}
@@ -0,0 +1,38 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.model;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class CuteProductLineSelectVo extends KitObject {
/**
* 部门ID(select的value)
*/
private String value;
/**
* 产品线,如"研发部/华南分部/devops组"
*/
private String label;
/**
* ID路径,如"1-2-3"
*/
private String idPath;
}
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.model;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class CuteUserSelectVo extends KitObject {
/**
* username
*/
private String value;
/**
* nickname
*/
private String label;
/**
* 部门ID
*/
private String deptId;
/**
* 邮箱
*/
private String email;
/**
* 手机号
*/
private String phone;
}
@@ -0,0 +1,39 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.service;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import cn.odboy.system.dal.mysql.SystemDeptMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class CuteBaseService {
@Autowired
private SystemDeptMapper systemDeptMapper;
/**
* 查询启用的所有部门集合
*
* @return /
*/
public List<SystemDeptTb> listEnabledDept() {
LambdaQueryWrapper<SystemDeptTb> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SystemDeptTb::getEnabled, 1);
return systemDeptMapper.selectList(wrapper);
}
}
@@ -0,0 +1,80 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.service;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.odboy.system.application.model.CuteDeptTreeVo;
import cn.odboy.system.constant.SystemDataScopeEnum;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import cn.odboy.system.dal.model.request.SystemQueryDeptArgs;
import cn.odboy.system.framework.permission.core.KitSecurityHelper;
import cn.odboy.system.service.SystemDeptService;
import cn.odboy.util.KitClassUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CuteDeptTreeService {
@Autowired
private SystemDeptService systemDeptService;
public List<CuteDeptTreeVo> listMetadata(SystemQueryDeptArgs args) throws Exception {
String dataScopeType = KitSecurityHelper.getDataScopeType();
if (dataScopeType.equals(SystemDataScopeEnum.ALL.getValue())) {
args.setPidIsNull(true);
}
List<Field> fields = KitClassUtil.getAllFields(args.getClass(), new ArrayList<>());
List<String> fieldNames = new ArrayList<>() {{
add("pidIsNull");
add("enabled");
}};
for (Field field : fields) {
// 设置对象的访问权限, 保证对private的属性的访问
field.setAccessible(true);
Object val = field.get(args);
if (fieldNames.contains(field.getName())) {
continue;
}
if (ObjectUtil.isNotNull(val)) {
args.setPidIsNull(null);
break;
}
}
// 数据权限
args.setIds(KitSecurityHelper.getCurrentUserDataScope());
List<SystemDeptTb> list = systemDeptService.queryDeptByArgs(args);
// 如果为空, 就代表为自定义权限或者本级权限, 就需要去重, 不理解可以注释掉,看查询结果
if (StrUtil.isBlank(dataScopeType)) {
return systemDeptService.filterRootDeptList(list).stream().map(this::convertToVo).collect(Collectors.toList());
}
return list.stream().map(this::convertToVo).collect(Collectors.toList());
}
private CuteDeptTreeVo convertToVo(SystemDeptTb record) {
CuteDeptTreeVo treeVo = new CuteDeptTreeVo();
treeVo.setId(Long.toString(record.getId()));
treeVo.setName(record.getName());
treeVo.setPid(record.getPid() == null ? null : Long.toString(record.getPid()));
treeVo.setSubCount(record.getSubCount());
return treeVo;
}
}
@@ -0,0 +1,82 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.service;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.odboy.framework.context.KitRequestHolder;
import cn.odboy.framework.exception.BadRequestException;
import cn.odboy.framework.properties.AppProperties;
import cn.odboy.framework.server.core.KitFileLocalUploadHelper;
import cn.odboy.system.dal.dataobject.SystemLocalStorageTb;
import cn.odboy.system.dal.mysql.SystemLocalStorageMapper;
import cn.odboy.util.KitFileUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import jakarta.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Date;
@Slf4j
@Service
public class CuteFileUploadService {
@Autowired
private SystemLocalStorageMapper systemLocalStorageMapper;
@Autowired
private KitFileLocalUploadHelper fileUploadPathHelper;
@Autowired
private AppProperties properties;
@Transactional(rollbackFor = Exception.class)
public String uploadLocal(MultipartFile multipartFile) {
long size = multipartFile.getSize();
KitFileUtil.checkSize(properties.getOss().getMaxSize(), size);
String suffix = KitFileUtil.getSuffix(multipartFile.getOriginalFilename());
String type = KitFileUtil.getFileType(suffix);
String uploadDateStr = DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT);
File file = KitFileUtil.upload(multipartFile, fileUploadPathHelper.getPath() + uploadDateStr + File.separator);
if (file == null) {
throw new BadRequestException("上传失败");
}
try {
String formatSize = KitFileUtil.getSize(size);
String prefixName = KitFileUtil.getPrefix(multipartFile.getOriginalFilename(), null);
SystemLocalStorageTb localStorage = new SystemLocalStorageTb();
localStorage.setRealName(file.getName());
localStorage.setName(prefixName);
localStorage.setSuffix(suffix);
localStorage.setPath(file.getPath());
localStorage.setType(type);
localStorage.setSize(formatSize);
localStorage.setDateGroup(uploadDateStr);
systemLocalStorageMapper.insert(localStorage);
// 构建上传路径 /file/20260117/odboycn-20260117055246428.png
HttpServletRequest httpServletRequest = KitRequestHolder.getHttpServletRequest();
StringBuffer requestURL = httpServletRequest.getRequestURL();
String[] splits = requestURL.toString().split("/api/component/CuteFileUpload");
String requestAddress = splits[0];
return String.format("%s/file/%s/%s", requestAddress, uploadDateStr, localStorage.getRealName());
} catch (Exception e) {
log.error("上传文件失败", e);
KitFileUtil.del(file);
throw e;
}
}
}
@@ -0,0 +1,84 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.service;
import cn.odboy.system.application.model.CuteProductLineSelectProVo;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class CuteProductLineSelectProService extends CuteBaseService {
/**
* 产品线选择组件Pro版 数据源
*
* @return /
*/
public List<CuteProductLineSelectProVo> listMetadata() {
List<SystemDeptTb> depts = this.listEnabledDept();
// 查询所有部门并按父子关系组织
Map<Long, SystemDeptTb> deptMap =
depts.stream().collect(Collectors.toMap(SystemDeptTb::getId, Function.identity()));
List<CuteProductLineSelectProVo> options = new ArrayList<>();
// 构建树形结构
for (SystemDeptTb dept : depts) {
// 只处理顶级部门(pid为null或0的部门)
if (dept.getPid() == null || dept.getPid() == 0) {
CuteProductLineSelectProVo vo = this.buildDeptTreePro(dept, deptMap);
options.add(vo);
}
}
// 按排序字段排序
options.sort(Comparator.comparingInt(o -> {
Long id = Long.valueOf(o.getValue());
return deptMap.get(id) != null ? deptMap.get(id).getDeptSort() : 0;
}));
return options;
}
/**
* 递归构建部门树
*
* @param dept 当前部门
* @param deptMap 部门映射
* @return CuteProductLineSelectProVo 树节点
*/
private CuteProductLineSelectProVo buildDeptTreePro(SystemDeptTb dept, Map<Long, SystemDeptTb> deptMap) {
CuteProductLineSelectProVo vo = new CuteProductLineSelectProVo();
vo.setValue(String.valueOf(dept.getId()));
vo.setLabel(dept.getName());
// 查找子部门
List<CuteProductLineSelectProVo> children = new ArrayList<>();
for (SystemDeptTb childDept : deptMap.values()) {
if (dept.getId().equals(childDept.getPid())) {
children.add(this.buildDeptTreePro(childDept, deptMap));
}
}
// 子部门按排序字段排序
children.sort(Comparator.comparingInt(o -> {
Long id = Long.valueOf(o.getValue());
return deptMap.get(id) != null ? deptMap.get(id).getDeptSort() : 0;
}));
vo.setChildren(children);
return vo;
}
}
@@ -0,0 +1,85 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.service;
import cn.odboy.system.application.model.CuteProductLineSelectVo;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class CuteProductLineSelectService extends CuteBaseService {
/**
* 产品线选择组件 数据源
*
* @return /
*/
public List<CuteProductLineSelectVo> listMetadata() {
List<SystemDeptTb> depts = this.listEnabledDept();
return this.buildDeptMetadata(depts);
}
private List<CuteProductLineSelectVo> buildDeptMetadata(List<SystemDeptTb> depts) {
// 查询所有部门并按父子关系组织
Map<Long, SystemDeptTb> deptMap =
depts.stream().collect(Collectors.toMap(SystemDeptTb::getId, Function.identity()));
List<CuteProductLineSelectVo> options = new ArrayList<>();
for (SystemDeptTb dept : depts) {
// 构建部门ID路径
List<Long> pathIds = new ArrayList<>();
this.buildDeptIdPath(dept, deptMap, pathIds);
// 反转路径,从顶级部门到当前部门
Collections.reverse(pathIds);
CuteProductLineSelectVo dto = new CuteProductLineSelectVo();
dto.setValue(Long.toString(dept.getId()));
dto.setIdPath(pathIds.stream().map(String::valueOf).collect(Collectors.joining("-")));
// 保留名称路径用于显示
dto.setLabel(this.buildNamePath(dept, deptMap));
options.add(dto);
}
// 按部门名称路径排序
options.sort(Comparator.comparing(CuteProductLineSelectVo::getLabel));
return options;
}
private void buildDeptIdPath(SystemDeptTb dept, Map<Long, SystemDeptTb> deptMap, List<Long> pathIds) {
pathIds.add(dept.getId());
if (dept.getPid() != null && dept.getPid() != 0 && deptMap.containsKey(dept.getPid())) {
this.buildDeptIdPath(deptMap.get(dept.getPid()), deptMap, pathIds);
}
}
private String buildNamePath(SystemDeptTb dept, Map<Long, SystemDeptTb> deptMap) {
List<String> pathNames = new ArrayList<>();
this.buildDeptNamePath(dept, deptMap, pathNames);
Collections.reverse(pathNames);
return String.join(" / ", pathNames);
}
private void buildDeptNamePath(SystemDeptTb dept, Map<Long, SystemDeptTb> deptMap, List<String> pathNames) {
pathNames.add(dept.getName());
if (dept.getPid() != null && dept.getPid() != 0 && deptMap.containsKey(dept.getPid())) {
this.buildDeptNamePath(deptMap.get(dept.getPid()), deptMap, pathNames);
}
}
}
@@ -0,0 +1,83 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.application.service;
import cn.hutool.core.collection.CollUtil;
import cn.odboy.system.application.model.CuteUserSelectVo;
import cn.odboy.system.dal.dataobject.SystemUserTb;
import cn.odboy.system.dal.model.request.SystemQueryUserArgs;
import cn.odboy.system.dal.mysql.SystemUserMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CuteUserSelectService {
@Autowired
private SystemUserMapper systemUserMapper;
/**
* 模糊查询用户基础信息,限制返回的条数
*
* @param args 查询参数
* @return /
*/
public List<CuteUserSelectVo> listMetadata(SystemQueryUserArgs args) {
LambdaQueryWrapper<SystemUserTb> wrapper = new LambdaQueryWrapper<>();
wrapper.select(SystemUserTb::getUsername, SystemUserTb::getNickName, SystemUserTb::getDeptId, SystemUserTb::getEmail, SystemUserTb::getPhone);
wrapper.and(c -> {
c.eq(SystemUserTb::getPhone, args.getBlurry());
c.or();
c.eq(SystemUserTb::getEmail, args.getBlurry());
c.or();
c.like(SystemUserTb::getUsername, args.getBlurry());
c.or();
c.like(SystemUserTb::getNickName, args.getBlurry());
});
return systemUserMapper.selectPage(new Page<>(1, 50), wrapper).convert(m -> {
CuteUserSelectVo selectVo = new CuteUserSelectVo();
selectVo.setValue(m.getUsername());
selectVo.setLabel(m.getNickName());
selectVo.setDeptId(Long.toString(m.getDeptId()));
selectVo.setEmail(m.getEmail());
selectVo.setPhone(m.getPhone());
return selectVo;
}).getRecords();
}
public List<CuteUserSelectVo> listMetadataByUsernames(List<String> usernameList) {
if (CollUtil.isEmpty(usernameList)) {
return new ArrayList<>();
}
LambdaQueryWrapper<SystemUserTb> wrapper = new LambdaQueryWrapper<>();
wrapper.select(SystemUserTb::getUsername, SystemUserTb::getNickName, SystemUserTb::getDeptId, SystemUserTb::getEmail, SystemUserTb::getPhone);
wrapper.in(SystemUserTb::getUsername, usernameList);
return systemUserMapper.selectList(wrapper).stream().map(m -> {
CuteUserSelectVo selectVo = new CuteUserSelectVo();
selectVo.setValue(m.getUsername());
selectVo.setLabel(m.getNickName());
selectVo.setDeptId(Long.toString(m.getDeptId()));
selectVo.setEmail(m.getEmail());
selectVo.setPhone(m.getPhone());
return selectVo;
}).collect(Collectors.toList());
}
}
@@ -0,0 +1,35 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.constant;
/**
* 关于缓存的Key集合
*/
public interface SystemCacheKey {
/**
* 在线用户
*/
String ONLINE_USER = "user::token:";
/**
* 登录验证码
*/
String CAPTCHA_LOGIN = "captcha::login:";
/**
* 用户信息
*/
String USER_INFO = "user::info:";
}
@@ -0,0 +1,56 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 验证码业务场景
*/
@Getter
@AllArgsConstructor
public enum SystemCaptchaBizEnum {
PHONE_RESET_EMAIL_CODE("10000", "phone_reset_email_code_", "SystemEmailCaptchaTemplate.ftl", "通过手机号码重置邮箱"),
EMAIL_RESET_EMAIL_CODE("10001", "email_reset_email_code_", "SystemEmailCaptchaTemplate.ftl", "通过旧邮箱重置邮箱"),
PHONE_RESET_PWD_CODE("10002", "phone_reset_pwd_code_", "SystemEmailCaptchaTemplate.ftl", "通过手机号码重置密码"),
EMAIL_RESET_PWD_CODE("10003", "email_reset_pwd_code_", "SystemEmailCaptchaTemplate.ftl", "通过邮箱重置密码");
/**
* 业务编码
*/
private final String bizCode;
/**
* redis中的key
*/
private final String redisKey;
/**
* resources文件夹,template中的模版名称
*/
private final String templateName;
/**
* 业务描述
*/
private final String description;
public static SystemCaptchaBizEnum getByBizCode(String bizCode) {
for (SystemCaptchaBizEnum value : SystemCaptchaBizEnum.values()) {
if (value.getBizCode().equals(bizCode)) {
return value;
}
}
return null;
}
}
@@ -0,0 +1,41 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 数据权限枚举
*/
@Getter
@AllArgsConstructor
public enum SystemDataScopeEnum {
ALL("全部", "全部的数据权限"),
THIS_LEVEL("本级", "自己部门的数据权限"),
CUSTOMIZE("自定义", "自定义的数据权限");
private final String value;
private final String description;
public static SystemDataScopeEnum find(String val) {
for (SystemDataScopeEnum dataScopeEnum : SystemDataScopeEnum.values()) {
if (dataScopeEnum.getValue().equals(val)) {
return dataScopeEnum;
}
}
return null;
}
}
@@ -0,0 +1,23 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.constant;
public interface SystemTransferProtocolConst {
String PREFIX_HTTP = "http://";
String PREFIX_HTTPS = "https://";
String PREFIX_HTTPS_BAD_REQUEST = "外链必须以http://或者https://开头";
}
@@ -0,0 +1,22 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.constant;
public interface SystemYesOrNoChConst {
String YES_STR = "是";
String NO_STR = "否";
}
@@ -0,0 +1,24 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.constant;
public interface SystemZhConst {
String YES_STR = "是";
String NO_STR = "否";
String ENABLE_STR = "启用";
String DISABLE_STR = "停用";
}
@@ -0,0 +1,58 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.annotation.AnonymousPostMapping;
import cn.odboy.system.dal.model.request.SystemUserLoginArgs;
import cn.odboy.system.dal.model.response.SystemAuthVo;
import cn.odboy.system.service.SystemAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletRequest;
/**
* 授权、根据token获取用户详细信息
*/
@Slf4j
@RestController
@RequestMapping("/auth")
@Api(tags = "系统:系统授权接口")
public class SystemAuthController {
@Autowired
private SystemAuthService systemAuthService;
@ApiOperation("登录授权")
@AnonymousPostMapping(value = "/login")
public ResponseEntity<SystemAuthVo> login(@Validated @RequestBody SystemUserLoginArgs loginRequest, HttpServletRequest request) throws Exception {
SystemAuthVo loginInfo = systemAuthService.doLogin(loginRequest, request);
return ResponseEntity.ok(loginInfo);
}
@ApiOperation("退出登录")
@AnonymousPostMapping(value = "/logout")
public ResponseEntity<Void> logout(HttpServletRequest request) {
systemAuthService.doLogout(request);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,63 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.system.constant.SystemCaptchaBizEnum;
import cn.odboy.system.dal.model.request.SystemCheckEmailCaptchaArgs;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemEmailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/captcha")
@Api(tags = "系统:验证码管理")
public class SystemCaptchaController {
@Autowired
private SystemEmailService systemEmailService;
@OperationLog
@ApiOperation("重置邮箱, 发送验证码")
@PostMapping(value = "/sendResetEmailCode")
public ResponseEntity<Void> sendResetEmailCode(@RequestParam String email) {
systemEmailService.sendCaptcha(SystemCaptchaBizEnum.EMAIL_RESET_EMAIL_CODE, email);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("重置密码,发送验证码")
@PostMapping(value = "/sendResetPasswordCode")
public ResponseEntity<Void> sendResetPasswordCode(@RequestParam String email) {
systemEmailService.sendCaptcha(SystemCaptchaBizEnum.EMAIL_RESET_PWD_CODE, email);
return ResponseEntity.ok(null);
}
@ApiOperation("验证码验证")
@PostMapping(value = "/verifyCode")
public ResponseEntity<Void> verifyCode(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) {
systemEmailService.checkEmailCaptcha(args);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,100 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import cn.odboy.system.dal.model.request.SystemCreateDeptArgs;
import cn.odboy.system.dal.model.request.SystemQueryDeptArgs;
import cn.odboy.system.dal.model.response.SystemDeptVo;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemDeptService;
import cn.odboy.util.KitPageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Set;
@RestController
@Api(tags = "系统:部门管理")
@RequestMapping("/api/dept")
public class SystemDeptController {
@Autowired
private SystemDeptService systemDeptService;
@OperationLog
@ApiOperation("导出部门数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('dept:list')")
public void exportDept(HttpServletResponse response, SystemQueryDeptArgs args) throws Exception {
systemDeptService.exportDeptXlsx(response, args);
}
@ApiOperation("查询部门")
@PostMapping(value = "/searchDept")
@PreAuthorize("@el.check('user:list','dept:list')")
public ResponseEntity<KitPageResult<SystemDeptTb>> queryDept(@Validated @RequestBody KitPageArgs<SystemQueryDeptArgs> pageArgs) throws Exception {
List<SystemDeptTb> depts = systemDeptService.queryAllDeptByArgs(pageArgs.getArgs(), true);
return ResponseEntity.ok(KitPageUtil.toPage(depts));
}
@ApiOperation("查询部门:根据ID获取同级与上级数据")
@PostMapping("/searchDeptTree")
@PreAuthorize("@el.check('user:list','dept:list')")
public ResponseEntity<KitPageResult<SystemDeptVo>> queryDeptSuperiorTree(@RequestBody List<Long> ids, @RequestParam(defaultValue = "false") Boolean exclude) {
return ResponseEntity.ok(systemDeptService.searchDeptTree(ids, exclude));
}
@OperationLog
@ApiOperation("新增部门")
@PostMapping(value = "/saveDept")
@PreAuthorize("@el.check('dept:add')")
public ResponseEntity<Void> saveDept(@Validated @RequestBody SystemCreateDeptArgs args) {
systemDeptService.saveDept(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改部门")
@PostMapping(value = "/updateDeptById")
@PreAuthorize("@el.check('dept:edit')")
public ResponseEntity<Void> updateDeptById(@Validated(SystemDeptTb.Update.class) @RequestBody SystemDeptTb args) {
systemDeptService.updateDeptById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除部门")
@PostMapping(value = "/deleteDeptByIds")
@PreAuthorize("@el.check('dept:del')")
public ResponseEntity<Void> deleteDeptByIds(@RequestBody Set<Long> ids) {
systemDeptService.deleteDeptByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,100 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemDictTb;
import cn.odboy.system.dal.model.request.SystemCreateDictArgs;
import cn.odboy.system.dal.model.request.SystemQueryDictArgs;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemDictService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Set;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "系统:字典管理")
@RequestMapping("/api/dict")
public class SystemDictController {
@Autowired
private SystemDictService systemDictService;
@OperationLog
@ApiOperation("导出字典数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('dict:list')")
public void exportDict(HttpServletResponse response, SystemQueryDictArgs args) {
systemDictService.exportDictXlsx(response, args);
}
@Deprecated
@ApiOperation("查询所有字典")
@PostMapping(value = "/queryAllDict")
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity<List<SystemDictTb>> queryAllDict() {
return ResponseEntity.ok(systemDictService.queryDictByArgs(new SystemQueryDictArgs()));
}
@ApiOperation("分页查询字典")
@PostMapping(value = "/searchDict")
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity<KitPageResult<SystemDictTb>> queryDictByArgs(@Validated @RequestBody KitPageArgs<SystemQueryDictArgs> pageArgs) {
Page<SystemDictTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemDictService.searchDict(pageArgs.getArgs(), page, pageArgs.getOrderBy()));
}
@OperationLog
@ApiOperation("新增字典")
@PostMapping(value = "/saveDict")
@PreAuthorize("@el.check('dict:add')")
public ResponseEntity<Void> saveDict(@Validated @RequestBody SystemCreateDictArgs args) {
systemDictService.saveDict(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改字典")
@PostMapping(value = "/updateDictById")
@PreAuthorize("@el.check('dict:edit')")
public ResponseEntity<Void> updateDictById(@Validated(SystemDictTb.Update.class) @RequestBody SystemDictTb args) {
systemDictService.updateDictById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除字典")
@PostMapping(value = "/deleteDictByIds")
@PreAuthorize("@el.check('dict:del')")
public ResponseEntity<Void> deleteDictByIds(@RequestBody Set<Long> ids) {
systemDictService.deleteDictByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,79 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemDictDetailTb;
import cn.odboy.system.dal.model.request.SystemCreateDictDetailArgs;
import cn.odboy.system.dal.model.request.SystemQueryDictDetailArgs;
import cn.odboy.system.dal.model.response.SystemDictDetailVo;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemDictDetailService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "系统:字典详情管理")
@RequestMapping("/api/dictDetail")
public class SystemDictDetailController {
@Autowired
private SystemDictDetailService systemDictDetailService;
@ApiOperation("查询字典详情")
@PostMapping(value = "/searchDictDetail")
public ResponseEntity<KitPageResult<SystemDictDetailVo>> queryDictDetailByArgs(@Validated @RequestBody KitPageArgs<SystemQueryDictDetailArgs> pageArgs) {
Page<SystemDictDetailTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemDictDetailService.searchDictDetail(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("新增字典详情")
@PostMapping(value = "/saveDictDetail")
@PreAuthorize("@el.check('dict:add')")
public ResponseEntity<Void> saveDictDetail(@Validated @RequestBody SystemCreateDictDetailArgs args) {
systemDictDetailService.saveDictDetail(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改字典详情")
@PostMapping(value = "/updateDictDetailById")
@PreAuthorize("@el.check('dict:edit')")
public ResponseEntity<Void> updateDictDetailById(@Validated(SystemDictDetailTb.Update.class) @RequestBody SystemDictDetailTb args) {
systemDictDetailService.updateDictDetailById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除字典详情")
@PostMapping(value = "/deleteDictDetailById")
@PreAuthorize("@el.check('dict:del')")
public ResponseEntity<Void> deleteDictDetailById(@RequestBody SystemDictDetailTb args) {
systemDictDetailService.deleteDictDetailById(args.getId());
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,64 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.system.dal.dataobject.SystemEmailConfigTb;
import cn.odboy.system.dal.model.request.SystemSendEmailArgs;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemEmailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 发送邮件
*/
@RestController
@RequestMapping("api/email")
@Api(tags = "工具:邮件管理")
public class SystemEmailController {
@Autowired
private SystemEmailService systemEmailService;
@ApiOperation("查询配置")
@PostMapping(value = "/getLastEmailConfig")
public ResponseEntity<SystemEmailConfigTb> getLastEmailConfig() {
return ResponseEntity.ok(systemEmailService.getLastEmailConfig());
}
@OperationLog
@ApiOperation("修改邮箱配置")
@PostMapping(value = "/updateEmailConfigById")
public ResponseEntity<Void> updateEmailConfigById(@Validated @RequestBody SystemEmailConfigTb emailConfig) throws Exception {
systemEmailService.updateEmailConfigById(emailConfig);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("发送邮件")
@PostMapping(value = "/send")
public ResponseEntity<Void> send(@Validated @RequestBody SystemSendEmailArgs sendEmailRequest) {
systemEmailService.sendEmail(sendEmailRequest);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,90 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemJobTb;
import cn.odboy.system.dal.model.request.SystemCreateJobArgs;
import cn.odboy.system.dal.model.request.SystemQueryJobArgs;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemJobService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Set;
@RestController
@Api(tags = "系统:岗位管理")
@RequestMapping("/api/job")
public class SystemJobController {
@Autowired
private SystemJobService systemJobService;
@OperationLog
@ApiOperation("导出岗位数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('job:list')")
public void exportJob(HttpServletResponse response, SystemQueryJobArgs args) {
systemJobService.exportJobXlsx(response, args);
}
@ApiOperation("分页查询岗位")
@PostMapping(value = "/searchJob")
@PreAuthorize("@el.check('job:list','user:list')")
public ResponseEntity<KitPageResult<SystemJobTb>> queryJobByArgs(@Validated @RequestBody KitPageArgs<SystemQueryJobArgs> pageArgs) {
Page<SystemJobTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemJobService.searchJobByArgs(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("新增岗位")
@PostMapping(value = "/saveJob")
@PreAuthorize("@el.check('job:add')")
public ResponseEntity<Void> saveJob(@Validated @RequestBody SystemCreateJobArgs args) {
systemJobService.saveJob(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改岗位")
@PostMapping(value = "/updateJobById")
@PreAuthorize("@el.check('job:edit')")
public ResponseEntity<Void> updateJobById(@Validated(SystemJobTb.Update.class) @RequestBody SystemJobTb args) {
systemJobService.updateJobById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除岗位")
@PostMapping(value = "/deleteJobByIds")
@PreAuthorize("@el.check('job:del')")
public ResponseEntity<Void> deleteJobByIds(@RequestBody Set<Long> ids) {
systemJobService.deleteJobByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,97 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemLocalStorageTb;
import cn.odboy.system.dal.model.request.SystemQueryStorageArgs;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemLocalStorageService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import jakarta.servlet.http.HttpServletResponse;
@RestController
@Api(tags = "工具:本地存储管理")
@RequestMapping("/api/localStorage")
public class SystemLocalStorageController {
@Autowired
private SystemLocalStorageService localStorageService;
@ApiOperation("查询文件")
@PostMapping(value = "/searchLocalStorage")
@PreAuthorize("@el.check('storage:list')")
public ResponseEntity<KitPageResult<SystemLocalStorageTb>> queryLocalStorage(@Validated @RequestBody KitPageArgs<SystemQueryStorageArgs> pageArgs) {
Page<SystemLocalStorageTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(localStorageService.searchLocalStorage(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("导出本地存储记录数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('storage:list')")
public void exportFile(HttpServletResponse response, SystemQueryStorageArgs args) {
localStorageService.exportLocalStorageXlsx(response, args);
}
@OperationLog
@ApiOperation("上传文件")
@PostMapping(value = "/uploadFile")
@PreAuthorize("@el.check('storage:add')")
public ResponseEntity<Void> uploadFile(@RequestParam String name, @RequestParam("file") MultipartFile file) {
localStorageService.uploadFile(name, file);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("上传图片")
@PostMapping("/uploadPicture")
public ResponseEntity<SystemLocalStorageTb> uploadPicture(@RequestParam MultipartFile file) {
SystemLocalStorageTb localStorage = localStorageService.uploadPicture(file);
return ResponseEntity.ok(localStorage);
}
@OperationLog
@ApiOperation("修改文件")
@PostMapping(value = "/updateLocalStorageById")
@PreAuthorize("@el.check('storage:edit')")
public ResponseEntity<Void> updateLocalStorageById(@Validated @RequestBody SystemLocalStorageTb args) {
localStorageService.updateLocalStorageById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除文件")
@PostMapping(value = "/deleteFileByIds")
public ResponseEntity<Void> deleteFileByIds(@RequestBody Long[] ids) {
localStorageService.deleteFileByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,133 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemMenuTb;
import cn.odboy.system.dal.model.request.SystemQueryMenuArgs;
import cn.odboy.system.dal.model.response.SystemMenuRouterVo;
import cn.odboy.system.dal.model.response.SystemMenuVo;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemMenuService;
import cn.odboy.util.KitPageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Set;
@RestController
@Api(tags = "系统:菜单管理")
@RequestMapping("/api/menu")
public class SystemMenuController {
@Autowired
private SystemMenuService systemMenuService;
@OperationLog
@ApiOperation("导出菜单数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('menu:list')")
public void exportMenu(HttpServletResponse response, SystemQueryMenuArgs args) throws Exception {
systemMenuService.exportMenuXlsx(response, args);
}
@PostMapping(value = "/buildMenus")
@ApiOperation("获取前端所需菜单")
public ResponseEntity<List<SystemMenuRouterVo>> buildMenus() {
List<SystemMenuRouterVo> systemMenuRouterVos = systemMenuService.buildFrontMenus();
return ResponseEntity.ok(systemMenuRouterVos);
}
@ApiOperation("返回全部的菜单")
@PostMapping(value = "/listMenuByPid")
@PreAuthorize("@el.check('menu:list','roles:list')")
public ResponseEntity<List<SystemMenuTb>> listMenuByPid(@RequestParam Long pid) {
List<SystemMenuTb> systemMenuTbs = systemMenuService.listMenuByPid(pid, false);
return ResponseEntity.ok(systemMenuTbs);
}
@ApiOperation("返回全部的菜单")
@PostMapping(value = "/listRoleMenuByPid")
@PreAuthorize("@el.check('menu:list','roles:list')")
public ResponseEntity<List<SystemMenuTb>> listRoleMenuByPid(@RequestParam Long pid) {
List<SystemMenuTb> systemMenuTbs = systemMenuService.listMenuByPid(pid, true);
return ResponseEntity.ok(systemMenuTbs);
}
@ApiOperation("根据菜单ID返回所有子节点ID, 包含自身ID")
@PostMapping(value = "/listChildMenuSetByMenuId")
@PreAuthorize("@el.check('menu:list','roles:list')")
public ResponseEntity<Set<Long>> listChildMenuSetByMenuId(@RequestParam Long id) {
Set<Long> ids = systemMenuService.listChildMenuSetByMenuId(id);
return ResponseEntity.ok(ids);
}
@PostMapping(value = "/searchMenu")
@ApiOperation("查询菜单")
@PreAuthorize("@el.check('menu:list')")
public ResponseEntity<KitPageResult<SystemMenuTb>> queryAllMenu(
@Validated @RequestBody KitPageArgs<SystemQueryMenuArgs> pageArgs) throws Exception {
List<SystemMenuTb> menuList = systemMenuService.queryAllMenu(pageArgs.getArgs(), true);
return ResponseEntity.ok(KitPageUtil.toPage(menuList));
}
@ApiOperation("查询菜单:根据ID获取同级与上级数据")
@PostMapping("/queryMenuSuperior")
@PreAuthorize("@el.check('menu:list')")
public ResponseEntity<List<SystemMenuVo>> queryMenuSuperior(@RequestBody List<Long> ids) {
List<SystemMenuVo> systemMenuTbs = systemMenuService.listMenuSuperior(ids);
return ResponseEntity.ok(systemMenuTbs);
}
@OperationLog
@ApiOperation("新增菜单")
@PostMapping(value = "/saveMenu")
@PreAuthorize("@el.check('menu:add')")
public ResponseEntity<Void> saveMenu(@Validated @RequestBody SystemMenuTb args) {
systemMenuService.saveMenu(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改菜单")
@PostMapping(value = "/updateMenuById")
@PreAuthorize("@el.check('menu:edit')")
public ResponseEntity<Void> updateMenuById(@Validated(SystemMenuTb.Update.class) @RequestBody SystemMenuTb args) {
systemMenuService.updateMenuById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除菜单")
@PostMapping(value = "/deleteMenuByIds")
@PreAuthorize("@el.check('menu:del')")
public ResponseEntity<Void> deleteMenuByIds(@RequestBody Set<Long> ids) {
systemMenuService.deleteMenuByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,45 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemMonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@Api(tags = "系统:服务监控管理")
@RequestMapping("/api/monitor")
public class SystemMonitorController {
@Autowired
private SystemMonitorService systemMonitorService;
@OperationLog
@PostMapping(value = "/getServerMonitorInfo")
@ApiOperation("查询服务监控")
@PreAuthorize("@el.check('monitor:list')")
public ResponseEntity<Map<String, Object>> getServerMonitorInfo() {
return ResponseEntity.ok(systemMonitorService.getServerMonitorInfo());
}
}
@@ -0,0 +1,72 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.model.response.SystemUserOnlineVo;
import cn.odboy.system.dal.redis.SystemUserOnlineInfoDAO;
import cn.odboy.system.framework.operalog.OperationLog;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Set;
@RestController
@RequestMapping("/api/user/online")
@Api(tags = "系统:在线用户管理")
public class SystemOnlineController {
@Autowired
private SystemUserOnlineInfoDAO systemUserOnlineInfoDAO;
@OperationLog
@ApiOperation("查询在线用户")
@PostMapping(value = "/searchOnlineUser")
@PreAuthorize("@el.check()")
public ResponseEntity<KitPageResult<SystemUserOnlineVo>> queryOnlineUser(@Validated @RequestBody KitPageArgs<SystemUserOnlineVo> pageArgs) {
IPage<SystemUserOnlineVo> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemUserOnlineInfoDAO.searchOnlineUser(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("导出在线用户数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check()")
public void exportOnlineUser(HttpServletResponse response, String username) {
systemUserOnlineInfoDAO.exportOnlineUserXlsx(response, username);
}
@OperationLog
@ApiOperation("踢出在线用户")
@PostMapping(value = "/kickOutUser")
@PreAuthorize("@el.check()")
public ResponseEntity<Void> kickOutUser(@RequestBody Set<String> keys) throws Exception {
systemUserOnlineInfoDAO.kickOutUser(keys);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,50 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemOperationLogTb;
import cn.odboy.system.dal.model.request.SystemQueryOperationLogArgs;
import cn.odboy.system.service.SystemOperationLogService;
import cn.odboy.util.KitPageUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "系统:审计日志")
@RequestMapping("/api/logs")
public class SystemOperationLogController {
@Autowired
private SystemOperationLogService systemOperationLogService;
@PostMapping(value = "/searchUserLog")
@ApiOperation("用户日志查询")
public ResponseEntity<KitPageResult<SystemOperationLogTb>> searchUserLog(@Validated @RequestBody KitPageArgs<SystemQueryOperationLogArgs> pageArgs) {
IPage<SystemOperationLogTb> systemOperationLogTbPage = systemOperationLogService.searchUserLog(pageArgs);
return new ResponseEntity<>(KitPageUtil.toPage(systemOperationLogTbPage), HttpStatus.OK);
}
}
@@ -0,0 +1,83 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemOssStorageTb;
import cn.odboy.system.dal.model.request.SystemQueryStorageArgs;
import cn.odboy.system.dal.model.response.SystemOssStorageVo;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemOssStorageService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import jakarta.servlet.http.HttpServletResponse;
@Slf4j
@RestController
@Api(tags = "工具:OSS存储管理")
@RequestMapping("/api/ossStorage")
public class SystemOssStorageController {
@Autowired
private SystemOssStorageService systemOssStorageService;
@ApiOperation("查询文件")
@PostMapping(value = "/searchOssStorage")
@PreAuthorize("@el.check('storage:list')")
public ResponseEntity<KitPageResult<SystemOssStorageVo>> queryOssStorage(@Validated @RequestBody KitPageArgs<SystemQueryStorageArgs> pageArgs) {
Page<SystemOssStorageTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemOssStorageService.searchOssStorage(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("导出OSS存储记录数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('storage:list')")
public void exportFile(HttpServletResponse response, SystemQueryStorageArgs args) {
systemOssStorageService.exportOssStorageXlsx(response, args);
}
@OperationLog
@ApiOperation("上传文件到OSS")
@PostMapping(value = "/uploadFile")
@PreAuthorize("@el.check('storage:add')")
public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file) {
String fileUrl = systemOssStorageService.uploadFile(file);
return ResponseEntity.ok(fileUrl);
}
@OperationLog
@ApiOperation("从OSS删除文件")
@PostMapping(value = "/deleteFileByIds")
public ResponseEntity<Void> deleteFileByIds(@RequestBody Long[] ids) {
systemOssStorageService.deleteFileByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,130 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
import cn.odboy.system.dal.dataobject.SystemQuartzLogTb;
import cn.odboy.system.dal.model.request.SystemQueryQuartzJobArgs;
import cn.odboy.system.dal.model.request.SystemUpdateQuartzJobArgs;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemQuartzJobService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Set;
@Slf4j
@RestController
@RequestMapping("/api/quartzJob")
@Api(tags = "系统:定时任务管理")
public class SystemQuartzJobController {
@Autowired
private SystemQuartzJobService systemQuartzJobService;
@ApiOperation("查询定时任务")
@PostMapping(value = "/searchQuartzJob")
@PreAuthorize("@el.check('quartzJob:list')")
public ResponseEntity<KitPageResult<SystemQuartzJobTb>> queryQuartzJobByCrud(@Validated @RequestBody KitPageArgs<SystemQueryQuartzJobArgs> pageArgs) {
Page<SystemQuartzJobTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemQuartzJobService.searchQuartzJobByArgs(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("导出定时任务数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('quartzJob:list')")
public void exportQuartzJob(HttpServletResponse response, SystemQueryQuartzJobArgs args) {
systemQuartzJobService.exportQuartzJobXlsx(response, args);
}
@OperationLog
@ApiOperation("导出定时任务日志数据")
@GetMapping(value = "/logs/download")
@PreAuthorize("@el.check('quartzJob:list')")
public void exportQuartzJobLog(HttpServletResponse response, SystemQueryQuartzJobArgs args) {
systemQuartzJobService.exportQuartzLogXlsx(response, args);
}
@ApiOperation("查询定时任务执行日志")
@PostMapping(value = "/searchQuartzLog")
@PreAuthorize("@el.check('quartzJob:list')")
public ResponseEntity<KitPageResult<SystemQuartzLogTb>> queryQuartzJobLog(@Validated @RequestBody KitPageArgs<SystemQueryQuartzJobArgs> pageArgs) {
Page<SystemQuartzLogTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemQuartzJobService.searchQuartzLogByArgs(pageArgs.getArgs(), page));
}
@OperationLog
@ApiOperation("新增定时任务")
@PostMapping(value = "/createQuartzJob")
@PreAuthorize("@el.check('quartzJob:add')")
public ResponseEntity<Void> createQuartzJob(@Validated @RequestBody SystemQuartzJobTb args) {
systemQuartzJobService.createJob(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改定时任务")
@PostMapping(value = "/updateQuartzJobResumeCron")
@PreAuthorize("@el.check('quartzJob:edit')")
public ResponseEntity<Void> updateQuartzJob(@Validated(SystemQuartzJobTb.Update.class) @RequestBody SystemUpdateQuartzJobArgs args) {
systemQuartzJobService.updateQuartzJobResumeCron(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("更改定时任务状态")
@PostMapping(value = "/switchQuartzJobStatus/{id}")
@PreAuthorize("@el.check('quartzJob:edit')")
public ResponseEntity<Void> switchQuartzJobStatus(@PathVariable Long id) {
SystemQuartzJobTb quartzJobTb = systemQuartzJobService.getQuartzJobById(id);
systemQuartzJobService.switchQuartzJobStatus(quartzJobTb);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("执行定时任务")
@PostMapping(value = "/startQuartzJob/{id}")
@PreAuthorize("@el.check('quartzJob:edit')")
public ResponseEntity<Void> startQuartzJob(@PathVariable Long id) {
SystemQuartzJobTb quartzJobTb = systemQuartzJobService.getQuartzJobById(id);
systemQuartzJobService.startQuartzJob(quartzJobTb);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除定时任务")
@PostMapping(value = "/deleteJobByIds")
@PreAuthorize("@el.check('quartzJob:del')")
public ResponseEntity<Void> deleteJobByIds(@RequestBody Set<Long> ids) {
systemQuartzJobService.deleteJobByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,121 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.hutool.core.lang.Dict;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemRoleTb;
import cn.odboy.system.dal.model.request.SystemCreateRoleArgs;
import cn.odboy.system.dal.model.request.SystemQueryRoleArgs;
import cn.odboy.system.dal.model.response.SystemRoleVo;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.service.SystemRoleService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Set;
@RestController
@Api(tags = "系统:角色管理")
@RequestMapping("/api/role")
public class SystemRoleController {
@Autowired
private SystemRoleService systemRoleService;
@ApiOperation("获取单个role")
@PostMapping(value = "/getRoleById")
@PreAuthorize("@el.check('roles:list')")
public ResponseEntity<SystemRoleVo> getRoleById(@RequestBody SystemRoleTb args) {
return ResponseEntity.ok(systemRoleService.getRoleVoById(args.getId()));
}
@ApiOperation("导出角色数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('role:list')")
public void exportRole(HttpServletResponse response, SystemQueryRoleArgs args) {
systemRoleService.exportRoleXlsx(response, args);
}
@ApiOperation("返回全部的角色")
@PostMapping(value = "/listAllRole")
@PreAuthorize("@el.check('roles:list','user:add','user:edit')")
public ResponseEntity<List<SystemRoleTb>> listAllRole() {
return ResponseEntity.ok(systemRoleService.listAllRole());
}
@ApiOperation("查询角色")
@PostMapping(value = "/searchRole")
@PreAuthorize("@el.check('roles:list')")
public ResponseEntity<KitPageResult<SystemRoleVo>> queryRoleByArgs(@Validated @RequestBody KitPageArgs<SystemQueryRoleArgs> pageArgs) {
Page<SystemRoleTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemRoleService.searchRoleByArgs(pageArgs.getArgs(), page));
}
@ApiOperation("获取用户级别")
@PostMapping(value = "/getCurrentUserRoleLevel")
public ResponseEntity<Dict> getCurrentUserRoleLevel() {
return ResponseEntity.ok(systemRoleService.getCurrentUserRoleLevel());
}
@OperationLog
@ApiOperation("新增角色")
@PostMapping(value = "/saveRole")
@PreAuthorize("@el.check('roles:add')")
public ResponseEntity<Void> saveRole(@Validated @RequestBody SystemCreateRoleArgs args) {
systemRoleService.saveRole(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改角色")
@PostMapping(value = "/updateRoleById")
@PreAuthorize("@el.check('roles:edit')")
public ResponseEntity<Void> updateRoleById(@Validated(SystemRoleTb.Update.class) @RequestBody SystemRoleVo args) {
systemRoleService.updateRoleById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改角色菜单")
@PostMapping(value = "/updateBindMenuById")
@PreAuthorize("@el.check('roles:edit')")
public ResponseEntity<Void> updateBindMenuById(@RequestBody SystemRoleVo args) {
systemRoleService.updateBindMenuById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除角色")
@PostMapping(value = "/deleteRoleByIds")
@PreAuthorize("@el.check('roles:del')")
public ResponseEntity<Void> deleteRoleByIds(@RequestBody Set<Long> ids) {
systemRoleService.deleteRoleByIds(ids);
return ResponseEntity.ok(null);
}
}
@@ -0,0 +1,149 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.controller;
import cn.odboy.base.KitPageArgs;
import cn.odboy.base.KitPageResult;
import cn.odboy.system.dal.dataobject.SystemUserTb;
import cn.odboy.system.dal.model.request.SystemQueryUserArgs;
import cn.odboy.system.dal.model.request.SystemUpdateUserPasswordArgs;
import cn.odboy.system.dal.model.response.SystemUserJwtVo;
import cn.odboy.system.dal.model.response.SystemUserVo;
import cn.odboy.system.framework.operalog.OperationLog;
import cn.odboy.system.framework.permission.core.KitSecurityHelper;
import cn.odboy.system.service.SystemAuthService;
import cn.odboy.system.service.SystemUserService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Set;
@Api(tags = "系统:用户管理")
@RestController
@RequestMapping("/api/user")
public class SystemUserController {
@Autowired
private SystemUserService systemUserService;
@Autowired
private SystemAuthService systemAuthService;
@OperationLog
@ApiOperation("导出用户数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('user:list')")
public void exportUserExcel(HttpServletResponse response, SystemQueryUserArgs args) {
systemUserService.exportUserXlsx(response, args);
}
@ApiOperation("查询用户")
@PostMapping(value = "/aggregationSearchUser")
@PreAuthorize("@el.check('user:list')")
public ResponseEntity<KitPageResult<SystemUserVo>> queryUserByArgs(@Validated @RequestBody KitPageArgs<SystemQueryUserArgs> pageArgs) {
String currentUsername = KitSecurityHelper.getCurrentUsername();
Page<SystemUserTb> page = new Page<>(pageArgs.getPage(), pageArgs.getSize());
return ResponseEntity.ok(systemUserService.aggregationSearchUserByArgs(page, pageArgs.getArgs(), currentUsername));
}
@OperationLog
@ApiOperation("新增用户")
@PostMapping(value = "/saveUser")
@PreAuthorize("@el.check('user:add')")
public ResponseEntity<Object> saveUser(@Validated @RequestBody SystemUserVo args) {
systemUserService.saveUser(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改用户数据")
@PostMapping(value = "/updateUserById")
@PreAuthorize("@el.check('user:edit')")
public ResponseEntity<Object> updateUserById(@Validated(SystemUserTb.Update.class) @RequestBody SystemUserVo args) {
systemUserService.updateUserById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改个人中心信息")
@PostMapping(value = "/updateUserCenterInfoById")
public ResponseEntity<Object> updateUserCenterInfoById(@Validated(SystemUserTb.Update.class) @RequestBody SystemUserTb args) {
systemUserService.updateUserCenterInfoById(args);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("删除用户")
@PostMapping(value = "/deleteUserByIds")
@PreAuthorize("@el.check('user:del')")
public ResponseEntity<Object> deleteUserByIds(@RequestBody Set<Long> ids) {
systemUserService.deleteUserByIds(ids);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改用户密码")
@PostMapping(value = "/updateUserPasswordByUsername")
public ResponseEntity<Object> updateUserPasswordByUsername(@RequestBody SystemUpdateUserPasswordArgs passVo) throws Exception {
String currentUsername = KitSecurityHelper.getCurrentUsername();
systemUserService.updateUserPasswordByUsername(currentUsername, passVo);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("重置用户密码")
@PostMapping(value = "/resetUserPasswordByIds")
public ResponseEntity<Object> resetUserPasswordByIds(@RequestBody Set<Long> ids) {
systemUserService.resetUserPasswordByIds(ids);
return ResponseEntity.ok(null);
}
@OperationLog
@ApiOperation("修改用户头像")
@PostMapping(value = "/updateUserAvatar")
public ResponseEntity<Object> updateUserAvatar(@RequestParam MultipartFile avatar) {
return ResponseEntity.ok(systemUserService.updateUserAvatar(avatar));
}
@OperationLog
@ApiOperation("修改用户邮箱")
@PostMapping(value = "/updateUserEmailByUsername/{code}")
public ResponseEntity<Object> updateUserEmailByUsername(@PathVariable String code, @RequestBody SystemUserTb args) throws Exception {
String currentUsername = KitSecurityHelper.getCurrentUsername();
systemUserService.updateUserEmailByUsername(currentUsername, args, code);
return ResponseEntity.ok(null);
}
@ApiOperation("获取用户信息")
@PostMapping(value = "/getCurrentUserInfo")
public ResponseEntity<SystemUserJwtVo> getUserInfo() {
SystemUserJwtVo userInfoVo = systemAuthService.getCurrentUserInfo();
return ResponseEntity.ok(userInfoVo);
}
}
@@ -0,0 +1,82 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;
@Getter
@Setter
@TableName("system_dept")
public class SystemDeptTb extends KitBaseUserTimeTb {
@NotNull(groups = Update.class)
@TableId(value = "dept_id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "排序")
private Integer deptSort;
@NotBlank
@ApiModelProperty(value = "部门名称")
private String name;
@NotNull
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "上级部门")
private Long pid;
@ApiModelProperty(value = "子节点数目", hidden = true)
private Integer subCount = 0;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemDeptTb dept = (SystemDeptTb) o;
return Objects.equals(id, dept.id) && Objects.equals(name, dept.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@ApiModelProperty(value = "是否有子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否为叶子")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "标签名称")
public String getLabel() {
return name;
}
}
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotNull;
@Getter
@Setter
@TableName("system_dict_detail")
public class SystemDictDetailTb extends KitBaseUserTimeTb {
@NotNull(groups = Update.class)
@ApiModelProperty(value = "ID", hidden = true)
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField(value = "dict_id")
@ApiModelProperty(hidden = true)
private Long dictId;
@ApiModelProperty(value = "字典标签")
private String label;
@ApiModelProperty(value = "字典值")
private String value;
@ApiModelProperty(value = "排序")
private Integer dictSort = 999;
}
@@ -0,0 +1,45 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Getter
@Setter
@TableName("system_dict")
public class SystemDictTb extends KitBaseUserTimeTb {
@NotNull(groups = Update.class)
@ApiModelProperty(value = "ID", hidden = true)
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotBlank
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "描述")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String description;
}
@@ -0,0 +1,51 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitObject;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
/**
* 邮件配置类,数据存覆盖式存入数据存
*/
@Data
@TableName("system_email_config")
@EqualsAndHashCode(callSuper = false)
public class SystemEmailConfigTb extends KitObject {
@TableId("config_id")
private Long id;
@NotBlank
@ApiModelProperty(value = "邮件服务器SMTP地址")
private String host;
@NotBlank
@ApiModelProperty(value = "邮件服务器 SMTP 端口")
private String port;
@NotBlank
@ApiModelProperty(value = "发件者用户名")
private String user;
@NotBlank
@ApiModelProperty(value = "密码")
private String password;
@NotBlank
@ApiModelProperty(value = "收件人")
private String fromUser;
}
@@ -0,0 +1,64 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;
@Getter
@Setter
@TableName("system_job")
public class SystemJobTb extends KitBaseUserTimeTb {
@NotNull(groups = Update.class)
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@NotBlank
@ApiModelProperty(value = "岗位名称")
private String name;
@NotNull
@ApiModelProperty(value = "岗位排序")
private Long jobSort;
@NotNull
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemJobTb job = (SystemJobTb) o;
return Objects.equals(id, job.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
@@ -0,0 +1,48 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@TableName("system_local_storage")
public class SystemLocalStorageTb extends KitBaseUserTimeTb {
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "真实文件名")
private String realName;
@ApiModelProperty(value = "文件名")
private String name;
@ApiModelProperty(value = "后缀")
private String suffix;
@ApiModelProperty(value = "路径")
private String path;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "大小")
private String size;
@ApiModelProperty(value = "日期分组")
private String dateGroup;
}
@@ -0,0 +1,97 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;
@Getter
@Setter
@TableName("system_menu")
public class SystemMenuTb extends KitBaseUserTimeTb {
@NotNull(groups = {Update.class})
@TableId(value = "menu_id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "菜单标题")
private String title;
@TableField(value = "name")
@ApiModelProperty(value = "菜单组件名称")
private String componentName;
@ApiModelProperty(value = "排序")
private Integer menuSort = 999;
@ApiModelProperty(value = "组件路径")
private String component;
@ApiModelProperty(value = "路由地址")
private String path;
@ApiModelProperty(value = "菜单类型,目录、菜单、按钮")
private Integer type;
@ApiModelProperty(value = "权限标识")
private String permission;
@ApiModelProperty(value = "菜单图标")
private String icon;
@ApiModelProperty(value = "缓存")
private Boolean cache;
@ApiModelProperty(value = "是否隐藏")
private Boolean hidden;
@ApiModelProperty(value = "上级菜单")
private Long pid;
@ApiModelProperty(value = "子节点数目", hidden = true)
private Integer subCount = 0;
@ApiModelProperty(value = "外链菜单")
private Boolean iFrame;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemMenuTb menu = (SystemMenuTb) o;
return Objects.equals(id, menu.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@ApiModelProperty(value = "是否有子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否为叶子")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "标签名称")
public String getLabel() {
return title;
}
}
@@ -0,0 +1,102 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitObject;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.Date;
/**
* <p>
* 系统审计日志
* </p>
*
* @author codegen
* @since 2025-05-12
*/
@Getter
@Setter
@ToString
@TableName("system_operation_log")
@ApiModel(value = "SystemOperationLog对象", description = "审计日志")
public class SystemOperationLogTb extends KitObject {
/**
* id
*/
@ApiModelProperty("id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 业务名称
*/
@TableField("biz_name")
private String bizName;
/**
* 业务方法
*/
@TableField("method")
private String method;
/**
* 业务参数
*/
@TableField("params")
private String params;
/**
* 访问来源IP
*/
@TableField("request_ip")
private String requestIp;
/**
* 执行时间
*/
@TableField("execute_time")
private Long executeTime;
/**
* 用户名
*/
@TableField("username")
private String username;
/**
* 访问来源地址
*/
@TableField("address")
private String address;
/**
* 浏览器信息
*/
@TableField("browser_info")
private String browserInfo;
/**
* 异常详情
*/
@TableField("exception_detail")
private String exceptionDetail;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
}
@@ -0,0 +1,81 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* OSS存储
* </p>
*
* @author codegen
* @since 2025-07-15
*/
@Getter
@Setter
@TableName("system_oss_storage")
@ApiModel(value = "SystemOssStorage对象", description = "OSS存储")
public class SystemOssStorageTb extends KitBaseUserTimeTb {
@ApiModelProperty("ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField("service_type")
@ApiModelProperty("类型,比如minio")
private String serviceType;
@TableField("endpoint")
@ApiModelProperty("服务地址")
private String endpoint;
@TableField("bucket_name")
@ApiModelProperty("存储桶名称")
private String bucketName;
@TableField("file_name")
@ApiModelProperty("完整文件名称")
private String fileName;
@TableField("file_size")
@ApiModelProperty("文件大小, 单位:字节")
private Long fileSize;
@TableField("file_mime")
@ApiModelProperty("文件类型")
private String fileMime;
@ApiModelProperty("短文件名")
@TableField("file_prefix")
private String filePrefix;
@ApiModelProperty("文件后缀")
@TableField("file_suffix")
private String fileSuffix;
@TableField("file_md5")
@ApiModelProperty("文件md5")
private String fileMd5;
@TableField("file_url")
@ApiModelProperty("文件链接")
private String fileUrl;
@TableField("file_code")
@ApiModelProperty("文件编码")
private String fileCode;
@TableField("object_name")
@ApiModelProperty("对象路径")
private String objectName;
}
@@ -0,0 +1,72 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Getter
@Setter
@TableName("system_quartz_job")
public class SystemQuartzJobTb extends KitBaseUserTimeTb {
public static final String JOB_KEY = "JOB_KEY";
@TableId(value = "id", type = IdType.AUTO)
@NotNull(groups = {Update.class})
private Long id;
@ApiModelProperty(value = "定时器名称")
private String jobName;
@NotBlank
@ApiModelProperty(value = "Bean名称")
private String beanName;
@NotBlank
@ApiModelProperty(value = "方法名称")
private String methodName;
@ApiModelProperty(value = "参数")
private String params;
@NotBlank
@ApiModelProperty(value = "cron表达式")
private String cronExpression;
@ApiModelProperty(value = "状态:暂停或启动")
private Boolean isPause = false;
@ApiModelProperty(value = "负责人")
private String personInCharge;
@ApiModelProperty(value = "报警邮箱")
private String email;
@ApiModelProperty(value = "子任务")
private String subTask;
@ApiModelProperty(value = "失败后暂停")
private Boolean pauseAfterFailure;
@NotBlank
@ApiModelProperty(value = "备注")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String description;
/**
* 扩展字段
*/
@TableField(exist = false)
@ApiModelProperty(value = "用于子任务唯一标识", hidden = true)
private String uuid;
}
@@ -0,0 +1,56 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitObject;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@Data
@TableName("system_quartz_log")
@EqualsAndHashCode(callSuper = false)
public class SystemQuartzLogTb extends KitObject {
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "任务名称", hidden = true)
private String jobName;
@ApiModelProperty(value = "bean名称", hidden = true)
private String beanName;
@ApiModelProperty(value = "方法名称", hidden = true)
private String methodName;
@ApiModelProperty(value = "参数", hidden = true)
private String params;
@ApiModelProperty(value = "cron表达式", hidden = true)
private String cronExpression;
@ApiModelProperty(value = "状态", hidden = true)
private Boolean isSuccess;
@ApiModelProperty(value = "异常详情", hidden = true)
private String exceptionDetail;
@ApiModelProperty(value = "执行耗时", hidden = true)
private Long time;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", hidden = true)
private Date createTime;
}
@@ -0,0 +1,33 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@TableName("system_roles_depts")
public class SystemRoleDeptTb extends KitObject {
@TableField(value = "role_id")
private Long roleId;
@TableField(value = "dept_id")
private Long deptId;
}
@@ -0,0 +1,35 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
/**
* 角色菜单
*/
@Getter
@Setter
@TableName("system_roles_menus")
public class SystemRoleMenuTb {
@TableField(value = "role_id")
private Long roleId;
@TableField(value = "menu_id")
private Long menuId;
}
@@ -0,0 +1,71 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import cn.odboy.system.constant.SystemDataScopeEnum;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;
/**
* 角色
*/
@Getter
@Setter
@TableName("system_role")
public class SystemRoleTb extends KitBaseUserTimeTb {
@NotNull(groups = {Update.class})
@TableId(value = "role_id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@NotBlank
@ApiModelProperty(value = "名称", hidden = true)
private String name;
@ApiModelProperty(value = "数据权限,全部 、 本级 、 自定义")
private String dataScope = SystemDataScopeEnum.THIS_LEVEL.getValue();
@ApiModelProperty(value = "级别,数值越小,级别越大")
private Integer level = 3;
@ApiModelProperty(value = "描述")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String description;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemRoleTb role = (SystemRoleTb) o;
return Objects.equals(id, role.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
@@ -0,0 +1,35 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
/**
* 角色菜单
*/
@Getter
@Setter
@TableName("system_users_jobs")
public class SystemUserJobTb {
@TableField(value = "user_id")
private Long userId;
@TableField(value = "job_id")
private Long jobId;
}
@@ -0,0 +1,33 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@TableName("system_users_roles")
public class SystemUserRoleTb extends KitObject {
@TableField(value = "user_id")
private Long userId;
@TableField(value = "role_id")
private Long roleId;
}
@@ -0,0 +1,100 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.dataobject;
import cn.odboy.base.KitBaseUserTimeTb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Date;
import java.util.Objects;
@Getter
@Setter
@TableName("system_user")
public class SystemUserTb extends KitBaseUserTimeTb {
@NotNull(groups = Update.class)
@TableId(value = "user_id", type = IdType.AUTO)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField(value = "dept_id")
@ApiModelProperty(hidden = true)
private Long deptId;
@NotBlank
@ApiModelProperty(value = "用户名称")
@TableField(value = "username")
private String username;
@NotBlank
@ApiModelProperty(value = "用户昵称")
@TableField(value = "nick_name")
private String nickName;
@Email
@NotBlank
@ApiModelProperty(value = "邮箱")
@TableField(value = "email")
private String email;
@NotBlank
@ApiModelProperty(value = "电话号码")
@TableField(value = "phone")
private String phone;
@ApiModelProperty(value = "用户性别")
@TableField(value = "gender")
private String gender;
@ApiModelProperty(value = "头像真实名称", hidden = true)
@TableField(value = "avatar_name")
private String avatarName;
@ApiModelProperty(value = "头像存储的路径", hidden = true)
@TableField(value = "avatar_path")
private String avatarPath;
@ApiModelProperty(value = "密码")
@TableField(value = "password")
private String password;
@NotNull
@ApiModelProperty(value = "是否启用")
@TableField(value = "enabled")
private Boolean enabled;
@ApiModelProperty(value = "是否为admin账号", hidden = true)
@TableField(value = "is_admin")
private Boolean isAdmin = false;
@ApiModelProperty(value = "最后修改密码的时间", hidden = true)
@TableField(value = "pwd_reset_time")
private Date pwdResetTime;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemUserTb user = (SystemUserTb) o;
return Objects.equals(id, user.id) && Objects.equals(username, user.username);
}
@Override
public int hashCode() {
return Objects.hash(id, username);
}
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemDeptExportRowVo extends KitObject {
@ExcelProperty("部门名称")
private String name;
@ExcelProperty("部门状态")
private String enabled;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,38 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemDictExportRowVo extends KitObject {
@ExcelProperty("字典名称")
private String name;
@ExcelProperty("字典描述")
private String description;
@ExcelProperty("字典标签")
private String label;
@ExcelProperty("字典值")
private String value;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemJobExportRowVo extends KitObject {
@ExcelProperty("岗位名称")
private String name;
@ExcelProperty("岗位状态")
private String enabled;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,40 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemLocalStorageExportRowVo extends KitObject {
@ExcelProperty(value = "文件名")
private String realName;
@ExcelProperty(value = "备注名")
private String name;
@ExcelProperty(value = "文件类型")
private String type;
@ExcelProperty(value = "文件大小")
private String size;
@ExcelProperty(value = "创建者")
private String createBy;
@ExcelProperty(value = "创建日期")
private Date createTime;
}
@@ -0,0 +1,42 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemMenuExportRowVo extends KitObject {
@ExcelProperty("菜单标题")
private String title;
@ExcelProperty("菜单类型")
private String type;
@ExcelProperty("权限标识")
private String permission;
@ExcelProperty("外链菜单")
private String iFrame;
@ExcelProperty("菜单可见")
private String hidden;
@ExcelProperty("是否缓存")
private String cache;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,44 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemOssStorageExportRowVo extends KitObject {
@ExcelProperty("服务类型")
private String serviceType;
@ExcelProperty("服务地址")
private String endpoint;
@ExcelProperty("存储桶名称")
private String bucketName;
@ExcelProperty("文件名称")
private String fileName;
@ExcelProperty("文件大小")
private String fileSizeDesc;
@ExcelProperty("文件类型")
private String fileMime;
@ExcelProperty("创建人")
private String createBy;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,44 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemQuartzJobExportRowVo extends KitObject {
@ExcelProperty("任务名称")
private String jobName;
@ExcelProperty("Bean名称")
private String beanName;
@ExcelProperty("执行方法")
private String methodName;
@ExcelProperty("参数")
private String params;
@ExcelProperty("表达式")
private String cronExpression;
@ExcelProperty("状态")
private String isPause;
@ExcelProperty("描述")
private String description;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemQuartzLogExportRowVo extends KitObject {
@ExcelProperty("任务名称")
private String jobName;
@ExcelProperty("Bean名称")
private String beanName;
@ExcelProperty("执行方法")
private String methodName;
@ExcelProperty("参数")
private String params;
@ExcelProperty("表达式")
private String cronExpression;
@ExcelProperty("异常详情")
private String exceptionDetail;
@ExcelProperty("耗时/毫秒")
private Long time;
@ExcelProperty("状态")
private String status;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,36 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemRoleExportRowVo extends KitObject {
@ExcelProperty("角色名称")
private String name;
@ExcelProperty("角色级别")
private Integer level;
@ExcelProperty("描述")
private String description;
@ExcelProperty("角色名称")
private Date createTime;
}
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class SystemUserExportRowVo extends KitObject {
@ExcelProperty("用户名")
private String username;
@ExcelProperty("角色")
private String roles;
@ExcelProperty("部门")
private String dept;
@ExcelProperty("岗位")
private String jobs;
@ExcelProperty("邮箱")
private String email;
@ExcelProperty("状态")
private String status;
@ExcelProperty("手机号码")
private String mobile;
@ExcelProperty("修改密码的时间")
private Date updatePwdTime;
@ExcelProperty("创建日期")
private Date createTime;
}
@@ -0,0 +1,39 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.export;
import cn.idev.excel.annotation.ExcelProperty;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SystemUserOnlineExportRowVo extends KitObject {
@ExcelProperty("用户名")
private String userName;
@ExcelProperty("部门")
private String dept;
@ExcelProperty("登录IP")
private String ip;
@ExcelProperty("登录地点")
private String address;
@ExcelProperty("浏览器")
private String browser;
@ExcelProperty("登录日期")
private String loginTime;
}
@@ -0,0 +1,33 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotBlank;
@Getter
@Setter
public class SystemCheckEmailCaptchaArgs extends KitObject {
@NotBlank(message = "邮箱不能为空")
private String email;
@NotBlank(message = "验证码不能为空")
private String code;
@NotBlank(message = "验证码业务标识不能为空")
private String bizCode;
}
@@ -0,0 +1,36 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemCreateDeptArgs extends KitObject {
@NotBlank(message = "部门名称必填")
private String name;
@NotNull(message = "部门排序必填")
private Integer deptSort;
private Boolean enabled;
private String isTop;
private Long pid;
private Integer subCount = 0;
}
@@ -0,0 +1,30 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemCreateDictArgs extends KitObject {
@NotBlank(message = "字典名称必填")
private String name;
private String description;
}
@@ -0,0 +1,37 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import cn.odboy.system.dal.dataobject.SystemDictTb;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemCreateDictDetailArgs extends KitObject {
@NotNull(message = "参数dict必填")
private SystemDictTb dict;
@NotBlank(message = "字典标签必填")
private String label;
@NotBlank(message = "字典值必填")
private String value;
@NotNull(message = "字典排序必填")
private Integer dictSort;
}
@@ -0,0 +1,33 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemCreateJobArgs extends KitObject {
@NotBlank(message = "职位名称必填")
private String name;
@NotNull(message = "职位排序必填")
private Integer jobSort;
private Boolean enabled;
}
@@ -0,0 +1,42 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Set;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemCreateRoleArgs extends KitObject {
@NotBlank(message = "角色名称必填")
private String name;
@NotNull(message = "角色级别必填")
private Integer level;
@NotBlank(message = "数据范围必填")
private String dataScope;
private String description;
/**
* 关联的部门
*/
private Long id;
private Set<SystemDeptTb> depts;
}
@@ -0,0 +1,38 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemQueryDeptArgs {
@ApiModelProperty(value = "部门id集合")
private List<Long> ids;
@ApiModelProperty(value = "部门名称")
private String name;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "上级部门")
private Long pid;
@ApiModelProperty(value = "PID为空查询")
private Boolean pidIsNull;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
}
@@ -0,0 +1,26 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SystemQueryDictArgs {
@ApiModelProperty(value = "模糊查询")
private String blurry;
}
@@ -0,0 +1,31 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SystemQueryDictDetailArgs extends KitObject {
@ApiModelProperty(value = "标签")
private String label;
@ApiModelProperty(value = "字典名称")
private String dictName;
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
@Data
@NoArgsConstructor
public class SystemQueryJobArgs {
@ApiModelProperty(value = "岗位名称")
private String name;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemQueryMenuArgs {
@ApiModelProperty(value = "模糊查询")
private String blurry;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
@ApiModelProperty(value = "PID为空查询")
private Boolean pidIsNull;
@ApiModelProperty(value = "PID")
private Long pid;
}
@@ -0,0 +1,26 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SystemQueryOperationLogArgs extends KitObject {
}
@@ -0,0 +1,32 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemQueryQuartzJobArgs {
@ApiModelProperty(value = "定时任务名称")
private String jobName;
@ApiModelProperty(value = "是否成功")
private Boolean isSuccess;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
}
@@ -0,0 +1,30 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemQueryRoleArgs {
@ApiModelProperty(value = "模糊查询")
private String blurry;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class SystemQueryStorageArgs {
@ApiModelProperty(value = "模糊查询")
private String blurry;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
@ApiModelProperty(value = "页码", example = "1")
private Integer page = 1;
@ApiModelProperty(value = "每页数据量", example = "10")
private Integer size = 10;
}
@@ -0,0 +1,43 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemQueryUserArgs extends KitObject {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "多个ID")
private Set<Long> deptIds = new HashSet<>();
@ApiModelProperty(value = "模糊查询")
private String blurry;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "部门ID")
private Long deptId;
@ApiModelProperty(value = "创建时间")
private List<Date> createTime;
}
@@ -0,0 +1,43 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import java.util.List;
/**
* 发送邮件时,接收参数的类
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SystemSendEmailArgs {
@NotEmpty
@ApiModelProperty(value = "收件人")
private List<String> tos;
@NotBlank
@ApiModelProperty(value = "主题")
private String subject;
@NotBlank
@ApiModelProperty(value = "内容")
private String content;
}
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import cn.odboy.base.KitObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemUpdateQuartzJobArgs extends KitObject {
@NotNull
private Long id;
private String uuid;
private String jobName;
@NotBlank
private String beanName;
@NotBlank
private String methodName;
private String params;
@NotBlank
private String cronExpression;
private Boolean isPause = false;
private String personInCharge;
private String email;
private String subTask;
private Boolean pauseAfterFailure;
@NotBlank
private String description;
}
@@ -0,0 +1,31 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 修改密码
*/
@Data
public class SystemUpdateUserPasswordArgs {
@ApiModelProperty(value = "旧密码")
private String oldPass;
@ApiModelProperty(value = "新密码")
private String newPass;
}
@@ -0,0 +1,37 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotBlank;
@Getter
@Setter
public class SystemUserLoginArgs {
@NotBlank
@ApiModelProperty(value = "用户名")
private String username;
@NotBlank
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "验证码")
private String code;
@ApiModelProperty(value = "验证码的key")
private String uuid = "";
}
@@ -0,0 +1,31 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
/**
* 登录成功后:token 与 用户信息
*/
@Getter
@Setter
public class SystemAuthVo extends KitObject {
private String token;
private SystemUserInfoVo user;
}
@@ -0,0 +1,37 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitObject;
import lombok.Getter;
import lombok.Setter;
/**
* 验证码信息
*/
@Getter
@Setter
public class SystemCaptchaVo extends KitObject {
/**
* redis key
*/
private String uuid;
/**
* image base64
*/
private String img;
}
@@ -0,0 +1,83 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitBaseUserTimeTb;
import cn.odboy.system.dal.dataobject.SystemRoleTb;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Objects;
import java.util.Set;
@Getter
@Setter
public class SystemDeptVo extends KitBaseUserTimeTb {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "排序")
private Integer deptSort;
@ApiModelProperty(value = "部门名称")
private String name;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "上级部门")
private Long pid;
@ApiModelProperty(value = "子节点数目", hidden = true)
private Integer subCount = 0;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemDeptVo dept = (SystemDeptVo) o;
return Objects.equals(id, dept.id) && Objects.equals(name, dept.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@ApiModelProperty(value = "是否有子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否为叶子")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "标签名称")
public String getLabel() {
return name;
}
/**
* 扩展字段
*/
@ApiModelProperty(value = "角色")
private Set<SystemRoleTb> roles;
@ApiModelProperty(value = "子部门")
private List<SystemDeptVo> children;
}
@@ -0,0 +1,43 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitBaseUserTimeTb;
import cn.odboy.system.dal.dataobject.SystemDictTb;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SystemDictDetailVo extends KitBaseUserTimeTb {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(hidden = true)
private Long dictId;
@ApiModelProperty(value = "字典标签")
private String label;
@ApiModelProperty(value = "字典值")
private String value;
@ApiModelProperty(value = "排序")
private Integer dictSort = 999;
/**
* 扩展字段
*/
@ApiModelProperty(value = "字典")
private SystemDictTb dict;
}
@@ -0,0 +1,35 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SystemMenuMetaVo extends KitObject {
@ApiModelProperty(value = "菜单标题")
private String title;
@ApiModelProperty(value = "菜单图标")
private String icon;
@ApiModelProperty(value = "缓存")
private Boolean noCache;
}
@@ -0,0 +1,47 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 构建前端路由时用到
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemMenuRouterVo extends KitObject {
@ApiModelProperty(value = "菜单名称")
private String name;
@ApiModelProperty(value = "路径")
private String path;
@ApiModelProperty(value = "隐藏状态")
private Boolean hidden;
@ApiModelProperty(value = "重定向")
private String redirect;
@ApiModelProperty(value = "组件")
private String component;
@ApiModelProperty(value = "总是显示")
private Boolean alwaysShow;
@ApiModelProperty(value = "元数据")
private SystemMenuMetaVo meta;
@ApiModelProperty(value = "子路由")
private List<SystemMenuRouterVo> children;
}
@@ -0,0 +1,99 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitBaseUserTimeTb;
import cn.odboy.system.dal.dataobject.SystemRoleTb;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Objects;
import java.util.Set;
@Getter
@Setter
public class SystemMenuVo extends KitBaseUserTimeTb {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "菜单标题")
private String title;
@ApiModelProperty(value = "菜单组件名称")
private String componentName;
@ApiModelProperty(value = "排序")
private Integer menuSort = 999;
@ApiModelProperty(value = "组件路径")
private String component;
@ApiModelProperty(value = "路由地址")
private String path;
@ApiModelProperty(value = "菜单类型,目录、菜单、按钮")
private Integer type;
@ApiModelProperty(value = "权限标识")
private String permission;
@ApiModelProperty(value = "菜单图标")
private String icon;
@ApiModelProperty(value = "缓存")
private Boolean cache;
@ApiModelProperty(value = "是否隐藏")
private Boolean hidden;
@ApiModelProperty(value = "上级菜单")
private Long pid;
@ApiModelProperty(value = "子节点数目", hidden = true)
private Integer subCount = 0;
@ApiModelProperty(value = "外链菜单")
private Boolean iFrame;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemMenuVo menu = (SystemMenuVo) o;
return Objects.equals(id, menu.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@ApiModelProperty(value = "是否有子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否为叶子")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "标签名称")
public String getLabel() {
return title;
}
/**
* 附加属性
*/
@ApiModelProperty(value = "菜单角色")
private Set<SystemRoleTb> roles;
@ApiModelProperty(value = "子菜单")
private List<SystemMenuVo> children;
}
@@ -0,0 +1,57 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitBaseUserTimeTb;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SystemOssStorageVo extends KitBaseUserTimeTb {
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("类型,比如minio")
private String serviceType;
@ApiModelProperty("服务地址")
private String endpoint;
@ApiModelProperty("存储桶名称")
private String bucketName;
@ApiModelProperty("完整文件名称")
private String fileName;
@ApiModelProperty("文件大小, 单位:字节")
private Long fileSize;
@ApiModelProperty("文件类型")
private String fileMime;
@ApiModelProperty("短文件名")
private String filePrefix;
@ApiModelProperty("文件后缀")
private String fileSuffix;
@ApiModelProperty("文件md5")
private String fileMd5;
@ApiModelProperty("文件链接")
private String fileUrl;
@ApiModelProperty("文件编码")
private String fileCode;
@ApiModelProperty("对象路径")
private String objectName;
/**
* 扩展字段
*/
private String fileSizeDesc;
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
/**
* 避免序列化问题
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SystemRoleCodeVo implements GrantedAuthority {
@ApiModelProperty(value = "角色名")
private String authority;
}
@@ -0,0 +1,70 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitBaseUserTimeTb;
import cn.odboy.system.constant.SystemDataScopeEnum;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import cn.odboy.system.dal.dataobject.SystemMenuTb;
import cn.odboy.system.dal.dataobject.SystemUserTb;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.Objects;
import java.util.Set;
@Getter
@Setter
public class SystemRoleVo extends KitBaseUserTimeTb {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "名称", hidden = true)
private String name;
@ApiModelProperty(value = "数据权限,全部 、 本级 、 自定义")
private String dataScope = SystemDataScopeEnum.THIS_LEVEL.getValue();
@ApiModelProperty(value = "级别,数值越小,级别越大")
private Integer level = 3;
@ApiModelProperty(value = "描述")
private String description;
/**
* 扩展字段
*/
@ApiModelProperty(value = "用户", hidden = true)
private Set<SystemUserTb> users;
@ApiModelProperty(value = "菜单", hidden = true)
private Set<SystemMenuTb> menus;
@ApiModelProperty(value = "部门", hidden = true)
private Set<SystemDeptTb> depts;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemRoleVo role = (SystemRoleVo) o;
return Objects.equals(id, role.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
@@ -0,0 +1,55 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitObject;
import cn.odboy.system.dal.dataobject.SystemDeptTb;
import cn.odboy.system.dal.dataobject.SystemJobTb;
import cn.odboy.system.dal.dataobject.SystemRoleTb;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Set;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemSimpleUserVo extends KitObject {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "用户角色")
private Set<SystemRoleTb> roles;
@ApiModelProperty(value = "用户岗位")
private Set<SystemJobTb> jobs;
private Long deptId;
private SystemDeptTb dept;
@ApiModelProperty(value = "用户名称")
private String username;
@ApiModelProperty(value = "用户昵称")
private String nickName;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "电话号码")
private String phone;
@ApiModelProperty(value = "用户性别")
private String gender;
@ApiModelProperty(value = "头像真实名称", hidden = true)
private String avatarName;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "是否为admin账号", hidden = true)
private Boolean isAdmin = false;
}
@@ -0,0 +1,36 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import cn.odboy.base.KitObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Data
@EqualsAndHashCode(callSuper = false)
public class SystemUserInfoVo extends KitObject {
private SystemSimpleUserVo user;
private List<Long> dataScopes;
private List<SystemRoleCodeVo> authorities;
public Set<String> getRoles() {
return authorities.stream().map(SystemRoleCodeVo::getAuthority).collect(Collectors.toSet());
}
}
@@ -0,0 +1,77 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Getter
@AllArgsConstructor
public class SystemUserJwtVo implements UserDetails {
@ApiModelProperty(value = "用户")
private final SystemUserVo user;
@ApiModelProperty(value = "数据权限")
private final List<Long> dataScopes;
@ApiModelProperty(value = "角色")
private final List<SystemRoleCodeVo> authorities;
public Set<String> getRoles() {
return authorities.stream().map(SystemRoleCodeVo::getAuthority).collect(Collectors.toSet());
}
@Override
@JSONField(serialize = false)
public String getPassword() {
return user.getPassword();
}
@Override
@JSONField(serialize = false)
public String getUsername() {
return user.getUsername();
}
@Override
@JSONField(serialize = false)
public boolean isAccountNonExpired() {
return true;
}
@Override
@JSONField(serialize = false)
public boolean isAccountNonLocked() {
return true;
}
@Override
@JSONField(serialize = false)
public boolean isCredentialsNonExpired() {
return true;
}
@Override
@JSONField(serialize = false)
public boolean isEnabled() {
return user.getEnabled();
}
}
@@ -0,0 +1,46 @@
/*
* Copyright 2021-2026 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.system.dal.model.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 在线用户
*/
@Data
public class SystemUserOnlineVo {
@ApiModelProperty(value = "Token编号")
private String uid;
@ApiModelProperty(value = "用户名")
private String userName;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "岗位")
private String dept;
@ApiModelProperty(value = "浏览器")
private String browser;
@ApiModelProperty(value = "IP")
private String ip;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "token")
private String key;
@ApiModelProperty(value = "登录时间")
private Date loginTime;
}

Some files were not shown because too many files have changed in this diff Show More