From 1c44f5ec1fb54fe08c4a9aa588f7d528aae3f33d Mon Sep 17 00:00:00 2001 From: Lierbao Date: Wed, 4 Jan 2023 16:54:41 +0800 Subject: [PATCH] userInfo userAuth --- ningda-generator/pom.xml | 7 +- .../generator/config/GeneratorCodeConfig.java | 6 +- .../pmapi/common/errorcode/AppErrorCode.java | 1 + .../pmapi/user/controller/UserAuthController.java | 20 ++ .../pmapi/user/controller/UserInfoController.java | 20 ++ .../com/ningdatech/pmapi/user/entity/UserAuth.java | 102 ++++++++++ .../com/ningdatech/pmapi/user/entity/UserInfo.java | 208 +++++++++++++++++++++ .../pmapi/user/mapper/UserAuthMapper.java | 16 ++ .../pmapi/user/mapper/UserAuthMapper.xml | 5 + .../pmapi/user/mapper/UserInfoMapper.java | 16 ++ .../pmapi/user/mapper/UserInfoMapper.xml | 5 + .../pmapi/user/service/IUserAuthService.java | 16 ++ .../pmapi/user/service/IUserInfoService.java | 16 ++ .../user/service/impl/UserAuthServiceImpl.java | 20 ++ .../user/service/impl/UserInfoServiceImpl.java | 20 ++ 15 files changed, 469 insertions(+), 9 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserAuthService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserAuthServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java diff --git a/ningda-generator/pom.xml b/ningda-generator/pom.xml index f83e876..761d999 100644 --- a/ningda-generator/pom.xml +++ b/ningda-generator/pom.xml @@ -26,14 +26,9 @@ freemarker - - - - org.postgresql - postgresql diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java index 12e7db1..4ac906e 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java @@ -13,13 +13,13 @@ import java.util.Collections; */ public class GeneratorCodeConfig { - private static final String PATH_LXX = ""; + private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/project-management/pmapi/src/main/java"; private static final String PATH_YYD = ""; private static final String PATH_LS = ""; private static final String PATH_ZPF = ""; private static final String PATH_CMM = ""; - private static final String URL = "jdbc:mysql://47.98.125.47:3306/car_rental?" + + private static final String URL = "jdbc:mysql://47.98.125.47:3306/nd_project_management?" + "useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&" + "useSSL=false&serverTimezone=Asia/Shanghai"; private static final String USER_NAME = "root"; @@ -58,7 +58,7 @@ public class GeneratorCodeConfig { } public static void main(String[] args) { - generate("Liuxinxin", "null", PATH_LXX, "null"); + generate("Liuxinxin", "user", PATH_LXX, "nd_user_auth", "nd_user_info"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/errorcode/AppErrorCode.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/errorcode/AppErrorCode.java index 40a8f06..547ef40 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/errorcode/AppErrorCode.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/errorcode/AppErrorCode.java @@ -14,4 +14,5 @@ public enum AppErrorCode { public Integer getCode() { return code; } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java new file mode 100644 index 0000000..233a7a5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.user.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 用户鉴权表 前端控制器 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +@Controller +@RequestMapping("/pmapi.user/user-auth") +public class UserAuthController { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java new file mode 100644 index 0000000..971fddc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.user.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 用户信息表 前端控制器 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +@Controller +@RequestMapping("/pmapi.user/user-info") +public class UserInfoController { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java new file mode 100644 index 0000000..b799c2b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java @@ -0,0 +1,102 @@ +package com.ningdatech.pmapi.user.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * 用户鉴权表 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +@TableName("nd_user_auth") +@ApiModel(value = "UserAuth对象", description = "用户鉴权表") +public class UserAuth implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + private Long userId; + + private String authType; + + private String identifier; + + private String credential; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public LocalDateTime getCreateOn() { + return createOn; + } + + public void setCreateOn(LocalDateTime createOn) { + this.createOn = createOn; + } + public LocalDateTime getUpdateOn() { + return updateOn; + } + + public void setUpdateOn(LocalDateTime updateOn) { + this.updateOn = updateOn; + } + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + public String getAuthType() { + return authType; + } + + public void setAuthType(String authType) { + this.authType = authType; + } + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + public String getCredential() { + return credential; + } + + public void setCredential(String credential) { + this.credential = credential; + } + + @Override + public String toString() { + return "UserAuth{" + + "id=" + id + + ", createOn=" + createOn + + ", updateOn=" + updateOn + + ", userId=" + userId + + ", authType=" + authType + + ", identifier=" + identifier + + ", credential=" + credential + + "}"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java new file mode 100644 index 0000000..22c5490 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java @@ -0,0 +1,208 @@ +package com.ningdatech.pmapi.user.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * 用户信息表 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +@TableName("nd_user_info") +@ApiModel(value = "UserInfo对象", description = "用户信息表") +public class UserInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("最后修改时间") + private LocalDateTime updateOn; + + @ApiModelProperty("创建人") + private Long createBy; + + @ApiModelProperty("最后修改人") + private Long updateBy; + + @ApiModelProperty("用户名(登陆账号)") + private String username; + + @ApiModelProperty("手机") + private String mobile; + + @ApiModelProperty("用户真实姓名") + private String realName; + + @ApiModelProperty("所属公司id") + private Long companyId; + + @ApiModelProperty("所属公司名称") + private String companyName; + + @ApiModelProperty("用户角色") + private String role; + + @ApiModelProperty("区域id") + private Long regionCode; + + @ApiModelProperty("头像文件id") + private Long avatarFileId; + + @ApiModelProperty("所负责的公司id列表") + private String manageCompanyIds; + + @ApiModelProperty("是否删除") + private Boolean deleted; + + @ApiModelProperty("身份证号") + private String idCard; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public LocalDateTime getCreateOn() { + return createOn; + } + + public void setCreateOn(LocalDateTime createOn) { + this.createOn = createOn; + } + public LocalDateTime getUpdateOn() { + return updateOn; + } + + public void setUpdateOn(LocalDateTime updateOn) { + this.updateOn = updateOn; + } + public Long getCreateBy() { + return createBy; + } + + public void setCreateBy(Long createBy) { + this.createBy = createBy; + } + public Long getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(Long updateBy) { + this.updateBy = updateBy; + } + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + public Long getRegionCode() { + return regionCode; + } + + public void setRegionCode(Long regionCode) { + this.regionCode = regionCode; + } + public Long getAvatarFileId() { + return avatarFileId; + } + + public void setAvatarFileId(Long avatarFileId) { + this.avatarFileId = avatarFileId; + } + public String getManageCompanyIds() { + return manageCompanyIds; + } + + public void setManageCompanyIds(String manageCompanyIds) { + this.manageCompanyIds = manageCompanyIds; + } + public Boolean getDeleted() { + return deleted; + } + + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + @Override + public String toString() { + return "UserInfo{" + + "id=" + id + + ", createOn=" + createOn + + ", updateOn=" + updateOn + + ", createBy=" + createBy + + ", updateBy=" + updateBy + + ", username=" + username + + ", mobile=" + mobile + + ", realName=" + realName + + ", companyId=" + companyId + + ", companyName=" + companyName + + ", role=" + role + + ", regionCode=" + regionCode + + ", avatarFileId=" + avatarFileId + + ", manageCompanyIds=" + manageCompanyIds + + ", deleted=" + deleted + + ", idCard=" + idCard + + "}"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.java new file mode 100644 index 0000000..05d4e91 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.user.mapper; + +import com.ningdatech.pmapi.user.entity.UserAuth; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 用户鉴权表 Mapper 接口 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +public interface UserAuthMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.xml new file mode 100644 index 0000000..bf07038 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.java new file mode 100644 index 0000000..be92ee4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.user.mapper; + +import com.ningdatech.pmapi.user.entity.UserInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 用户信息表 Mapper 接口 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +public interface UserInfoMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.xml new file mode 100644 index 0000000..acb1729 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserAuthService.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserAuthService.java new file mode 100644 index 0000000..6de3e0a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserAuthService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.user.service; + +import com.ningdatech.pmapi.user.entity.UserAuth; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户鉴权表 服务类 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +public interface IUserAuthService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java new file mode 100644 index 0000000..caf95c4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.user.service; + +import com.ningdatech.pmapi.user.entity.UserInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户信息表 服务类 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +public interface IUserInfoService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserAuthServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserAuthServiceImpl.java new file mode 100644 index 0000000..aacda5b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserAuthServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.user.service.impl; + +import com.ningdatech.pmapi.user.entity.UserAuth; +import com.ningdatech.pmapi.user.mapper.UserAuthMapper; +import com.ningdatech.pmapi.user.service.IUserAuthService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户鉴权表 服务实现类 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +@Service +public class UserAuthServiceImpl extends ServiceImpl implements IUserAuthService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java new file mode 100644 index 0000000..602dac4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.user.service.impl; + +import com.ningdatech.pmapi.user.entity.UserInfo; +import com.ningdatech.pmapi.user.mapper.UserInfoMapper; +import com.ningdatech.pmapi.user.service.IUserInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户信息表 服务实现类 + *

+ * + * @author Liuxinxin + * @since 2023-01-04 + */ +@Service +public class UserInfoServiceImpl extends ServiceImpl implements IUserInfoService { + +}