feat: 用户管理模块开发
This commit is contained in:
@@ -35,5 +35,20 @@
|
||||
<artifactId>jc-club-auth-infra</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>jc-club-auth-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -1,13 +0,0 @@
|
||||
package com.landaiqing;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.landaiqing.auth.domain.convert;
|
||||
|
||||
import com.landaiqing.auth.domain.entity.AuthPermissionBO;
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthPermission;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 权限bo转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthPermissionBOConverter {
|
||||
|
||||
AuthPermissionBOConverter INSTANCE = Mappers.getMapper(AuthPermissionBOConverter.class);
|
||||
|
||||
AuthPermission convertBOToEntity(AuthPermissionBO authPermissionBO);
|
||||
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.landaiqing.auth.domain.convert;
|
||||
|
||||
import com.landaiqing.auth.domain.entity.AuthRoleBO;
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRole;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 角色bo转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthRoleBOConverter {
|
||||
|
||||
AuthRoleBOConverter INSTANCE = Mappers.getMapper(AuthRoleBOConverter.class);
|
||||
|
||||
AuthRole convertBOToEntity(AuthRoleBO authRoleBO);
|
||||
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package com.landaiqing.auth.domain.convert;
|
||||
|
||||
import com.landaiqing.auth.domain.entity.AuthUserBO;
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUser;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 用户bo转换器
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthUserBOConverter {
|
||||
|
||||
AuthUserBOConverter INSTANCE = Mappers.getMapper(AuthUserBOConverter.class);
|
||||
|
||||
AuthUser convertBOToEntity(AuthUserBO authUserBO);
|
||||
|
||||
AuthUserBO convertEntityToBO(AuthUser authUser);
|
||||
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.landaiqing.auth.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 权限dto
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2023/11/3
|
||||
*/
|
||||
@Data
|
||||
public class AuthPermissionBO 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.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 角色bo
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2023/11/2
|
||||
*/
|
||||
@Data
|
||||
public class AuthRoleBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleKey;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package com.landaiqing.auth.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRolePermission)实体类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2023-11-04 22:16:00
|
||||
*/
|
||||
@Data
|
||||
public class AuthRolePermissionBO 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.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用戶信息dto
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2023/11/1
|
||||
*/
|
||||
@Data
|
||||
public class AuthUserBO 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;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,21 @@
|
||||
package com.landaiqing.auth.domain.service;
|
||||
|
||||
|
||||
import com.landaiqing.auth.domain.entity.AuthUserBO;
|
||||
|
||||
/**
|
||||
* 用户领域service
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
public interface AuthUserDomainService {
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
Boolean register(AuthUserBO authUserBO);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package com.landaiqing.auth.domain.service.impl;
|
||||
|
||||
import com.landaiqing.auth.common.enums.AuthUserStatusEnum;
|
||||
import com.landaiqing.auth.common.enums.IsDeletedFlagEnum;
|
||||
import com.landaiqing .auth.domain.convert.AuthUserBOConverter;
|
||||
import com.landaiqing.auth.domain.entity.AuthUserBO;
|
||||
import com.landaiqing.auth.domain.service.AuthUserDomainService;
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUser;
|
||||
import com.landaiqing.auth.infra.basic.service.AuthUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AuthUserDomainServiceImpl implements AuthUserDomainService {
|
||||
|
||||
@Resource
|
||||
private AuthUserService authUserService;
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean register(AuthUserBO authUserBO) {
|
||||
AuthUser authUser = AuthUserBOConverter.INSTANCE.convertBOToEntity(authUserBO);
|
||||
authUser.setStatus(AuthUserStatusEnum.OPEN.getCode());
|
||||
authUser.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
|
||||
Integer count = authUserService.insert(authUser);
|
||||
return count > 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user