first commit
This commit is contained in:
@@ -0,0 +1,285 @@
|
||||
package com.metalloop.modules.auth.controller;
|
||||
|
||||
import cn.dev33.satoken.session.SaSession;
|
||||
import com.metalloop.common.auth.Authentication;
|
||||
import com.metalloop.common.auth.handler.LoginSuccessHandler;
|
||||
import com.metalloop.common.auth.handler.LogoutSuccessHandler;
|
||||
import com.metalloop.common.auth.handler.PasswordCheckFailureHandler;
|
||||
import com.metalloop.common.auth.handler.VerifyCodeHandler;
|
||||
import com.metalloop.common.auth.model.AuthenticationMiniAppRequest;
|
||||
import com.metalloop.common.auth.password.PasswordDecryptor;
|
||||
import com.metalloop.common.auth.sso.SsoCodeService;
|
||||
import com.metalloop.common.auth.sso.model.SsoUserInfo;
|
||||
import com.metalloop.common.auth.userdetails.UserDetails;
|
||||
import com.metalloop.common.auth.userdetails.UserDetailsService;
|
||||
import com.metalloop.common.constant.SecurityConstants;
|
||||
import com.metalloop.common.enums.LoginType;
|
||||
import com.metalloop.common.exception.*;
|
||||
import com.metalloop.common.model.Result;
|
||||
import com.metalloop.common.utils.IPHelper;
|
||||
import com.metalloop.modules.auth.model.req.AuthenticationRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 认证授权端点
|
||||
*
|
||||
* @author zhaowenhao
|
||||
* @since 2023-03-19
|
||||
*/
|
||||
public class AuthController {
|
||||
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final LoginType loginType;
|
||||
|
||||
private final UserDetailsService userDetailsService;
|
||||
|
||||
private final LoginSuccessHandler loginSuccessHandler;
|
||||
private final LogoutSuccessHandler logoutSuccessHandler;
|
||||
|
||||
private final PasswordDecryptor passwordDecryptor;
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
private final VerifyCodeHandler verifyCodeHandler;
|
||||
|
||||
private final PasswordCheckFailureHandler passwordCheckFailureHandler;
|
||||
|
||||
/**
|
||||
* 单点登陆授权码服务
|
||||
*/
|
||||
private SsoCodeService ssoCodeService;
|
||||
|
||||
/**
|
||||
* 单点登陆授权码超时时间,单位:秒
|
||||
*/
|
||||
private int ssoCodeTimeOut = 300;
|
||||
|
||||
public void initSso(SsoCodeService ssoCodeService, int ssoCodeTimeOut) {
|
||||
this.ssoCodeService = ssoCodeService;
|
||||
this.ssoCodeTimeOut = ssoCodeTimeOut;
|
||||
}
|
||||
|
||||
public AuthController(LoginType loginType, UserDetailsService userDetailsService, LoginSuccessHandler loginSuccessHandler,
|
||||
LogoutSuccessHandler logoutSuccessHandler, PasswordDecryptor passwordDecryptor, PasswordEncoder passwordEncoder
|
||||
, VerifyCodeHandler verifyCodeHandler, PasswordCheckFailureHandler passwordCheckFailureHandler) {
|
||||
this.loginType = loginType;
|
||||
this.userDetailsService = userDetailsService;
|
||||
this.loginSuccessHandler = loginSuccessHandler;
|
||||
this.logoutSuccessHandler = logoutSuccessHandler;
|
||||
this.passwordDecryptor = passwordDecryptor;
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
this.verifyCodeHandler = verifyCodeHandler;
|
||||
this.passwordCheckFailureHandler = passwordCheckFailureHandler;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
public Object getVerifyCode(@RequestBody @Validated AuthenticationRequest request, HttpServletRequest httpServletRequest) {
|
||||
// 用户名、密码校验
|
||||
UserDetails userDetails = loginVerify(request, httpServletRequest);
|
||||
if (verifyCodeHandler.createVerifyCode(userDetails.getPhoneNum())) {
|
||||
return Result.ok("发送验证码成功");
|
||||
} else {
|
||||
return Result.fail("发送验证码失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
public Object login(@RequestBody @Validated AuthenticationRequest request, HttpServletRequest httpServletRequest) {
|
||||
|
||||
// 用户名、密码校验
|
||||
UserDetails userDetails = loginVerify(request, httpServletRequest);
|
||||
|
||||
// 在sa-token中进行登录操作
|
||||
loginType.getStpLogic().login(userDetails.getUserId());
|
||||
String accessToken = loginType.getStpLogic().getTokenValue();
|
||||
SaSession session = loginType.getStpLogic().getSession();
|
||||
|
||||
// 将登录成功的认证信息封装至session中
|
||||
Authentication authentication = Authentication.withUserDetails(userDetails).accessToken(accessToken).build();
|
||||
session.set(SecurityConstants.SESSION_KEY_AUTHENTICATION, authentication);
|
||||
|
||||
// 登录成功响应结果处理器
|
||||
return loginSuccessHandler.onSuccess(authentication);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户名、密码校验
|
||||
*/
|
||||
private UserDetails loginVerify(AuthenticationRequest request, HttpServletRequest servletRequest) {
|
||||
String username = request.getUsername();
|
||||
String password = request.getPassword();
|
||||
|
||||
// 获取用户ip
|
||||
String ip = IPHelper.getIpAddr(servletRequest);
|
||||
|
||||
// 从 UserDetailsService 加载用户并验证用户名和密码
|
||||
UserDetails userDetails;
|
||||
try {
|
||||
userDetails = userDetailsService.loadUserByUsername(username);
|
||||
} catch (UsernameNotFoundException ex) {
|
||||
this.logger.debug("未找到用户: '" + username + "'");
|
||||
throw new BadCredentialsException("用户名或密码错误");
|
||||
}
|
||||
if (userDetails == null) {
|
||||
this.logger.debug("未找到用户: '" + username + "'");
|
||||
throw new BadCredentialsException("用户名或密码错误");
|
||||
}
|
||||
|
||||
// 验证用户账号状态
|
||||
if (!userDetails.isAccountNonLocked()) {
|
||||
this.logger.debug("账号被锁定");
|
||||
passwordCheckFailureHandler.checkAccountLockStatus(ip, userDetails);
|
||||
}
|
||||
if (!userDetails.isEnabled()) {
|
||||
this.logger.debug("账号被禁用");
|
||||
throw new DisabledException("账号被禁用");
|
||||
}
|
||||
if (!userDetails.isAccountNonExpired()) {
|
||||
this.logger.debug("账号已过期");
|
||||
throw new AccountExpiredException("账号已过期");
|
||||
}
|
||||
if (!userDetails.isCredentialsNonExpired()) {
|
||||
this.logger.debug("密码已过期");
|
||||
throw new CredentialsExpiredException("密码已过期");
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
String presentedPassword = password;
|
||||
|
||||
// 密码解密
|
||||
if (passwordDecryptor != null) {
|
||||
presentedPassword = passwordDecryptor.decrypt(presentedPassword);
|
||||
}
|
||||
|
||||
// 密码匹配
|
||||
if (!passwordEncoder.matches(presentedPassword, userDetails.getPassword())) {
|
||||
logger.debug("密码错误");
|
||||
throw new BadCredentialsException("用户名或密码错误");
|
||||
}
|
||||
|
||||
return userDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户名、密码校验
|
||||
*/
|
||||
private UserDetails loginVerifyForMiniApp(AuthenticationMiniAppRequest request, HttpServletRequest servletRequest) {
|
||||
String username = request.getUsername();
|
||||
String password = request.getPassword();
|
||||
|
||||
// 获取用户ip
|
||||
String ip = IPHelper.getIpAddr(servletRequest);
|
||||
|
||||
// 从 UserDetailsService 加载用户并验证用户名和密码
|
||||
UserDetails userDetails;
|
||||
try {
|
||||
userDetails = userDetailsService.loadUserByUsername(username);
|
||||
} catch (UsernameNotFoundException ex) {
|
||||
this.logger.debug("未找到用户: '" + username + "'");
|
||||
throw new BadCredentialsException("用户名或密码错误");
|
||||
}
|
||||
if (userDetails == null) {
|
||||
this.logger.debug("未找到用户: '" + username + "'");
|
||||
throw new BadCredentialsException("用户名或密码错误");
|
||||
}
|
||||
|
||||
// 验证用户账号状态
|
||||
if (!userDetails.isAccountNonLocked()) {
|
||||
this.logger.debug("账号被锁定");
|
||||
passwordCheckFailureHandler.checkAccountLockStatus(ip, userDetails);
|
||||
}
|
||||
if (!userDetails.isEnabled()) {
|
||||
this.logger.debug("账号被禁用");
|
||||
throw new DisabledException("账号被禁用");
|
||||
}
|
||||
if (!userDetails.isAccountNonExpired()) {
|
||||
this.logger.debug("账号已过期");
|
||||
throw new AccountExpiredException("账号已过期");
|
||||
}
|
||||
if (!userDetails.isCredentialsNonExpired()) {
|
||||
this.logger.debug("密码已过期");
|
||||
throw new CredentialsExpiredException("密码已过期");
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
String presentedPassword = password;
|
||||
|
||||
// 密码解密
|
||||
if (passwordDecryptor != null) {
|
||||
presentedPassword = passwordDecryptor.decrypt(presentedPassword);
|
||||
}
|
||||
|
||||
// 密码匹配
|
||||
if (!passwordEncoder.matches(presentedPassword, userDetails.getPassword())) {
|
||||
logger.debug("密码错误");
|
||||
throw new BadCredentialsException("用户名或密码错误");
|
||||
}
|
||||
|
||||
return userDetails;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
public Object logout() {
|
||||
Object o = loginType.getStpLogic().getSession().get(SecurityConstants.SESSION_KEY_AUTHENTICATION);
|
||||
Authentication authentication = null;
|
||||
if (o instanceof Authentication) {
|
||||
authentication = (Authentication) o;
|
||||
}
|
||||
loginType.getStpLogic().logout();
|
||||
// 登出成功响应结果处理器
|
||||
return logoutSuccessHandler.onSuccess(authentication);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
public Object miniAppLogout() {
|
||||
Object o = loginType.getStpLogic().getSession().get(SecurityConstants.SESSION_KEY_AUTHENTICATION);
|
||||
Authentication authentication = null;
|
||||
if (o instanceof Authentication) {
|
||||
authentication = (Authentication) o;
|
||||
}
|
||||
loginType.getStpLogic().logout();
|
||||
// 登出成功响应结果处理器
|
||||
return logoutSuccessHandler.onSuccess(authentication);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
public Object getSsoCode() {
|
||||
// 验证当前会话是否有效
|
||||
if (loginType.getStpLogic().isLogin()) {
|
||||
Object o = loginType.getStpLogic().getSession().get(SecurityConstants.SESSION_KEY_AUTHENTICATION);
|
||||
Authentication authentication = null;
|
||||
if (o instanceof Authentication) {
|
||||
authentication = (Authentication) o;
|
||||
}
|
||||
if (authentication != null) {
|
||||
// 签发授权码
|
||||
String authorizationCode = ssoCodeService.generateCode(authentication.getUserId(), ssoCodeTimeOut);
|
||||
return Result.ok(authorizationCode);
|
||||
}
|
||||
}
|
||||
return Result.fail("当前会话无效");
|
||||
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
public Object getSsoUserInfo(@RequestParam("code") String code) {
|
||||
// 验证授权码并获取绑定的用户信息
|
||||
SsoUserInfo userInfo = ssoCodeService.validateCode(code);
|
||||
|
||||
// 登录成功响应结果处理器
|
||||
return Result.ok(userInfo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.metalloop.modules.auth.controller;
|
||||
|
||||
import com.metalloop.common.auth.encrypt.KeyProperties;
|
||||
import com.metalloop.common.auth.encrypt.KeyStoreKeyFactory;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.security.PublicKey;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* 获取公钥端点
|
||||
*
|
||||
* @author zhaowenhao
|
||||
* @since 2023-03-19
|
||||
*/
|
||||
public class RsaPublicKeyController {
|
||||
|
||||
private final KeyProperties keyProperties;
|
||||
|
||||
public RsaPublicKeyController(KeyProperties keyProperties) {
|
||||
this.keyProperties = keyProperties;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
public String getPublicKey() {
|
||||
if (keyProperties != null) {
|
||||
KeyPair keyPair = new KeyStoreKeyFactory(keyProperties.getKeyStore().getLocation(), keyProperties.getKeyStore().getSecret().toCharArray()).getKeyPair(keyProperties.getKeyStore().getAlias());
|
||||
PublicKey publicKey = keyPair.getPublic();
|
||||
RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;
|
||||
byte[] publicKeyBytes = rsaPublicKey.getEncoded();
|
||||
return Base64.getEncoder().encodeToString(publicKeyBytes);
|
||||
}
|
||||
return "获取失败";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysEnterpriseQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysEnterpriseReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysEnterpriseRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterprise;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息主转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysEnterpriseConverter {
|
||||
|
||||
SysEnterpriseConverter INSTANCE = Mappers.getMapper(SysEnterpriseConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysEnterprise 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysEnterpriseRespDto toRespDto(SysEnterprise sysEnterprise);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysEnterprises 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysEnterpriseRespDto> toRespDto(List<SysEnterprise> sysEnterprises);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysEnterpriseReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysEnterprise fromReqDto(SysEnterpriseReqDto sysEnterpriseReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysEnterpriseReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysEnterprise> fromReqDto(List<SysEnterpriseReqDto> sysEnterpriseReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysEnterpriseQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysEnterpriseQuery fromQueryReqDtoToQuery(SysEnterpriseQueryReqDto sysEnterpriseQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysEnterpriseImageQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysEnterpriseImageReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysEnterpriseImageRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterpriseImage;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseImageQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业图片附件转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysEnterpriseImageConverter {
|
||||
|
||||
SysEnterpriseImageConverter INSTANCE = Mappers.getMapper(SysEnterpriseImageConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysEnterpriseImage 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysEnterpriseImageRespDto toRespDto(SysEnterpriseImage sysEnterpriseImage);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysEnterpriseImages 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysEnterpriseImageRespDto> toRespDto(List<SysEnterpriseImage> sysEnterpriseImages);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysEnterpriseImageReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysEnterpriseImage fromReqDto(SysEnterpriseImageReqDto sysEnterpriseImageReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysEnterpriseImageReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysEnterpriseImage> fromReqDto(List<SysEnterpriseImageReqDto> sysEnterpriseImageReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysEnterpriseImageQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysEnterpriseImageQuery fromQueryReqDtoToQuery(SysEnterpriseImageQueryReqDto sysEnterpriseImageQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysPermissionQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysPermissionReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysPermissionRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysPermission;
|
||||
import com.metalloop.modules.auth.model.query.SysPermissionQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysPermissionConverter {
|
||||
|
||||
SysPermissionConverter INSTANCE = Mappers.getMapper(SysPermissionConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysPermission 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysPermissionRespDto toRespDto(SysPermission sysPermission);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysPermissions 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysPermissionRespDto> toRespDto(List<SysPermission> sysPermissions);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysPermissionReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysPermission fromReqDto(SysPermissionReqDto sysPermissionReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysPermissionReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysPermission> fromReqDto(List<SysPermissionReqDto> sysPermissionReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysPermissionQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysPermissionQuery fromQueryReqDtoToQuery(SysPermissionQueryReqDto sysPermissionQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysRoleQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysRoleReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysRoleRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysRole;
|
||||
import com.metalloop.modules.auth.model.query.SysRoleQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysRoleConverter {
|
||||
|
||||
SysRoleConverter INSTANCE = Mappers.getMapper(SysRoleConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysRole 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysRoleRespDto toRespDto(SysRole sysRole);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysRoles 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysRoleRespDto> toRespDto(List<SysRole> sysRoles);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysRoleReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysRole fromReqDto(SysRoleReqDto sysRoleReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysRoleReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysRole> fromReqDto(List<SysRoleReqDto> sysRoleReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysRoleQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysRoleQuery fromQueryReqDtoToQuery(SysRoleQueryReqDto sysRoleQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysRolePermissionQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysRolePermissionReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysRolePermissionRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysRolePermission;
|
||||
import com.metalloop.modules.auth.model.query.SysRolePermissionQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色-权限关联转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysRolePermissionConverter {
|
||||
|
||||
SysRolePermissionConverter INSTANCE = Mappers.getMapper(SysRolePermissionConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysRolePermission 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysRolePermissionRespDto toRespDto(SysRolePermission sysRolePermission);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysRolePermissions 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysRolePermissionRespDto> toRespDto(List<SysRolePermission> sysRolePermissions);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysRolePermissionReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysRolePermission fromReqDto(SysRolePermissionReqDto sysRolePermissionReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysRolePermissionReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysRolePermission> fromReqDto(List<SysRolePermissionReqDto> sysRolePermissionReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysRolePermissionQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysRolePermissionQuery fromQueryReqDtoToQuery(SysRolePermissionQueryReqDto sysRolePermissionQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysUserQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysUserReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysUserRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysUser;
|
||||
import com.metalloop.modules.auth.model.query.SysUserQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysUserConverter {
|
||||
|
||||
SysUserConverter INSTANCE = Mappers.getMapper(SysUserConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysUser 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysUserRespDto toRespDto(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysUsers 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysUserRespDto> toRespDto(List<SysUser> sysUsers);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysUserReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysUser fromReqDto(SysUserReqDto sysUserReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysUserReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysUser> fromReqDto(List<SysUserReqDto> sysUserReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysUserQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysUserQuery fromQueryReqDtoToQuery(SysUserQueryReqDto sysUserQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.auth.converter;
|
||||
|
||||
import com.metalloop.modules.auth.model.req.SysUserRoleQueryReqDto;
|
||||
import com.metalloop.modules.auth.model.req.SysUserRoleReqDto;
|
||||
import com.metalloop.modules.auth.model.resp.SysUserRoleRespDto;
|
||||
import com.metalloop.modules.auth.model.po.SysUserRole;
|
||||
import com.metalloop.modules.auth.model.query.SysUserRoleQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与角色关联转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface SysUserRoleConverter {
|
||||
|
||||
SysUserRoleConverter INSTANCE = Mappers.getMapper(SysUserRoleConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param sysUserRole 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysUserRoleRespDto toRespDto(SysUserRole sysUserRole);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param sysUserRoles 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysUserRoleRespDto> toRespDto(List<SysUserRole> sysUserRoles);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param sysUserRoleReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysUserRole fromReqDto(SysUserRoleReqDto sysUserRoleReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param sysUserRoleReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<SysUserRole> fromReqDto(List<SysUserRoleReqDto> sysUserRoleReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param sysUserRoleQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
SysUserRoleQuery fromQueryReqDtoToQuery(SysUserRoleQueryReqDto sysUserRoleQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterpriseImage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 企业图片附件 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysEnterpriseImageMapper extends BaseMapper<SysEnterpriseImage> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterprise;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 企业信息主 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysEnterpriseMapper extends BaseMapper<SysEnterprise> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysPermission;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 权限 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysRole;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 角色 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysRolePermission;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 角色-权限关联 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRolePermissionMapper extends BaseMapper<SysRolePermission> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.auth.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysUserRole;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户与角色关联 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业信息主")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_enterprise")
|
||||
public class SysEnterprise implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业ID(主键)
|
||||
*/
|
||||
@Schema(description = "企业ID(主键)")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Schema(description = "企业名称")
|
||||
@TableField(value = "enterprise_name")
|
||||
private String enterpriseName;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
@Schema(description = "企业地址")
|
||||
@TableField(value = "enterprise_address")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
@Schema(description = "仓库地址")
|
||||
@TableField(value = "warehouse_address")
|
||||
private String warehouseAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
@TableField(value = "contact_person")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
@Schema(description = "法人代表")
|
||||
@TableField(value = "legal_person")
|
||||
private String legalPerson;
|
||||
|
||||
/**
|
||||
* 电话1
|
||||
*/
|
||||
@Schema(description = "电话1")
|
||||
@TableField(value = "phone1")
|
||||
private String phone1;
|
||||
|
||||
/**
|
||||
* 电话2
|
||||
*/
|
||||
@Schema(description = "电话2")
|
||||
@TableField(value = "phone2")
|
||||
private String phone2;
|
||||
|
||||
/**
|
||||
* 电话3
|
||||
*/
|
||||
@Schema(description = "电话3")
|
||||
@TableField(value = "phone3")
|
||||
private String phone3;
|
||||
|
||||
/**
|
||||
* 经营模式
|
||||
*/
|
||||
@Schema(description = "经营模式")
|
||||
@TableField(value = "business_model")
|
||||
private String businessModel;
|
||||
|
||||
/**
|
||||
* 企业简介
|
||||
*/
|
||||
@Schema(description = "企业简介")
|
||||
@TableField(value = "profile_intro")
|
||||
private String profileIntro;
|
||||
|
||||
/**
|
||||
* 标题图片URL
|
||||
*/
|
||||
@Schema(description = "标题图片URL")
|
||||
@TableField(value = "title_img_url")
|
||||
private String titleImgUrl;
|
||||
|
||||
/**
|
||||
* 简介图片URL
|
||||
*/
|
||||
@Schema(description = "简介图片URL")
|
||||
@TableField(value = "intro_img_url")
|
||||
private String introImgUrl;
|
||||
|
||||
/**
|
||||
* 营业执照URL
|
||||
*/
|
||||
@Schema(description = "营业执照URL")
|
||||
@TableField(value = "business_license_url")
|
||||
private String businessLicenseUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证正面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证正面URL")
|
||||
@TableField(value = "legal_id_front_url")
|
||||
private String legalIdFrontUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证反面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证反面URL")
|
||||
@TableField(value = "legal_id_back_url")
|
||||
private String legalIdBackUrl;
|
||||
|
||||
/**
|
||||
* OCR识别统一信用社ID(或统一信用代码)
|
||||
*/
|
||||
@Schema(description = "OCR识别统一信用社ID(或统一信用代码)")
|
||||
@TableField(value = "ocr_credit_code_id")
|
||||
private String ocrCreditCodeId;
|
||||
|
||||
/**
|
||||
* 法人身份证号
|
||||
*/
|
||||
@Schema(description = "法人身份证号")
|
||||
@TableField(value = "id_card_number")
|
||||
private String idCardNumber;
|
||||
|
||||
/**
|
||||
* 信用额度
|
||||
*/
|
||||
@Schema(description = "信用额度")
|
||||
@TableField(value = "credit_limit")
|
||||
private java.math.BigDecimal creditLimit;
|
||||
|
||||
/**
|
||||
* 认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)")
|
||||
@TableField(value = "audit_status")
|
||||
private Boolean auditStatus;
|
||||
|
||||
/**
|
||||
* 认证资料提交时间
|
||||
*/
|
||||
@Schema(description = "认证资料提交时间")
|
||||
@TableField(value = "submit_time")
|
||||
private java.util.Date submitTime;
|
||||
|
||||
/**
|
||||
* 认证审核完成时间
|
||||
*/
|
||||
@Schema(description = "认证审核完成时间")
|
||||
@TableField(value = "audit_time")
|
||||
private java.util.Date auditTime;
|
||||
|
||||
/**
|
||||
* 审核驳回原因
|
||||
*/
|
||||
@Schema(description = "审核驳回原因")
|
||||
@TableField(value = "reject_reason")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
|
||||
private java.util.Date updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业图片附件")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_enterprise_image")
|
||||
public class SysEnterpriseImage implements Serializable {
|
||||
|
||||
/**
|
||||
* 图片ID(主键)
|
||||
*/
|
||||
@Schema(description = "图片ID(主键)")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属企业ID
|
||||
*/
|
||||
@Schema(description = "所属企业ID")
|
||||
@TableField(value = "enterprise_id")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)
|
||||
*/
|
||||
@Schema(description = "图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)")
|
||||
@TableField(value = "image_type")
|
||||
private Boolean imageType;
|
||||
|
||||
/**
|
||||
* 图片存储URL
|
||||
*/
|
||||
@Schema(description = "图片存储URL")
|
||||
@TableField(value = "image_url")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
||||
private java.util.Date createdAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "权限")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_permission")
|
||||
public class SysPermission implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@Schema(description = "菜单名称")
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 权限标识(唯一,用于后端鉴权)
|
||||
*/
|
||||
@Schema(description = "权限标识(唯一,用于后端鉴权)")
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 菜单类型;0-系统 1-目录 2-菜单 3-按钮
|
||||
*/
|
||||
@Schema(description = "菜单类型;0-系统 1-目录 2-菜单 3-按钮")
|
||||
@TableField(value = "type")
|
||||
private Boolean type;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 父权限ID
|
||||
*/
|
||||
@Schema(description = "父权限ID")
|
||||
@TableField(value = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@Schema(description = "菜单图标")
|
||||
@TableField(value = "icon")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 后端接口地址(辅助)
|
||||
*/
|
||||
@Schema(description = "后端接口地址(辅助)")
|
||||
@TableField(value = "api_path")
|
||||
private String apiPath;
|
||||
|
||||
/**
|
||||
* 前端路由地址
|
||||
*/
|
||||
@Schema(description = "前端路由地址")
|
||||
@TableField(value = "route_path")
|
||||
private String routePath;
|
||||
|
||||
/**
|
||||
* 前端组件路径
|
||||
*/
|
||||
@Schema(description = "前端组件路径")
|
||||
@TableField(value = "component")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 前端组件名
|
||||
*/
|
||||
@Schema(description = "前端组件名")
|
||||
@TableField(value = "component_name")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 启用状态(0-禁用 1-启用)
|
||||
*/
|
||||
@Schema(description = "启用状态(0-禁用 1-启用)")
|
||||
@TableField(value = "enabled")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建用户ID
|
||||
*/
|
||||
@Schema(description = "创建用户ID")
|
||||
@TableField(value = "create_user", fill = FieldFill.INSERT)
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户ID
|
||||
*/
|
||||
@Schema(description = "修改用户ID")
|
||||
@TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 数据状态(0-正常 1-已删)
|
||||
*/
|
||||
@Schema(description = "数据状态(0-正常 1-已删)")
|
||||
@TableField(value = "data_status")
|
||||
private Boolean dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_role")
|
||||
public class SysRole implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Schema(description = "角色名称")
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
@Schema(description = "角色权限字符串")
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false
|
||||
*/
|
||||
@Schema(description = "启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false")
|
||||
@TableField(value = "enabled")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
@Schema(description = "角色描述")
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人;用户表ID
|
||||
*/
|
||||
@Schema(description = "创建人;用户表ID")
|
||||
@TableField(value = "create_user", fill = FieldFill.INSERT)
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人所属机构;组织机构表ID
|
||||
*/
|
||||
@Schema(description = "创建人所属机构;组织机构表ID")
|
||||
@TableField(value = "create_org")
|
||||
private Long createOrg;
|
||||
|
||||
/**
|
||||
* 创建时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "创建时间;yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "修改时间;yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改用户ID;对应用户表的ID字段
|
||||
*/
|
||||
@Schema(description = "修改用户ID;对应用户表的ID字段")
|
||||
@TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 数据状态;0-正常 1-已删 默认值为0
|
||||
*/
|
||||
@Schema(description = "数据状态;0-正常 1-已删 默认值为0")
|
||||
@TableField(value = "data_status")
|
||||
private String dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色-权限关联")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_role_permission")
|
||||
public class SysRolePermission implements Serializable {
|
||||
|
||||
/**
|
||||
* 自增编号
|
||||
*/
|
||||
@Schema(description = "自增编号")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
@TableField(value = "role_id")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
@TableField(value = "permission_id")
|
||||
private Long permissionId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_user")
|
||||
public class SysUser implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID(主键)
|
||||
*/
|
||||
@Schema(description = "用户ID(主键)")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名(登录账号)
|
||||
*/
|
||||
@Schema(description = "用户名(登录账号)")
|
||||
@TableField(value = "username")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码(存储哈希值)
|
||||
*/
|
||||
@Schema(description = "密码(存储哈希值)")
|
||||
@TableField(value = "password")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证状态(0-未认证,1-认证中,2-已认证)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-未认证,1-认证中,2-已认证)")
|
||||
@TableField(value = "auth_status")
|
||||
private Boolean authStatus;
|
||||
|
||||
/**
|
||||
* 关联的企业ID(外键,指向企业表)
|
||||
*/
|
||||
@Schema(description = "关联的企业ID(外键,指向企业表)")
|
||||
@TableField(value = "enterprise_id")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
@TableField(value = "phone")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
@TableField(value = "email")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态(0-禁用,1-正常)
|
||||
*/
|
||||
@Schema(description = "用户状态(0-禁用,1-正常)")
|
||||
@TableField(value = "user_status")
|
||||
private Boolean userStatus;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@Schema(description = "注册时间")
|
||||
@TableField(value = "reg_time")
|
||||
private java.util.Date regTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.metalloop.modules.auth.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户与角色关联")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "sys_user_role")
|
||||
public class SysUserRole implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
@TableField(value = "user_id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
@TableField(value = "role_id")
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@Schema(description = "分配时间")
|
||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业图片附件查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysEnterpriseImageQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 图片ID(主键)
|
||||
*/
|
||||
@Schema(description = "图片ID(主键)")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属企业ID
|
||||
*/
|
||||
@Schema(description = "所属企业ID")
|
||||
@TableField(value = "enterprise_id")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)
|
||||
*/
|
||||
@Schema(description = "图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)")
|
||||
@TableField(value = "image_type")
|
||||
private Boolean imageType;
|
||||
|
||||
/**
|
||||
* 图片存储URL
|
||||
*/
|
||||
@Schema(description = "图片存储URL")
|
||||
@TableField(value = "image_url")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "created_at")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业信息主查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysEnterpriseQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业ID(主键)
|
||||
*/
|
||||
@Schema(description = "企业ID(主键)")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Schema(description = "企业名称")
|
||||
@TableField(value = "enterprise_name")
|
||||
private String enterpriseName;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
@Schema(description = "企业地址")
|
||||
@TableField(value = "enterprise_address")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
@Schema(description = "仓库地址")
|
||||
@TableField(value = "warehouse_address")
|
||||
private String warehouseAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
@TableField(value = "contact_person")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
@Schema(description = "法人代表")
|
||||
@TableField(value = "legal_person")
|
||||
private String legalPerson;
|
||||
|
||||
/**
|
||||
* 电话1
|
||||
*/
|
||||
@Schema(description = "电话1")
|
||||
@TableField(value = "phone1")
|
||||
private String phone1;
|
||||
|
||||
/**
|
||||
* 电话2
|
||||
*/
|
||||
@Schema(description = "电话2")
|
||||
@TableField(value = "phone2")
|
||||
private String phone2;
|
||||
|
||||
/**
|
||||
* 电话3
|
||||
*/
|
||||
@Schema(description = "电话3")
|
||||
@TableField(value = "phone3")
|
||||
private String phone3;
|
||||
|
||||
/**
|
||||
* 经营模式
|
||||
*/
|
||||
@Schema(description = "经营模式")
|
||||
@TableField(value = "business_model")
|
||||
private String businessModel;
|
||||
|
||||
/**
|
||||
* 企业简介
|
||||
*/
|
||||
@Schema(description = "企业简介")
|
||||
@TableField(value = "profile_intro")
|
||||
private String profileIntro;
|
||||
|
||||
/**
|
||||
* 标题图片URL
|
||||
*/
|
||||
@Schema(description = "标题图片URL")
|
||||
@TableField(value = "title_img_url")
|
||||
private String titleImgUrl;
|
||||
|
||||
/**
|
||||
* 简介图片URL
|
||||
*/
|
||||
@Schema(description = "简介图片URL")
|
||||
@TableField(value = "intro_img_url")
|
||||
private String introImgUrl;
|
||||
|
||||
/**
|
||||
* 营业执照URL
|
||||
*/
|
||||
@Schema(description = "营业执照URL")
|
||||
@TableField(value = "business_license_url")
|
||||
private String businessLicenseUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证正面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证正面URL")
|
||||
@TableField(value = "legal_id_front_url")
|
||||
private String legalIdFrontUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证反面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证反面URL")
|
||||
@TableField(value = "legal_id_back_url")
|
||||
private String legalIdBackUrl;
|
||||
|
||||
/**
|
||||
* OCR识别统一信用社ID(或统一信用代码)
|
||||
*/
|
||||
@Schema(description = "OCR识别统一信用社ID(或统一信用代码)")
|
||||
@TableField(value = "ocr_credit_code_id")
|
||||
private String ocrCreditCodeId;
|
||||
|
||||
/**
|
||||
* 法人身份证号
|
||||
*/
|
||||
@Schema(description = "法人身份证号")
|
||||
@TableField(value = "id_card_number")
|
||||
private String idCardNumber;
|
||||
|
||||
/**
|
||||
* 信用额度
|
||||
*/
|
||||
@Schema(description = "信用额度")
|
||||
@TableField(value = "credit_limit")
|
||||
private java.math.BigDecimal creditLimit;
|
||||
|
||||
/**
|
||||
* 认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)")
|
||||
@TableField(value = "audit_status")
|
||||
private Boolean auditStatus;
|
||||
|
||||
/**
|
||||
* 认证资料提交时间
|
||||
*/
|
||||
@Schema(description = "认证资料提交时间")
|
||||
@TableField(value = "submit_time")
|
||||
private java.util.Date submitTime;
|
||||
|
||||
/**
|
||||
* 认证审核完成时间
|
||||
*/
|
||||
@Schema(description = "认证审核完成时间")
|
||||
@TableField(value = "audit_time")
|
||||
private java.util.Date auditTime;
|
||||
|
||||
/**
|
||||
* 审核驳回原因
|
||||
*/
|
||||
@Schema(description = "审核驳回原因")
|
||||
@TableField(value = "reject_reason")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "created_at")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(value = "updated_at")
|
||||
private java.util.Date updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "权限查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysPermissionQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@Schema(description = "菜单名称")
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 权限标识(唯一,用于后端鉴权)
|
||||
*/
|
||||
@Schema(description = "权限标识(唯一,用于后端鉴权)")
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 菜单类型;0-系统 1-目录 2-菜单 3-按钮
|
||||
*/
|
||||
@Schema(description = "菜单类型;0-系统 1-目录 2-菜单 3-按钮")
|
||||
@TableField(value = "type")
|
||||
private Boolean type;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 父权限ID
|
||||
*/
|
||||
@Schema(description = "父权限ID")
|
||||
@TableField(value = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@Schema(description = "菜单图标")
|
||||
@TableField(value = "icon")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 后端接口地址(辅助)
|
||||
*/
|
||||
@Schema(description = "后端接口地址(辅助)")
|
||||
@TableField(value = "api_path")
|
||||
private String apiPath;
|
||||
|
||||
/**
|
||||
* 前端路由地址
|
||||
*/
|
||||
@Schema(description = "前端路由地址")
|
||||
@TableField(value = "route_path")
|
||||
private String routePath;
|
||||
|
||||
/**
|
||||
* 前端组件路径
|
||||
*/
|
||||
@Schema(description = "前端组件路径")
|
||||
@TableField(value = "component")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 前端组件名
|
||||
*/
|
||||
@Schema(description = "前端组件名")
|
||||
@TableField(value = "component_name")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 启用状态(0-禁用 1-启用)
|
||||
*/
|
||||
@Schema(description = "启用状态(0-禁用 1-启用)")
|
||||
@TableField(value = "enabled")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建用户ID
|
||||
*/
|
||||
@Schema(description = "创建用户ID")
|
||||
@TableField(value = "create_user")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户ID
|
||||
*/
|
||||
@Schema(description = "修改用户ID")
|
||||
@TableField(value = "update_user")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "create_time")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(value = "update_time")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 数据状态(0-正常 1-已删)
|
||||
*/
|
||||
@Schema(description = "数据状态(0-正常 1-已删)")
|
||||
@TableField(value = "data_status")
|
||||
private Boolean dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色-权限关联查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysRolePermissionQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 自增编号
|
||||
*/
|
||||
@Schema(description = "自增编号")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
@TableField(value = "role_id")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
@TableField(value = "permission_id")
|
||||
private Long permissionId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysRoleQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Schema(description = "角色名称")
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
@Schema(description = "角色权限字符串")
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false
|
||||
*/
|
||||
@Schema(description = "启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false")
|
||||
@TableField(value = "enabled")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
@Schema(description = "角色描述")
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人;用户表ID
|
||||
*/
|
||||
@Schema(description = "创建人;用户表ID")
|
||||
@TableField(value = "create_user")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人所属机构;组织机构表ID
|
||||
*/
|
||||
@Schema(description = "创建人所属机构;组织机构表ID")
|
||||
@TableField(value = "create_org")
|
||||
private Long createOrg;
|
||||
|
||||
/**
|
||||
* 创建时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "创建时间;yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(value = "create_time")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "修改时间;yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(value = "update_time")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改用户ID;对应用户表的ID字段
|
||||
*/
|
||||
@Schema(description = "修改用户ID;对应用户表的ID字段")
|
||||
@TableField(value = "update_user")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 数据状态;0-正常 1-已删 默认值为0
|
||||
*/
|
||||
@Schema(description = "数据状态;0-正常 1-已删 默认值为0")
|
||||
@TableField(value = "data_status")
|
||||
private String dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysUserQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID(主键)
|
||||
*/
|
||||
@Schema(description = "用户ID(主键)")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名(登录账号)
|
||||
*/
|
||||
@Schema(description = "用户名(登录账号)")
|
||||
@TableField(value = "username")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码(存储哈希值)
|
||||
*/
|
||||
@Schema(description = "密码(存储哈希值)")
|
||||
@TableField(value = "password")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证状态(0-未认证,1-认证中,2-已认证)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-未认证,1-认证中,2-已认证)")
|
||||
@TableField(value = "auth_status")
|
||||
private Boolean authStatus;
|
||||
|
||||
/**
|
||||
* 关联的企业ID(外键,指向企业表)
|
||||
*/
|
||||
@Schema(description = "关联的企业ID(外键,指向企业表)")
|
||||
@TableField(value = "enterprise_id")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
@TableField(value = "phone")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
@TableField(value = "email")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态(0-禁用,1-正常)
|
||||
*/
|
||||
@Schema(description = "用户状态(0-禁用,1-正常)")
|
||||
@TableField(value = "user_status")
|
||||
private Boolean userStatus;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@Schema(description = "注册时间")
|
||||
@TableField(value = "reg_time")
|
||||
private java.util.Date regTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.metalloop.modules.auth.model.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联查询对象
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户与角色关联查询对象")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysUserRoleQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
@TableField(value = "user_id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
@TableField(value = "role_id")
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@Schema(description = "分配时间")
|
||||
@TableField(value = "created_at")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "")
|
||||
@TableField(value = "id")
|
||||
private Long id;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 认证请求
|
||||
*
|
||||
* @author zhaowenhao
|
||||
* @since 2023-03-19
|
||||
*/
|
||||
@Data
|
||||
public class AuthenticationRequest {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
private String verifyCode;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业图片附件及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseImageLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业图片附件实体
|
||||
*/
|
||||
@Schema(description = "企业图片附件实体")
|
||||
private SysEnterpriseImageReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysEnterpriseImageQueryReqDto>> conditions;
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "企业图片附件分页查询请求 DTO")
|
||||
public class SysEnterpriseImagePageQueryReqDto extends SysEnterpriseImageQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业图片附件查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseImageQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 图片ID(主键)
|
||||
*/
|
||||
@Schema(description = "图片ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属企业ID
|
||||
*/
|
||||
@Schema(description = "所属企业ID")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)
|
||||
*/
|
||||
@Schema(description = "图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)")
|
||||
private Boolean imageType;
|
||||
|
||||
/**
|
||||
* 图片存储URL
|
||||
*/
|
||||
@Schema(description = "图片存储URL")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业图片附件请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseImageReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 图片ID(主键)
|
||||
*/
|
||||
@Schema(description = "图片ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属企业ID
|
||||
*/
|
||||
@Schema(description = "所属企业ID")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)
|
||||
*/
|
||||
@Schema(description = "图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)")
|
||||
private Boolean imageType;
|
||||
|
||||
/**
|
||||
* 图片存储URL
|
||||
*/
|
||||
@Schema(description = "图片存储URL")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业图片附件根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseImageUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业图片附件实体
|
||||
*/
|
||||
@Schema(description = "企业图片附件实体")
|
||||
private SysEnterpriseImageReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysEnterpriseImageQueryReqDto queryReqDto;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息主及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业信息主实体
|
||||
*/
|
||||
@Schema(description = "企业信息主实体")
|
||||
private SysEnterpriseReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysEnterpriseQueryReqDto>> conditions;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "企业信息主分页查询请求 DTO")
|
||||
public class SysEnterprisePageQueryReqDto extends SysEnterpriseQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业信息主查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业ID(主键)
|
||||
*/
|
||||
@Schema(description = "企业ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Schema(description = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
@Schema(description = "企业地址")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
@Schema(description = "仓库地址")
|
||||
private String warehouseAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
@Schema(description = "法人代表")
|
||||
private String legalPerson;
|
||||
|
||||
/**
|
||||
* 电话1
|
||||
*/
|
||||
@Schema(description = "电话1")
|
||||
private String phone1;
|
||||
|
||||
/**
|
||||
* 电话2
|
||||
*/
|
||||
@Schema(description = "电话2")
|
||||
private String phone2;
|
||||
|
||||
/**
|
||||
* 电话3
|
||||
*/
|
||||
@Schema(description = "电话3")
|
||||
private String phone3;
|
||||
|
||||
/**
|
||||
* 经营模式
|
||||
*/
|
||||
@Schema(description = "经营模式")
|
||||
private String businessModel;
|
||||
|
||||
/**
|
||||
* 企业简介
|
||||
*/
|
||||
@Schema(description = "企业简介")
|
||||
private String profileIntro;
|
||||
|
||||
/**
|
||||
* 标题图片URL
|
||||
*/
|
||||
@Schema(description = "标题图片URL")
|
||||
private String titleImgUrl;
|
||||
|
||||
/**
|
||||
* 简介图片URL
|
||||
*/
|
||||
@Schema(description = "简介图片URL")
|
||||
private String introImgUrl;
|
||||
|
||||
/**
|
||||
* 营业执照URL
|
||||
*/
|
||||
@Schema(description = "营业执照URL")
|
||||
private String businessLicenseUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证正面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证正面URL")
|
||||
private String legalIdFrontUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证反面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证反面URL")
|
||||
private String legalIdBackUrl;
|
||||
|
||||
/**
|
||||
* OCR识别统一信用社ID(或统一信用代码)
|
||||
*/
|
||||
@Schema(description = "OCR识别统一信用社ID(或统一信用代码)")
|
||||
private String ocrCreditCodeId;
|
||||
|
||||
/**
|
||||
* 法人身份证号
|
||||
*/
|
||||
@Schema(description = "法人身份证号")
|
||||
private String idCardNumber;
|
||||
|
||||
/**
|
||||
* 信用额度
|
||||
*/
|
||||
@Schema(description = "信用额度")
|
||||
private java.math.BigDecimal creditLimit;
|
||||
|
||||
/**
|
||||
* 认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)")
|
||||
private Boolean auditStatus;
|
||||
|
||||
/**
|
||||
* 认证资料提交时间
|
||||
*/
|
||||
@Schema(description = "认证资料提交时间")
|
||||
private java.util.Date submitTime;
|
||||
|
||||
/**
|
||||
* 认证审核完成时间
|
||||
*/
|
||||
@Schema(description = "认证审核完成时间")
|
||||
private java.util.Date auditTime;
|
||||
|
||||
/**
|
||||
* 审核驳回原因
|
||||
*/
|
||||
@Schema(description = "审核驳回原因")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private java.util.Date updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业信息主请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业ID(主键)
|
||||
*/
|
||||
@Schema(description = "企业ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Schema(description = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
@Schema(description = "企业地址")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
@Schema(description = "仓库地址")
|
||||
private String warehouseAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
@Schema(description = "法人代表")
|
||||
private String legalPerson;
|
||||
|
||||
/**
|
||||
* 电话1
|
||||
*/
|
||||
@Schema(description = "电话1")
|
||||
private String phone1;
|
||||
|
||||
/**
|
||||
* 电话2
|
||||
*/
|
||||
@Schema(description = "电话2")
|
||||
private String phone2;
|
||||
|
||||
/**
|
||||
* 电话3
|
||||
*/
|
||||
@Schema(description = "电话3")
|
||||
private String phone3;
|
||||
|
||||
/**
|
||||
* 经营模式
|
||||
*/
|
||||
@Schema(description = "经营模式")
|
||||
private String businessModel;
|
||||
|
||||
/**
|
||||
* 企业简介
|
||||
*/
|
||||
@Schema(description = "企业简介")
|
||||
private String profileIntro;
|
||||
|
||||
/**
|
||||
* 标题图片URL
|
||||
*/
|
||||
@Schema(description = "标题图片URL")
|
||||
private String titleImgUrl;
|
||||
|
||||
/**
|
||||
* 简介图片URL
|
||||
*/
|
||||
@Schema(description = "简介图片URL")
|
||||
private String introImgUrl;
|
||||
|
||||
/**
|
||||
* 营业执照URL
|
||||
*/
|
||||
@Schema(description = "营业执照URL")
|
||||
private String businessLicenseUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证正面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证正面URL")
|
||||
private String legalIdFrontUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证反面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证反面URL")
|
||||
private String legalIdBackUrl;
|
||||
|
||||
/**
|
||||
* OCR识别统一信用社ID(或统一信用代码)
|
||||
*/
|
||||
@Schema(description = "OCR识别统一信用社ID(或统一信用代码)")
|
||||
private String ocrCreditCodeId;
|
||||
|
||||
/**
|
||||
* 法人身份证号
|
||||
*/
|
||||
@Schema(description = "法人身份证号")
|
||||
private String idCardNumber;
|
||||
|
||||
/**
|
||||
* 信用额度
|
||||
*/
|
||||
@Schema(description = "信用额度")
|
||||
private java.math.BigDecimal creditLimit;
|
||||
|
||||
/**
|
||||
* 认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)")
|
||||
private Boolean auditStatus;
|
||||
|
||||
/**
|
||||
* 认证资料提交时间
|
||||
*/
|
||||
@Schema(description = "认证资料提交时间")
|
||||
private java.util.Date submitTime;
|
||||
|
||||
/**
|
||||
* 认证审核完成时间
|
||||
*/
|
||||
@Schema(description = "认证审核完成时间")
|
||||
private java.util.Date auditTime;
|
||||
|
||||
/**
|
||||
* 审核驳回原因
|
||||
*/
|
||||
@Schema(description = "审核驳回原因")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private java.util.Date updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业信息主根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业信息主实体
|
||||
*/
|
||||
@Schema(description = "企业信息主实体")
|
||||
private SysEnterpriseReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysEnterpriseQueryReqDto queryReqDto;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysPermissionLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限实体
|
||||
*/
|
||||
@Schema(description = "权限实体")
|
||||
private SysPermissionReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysPermissionQueryReqDto>> conditions;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "权限分页查询请求 DTO")
|
||||
public class SysPermissionPageQueryReqDto extends SysPermissionQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "权限查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysPermissionQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@Schema(description = "菜单名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 权限标识(唯一,用于后端鉴权)
|
||||
*/
|
||||
@Schema(description = "权限标识(唯一,用于后端鉴权)")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 菜单类型;0-系统 1-目录 2-菜单 3-按钮
|
||||
*/
|
||||
@Schema(description = "菜单类型;0-系统 1-目录 2-菜单 3-按钮")
|
||||
private Boolean type;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 父权限ID
|
||||
*/
|
||||
@Schema(description = "父权限ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 后端接口地址(辅助)
|
||||
*/
|
||||
@Schema(description = "后端接口地址(辅助)")
|
||||
private String apiPath;
|
||||
|
||||
/**
|
||||
* 前端路由地址
|
||||
*/
|
||||
@Schema(description = "前端路由地址")
|
||||
private String routePath;
|
||||
|
||||
/**
|
||||
* 前端组件路径
|
||||
*/
|
||||
@Schema(description = "前端组件路径")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 前端组件名
|
||||
*/
|
||||
@Schema(description = "前端组件名")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 启用状态(0-禁用 1-启用)
|
||||
*/
|
||||
@Schema(description = "启用状态(0-禁用 1-启用)")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建用户ID
|
||||
*/
|
||||
@Schema(description = "创建用户ID")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户ID
|
||||
*/
|
||||
@Schema(description = "修改用户ID")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 数据状态(0-正常 1-已删)
|
||||
*/
|
||||
@Schema(description = "数据状态(0-正常 1-已删)")
|
||||
private Boolean dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "权限请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysPermissionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@Schema(description = "菜单名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 权限标识(唯一,用于后端鉴权)
|
||||
*/
|
||||
@Schema(description = "权限标识(唯一,用于后端鉴权)")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 菜单类型;0-系统 1-目录 2-菜单 3-按钮
|
||||
*/
|
||||
@Schema(description = "菜单类型;0-系统 1-目录 2-菜单 3-按钮")
|
||||
private Boolean type;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 父权限ID
|
||||
*/
|
||||
@Schema(description = "父权限ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 后端接口地址(辅助)
|
||||
*/
|
||||
@Schema(description = "后端接口地址(辅助)")
|
||||
private String apiPath;
|
||||
|
||||
/**
|
||||
* 前端路由地址
|
||||
*/
|
||||
@Schema(description = "前端路由地址")
|
||||
private String routePath;
|
||||
|
||||
/**
|
||||
* 前端组件路径
|
||||
*/
|
||||
@Schema(description = "前端组件路径")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 前端组件名
|
||||
*/
|
||||
@Schema(description = "前端组件名")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 启用状态(0-禁用 1-启用)
|
||||
*/
|
||||
@Schema(description = "启用状态(0-禁用 1-启用)")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建用户ID
|
||||
*/
|
||||
@Schema(description = "创建用户ID")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户ID
|
||||
*/
|
||||
@Schema(description = "修改用户ID")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 数据状态(0-正常 1-已删)
|
||||
*/
|
||||
@Schema(description = "数据状态(0-正常 1-已删)")
|
||||
private Boolean dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "权限根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysPermissionUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限实体
|
||||
*/
|
||||
@Schema(description = "权限实体")
|
||||
private SysPermissionReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysPermissionQueryReqDto queryReqDto;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色实体
|
||||
*/
|
||||
@Schema(description = "角色实体")
|
||||
private SysRoleReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysRoleQueryReqDto>> conditions;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "角色分页查询请求 DTO")
|
||||
public class SysRolePageQueryReqDto extends SysRoleQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色-权限关联及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRolePermissionLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色-权限关联实体
|
||||
*/
|
||||
@Schema(description = "角色-权限关联实体")
|
||||
private SysRolePermissionReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysRolePermissionQueryReqDto>> conditions;
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "角色-权限关联分页查询请求 DTO")
|
||||
public class SysRolePermissionPageQueryReqDto extends SysRolePermissionQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色-权限关联查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRolePermissionQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 自增编号
|
||||
*/
|
||||
@Schema(description = "自增编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
private Long permissionId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色-权限关联请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRolePermissionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 自增编号
|
||||
*/
|
||||
@Schema(description = "自增编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
private Long permissionId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色-权限关联根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRolePermissionUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色-权限关联实体
|
||||
*/
|
||||
@Schema(description = "角色-权限关联实体")
|
||||
private SysRolePermissionReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysRolePermissionQueryReqDto queryReqDto;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Schema(description = "角色名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
@Schema(description = "角色权限字符串")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false
|
||||
*/
|
||||
@Schema(description = "启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
@Schema(description = "角色描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人;用户表ID
|
||||
*/
|
||||
@Schema(description = "创建人;用户表ID")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人所属机构;组织机构表ID
|
||||
*/
|
||||
@Schema(description = "创建人所属机构;组织机构表ID")
|
||||
private Long createOrg;
|
||||
|
||||
/**
|
||||
* 创建时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "创建时间;yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "修改时间;yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改用户ID;对应用户表的ID字段
|
||||
*/
|
||||
@Schema(description = "修改用户ID;对应用户表的ID字段")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 数据状态;0-正常 1-已删 默认值为0
|
||||
*/
|
||||
@Schema(description = "数据状态;0-正常 1-已删 默认值为0")
|
||||
private String dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Schema(description = "角色名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
@Schema(description = "角色权限字符串")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false
|
||||
*/
|
||||
@Schema(description = "启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
@Schema(description = "角色描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人;用户表ID
|
||||
*/
|
||||
@Schema(description = "创建人;用户表ID")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人所属机构;组织机构表ID
|
||||
*/
|
||||
@Schema(description = "创建人所属机构;组织机构表ID")
|
||||
private Long createOrg;
|
||||
|
||||
/**
|
||||
* 创建时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "创建时间;yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "修改时间;yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改用户ID;对应用户表的ID字段
|
||||
*/
|
||||
@Schema(description = "修改用户ID;对应用户表的ID字段")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 数据状态;0-正常 1-已删 默认值为0
|
||||
*/
|
||||
@Schema(description = "数据状态;0-正常 1-已删 默认值为0")
|
||||
private String dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色实体
|
||||
*/
|
||||
@Schema(description = "角色实体")
|
||||
private SysRoleReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysRoleQueryReqDto queryReqDto;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户实体
|
||||
*/
|
||||
@Schema(description = "用户实体")
|
||||
private SysUserReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysUserQueryReqDto>> conditions;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "用户分页查询请求 DTO")
|
||||
public class SysUserPageQueryReqDto extends SysUserQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID(主键)
|
||||
*/
|
||||
@Schema(description = "用户ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名(登录账号)
|
||||
*/
|
||||
@Schema(description = "用户名(登录账号)")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码(存储哈希值)
|
||||
*/
|
||||
@Schema(description = "密码(存储哈希值)")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证状态(0-未认证,1-认证中,2-已认证)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-未认证,1-认证中,2-已认证)")
|
||||
private Boolean authStatus;
|
||||
|
||||
/**
|
||||
* 关联的企业ID(外键,指向企业表)
|
||||
*/
|
||||
@Schema(description = "关联的企业ID(外键,指向企业表)")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态(0-禁用,1-正常)
|
||||
*/
|
||||
@Schema(description = "用户状态(0-禁用,1-正常)")
|
||||
private Boolean userStatus;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@Schema(description = "注册时间")
|
||||
private java.util.Date regTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID(主键)
|
||||
*/
|
||||
@Schema(description = "用户ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名(登录账号)
|
||||
*/
|
||||
@Schema(description = "用户名(登录账号)")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码(存储哈希值)
|
||||
*/
|
||||
@Schema(description = "密码(存储哈希值)")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证状态(0-未认证,1-认证中,2-已认证)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-未认证,1-认证中,2-已认证)")
|
||||
private Boolean authStatus;
|
||||
|
||||
/**
|
||||
* 关联的企业ID(外键,指向企业表)
|
||||
*/
|
||||
@Schema(description = "关联的企业ID(外键,指向企业表)")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态(0-禁用,1-正常)
|
||||
*/
|
||||
@Schema(description = "用户状态(0-禁用,1-正常)")
|
||||
private Boolean userStatus;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@Schema(description = "注册时间")
|
||||
private java.util.Date regTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.metalloop.common.core.lock.LockConditionReqDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与角色关联及幂等性锁定条件组合 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserRoleLockConditionReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户与角色关联实体
|
||||
*/
|
||||
@Schema(description = "用户与角色关联实体")
|
||||
private SysUserRoleReqDto entity;
|
||||
|
||||
/**
|
||||
* 锁定条件
|
||||
*/
|
||||
@Schema(description = "锁定条件")
|
||||
private List<LockConditionReqDto<SysUserRoleQueryReqDto>> conditions;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联分页查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "用户与角色关联分页查询请求 DTO")
|
||||
public class SysUserRolePageQueryReqDto extends SysUserRoleQueryReqDto implements Serializable {
|
||||
// region 分页参数接收区域
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@Schema(description = "当前页,默认 1")
|
||||
private Long current = 1L;
|
||||
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
@Schema(description = "每页显示条数,默认 10")
|
||||
private Long size = 10L;
|
||||
|
||||
/**
|
||||
* 生成 mybatis plus 的分页对象
|
||||
*
|
||||
* @param <T> 分页元素类型
|
||||
* @return 分页对象
|
||||
*/
|
||||
public <T> Page<T> page() {
|
||||
return Page.of(current, size);
|
||||
}
|
||||
// ednRegion
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联查询请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户与角色关联查询请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserRoleQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@Schema(description = "分配时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "")
|
||||
private Long id;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联请求 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户与角色关联请求 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserRoleReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@Schema(description = "分配时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "")
|
||||
private Long id;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户与角色关联根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserRoleUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户与角色关联实体
|
||||
*/
|
||||
@Schema(description = "用户与角色关联实体")
|
||||
private SysUserRoleReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysUserRoleQueryReqDto queryReqDto;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.metalloop.modules.auth.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户根据查询修改 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户根据查询修改 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserUpdateByQueryReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户实体
|
||||
*/
|
||||
@Schema(description = "用户实体")
|
||||
private SysUserReqDto entity;
|
||||
|
||||
/**
|
||||
* 查询请求 DTO
|
||||
*/
|
||||
@Schema(description = "查询请求 DTO")
|
||||
private SysUserQueryReqDto queryReqDto;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 认证响应
|
||||
*
|
||||
* @author zhaowenhao
|
||||
* @since 2023-03-19
|
||||
*/
|
||||
@Data
|
||||
public class AuthenticationResponse {
|
||||
|
||||
/**
|
||||
* 访问令牌
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* 用户登录名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业图片附件响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业图片附件响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseImageRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 图片ID(主键)
|
||||
*/
|
||||
@Schema(description = "图片ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属企业ID
|
||||
*/
|
||||
@Schema(description = "所属企业ID")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)
|
||||
*/
|
||||
@Schema(description = "图片类型(0-公司环境,1-资质证书,2-生产设备,3-主营产品)")
|
||||
private Boolean imageType;
|
||||
|
||||
/**
|
||||
* 图片存储URL
|
||||
*/
|
||||
@Schema(description = "图片存储URL")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业信息主响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业信息主响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysEnterpriseRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 企业ID(主键)
|
||||
*/
|
||||
@Schema(description = "企业ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Schema(description = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
@Schema(description = "企业地址")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
@Schema(description = "仓库地址")
|
||||
private String warehouseAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
@Schema(description = "法人代表")
|
||||
private String legalPerson;
|
||||
|
||||
/**
|
||||
* 电话1
|
||||
*/
|
||||
@Schema(description = "电话1")
|
||||
private String phone1;
|
||||
|
||||
/**
|
||||
* 电话2
|
||||
*/
|
||||
@Schema(description = "电话2")
|
||||
private String phone2;
|
||||
|
||||
/**
|
||||
* 电话3
|
||||
*/
|
||||
@Schema(description = "电话3")
|
||||
private String phone3;
|
||||
|
||||
/**
|
||||
* 经营模式
|
||||
*/
|
||||
@Schema(description = "经营模式")
|
||||
private String businessModel;
|
||||
|
||||
/**
|
||||
* 企业简介
|
||||
*/
|
||||
@Schema(description = "企业简介")
|
||||
private String profileIntro;
|
||||
|
||||
/**
|
||||
* 标题图片URL
|
||||
*/
|
||||
@Schema(description = "标题图片URL")
|
||||
private String titleImgUrl;
|
||||
|
||||
/**
|
||||
* 简介图片URL
|
||||
*/
|
||||
@Schema(description = "简介图片URL")
|
||||
private String introImgUrl;
|
||||
|
||||
/**
|
||||
* 营业执照URL
|
||||
*/
|
||||
@Schema(description = "营业执照URL")
|
||||
private String businessLicenseUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证正面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证正面URL")
|
||||
private String legalIdFrontUrl;
|
||||
|
||||
/**
|
||||
* 法人身份证反面URL
|
||||
*/
|
||||
@Schema(description = "法人身份证反面URL")
|
||||
private String legalIdBackUrl;
|
||||
|
||||
/**
|
||||
* OCR识别统一信用社ID(或统一信用代码)
|
||||
*/
|
||||
@Schema(description = "OCR识别统一信用社ID(或统一信用代码)")
|
||||
private String ocrCreditCodeId;
|
||||
|
||||
/**
|
||||
* 法人身份证号
|
||||
*/
|
||||
@Schema(description = "法人身份证号")
|
||||
private String idCardNumber;
|
||||
|
||||
/**
|
||||
* 信用额度
|
||||
*/
|
||||
@Schema(description = "信用额度")
|
||||
private java.math.BigDecimal creditLimit;
|
||||
|
||||
/**
|
||||
* 认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-待提交,1-审核中,2-已通过,3-已驳回)")
|
||||
private Boolean auditStatus;
|
||||
|
||||
/**
|
||||
* 认证资料提交时间
|
||||
*/
|
||||
@Schema(description = "认证资料提交时间")
|
||||
private java.util.Date submitTime;
|
||||
|
||||
/**
|
||||
* 认证审核完成时间
|
||||
*/
|
||||
@Schema(description = "认证审核完成时间")
|
||||
private java.util.Date auditTime;
|
||||
|
||||
/**
|
||||
* 审核驳回原因
|
||||
*/
|
||||
@Schema(description = "审核驳回原因")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private java.util.Date updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "权限响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysPermissionRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@Schema(description = "菜单名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 权限标识(唯一,用于后端鉴权)
|
||||
*/
|
||||
@Schema(description = "权限标识(唯一,用于后端鉴权)")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 菜单类型;0-系统 1-目录 2-菜单 3-按钮
|
||||
*/
|
||||
@Schema(description = "菜单类型;0-系统 1-目录 2-菜单 3-按钮")
|
||||
private Boolean type;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 父权限ID
|
||||
*/
|
||||
@Schema(description = "父权限ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 后端接口地址(辅助)
|
||||
*/
|
||||
@Schema(description = "后端接口地址(辅助)")
|
||||
private String apiPath;
|
||||
|
||||
/**
|
||||
* 前端路由地址
|
||||
*/
|
||||
@Schema(description = "前端路由地址")
|
||||
private String routePath;
|
||||
|
||||
/**
|
||||
* 前端组件路径
|
||||
*/
|
||||
@Schema(description = "前端组件路径")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 前端组件名
|
||||
*/
|
||||
@Schema(description = "前端组件名")
|
||||
private String componentName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 启用状态(0-禁用 1-启用)
|
||||
*/
|
||||
@Schema(description = "启用状态(0-禁用 1-启用)")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建用户ID
|
||||
*/
|
||||
@Schema(description = "创建用户ID")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 修改用户ID
|
||||
*/
|
||||
@Schema(description = "修改用户ID")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 数据状态(0-正常 1-已删)
|
||||
*/
|
||||
@Schema(description = "数据状态(0-正常 1-已删)")
|
||||
private Boolean dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色-权限关联响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色-权限关联响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRolePermissionRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 自增编号
|
||||
*/
|
||||
@Schema(description = "自增编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
@Schema(description = "权限ID")
|
||||
private Long permissionId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "角色响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Schema(description = "角色名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
@Schema(description = "角色权限字符串")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false
|
||||
*/
|
||||
@Schema(description = "启用状态:指示角色是启用还是禁用。禁用角色无法进行授权。如果已启用,则为true,否则为false")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
@Schema(description = "角色描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人;用户表ID
|
||||
*/
|
||||
@Schema(description = "创建人;用户表ID")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人所属机构;组织机构表ID
|
||||
*/
|
||||
@Schema(description = "创建人所属机构;组织机构表ID")
|
||||
private Long createOrg;
|
||||
|
||||
/**
|
||||
* 创建时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "创建时间;yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间;yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Schema(description = "修改时间;yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改用户ID;对应用户表的ID字段
|
||||
*/
|
||||
@Schema(description = "修改用户ID;对应用户表的ID字段")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 数据状态;0-正常 1-已删 默认值为0
|
||||
*/
|
||||
@Schema(description = "数据状态;0-正常 1-已删 默认值为0")
|
||||
private String dataStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID(主键)
|
||||
*/
|
||||
@Schema(description = "用户ID(主键)")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名(登录账号)
|
||||
*/
|
||||
@Schema(description = "用户名(登录账号)")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码(存储哈希值)
|
||||
*/
|
||||
@Schema(description = "密码(存储哈希值)")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证状态(0-未认证,1-认证中,2-已认证)
|
||||
*/
|
||||
@Schema(description = "认证状态(0-未认证,1-认证中,2-已认证)")
|
||||
private Boolean authStatus;
|
||||
|
||||
/**
|
||||
* 关联的企业ID(外键,指向企业表)
|
||||
*/
|
||||
@Schema(description = "关联的企业ID(外键,指向企业表)")
|
||||
private Integer enterpriseId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态(0-禁用,1-正常)
|
||||
*/
|
||||
@Schema(description = "用户状态(0-禁用,1-正常)")
|
||||
private Boolean userStatus;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@Schema(description = "注册时间")
|
||||
private java.util.Date regTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.metalloop.modules.auth.model.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与角色关联响应 DTO
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "用户与角色关联响应 DTO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysUserRoleRespDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Integer roleId;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@Schema(description = "分配时间")
|
||||
private java.util.Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "")
|
||||
private Long id;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterpriseImage;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseImageQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 企业图片附件 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysEnterpriseImageService extends ISuperService<SysEnterpriseImage> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建企业图片附件
|
||||
*
|
||||
* @param sysEnterpriseImage 企业图片附件
|
||||
* @return 创建后的企业图片附件
|
||||
*/
|
||||
SysEnterpriseImage create(SysEnterpriseImage sysEnterpriseImage);
|
||||
|
||||
/**
|
||||
* 批量创建企业图片附件
|
||||
*
|
||||
* @param sysEnterpriseImages 企业图片附件列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysEnterpriseImage> sysEnterpriseImages);
|
||||
|
||||
/**
|
||||
* 获取全部企业图片附件列表
|
||||
*
|
||||
* @return 全部企业图片附件列表
|
||||
*/
|
||||
List<SysEnterpriseImage> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新企业图片附件
|
||||
*
|
||||
* @param sysEnterpriseImages 企业图片附件列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysEnterpriseImage> sysEnterpriseImages);
|
||||
|
||||
/**
|
||||
* 通过ID删除企业图片附件
|
||||
*
|
||||
* @param id 企业图片附件ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除企业图片附件
|
||||
*
|
||||
* @param ids 企业图片附件ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建企业图片附件
|
||||
*
|
||||
* @param entity 企业图片附件
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysEnterpriseImage entity, LockCondition<SysEnterpriseImage>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新企业图片附件
|
||||
*
|
||||
* @param entity 企业图片附件
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysEnterpriseImage entity, LockCondition<SysEnterpriseImage>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新企业图片附件(幂等性)
|
||||
*
|
||||
* @param entity 企业图片附件
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysEnterpriseImage entity, LockCondition<SysEnterpriseImage>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取企业图片附件
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 企业图片附件分页
|
||||
*/
|
||||
Page<SysEnterpriseImage> pageByQuery(long current, long size, SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部企业图片附件
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部企业图片附件分页
|
||||
*/
|
||||
Page<SysEnterpriseImage> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和企业图片附件的映射
|
||||
*
|
||||
* @return ID和企业图片附件的映射
|
||||
*/
|
||||
Map<String, SysEnterpriseImage> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和企业图片附件的映射
|
||||
*
|
||||
* @param ids 企业图片附件ID列表
|
||||
* @return ID和企业图片附件的映射
|
||||
*/
|
||||
Map<String, SysEnterpriseImage> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和企业图片附件 列表的分组
|
||||
*
|
||||
* @return ID和企业图片附件 列表的分组
|
||||
*/
|
||||
Map<String, List<SysEnterpriseImage>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和企业图片附件 列表的分组
|
||||
*
|
||||
* @param ids 企业图片附件ID列表
|
||||
* @return ID和企业图片附件 列表的分组
|
||||
*/
|
||||
Map<String, List<SysEnterpriseImage>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部企业图片附件数量
|
||||
*
|
||||
* @return 全部企业图片附件数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysEnterpriseImageQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改企业图片附件
|
||||
*
|
||||
* @param entity 企业图片附件
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysEnterpriseImage entity, SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除企业图片附件
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取企业图片附件
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业图片附件
|
||||
*/
|
||||
SysEnterpriseImage getByQuery(SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取企业图片附件列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业图片附件列表
|
||||
*/
|
||||
List<SysEnterpriseImage> listByQuery(SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和企业图片附件的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和企业图片附件的映射
|
||||
*/
|
||||
Map<Long, SysEnterpriseImage> getIdMapByQuery(SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的企业图片附件
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业图片附件分组
|
||||
*/
|
||||
Map<Long, List<SysEnterpriseImage>> getIdGroupByQuery(SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取企业图片附件数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业图片附件数量
|
||||
*/
|
||||
Long countByQuery(SysEnterpriseImageQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的企业图片附件
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysEnterpriseImageQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterprise;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 企业信息主 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysEnterpriseService extends ISuperService<SysEnterprise> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建企业信息主
|
||||
*
|
||||
* @param sysEnterprise 企业信息主
|
||||
* @return 创建后的企业信息主
|
||||
*/
|
||||
SysEnterprise create(SysEnterprise sysEnterprise);
|
||||
|
||||
/**
|
||||
* 批量创建企业信息主
|
||||
*
|
||||
* @param sysEnterprises 企业信息主列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysEnterprise> sysEnterprises);
|
||||
|
||||
/**
|
||||
* 获取全部企业信息主列表
|
||||
*
|
||||
* @return 全部企业信息主列表
|
||||
*/
|
||||
List<SysEnterprise> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新企业信息主
|
||||
*
|
||||
* @param sysEnterprises 企业信息主列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysEnterprise> sysEnterprises);
|
||||
|
||||
/**
|
||||
* 通过ID删除企业信息主
|
||||
*
|
||||
* @param id 企业信息主ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除企业信息主
|
||||
*
|
||||
* @param ids 企业信息主ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建企业信息主
|
||||
*
|
||||
* @param entity 企业信息主
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysEnterprise entity, LockCondition<SysEnterprise>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新企业信息主
|
||||
*
|
||||
* @param entity 企业信息主
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysEnterprise entity, LockCondition<SysEnterprise>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新企业信息主(幂等性)
|
||||
*
|
||||
* @param entity 企业信息主
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysEnterprise entity, LockCondition<SysEnterprise>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取企业信息主
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 企业信息主分页
|
||||
*/
|
||||
Page<SysEnterprise> pageByQuery(long current, long size, SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部企业信息主
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部企业信息主分页
|
||||
*/
|
||||
Page<SysEnterprise> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和企业信息主的映射
|
||||
*
|
||||
* @return ID和企业信息主的映射
|
||||
*/
|
||||
Map<String, SysEnterprise> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和企业信息主的映射
|
||||
*
|
||||
* @param ids 企业信息主ID列表
|
||||
* @return ID和企业信息主的映射
|
||||
*/
|
||||
Map<String, SysEnterprise> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和企业信息主 列表的分组
|
||||
*
|
||||
* @return ID和企业信息主 列表的分组
|
||||
*/
|
||||
Map<String, List<SysEnterprise>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和企业信息主 列表的分组
|
||||
*
|
||||
* @param ids 企业信息主ID列表
|
||||
* @return ID和企业信息主 列表的分组
|
||||
*/
|
||||
Map<String, List<SysEnterprise>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部企业信息主数量
|
||||
*
|
||||
* @return 全部企业信息主数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysEnterpriseQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改企业信息主
|
||||
*
|
||||
* @param entity 企业信息主
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysEnterprise entity, SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除企业信息主
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取企业信息主
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业信息主
|
||||
*/
|
||||
SysEnterprise getByQuery(SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取企业信息主列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业信息主列表
|
||||
*/
|
||||
List<SysEnterprise> listByQuery(SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和企业信息主的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和企业信息主的映射
|
||||
*/
|
||||
Map<Long, SysEnterprise> getIdMapByQuery(SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的企业信息主
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业信息主分组
|
||||
*/
|
||||
Map<Long, List<SysEnterprise>> getIdGroupByQuery(SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取企业信息主数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 企业信息主数量
|
||||
*/
|
||||
Long countByQuery(SysEnterpriseQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的企业信息主
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysEnterpriseQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysPermission;
|
||||
import com.metalloop.modules.auth.model.query.SysPermissionQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 权限 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysPermissionService extends ISuperService<SysPermission> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建权限
|
||||
*
|
||||
* @param sysPermission 权限
|
||||
* @return 创建后的权限
|
||||
*/
|
||||
SysPermission create(SysPermission sysPermission);
|
||||
|
||||
/**
|
||||
* 批量创建权限
|
||||
*
|
||||
* @param sysPermissions 权限列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysPermission> sysPermissions);
|
||||
|
||||
/**
|
||||
* 获取全部权限列表
|
||||
*
|
||||
* @return 全部权限列表
|
||||
*/
|
||||
List<SysPermission> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新权限
|
||||
*
|
||||
* @param sysPermissions 权限列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysPermission> sysPermissions);
|
||||
|
||||
/**
|
||||
* 通过ID删除权限
|
||||
*
|
||||
* @param id 权限ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除权限
|
||||
*
|
||||
* @param ids 权限ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建权限
|
||||
*
|
||||
* @param entity 权限
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysPermission entity, LockCondition<SysPermission>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新权限
|
||||
*
|
||||
* @param entity 权限
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysPermission entity, LockCondition<SysPermission>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新权限(幂等性)
|
||||
*
|
||||
* @param entity 权限
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysPermission entity, LockCondition<SysPermission>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取权限
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 权限分页
|
||||
*/
|
||||
Page<SysPermission> pageByQuery(long current, long size, SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部权限
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部权限分页
|
||||
*/
|
||||
Page<SysPermission> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和权限的映射
|
||||
*
|
||||
* @return ID和权限的映射
|
||||
*/
|
||||
Map<String, SysPermission> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和权限的映射
|
||||
*
|
||||
* @param ids 权限ID列表
|
||||
* @return ID和权限的映射
|
||||
*/
|
||||
Map<String, SysPermission> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和权限 列表的分组
|
||||
*
|
||||
* @return ID和权限 列表的分组
|
||||
*/
|
||||
Map<String, List<SysPermission>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和权限 列表的分组
|
||||
*
|
||||
* @param ids 权限ID列表
|
||||
* @return ID和权限 列表的分组
|
||||
*/
|
||||
Map<String, List<SysPermission>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部权限数量
|
||||
*
|
||||
* @return 全部权限数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysPermissionQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改权限
|
||||
*
|
||||
* @param entity 权限
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysPermission entity, SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除权限
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取权限
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 权限
|
||||
*/
|
||||
SysPermission getByQuery(SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取权限列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 权限列表
|
||||
*/
|
||||
List<SysPermission> listByQuery(SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和权限的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和权限的映射
|
||||
*/
|
||||
Map<Long, SysPermission> getIdMapByQuery(SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的权限
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 权限分组
|
||||
*/
|
||||
Map<Long, List<SysPermission>> getIdGroupByQuery(SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取权限数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 权限数量
|
||||
*/
|
||||
Long countByQuery(SysPermissionQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的权限
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysPermissionQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysRolePermission;
|
||||
import com.metalloop.modules.auth.model.query.SysRolePermissionQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色-权限关联 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysRolePermissionService extends ISuperService<SysRolePermission> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建角色-权限关联
|
||||
*
|
||||
* @param sysRolePermission 角色-权限关联
|
||||
* @return 创建后的角色-权限关联
|
||||
*/
|
||||
SysRolePermission create(SysRolePermission sysRolePermission);
|
||||
|
||||
/**
|
||||
* 批量创建角色-权限关联
|
||||
*
|
||||
* @param sysRolePermissions 角色-权限关联列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysRolePermission> sysRolePermissions);
|
||||
|
||||
/**
|
||||
* 获取全部角色-权限关联列表
|
||||
*
|
||||
* @return 全部角色-权限关联列表
|
||||
*/
|
||||
List<SysRolePermission> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新角色-权限关联
|
||||
*
|
||||
* @param sysRolePermissions 角色-权限关联列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysRolePermission> sysRolePermissions);
|
||||
|
||||
/**
|
||||
* 通过ID删除角色-权限关联
|
||||
*
|
||||
* @param id 角色-权限关联ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除角色-权限关联
|
||||
*
|
||||
* @param ids 角色-权限关联ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建角色-权限关联
|
||||
*
|
||||
* @param entity 角色-权限关联
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysRolePermission entity, LockCondition<SysRolePermission>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新角色-权限关联
|
||||
*
|
||||
* @param entity 角色-权限关联
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysRolePermission entity, LockCondition<SysRolePermission>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新角色-权限关联(幂等性)
|
||||
*
|
||||
* @param entity 角色-权限关联
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysRolePermission entity, LockCondition<SysRolePermission>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取角色-权限关联
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 角色-权限关联分页
|
||||
*/
|
||||
Page<SysRolePermission> pageByQuery(long current, long size, SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部角色-权限关联
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部角色-权限关联分页
|
||||
*/
|
||||
Page<SysRolePermission> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和角色-权限关联的映射
|
||||
*
|
||||
* @return ID和角色-权限关联的映射
|
||||
*/
|
||||
Map<String, SysRolePermission> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和角色-权限关联的映射
|
||||
*
|
||||
* @param ids 角色-权限关联ID列表
|
||||
* @return ID和角色-权限关联的映射
|
||||
*/
|
||||
Map<String, SysRolePermission> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和角色-权限关联 列表的分组
|
||||
*
|
||||
* @return ID和角色-权限关联 列表的分组
|
||||
*/
|
||||
Map<String, List<SysRolePermission>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和角色-权限关联 列表的分组
|
||||
*
|
||||
* @param ids 角色-权限关联ID列表
|
||||
* @return ID和角色-权限关联 列表的分组
|
||||
*/
|
||||
Map<String, List<SysRolePermission>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部角色-权限关联数量
|
||||
*
|
||||
* @return 全部角色-权限关联数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysRolePermissionQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改角色-权限关联
|
||||
*
|
||||
* @param entity 角色-权限关联
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysRolePermission entity, SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除角色-权限关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取角色-权限关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色-权限关联
|
||||
*/
|
||||
SysRolePermission getByQuery(SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取角色-权限关联列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色-权限关联列表
|
||||
*/
|
||||
List<SysRolePermission> listByQuery(SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和角色-权限关联的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和角色-权限关联的映射
|
||||
*/
|
||||
Map<Long, SysRolePermission> getIdMapByQuery(SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的角色-权限关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色-权限关联分组
|
||||
*/
|
||||
Map<Long, List<SysRolePermission>> getIdGroupByQuery(SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取角色-权限关联数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色-权限关联数量
|
||||
*/
|
||||
Long countByQuery(SysRolePermissionQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的角色-权限关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysRolePermissionQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysRole;
|
||||
import com.metalloop.modules.auth.model.query.SysRoleQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysRoleService extends ISuperService<SysRole> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建角色
|
||||
*
|
||||
* @param sysRole 角色
|
||||
* @return 创建后的角色
|
||||
*/
|
||||
SysRole create(SysRole sysRole);
|
||||
|
||||
/**
|
||||
* 批量创建角色
|
||||
*
|
||||
* @param sysRoles 角色列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysRole> sysRoles);
|
||||
|
||||
/**
|
||||
* 获取全部角色列表
|
||||
*
|
||||
* @return 全部角色列表
|
||||
*/
|
||||
List<SysRole> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新角色
|
||||
*
|
||||
* @param sysRoles 角色列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysRole> sysRoles);
|
||||
|
||||
/**
|
||||
* 通过ID删除角色
|
||||
*
|
||||
* @param id 角色ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*
|
||||
* @param ids 角色ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建角色
|
||||
*
|
||||
* @param entity 角色
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysRole entity, LockCondition<SysRole>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新角色
|
||||
*
|
||||
* @param entity 角色
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysRole entity, LockCondition<SysRole>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新角色(幂等性)
|
||||
*
|
||||
* @param entity 角色
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysRole entity, LockCondition<SysRole>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取角色
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 角色分页
|
||||
*/
|
||||
Page<SysRole> pageByQuery(long current, long size, SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部角色
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部角色分页
|
||||
*/
|
||||
Page<SysRole> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和角色的映射
|
||||
*
|
||||
* @return ID和角色的映射
|
||||
*/
|
||||
Map<String, SysRole> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和角色的映射
|
||||
*
|
||||
* @param ids 角色ID列表
|
||||
* @return ID和角色的映射
|
||||
*/
|
||||
Map<String, SysRole> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和角色 列表的分组
|
||||
*
|
||||
* @return ID和角色 列表的分组
|
||||
*/
|
||||
Map<String, List<SysRole>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和角色 列表的分组
|
||||
*
|
||||
* @param ids 角色ID列表
|
||||
* @return ID和角色 列表的分组
|
||||
*/
|
||||
Map<String, List<SysRole>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部角色数量
|
||||
*
|
||||
* @return 全部角色数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysRoleQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改角色
|
||||
*
|
||||
* @param entity 角色
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysRole entity, SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除角色
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取角色
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色
|
||||
*/
|
||||
SysRole getByQuery(SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取角色列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色列表
|
||||
*/
|
||||
List<SysRole> listByQuery(SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和角色的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和角色的映射
|
||||
*/
|
||||
Map<Long, SysRole> getIdMapByQuery(SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的角色
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色分组
|
||||
*/
|
||||
Map<Long, List<SysRole>> getIdGroupByQuery(SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取角色数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 角色数量
|
||||
*/
|
||||
Long countByQuery(SysRoleQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的角色
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysRoleQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysUserRole;
|
||||
import com.metalloop.modules.auth.model.query.SysUserRoleQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户与角色关联 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysUserRoleService extends ISuperService<SysUserRole> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建用户与角色关联
|
||||
*
|
||||
* @param sysUserRole 用户与角色关联
|
||||
* @return 创建后的用户与角色关联
|
||||
*/
|
||||
SysUserRole create(SysUserRole sysUserRole);
|
||||
|
||||
/**
|
||||
* 批量创建用户与角色关联
|
||||
*
|
||||
* @param sysUserRoles 用户与角色关联列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysUserRole> sysUserRoles);
|
||||
|
||||
/**
|
||||
* 获取全部用户与角色关联列表
|
||||
*
|
||||
* @return 全部用户与角色关联列表
|
||||
*/
|
||||
List<SysUserRole> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新用户与角色关联
|
||||
*
|
||||
* @param sysUserRoles 用户与角色关联列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysUserRole> sysUserRoles);
|
||||
|
||||
/**
|
||||
* 通过ID删除用户与角色关联
|
||||
*
|
||||
* @param id 用户与角色关联ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户与角色关联
|
||||
*
|
||||
* @param ids 用户与角色关联ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建用户与角色关联
|
||||
*
|
||||
* @param entity 用户与角色关联
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysUserRole entity, LockCondition<SysUserRole>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新用户与角色关联
|
||||
*
|
||||
* @param entity 用户与角色关联
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysUserRole entity, LockCondition<SysUserRole>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新用户与角色关联(幂等性)
|
||||
*
|
||||
* @param entity 用户与角色关联
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysUserRole entity, LockCondition<SysUserRole>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取用户与角色关联
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 用户与角色关联分页
|
||||
*/
|
||||
Page<SysUserRole> pageByQuery(long current, long size, SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部用户与角色关联
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部用户与角色关联分页
|
||||
*/
|
||||
Page<SysUserRole> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和用户与角色关联的映射
|
||||
*
|
||||
* @return ID和用户与角色关联的映射
|
||||
*/
|
||||
Map<String, SysUserRole> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和用户与角色关联的映射
|
||||
*
|
||||
* @param ids 用户与角色关联ID列表
|
||||
* @return ID和用户与角色关联的映射
|
||||
*/
|
||||
Map<String, SysUserRole> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和用户与角色关联 列表的分组
|
||||
*
|
||||
* @return ID和用户与角色关联 列表的分组
|
||||
*/
|
||||
Map<String, List<SysUserRole>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和用户与角色关联 列表的分组
|
||||
*
|
||||
* @param ids 用户与角色关联ID列表
|
||||
* @return ID和用户与角色关联 列表的分组
|
||||
*/
|
||||
Map<String, List<SysUserRole>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部用户与角色关联数量
|
||||
*
|
||||
* @return 全部用户与角色关联数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysUserRoleQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改用户与角色关联
|
||||
*
|
||||
* @param entity 用户与角色关联
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysUserRole entity, SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除用户与角色关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取用户与角色关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户与角色关联
|
||||
*/
|
||||
SysUserRole getByQuery(SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取用户与角色关联列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户与角色关联列表
|
||||
*/
|
||||
List<SysUserRole> listByQuery(SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和用户与角色关联的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和用户与角色关联的映射
|
||||
*/
|
||||
Map<Long, SysUserRole> getIdMapByQuery(SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的用户与角色关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户与角色关联分组
|
||||
*/
|
||||
Map<Long, List<SysUserRole>> getIdGroupByQuery(SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取用户与角色关联数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户与角色关联数量
|
||||
*/
|
||||
Long countByQuery(SysUserRoleQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的用户与角色关联
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysUserRoleQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.metalloop.modules.auth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.ISuperService;
|
||||
import com.metalloop.modules.auth.model.po.SysUser;
|
||||
import com.metalloop.modules.auth.model.query.SysUserQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户 Service
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface SysUserService extends ISuperService<SysUser> {
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
/**
|
||||
* 创建用户
|
||||
*
|
||||
* @param sysUser 用户
|
||||
* @return 创建后的用户
|
||||
*/
|
||||
SysUser create(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 批量创建用户
|
||||
*
|
||||
* @param sysUsers 用户列表
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean batchCreate(List<SysUser> sysUsers);
|
||||
|
||||
/**
|
||||
* 获取全部用户列表
|
||||
*
|
||||
* @return 全部用户列表
|
||||
*/
|
||||
List<SysUser> listAll();
|
||||
|
||||
/**
|
||||
* 批量更新用户
|
||||
*
|
||||
* @param sysUsers 用户列表
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean batchUpdateById(List<SysUser> sysUsers);
|
||||
|
||||
/**
|
||||
* 通过ID删除用户
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户
|
||||
*
|
||||
* @param ids 用户ID列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 幂等性创建用户
|
||||
*
|
||||
* @param entity 用户
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
Boolean createIdempotency(SysUser entity, LockCondition<SysUser>... conditions);
|
||||
|
||||
/**
|
||||
* 通过ID幂等性更新用户
|
||||
*
|
||||
* @param entity 用户
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateByIdIdempotency(SysUser entity, LockCondition<SysUser>... conditions);
|
||||
|
||||
/**
|
||||
* 创建或更新用户(幂等性)
|
||||
*
|
||||
* @param entity 用户
|
||||
* @param conditions 幂等性条件
|
||||
* @return 是否创建或更新成功
|
||||
*/
|
||||
Boolean saveOrUpdateIdempotency(SysUser entity, LockCondition<SysUser>... conditions);
|
||||
|
||||
/**
|
||||
* 通过查询条件进行分页获取用户
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @param query 查询条件
|
||||
* @return 用户分页
|
||||
*/
|
||||
Page<SysUser> pageByQuery(long current, long size, SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 分页获取全部用户
|
||||
*
|
||||
* @param current 当前页数
|
||||
* @param size 每页记录数量
|
||||
* @return 全部用户分页
|
||||
*/
|
||||
Page<SysUser> pageAll(long current, long size);
|
||||
|
||||
/**
|
||||
* 获取ID和用户的映射
|
||||
*
|
||||
* @return ID和用户的映射
|
||||
*/
|
||||
Map<String, SysUser> getIdMap();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和用户的映射
|
||||
*
|
||||
* @param ids 用户ID列表
|
||||
* @return ID和用户的映射
|
||||
*/
|
||||
Map<String, SysUser> getIdMapByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取ID和用户 列表的分组
|
||||
*
|
||||
* @return ID和用户 列表的分组
|
||||
*/
|
||||
Map<String, List<SysUser>> getIdGroup();
|
||||
|
||||
/**
|
||||
* 获取指定ID集合的ID和用户 列表的分组
|
||||
*
|
||||
* @param ids 用户ID列表
|
||||
* @return ID和用户 列表的分组
|
||||
*/
|
||||
Map<String, List<SysUser>> getIdGroupByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取全部用户数量
|
||||
*
|
||||
* @return 全部用户数量
|
||||
*/
|
||||
Long countAll();
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysUserQuery
|
||||
|
||||
/**
|
||||
* 通过查询条件修改用户
|
||||
*
|
||||
* @param entity 用户
|
||||
* @param query 查询条件
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByQuery(SysUser entity, SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件删除用户
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean removeByQuery(SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取用户
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户
|
||||
*/
|
||||
SysUser getByQuery(SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取用户列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<SysUser> listByQuery(SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取ID和用户的映射
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return ID和用户的映射
|
||||
*/
|
||||
Map<Long, SysUser> getIdMapByQuery(SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取分组的用户
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户分组
|
||||
*/
|
||||
Map<Long, List<SysUser>> getIdGroupByQuery(SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 通过查询条件获取用户数量
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 用户数量
|
||||
*/
|
||||
Long countByQuery(SysUserQuery query);
|
||||
|
||||
/**
|
||||
* 检查是否存在符合查询条件的用户
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 是否存在
|
||||
*/
|
||||
Boolean existsByQuery(SysUserQuery query);
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysEnterpriseImageMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterpriseImage;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseImageQuery;
|
||||
import com.metalloop.modules.auth.service.SysEnterpriseImageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 企业图片附件 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysEnterpriseImageServiceImpl extends SuperServiceImpl<SysEnterpriseImageMapper, SysEnterpriseImage> implements SysEnterpriseImageService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysEnterpriseImageMapper sysEnterpriseImageMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysEnterpriseImage create(SysEnterpriseImage sysEnterpriseImage) {
|
||||
save(sysEnterpriseImage);
|
||||
return sysEnterpriseImage;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysEnterpriseImage> sysEnterpriseImages) {
|
||||
return saveBatch(sysEnterpriseImages);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysEnterpriseImage> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysEnterpriseImage> sysEnterpriseImages) {
|
||||
return updateBatchById(sysEnterpriseImages);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysEnterpriseImage entity, LockCondition<SysEnterpriseImage>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean updateByIdIdempotency(SysEnterpriseImage entity, LockCondition<SysEnterpriseImage>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean saveOrUpdateIdempotency(SysEnterpriseImage entity, LockCondition<SysEnterpriseImage>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysEnterpriseImage> pageByQuery(long current, long size, SysEnterpriseImageQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysEnterpriseImage> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysEnterpriseImage> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysEnterpriseImage> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysEnterpriseImage>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysEnterpriseImage>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysEnterpriseImageQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysEnterpriseImage entity, SysEnterpriseImageQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysEnterpriseImageQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysEnterpriseImage getByQuery(SysEnterpriseImageQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysEnterpriseImage> listByQuery(SysEnterpriseImageQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysEnterpriseImage> getIdMapByQuery(SysEnterpriseImageQuery query) {
|
||||
return toMap(SysEnterpriseImage::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysEnterpriseImage>> getIdGroupByQuery(SysEnterpriseImageQuery query) {
|
||||
return toGroup(SysEnterpriseImage::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysEnterpriseImageQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysEnterpriseImageQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysEnterpriseImageMapper;
|
||||
import com.metalloop.modules.auth.mapper.SysEnterpriseMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterprise;
|
||||
import com.metalloop.modules.auth.model.po.SysEnterpriseImage;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseImageQuery;
|
||||
import com.metalloop.modules.auth.model.query.SysEnterpriseQuery;
|
||||
import com.metalloop.modules.auth.service.SysEnterpriseImageService;
|
||||
import com.metalloop.modules.auth.service.SysEnterpriseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 企业信息主 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysEnterpriseServiceImpl extends SuperServiceImpl<SysEnterpriseMapper, SysEnterprise> implements SysEnterpriseService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysEnterpriseMapper sysEnterpriseMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysEnterprise create(SysEnterprise sysEnterprise) {
|
||||
save(sysEnterprise);
|
||||
return sysEnterprise;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysEnterprise> sysEnterprises) {
|
||||
return saveBatch(sysEnterprises);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysEnterprise> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysEnterprise> sysEnterprises) {
|
||||
return updateBatchById(sysEnterprises);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysEnterprise entity, LockCondition<SysEnterprise>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean updateByIdIdempotency(SysEnterprise entity, LockCondition<SysEnterprise>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean saveOrUpdateIdempotency(SysEnterprise entity, LockCondition<SysEnterprise>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysEnterprise> pageByQuery(long current, long size, SysEnterpriseQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysEnterprise> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysEnterprise> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysEnterprise> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysEnterprise>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysEnterprise>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysEnterpriseQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysEnterprise entity, SysEnterpriseQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysEnterpriseQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysEnterprise getByQuery(SysEnterpriseQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysEnterprise> listByQuery(SysEnterpriseQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysEnterprise> getIdMapByQuery(SysEnterpriseQuery query) {
|
||||
return toMap(SysEnterprise::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysEnterprise>> getIdGroupByQuery(SysEnterpriseQuery query) {
|
||||
return toGroup(SysEnterprise::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysEnterpriseQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysEnterpriseQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysPermissionMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysPermission;
|
||||
import com.metalloop.modules.auth.model.query.SysPermissionQuery;
|
||||
import com.metalloop.modules.auth.service.SysPermissionService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 权限 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysPermissionServiceImpl extends SuperServiceImpl<SysPermissionMapper, SysPermission> implements SysPermissionService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysPermissionMapper sysPermissionMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysPermission create(SysPermission sysPermission) {
|
||||
save(sysPermission);
|
||||
return sysPermission;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysPermission> sysPermissions) {
|
||||
return saveBatch(sysPermissions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysPermission> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysPermission> sysPermissions) {
|
||||
return updateBatchById(sysPermissions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysPermission entity, LockCondition<SysPermission>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public final Boolean updateByIdIdempotency(SysPermission entity, LockCondition<SysPermission>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public final Boolean saveOrUpdateIdempotency(SysPermission entity, LockCondition<SysPermission>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysPermission> pageByQuery(long current, long size, SysPermissionQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysPermission> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysPermission> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysPermission> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysPermission>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysPermission>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysPermissionQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysPermission entity, SysPermissionQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysPermissionQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysPermission getByQuery(SysPermissionQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysPermission> listByQuery(SysPermissionQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysPermission> getIdMapByQuery(SysPermissionQuery query) {
|
||||
return toMap(SysPermission::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysPermission>> getIdGroupByQuery(SysPermissionQuery query) {
|
||||
return toGroup(SysPermission::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysPermissionQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysPermissionQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysRolePermissionMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysRolePermission;
|
||||
import com.metalloop.modules.auth.model.query.SysRolePermissionQuery;
|
||||
import com.metalloop.modules.auth.service.SysRolePermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色-权限关联 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysRolePermissionServiceImpl extends SuperServiceImpl<SysRolePermissionMapper, SysRolePermission> implements SysRolePermissionService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysRolePermissionMapper sysRolePermissionMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysRolePermission create(SysRolePermission sysRolePermission) {
|
||||
save(sysRolePermission);
|
||||
return sysRolePermission;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysRolePermission> sysRolePermissions) {
|
||||
return saveBatch(sysRolePermissions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRolePermission> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysRolePermission> sysRolePermissions) {
|
||||
return updateBatchById(sysRolePermissions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysRolePermission entity, LockCondition<SysRolePermission>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean updateByIdIdempotency(SysRolePermission entity, LockCondition<SysRolePermission>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean saveOrUpdateIdempotency(SysRolePermission entity, LockCondition<SysRolePermission>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysRolePermission> pageByQuery(long current, long size, SysRolePermissionQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysRolePermission> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysRolePermission> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysRolePermission> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysRolePermission>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysRolePermission>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysRolePermissionQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysRolePermission entity, SysRolePermissionQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysRolePermissionQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysRolePermission getByQuery(SysRolePermissionQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRolePermission> listByQuery(SysRolePermissionQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysRolePermission> getIdMapByQuery(SysRolePermissionQuery query) {
|
||||
return toMap(SysRolePermission::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysRolePermission>> getIdGroupByQuery(SysRolePermissionQuery query) {
|
||||
return toGroup(SysRolePermission::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysRolePermissionQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysRolePermissionQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysRoleMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysPermission;
|
||||
import com.metalloop.modules.auth.model.po.SysRole;
|
||||
import com.metalloop.modules.auth.model.query.SysRoleQuery;
|
||||
import com.metalloop.modules.auth.service.SysRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysRoleServiceImpl extends SuperServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysRoleMapper sysRoleMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysRole create(SysRole sysRole) {
|
||||
save(sysRole);
|
||||
return sysRole;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysRole> sysRoles) {
|
||||
return saveBatch(sysRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRole> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysRole> sysRoles) {
|
||||
return updateBatchById(sysRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysRole entity, LockCondition<SysRole>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean updateByIdIdempotency(SysRole entity, LockCondition<SysRole>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean saveOrUpdateIdempotency(SysRole entity, LockCondition<SysRole>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysRole> pageByQuery(long current, long size, SysRoleQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysRole> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysRole> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysRole> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysRole>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysRole>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysRoleQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysRole entity, SysRoleQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysRoleQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysRole getByQuery(SysRoleQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRole> listByQuery(SysRoleQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysRole> getIdMapByQuery(SysRoleQuery query) {
|
||||
return toMap(SysRole::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysRole>> getIdGroupByQuery(SysRoleQuery query) {
|
||||
return toGroup(SysRole::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysRoleQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysRoleQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysUserRoleMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysUserRole;
|
||||
import com.metalloop.modules.auth.model.query.SysUserRoleQuery;
|
||||
import com.metalloop.modules.auth.service.SysUserRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户与角色关联 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysUserRoleServiceImpl extends SuperServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysUserRoleMapper sysUserRoleMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysUserRole create(SysUserRole sysUserRole) {
|
||||
save(sysUserRole);
|
||||
return sysUserRole;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysUserRole> sysUserRoles) {
|
||||
return saveBatch(sysUserRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserRole> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysUserRole> sysUserRoles) {
|
||||
return updateBatchById(sysUserRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysUserRole entity, LockCondition<SysUserRole>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean updateByIdIdempotency(SysUserRole entity, LockCondition<SysUserRole>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean saveOrUpdateIdempotency(SysUserRole entity, LockCondition<SysUserRole>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysUserRole> pageByQuery(long current, long size, SysUserRoleQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysUserRole> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysUserRole> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysUserRole> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysUserRole>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysUserRole>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysUserRoleQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysUserRole entity, SysUserRoleQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysUserRoleQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserRole getByQuery(SysUserRoleQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserRole> listByQuery(SysUserRoleQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysUserRole> getIdMapByQuery(SysUserRoleQuery query) {
|
||||
return toMap(SysUserRole::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysUserRole>> getIdGroupByQuery(SysUserRoleQuery query) {
|
||||
return toGroup(SysUserRole::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysUserRoleQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysUserRoleQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.metalloop.modules.auth.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.metalloop.common.core.lock.DistributedLock;
|
||||
import com.metalloop.common.core.lock.LockCondition;
|
||||
import com.metalloop.common.service.impl.SuperServiceImpl;
|
||||
import com.metalloop.modules.auth.mapper.SysUserMapper;
|
||||
import com.metalloop.modules.auth.model.po.SysUser;
|
||||
import com.metalloop.modules.auth.model.query.SysUserQuery;
|
||||
import com.metalloop.modules.auth.service.SysUserService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户 Service 实现类
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("java:S6809")
|
||||
@Service
|
||||
public class SysUserServiceImpl extends SuperServiceImpl<SysUserMapper, SysUser> implements SysUserService {
|
||||
|
||||
@Resource
|
||||
private DistributedLock distributedLock;
|
||||
|
||||
@Resource
|
||||
SysUserMapper sysUserMapper;
|
||||
|
||||
// region 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
|
||||
@Override
|
||||
public SysUser create(SysUser sysUser) {
|
||||
save(sysUser);
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchCreate(List<SysUser> sysUsers) {
|
||||
return saveBatch(sysUsers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> listAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchUpdateById(List<SysUser> sysUsers) {
|
||||
return updateBatchById(sysUsers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchDelete(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean createIdempotency(SysUser entity, LockCondition<SysUser>... conditions) {
|
||||
return saveIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean updateByIdIdempotency(SysUser entity, LockCondition<SysUser>... conditions) {
|
||||
return updateByIdIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@Override
|
||||
public final Boolean saveOrUpdateIdempotency(SysUser entity, LockCondition<SysUser>... conditions) {
|
||||
return saveOrUpdateIdempotency(entity, distributedLock, conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysUser> pageByQuery(long current, long size, SysUserQuery query) {
|
||||
return page(Page.of(current, size), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysUser> pageAll(long current, long size) {
|
||||
return page(Page.of(current, size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysUser> getIdMap() {
|
||||
return toMap(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SysUser> getIdMapByIds(List<String> ids) {
|
||||
return toMap(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysUser>> getIdGroup() {
|
||||
return toGroup(e -> String.valueOf(e.getId()), list());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<SysUser>> getIdGroupByIds(List<String> ids) {
|
||||
return toGroup(e -> String.valueOf(e.getId()), listByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAll() {
|
||||
return count();
|
||||
}
|
||||
|
||||
// region 此区域的方法主要用作示例,禁止滥用,因为Query对象大而全,调用者会很迷惑,必须封装为更具体的参数及签名的方法,如getByCodeAndType(String code, Integer type)。
|
||||
// 除非:确实需要3个及以上参数,方可合并为Query,如SysUserQuery
|
||||
|
||||
@Override
|
||||
public Boolean updateByQuery(SysUser entity, SysUserQuery query) {
|
||||
return update(entity, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeByQuery(SysUserQuery query) {
|
||||
return remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUser getByQuery(SysUserQuery query) {
|
||||
return get(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> listByQuery(SysUserQuery query) {
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SysUser> getIdMapByQuery(SysUserQuery query) {
|
||||
return toMap(SysUser::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<SysUser>> getIdGroupByQuery(SysUserQuery query) {
|
||||
return toGroup(SysUser::getId, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByQuery(SysUserQuery query) {
|
||||
return count(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean existsByQuery(SysUserQuery query) {
|
||||
long count = count(query);
|
||||
return count > 0;
|
||||
}
|
||||
// endregion
|
||||
|
||||
// endregion 自动生成代码区,后续手动添加的代码要放在这个区域之外
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.bussiness.converter;
|
||||
|
||||
import com.metalloop.modules.bussiness.model.req.BizEnterpriseProductQueryReqDto;
|
||||
import com.metalloop.modules.bussiness.model.req.BizEnterpriseProductReqDto;
|
||||
import com.metalloop.modules.bussiness.model.resp.BizEnterpriseProductRespDto;
|
||||
import com.metalloop.modules.bussiness.model.po.BizEnterpriseProduct;
|
||||
import com.metalloop.modules.bussiness.model.query.BizEnterpriseProductQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业经营产品转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface BizEnterpriseProductConverter {
|
||||
|
||||
BizEnterpriseProductConverter INSTANCE = Mappers.getMapper(BizEnterpriseProductConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param bizEnterpriseProduct 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizEnterpriseProductRespDto toRespDto(BizEnterpriseProduct bizEnterpriseProduct);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param bizEnterpriseProducts 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizEnterpriseProductRespDto> toRespDto(List<BizEnterpriseProduct> bizEnterpriseProducts);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param bizEnterpriseProductReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizEnterpriseProduct fromReqDto(BizEnterpriseProductReqDto bizEnterpriseProductReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param bizEnterpriseProductReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizEnterpriseProduct> fromReqDto(List<BizEnterpriseProductReqDto> bizEnterpriseProductReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param bizEnterpriseProductQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizEnterpriseProductQuery fromQueryReqDtoToQuery(BizEnterpriseProductQueryReqDto bizEnterpriseProductQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.bussiness.converter;
|
||||
|
||||
import com.metalloop.modules.bussiness.model.req.BizMaterialQueryReqDto;
|
||||
import com.metalloop.modules.bussiness.model.req.BizMaterialReqDto;
|
||||
import com.metalloop.modules.bussiness.model.resp.BizMaterialRespDto;
|
||||
import com.metalloop.modules.bussiness.model.po.BizMaterial;
|
||||
import com.metalloop.modules.bussiness.model.query.BizMaterialQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务-材质基础转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface BizMaterialConverter {
|
||||
|
||||
BizMaterialConverter INSTANCE = Mappers.getMapper(BizMaterialConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param bizMaterial 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizMaterialRespDto toRespDto(BizMaterial bizMaterial);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param bizMaterials 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizMaterialRespDto> toRespDto(List<BizMaterial> bizMaterials);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param bizMaterialReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizMaterial fromReqDto(BizMaterialReqDto bizMaterialReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param bizMaterialReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizMaterial> fromReqDto(List<BizMaterialReqDto> bizMaterialReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param bizMaterialQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizMaterialQuery fromQueryReqDtoToQuery(BizMaterialQueryReqDto bizMaterialQueryReqDto);
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.bussiness.converter;
|
||||
|
||||
import com.metalloop.modules.bussiness.model.req.BizPurchaseRequestQueryReqDto;
|
||||
import com.metalloop.modules.bussiness.model.req.BizPurchaseRequestReqDto;
|
||||
import com.metalloop.modules.bussiness.model.resp.BizPurchaseRequestRespDto;
|
||||
import com.metalloop.modules.bussiness.model.po.BizPurchaseRequest;
|
||||
import com.metalloop.modules.bussiness.model.query.BizPurchaseRequestQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务-求购信息转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface BizPurchaseRequestConverter {
|
||||
|
||||
BizPurchaseRequestConverter INSTANCE = Mappers.getMapper(BizPurchaseRequestConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param bizPurchaseRequest 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizPurchaseRequestRespDto toRespDto(BizPurchaseRequest bizPurchaseRequest);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param bizPurchaseRequests 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizPurchaseRequestRespDto> toRespDto(List<BizPurchaseRequest> bizPurchaseRequests);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param bizPurchaseRequestReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizPurchaseRequest fromReqDto(BizPurchaseRequestReqDto bizPurchaseRequestReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param bizPurchaseRequestReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizPurchaseRequest> fromReqDto(List<BizPurchaseRequestReqDto> bizPurchaseRequestReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param bizPurchaseRequestQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizPurchaseRequestQuery fromQueryReqDtoToQuery(BizPurchaseRequestQueryReqDto bizPurchaseRequestQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.bussiness.converter;
|
||||
|
||||
import com.metalloop.modules.bussiness.model.req.BizSupplyInfoQueryReqDto;
|
||||
import com.metalloop.modules.bussiness.model.req.BizSupplyInfoReqDto;
|
||||
import com.metalloop.modules.bussiness.model.resp.BizSupplyInfoRespDto;
|
||||
import com.metalloop.modules.bussiness.model.po.BizSupplyInfo;
|
||||
import com.metalloop.modules.bussiness.model.query.BizSupplyInfoQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务-发布信息转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface BizSupplyInfoConverter {
|
||||
|
||||
BizSupplyInfoConverter INSTANCE = Mappers.getMapper(BizSupplyInfoConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param bizSupplyInfo 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizSupplyInfoRespDto toRespDto(BizSupplyInfo bizSupplyInfo);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param bizSupplyInfos 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizSupplyInfoRespDto> toRespDto(List<BizSupplyInfo> bizSupplyInfos);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param bizSupplyInfoReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizSupplyInfo fromReqDto(BizSupplyInfoReqDto bizSupplyInfoReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param bizSupplyInfoReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizSupplyInfo> fromReqDto(List<BizSupplyInfoReqDto> bizSupplyInfoReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param bizSupplyInfoQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizSupplyInfoQuery fromQueryReqDtoToQuery(BizSupplyInfoQueryReqDto bizSupplyInfoQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.metalloop.modules.bussiness.converter;
|
||||
|
||||
import com.metalloop.modules.bussiness.model.req.BizVarietyQueryReqDto;
|
||||
import com.metalloop.modules.bussiness.model.req.BizVarietyReqDto;
|
||||
import com.metalloop.modules.bussiness.model.resp.BizVarietyRespDto;
|
||||
import com.metalloop.modules.bussiness.model.po.BizVariety;
|
||||
import com.metalloop.modules.bussiness.model.query.BizVarietyQuery;
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务-产品品种转换器
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@SuppressWarnings("UnmappedTargetProperties")
|
||||
@Mapper(builder = @Builder(disableBuilder = true))
|
||||
public interface BizVarietyConverter {
|
||||
|
||||
BizVarietyConverter INSTANCE = Mappers.getMapper(BizVarietyConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转换为响应 DTO
|
||||
*
|
||||
* @param bizVariety 实体
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizVarietyRespDto toRespDto(BizVariety bizVariety);
|
||||
|
||||
/**
|
||||
* 实体列表转换为响应 DTO 列表
|
||||
*
|
||||
* @param bizVarietys 实体列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizVarietyRespDto> toRespDto(List<BizVariety> bizVarietys);
|
||||
|
||||
/**
|
||||
* 请求 DTO 转换为实体
|
||||
*
|
||||
* @param bizVarietyReqDto 请求 DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizVariety fromReqDto(BizVarietyReqDto bizVarietyReqDto);
|
||||
|
||||
/**
|
||||
* 请求 DTO 列表转换为实体列表
|
||||
*
|
||||
* @param bizVarietyReqDtos 请求 DTO 列表
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
List<BizVariety> fromReqDto(List<BizVarietyReqDto> bizVarietyReqDtos);
|
||||
|
||||
/**
|
||||
* 查询请求 DTO 转换为查询对象
|
||||
*
|
||||
* @param bizVarietyQueryReqDto 查询请求DTO
|
||||
* @return 转换后的数据
|
||||
*/
|
||||
BizVarietyQuery fromQueryReqDtoToQuery(BizVarietyQueryReqDto bizVarietyQueryReqDto);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.bussiness.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.bussiness.model.po.BizEnterpriseProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 企业经营产品 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizEnterpriseProductMapper extends BaseMapper<BizEnterpriseProduct> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.bussiness.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.bussiness.model.po.BizMaterial;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 业务-材质基础 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizMaterialMapper extends BaseMapper<BizMaterial> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.bussiness.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.bussiness.model.po.BizPurchaseRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 业务-求购信息 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizPurchaseRequestMapper extends BaseMapper<BizPurchaseRequest> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.bussiness.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.bussiness.model.po.BizSupplyInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 业务-发布信息 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizSupplyInfoMapper extends BaseMapper<BizSupplyInfo> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.metalloop.modules.bussiness.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.metalloop.modules.bussiness.model.po.BizVariety;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 业务-产品品种 Mapper
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizVarietyMapper extends BaseMapper<BizVariety> {
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.metalloop.modules.bussiness.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业经营产品
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "企业经营产品")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "biz_enterprise_product")
|
||||
public class BizEnterpriseProduct implements Serializable {
|
||||
|
||||
/**
|
||||
* 记录ID(主键)
|
||||
*/
|
||||
@Schema(description = "记录ID(主键)")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业ID(关联 ent_enterprise 表)
|
||||
*/
|
||||
@Schema(description = "企业ID(关联 ent_enterprise 表)")
|
||||
@TableField(value = "enterprise_id")
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 品种ID(关联 biz_variety 表)
|
||||
*/
|
||||
@Schema(description = "品种ID(关联 biz_variety 表)")
|
||||
@TableField(value = "variety_id")
|
||||
private Long varietyId;
|
||||
|
||||
/**
|
||||
* 材质ID(关联 biz_material 表)
|
||||
*/
|
||||
@Schema(description = "材质ID(关联 biz_material 表)")
|
||||
@TableField(value = "material_id")
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@Schema(description = "单价")
|
||||
@TableField(value = "unit_price")
|
||||
private java.math.BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 可供应重量
|
||||
*/
|
||||
@Schema(description = "可供应重量")
|
||||
@TableField(value = "weight")
|
||||
private java.math.BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 状态(0-下架/停售,1-上架/在售)
|
||||
*/
|
||||
@Schema(description = "状态(0-下架/停售,1-上架/在售)")
|
||||
@TableField(value = "status")
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 备注说明(如:含税价、交货期等)
|
||||
*/
|
||||
@Schema(description = "备注说明(如:含税价、交货期等)")
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private java.util.Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.metalloop.modules.bussiness.model.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 业务-材质基础
|
||||
*
|
||||
* @author yy
|
||||
* @since 2026-09-10
|
||||
*/
|
||||
@Schema(description = "业务-材质基础")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "biz_material")
|
||||
public class BizMaterial implements Serializable {
|
||||
|
||||
/**
|
||||
* 材质ID
|
||||
*/
|
||||
@Schema(description = "材质ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 材质名称
|
||||
*/
|
||||
@Schema(description = "材质名称")
|
||||
@TableField(value = "material_name")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 材质编码
|
||||
*/
|
||||
@Schema(description = "材质编码")
|
||||
@TableField(value = "material_code")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 材质描述
|
||||
*/
|
||||
@Schema(description = "材质描述")
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private java.util.Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user