feat: 修改模块名称
This commit is contained in:
33
qing-yu-club-auth/qing-yu-club-auth-application/pom.xml
Normal file
33
qing-yu-club-auth/qing-yu-club-auth-application/pom.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>qing-yu-club-auth-application</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>qing-yu-club-auth-application</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<modules>
|
||||
<module>qing-yu-club-auth-application-controller</module>
|
||||
<module>qing-yu-club-auth-application-job</module>
|
||||
<module>qing-yu-club-auth-application-mq</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,38 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth-application</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>qing-yu-club-auth-application-controller</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>qing-yu-club-auth-application-controller</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth-domain</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,36 @@
|
||||
package com.landaiqing.auth.application.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname GlobalConfig
|
||||
* @BelongsProject: qing-yu-club
|
||||
* @BelongsPackage: com.landaiqing.subject.application.config
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-02-16 15:57
|
||||
* @Description: MVC全局处理
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class GlobalConfig extends WebMvcConfigurationSupport {
|
||||
@Override
|
||||
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
super.configureMessageConverters(converters);
|
||||
converters.add(mappingJackson2HttpMessageConverter());
|
||||
}
|
||||
private MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(){
|
||||
ObjectMapper objectMapper=new ObjectMapper();
|
||||
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false);
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
MappingJackson2HttpMessageConverter converter=new MappingJackson2HttpMessageConverter(objectMapper);
|
||||
return converter;
|
||||
}
|
||||
}
|
@@ -0,0 +1,102 @@
|
||||
package com.landaiqing.auth.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.landaiqing.auth.application.convert.AuthPermissionDTOConverter;
|
||||
import com.landaiqing.auth.application.dto.AuthPermissionDTO;
|
||||
import com.landaiqing.auth.domain.entity.AuthPermissionBO;
|
||||
import com.landaiqing.auth.domain.service.AuthPermissionDomainService;
|
||||
import com.landaiqing.auth.common.entity.Result;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 权限controller
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/permission/")
|
||||
@Slf4j
|
||||
public class PermissionController {
|
||||
|
||||
@Resource
|
||||
private AuthPermissionDomainService authPermissionDomainService;
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result<Boolean> add(@RequestBody AuthPermissionDTO authPermissionDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("PermissionController.add.dto:{}", JSON.toJSONString(authPermissionDTO));
|
||||
}
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(authPermissionDTO.getName()), "权限名称不能为空");
|
||||
Preconditions.checkNotNull(authPermissionDTO.getParentId(), "权限父id不能为空");
|
||||
AuthPermissionBO permissionBO = AuthPermissionDTOConverter.INSTANCE.convertDTOToBO(authPermissionDTO);
|
||||
return Result.ok(authPermissionDomainService.add(permissionBO));
|
||||
} catch (Exception e) {
|
||||
log.error("PermissionController.add.error:{}", e.getMessage(), e);
|
||||
return Result.fail("新增权限失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限
|
||||
*/
|
||||
@RequestMapping("update")
|
||||
public Result<Boolean> update(@RequestBody AuthPermissionDTO authPermissionDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("PermissionController.update.dto:{}", JSON.toJSONString(authPermissionDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(authPermissionDTO.getId(), "权限id不能为空");
|
||||
AuthPermissionBO permissionBO = AuthPermissionDTOConverter.INSTANCE.convertDTOToBO(authPermissionDTO);
|
||||
return Result.ok(authPermissionDomainService.update(permissionBO));
|
||||
} catch (Exception e) {
|
||||
log.error("PermissionController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("更新权限信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
*/
|
||||
@RequestMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody AuthPermissionDTO authPermissionDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("PermissionController.delete.dto:{}", JSON.toJSONString(authPermissionDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(authPermissionDTO.getId(), "权限id不能为空");
|
||||
AuthPermissionBO permissionBO = AuthPermissionDTOConverter.INSTANCE.convertDTOToBO(authPermissionDTO);
|
||||
return Result.ok(authPermissionDomainService.delete(permissionBO));
|
||||
} catch (Exception e) {
|
||||
log.error("PermissionController.delete.error:{}", e.getMessage(), e);
|
||||
return Result.fail("删除权限信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户权限
|
||||
*/
|
||||
@RequestMapping("getPermission")
|
||||
public Result<Boolean> getPermission(String userName) {
|
||||
try {
|
||||
log.info("PermissionController.getPermission.userName:{}",userName);
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(userName), "用户id不能为空");
|
||||
return Result.ok(authPermissionDomainService.getPermission(userName));
|
||||
} catch (Exception e) {
|
||||
log.error("PermissionController.getPermission.error:{}", e.getMessage(), e);
|
||||
return Result.fail("查询用户权限信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,90 @@
|
||||
package com.landaiqing.auth.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.landaiqing.auth.application.convert.AuthRoleDTOConverter;
|
||||
import com.landaiqing.auth.application.dto.AuthRoleDTO;
|
||||
import com.landaiqing.auth.common.entity.Result;
|
||||
import com.landaiqing.auth.domain.entity.AuthRoleBO;
|
||||
import com.landaiqing.auth.domain.service.AuthRoleDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Classname RoleController
|
||||
* @BelongsProject: qing-yu-club
|
||||
* @BelongsPackage: com.landaiqing.auth.application.controller
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-02-19 15:34
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/role/")
|
||||
@Slf4j
|
||||
public class RoleController {
|
||||
@Resource
|
||||
private AuthRoleDomainService authRoleDomainService;
|
||||
/**
|
||||
* @description: 新增角色
|
||||
* @param: [authRoleDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/2/19 15:36
|
||||
*/
|
||||
@PostMapping("add")
|
||||
public Result<Boolean> add(@RequestBody AuthRoleDTO authRoleDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("RoleController.add.dto:{}", JSON.toJSONString(authRoleDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(authRoleDTO.getRoleName(),"角色名称不能为空");
|
||||
Preconditions.checkNotNull(authRoleDTO.getRoleKey(),"角色Key不能为空");
|
||||
AuthRoleBO authRoleBO = AuthRoleDTOConverter.INSTANCE.convertDTOToBO(authRoleDTO);
|
||||
return Result.ok(authRoleDomainService.add(authRoleBO));
|
||||
} catch (Exception e) {
|
||||
log.error("RoleController.add.error:{}", e.getMessage(), e);
|
||||
return Result.fail("新增角色失败");
|
||||
}
|
||||
}
|
||||
@PostMapping("update")
|
||||
public Result<Boolean> update(@RequestBody AuthRoleDTO authRoleDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("RoleController.update.dto:{}", JSON.toJSONString(authRoleDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(authRoleDTO.getId(),"角色id不能为空");
|
||||
|
||||
AuthRoleBO authRoleBO = AuthRoleDTOConverter.INSTANCE.convertDTOToBO(authRoleDTO);
|
||||
return Result.ok(authRoleDomainService.update(authRoleBO));
|
||||
} catch (Exception e) {
|
||||
log.error("RoleController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("更新角色信息失败");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 删除角色
|
||||
* @param: [authRoleDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/2/19 15:53
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody AuthRoleDTO authRoleDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("RoleController.delete.dto:{}", JSON.toJSONString(authRoleDTO));
|
||||
}
|
||||
AuthRoleBO authRoleBO = AuthRoleDTOConverter.INSTANCE.convertDTOToBO(authRoleDTO);
|
||||
return Result.ok(authRoleDomainService.delete(authRoleBO));
|
||||
} catch (Exception e) {
|
||||
log.error("RoleController.delete.error:{}", e.getMessage(), e);
|
||||
return Result.fail("删除角色信息失败");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package com.landaiqing.auth.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.landaiqing.auth.application.convert.AuthRolePermissionDTOConverter;
|
||||
import com.landaiqing.auth.application.dto.AuthRolePermissionDTO;
|
||||
import com.landaiqing.auth.common.entity.Result;
|
||||
import com.landaiqing.auth.domain.entity.AuthRolePermissionBO;
|
||||
import com.landaiqing.auth.domain.service.AuthRolePermissionDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 角色权限controller
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rolePermission/")
|
||||
@Slf4j
|
||||
public class RolePermissionController {
|
||||
|
||||
@Resource
|
||||
private AuthRolePermissionDomainService authRolePermissionDomainService;
|
||||
|
||||
/**
|
||||
* 新增角色权限关联关系
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result<Boolean> add(@RequestBody AuthRolePermissionDTO authRolePermissionDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("RolePermissionController.add.dto:{}", JSON.toJSONString(authRolePermissionDTO));
|
||||
}
|
||||
Preconditions.checkArgument(!CollectionUtils.isEmpty(authRolePermissionDTO.getPermissionIdList()),"权限关联不能为空");
|
||||
Preconditions.checkNotNull(authRolePermissionDTO.getRoleId(),"角色不能为空!");
|
||||
AuthRolePermissionBO rolePermissionBO = AuthRolePermissionDTOConverter.INSTANCE.convertDTOToBO(authRolePermissionDTO);
|
||||
return Result.ok(authRolePermissionDomainService.add(rolePermissionBO));
|
||||
} catch (Exception e) {
|
||||
log.error("PermissionController.add.error:{}", e.getMessage(), e);
|
||||
return Result.fail("新增角色权限失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,126 @@
|
||||
package com.landaiqing.auth.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.landaiqing.auth.application.convert.AuthUserDTOConverter;
|
||||
import com.landaiqing.auth.application.dto.AuthUserDTO;
|
||||
import com.landaiqing.auth.common.entity.Result;
|
||||
import com.landaiqing.auth.domain.entity.AuthUserBO;
|
||||
import com.landaiqing.auth.domain.service.AuthUserDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Classname UserController
|
||||
* @BelongsProject: qing-yu-club
|
||||
* @BelongsPackage: com.landaiqing.auth.application.controller
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-02-19 13:46
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/")
|
||||
@Slf4j
|
||||
public class UserController {
|
||||
|
||||
@Resource
|
||||
private AuthUserDomainService authUserDomainService;
|
||||
/**
|
||||
* @description: 用户注册
|
||||
* @param: []
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/2/19 13:57
|
||||
*/
|
||||
@PostMapping("register")
|
||||
public Result<Boolean> register(@RequestBody AuthUserDTO authUserDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("UserController.register.dto:{}", JSON.toJSONString(authUserDTO));
|
||||
}
|
||||
checkUserInfo(authUserDTO);
|
||||
AuthUserBO authUserBO = AuthUserDTOConverter.INSTANCE.convertDTOToBO(authUserDTO);
|
||||
return Result.ok(authUserDomainService.register(authUserBO));
|
||||
} catch (Exception e) {
|
||||
log.error("UserController.register.error:{}", e.getMessage(), e);
|
||||
return Result.fail("注册用户失败");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 修改用户信息
|
||||
* @param: [authUserDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/2/19 14:38
|
||||
*/
|
||||
@PostMapping("update")
|
||||
public Result<Boolean> update(@RequestBody AuthUserDTO authUserDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("UserController.update.dto:{}", JSON.toJSONString(authUserDTO));
|
||||
}
|
||||
checkUserInfo(authUserDTO);
|
||||
AuthUserBO authUserBO = AuthUserDTOConverter.INSTANCE.convertDTOToBO(authUserDTO);
|
||||
return Result.ok(authUserDomainService.update(authUserBO));
|
||||
} catch (Exception e) {
|
||||
log.error("UserController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("更新用户信息失败");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 用户启用/禁用
|
||||
* @param: [authUserDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/2/19 14:56
|
||||
*/
|
||||
@PostMapping("changeStatus")
|
||||
public Result<Boolean> changeStatus(@RequestBody AuthUserDTO authUserDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("UserController.changeStatus.dto:{}", JSON.toJSONString(authUserDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(authUserDTO.getStatus(),"用户名状态不能为空");
|
||||
AuthUserBO authUserBO = AuthUserDTOConverter.INSTANCE.convertDTOToBO(authUserDTO);
|
||||
return Result.ok(authUserDomainService.update(authUserBO));
|
||||
} catch (Exception e) {
|
||||
log.error("UserController.changeStatus.error:{}", e.getMessage(), e);
|
||||
return Result.fail("启用/禁用用户信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 删除用户
|
||||
* @param: [authUserDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/2/19 14:50
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody AuthUserDTO authUserDTO){
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("UserController.update.dto:{}", JSON.toJSONString(authUserDTO));
|
||||
}
|
||||
AuthUserBO authUserBO = AuthUserDTOConverter.INSTANCE.convertDTOToBO(authUserDTO);
|
||||
return Result.ok(authUserDomainService.delete(authUserBO));
|
||||
} catch (Exception e) {
|
||||
log.error("UserController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("删除用户信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkUserInfo(@RequestBody AuthUserDTO authUserDTO) {
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(authUserDTO.getUserName()),"用户名不能为空");
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(authUserDTO.getEmail()),"邮箱不能为空");
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(authUserDTO.getPassword()),"密码不能为空");
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.landaiqing.auth.application.convert;
|
||||
|
||||
import com.landaiqing.auth.application.dto.AuthPermissionDTO;
|
||||
import com.landaiqing.auth.domain.entity.AuthPermissionBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 权限dto转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthPermissionDTOConverter {
|
||||
|
||||
AuthPermissionDTOConverter INSTANCE = Mappers.getMapper(AuthPermissionDTOConverter.class);
|
||||
|
||||
AuthPermissionBO convertDTOToBO(AuthPermissionDTO authPermissionDTO);
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.landaiqing.auth.application.convert;
|
||||
|
||||
import com.landaiqing.auth.application.dto.AuthRoleDTO;
|
||||
import com.landaiqing.auth.domain.entity.AuthRoleBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 角色dto转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthRoleDTOConverter {
|
||||
|
||||
AuthRoleDTOConverter INSTANCE = Mappers.getMapper(AuthRoleDTOConverter.class);
|
||||
|
||||
AuthRoleBO convertDTOToBO(AuthRoleDTO authRoleDTO);
|
||||
|
||||
AuthRoleDTO convertBOToDTO(AuthRoleBO authRoleBO);
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.landaiqing.auth.application.convert;
|
||||
|
||||
import com.landaiqing.auth.application.dto.AuthRolePermissionDTO;
|
||||
import com.landaiqing.auth.domain.entity.AuthRolePermissionBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 权限dto转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthRolePermissionDTOConverter {
|
||||
|
||||
AuthRolePermissionDTOConverter INSTANCE = Mappers.getMapper(AuthRolePermissionDTOConverter.class);
|
||||
|
||||
AuthRolePermissionBO convertDTOToBO(AuthRolePermissionDTO authRolePermissionDTO);
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.landaiqing.auth.application.convert;
|
||||
|
||||
import com.landaiqing.auth.application.dto.AuthUserDTO;
|
||||
import com.landaiqing.auth.domain.entity.AuthUserBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 用户dto转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthUserDTOConverter {
|
||||
|
||||
AuthUserDTOConverter INSTANCE = Mappers.getMapper(AuthUserDTOConverter.class);
|
||||
|
||||
AuthUserBO convertDTOToBO(AuthUserDTO authUserDTO);
|
||||
|
||||
AuthUserDTO convertBOToDTO(AuthUserBO authUserBO);
|
||||
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.landaiqing.auth.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限dto
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@Data
|
||||
public class AuthPermissionDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String menuUrl;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer show;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String permissionKey;
|
||||
}
|
||||
|
@@ -0,0 +1,23 @@
|
||||
package com.landaiqing.auth.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色dto
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@Data
|
||||
public class AuthRoleDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleKey;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,25 @@
|
||||
package com.landaiqing.auth.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRolePermission)实体类
|
||||
*
|
||||
* @author landaiqing
|
||||
*/
|
||||
@Data
|
||||
public class AuthRolePermissionDTO implements Serializable {
|
||||
private static final long serialVersionUID = 459343371709166261L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
private Long permissionId;
|
||||
|
||||
private List<Long> permissionIdList;
|
||||
}
|
||||
|
@@ -0,0 +1,39 @@
|
||||
package com.landaiqing.auth.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (AuthUser)DTO
|
||||
*/
|
||||
@Data
|
||||
public class AuthUserDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private String email;
|
||||
|
||||
private String phone;
|
||||
|
||||
private String password;
|
||||
|
||||
private Integer sex;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String introduce;
|
||||
|
||||
private String extJson;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,28 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth-application</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>qing-yu-club-auth-application-job</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>qing-yu-club-auth-application-job</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,13 @@
|
||||
package com.landaiqing;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.landaiqing;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth-application</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>qing-yu-club-auth-application-mq</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>qing-yu-club-auth-application-mq</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,13 @@
|
||||
package com.landaiqing;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.landaiqing;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user