Woody 2 lat temu
commit
83c92327c6

+ 48 - 0
.gitignore

@@ -0,0 +1,48 @@
+# Compiled class file
+*.class
+*.classpath
+*.factorypath
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+# IDE Files #
+*.iml
+.idea
+.idea/
+.project
+.settings
+target
+.DS_Store
+
+# temp ignore
+*.cache
+*.diff
+*.patch
+*.tmp
+
+# Maven ignore
+.flattened-pom.xml
+
+# Commitizen
+CHANGELOG.md
+node_modules/
+package-lock.json
+package.json

+ 1 - 0
lombok.config

@@ -0,0 +1 @@
+lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier

+ 44 - 0
pom.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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.chelvc.platform</groupId>
+        <artifactId>platform-cloud</artifactId>
+        <version>1.0.0-RELEASE</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>com.chelvc.cloud</groupId>
+    <artifactId>admin</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+
+    <properties>
+        <uc-api.version>1.0.0-SNAPSHOT</uc-api.version>
+        <platform-redis.version>1.0.0-RELEASE</platform-redis.version>
+        <platform-security.version>1.0.0-RELEASE</platform-security.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.chelvc.cloud</groupId>
+            <artifactId>uc-api</artifactId>
+            <version>${uc-api.version}</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.chelvc.platform</groupId>
+            <artifactId>platform-redis</artifactId>
+            <version>${platform-redis.version}</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.chelvc.platform</groupId>
+            <artifactId>platform-security</artifactId>
+            <version>${platform-security.version}</version>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+</project>

+ 17 - 0
src/main/java/com/chelvc/cloud/admin/AdminServer.java

@@ -0,0 +1,17 @@
+package com.chelvc.cloud.admin;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * 后台管理服务启动类
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@SpringBootApplication(scanBasePackages = "com.chelvc")
+public class AdminServer {
+    public static void main(String[] args) {
+        SpringApplication.run(AdminServer.class);
+    }
+}

+ 83 - 0
src/main/java/com/chelvc/cloud/admin/controller/ClientController.java

@@ -0,0 +1,83 @@
+package com.chelvc.cloud.admin.controller;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+import com.chelvc.cloud.uc.api.dto.ClientDTO;
+import com.chelvc.cloud.uc.api.param.ClientModifyParam;
+import com.chelvc.cloud.uc.api.param.ClientPagingParam;
+import com.chelvc.cloud.uc.api.service.ClientService;
+import com.chelvc.platform.base.annotation.UnifiedResponseBody;
+import com.chelvc.platform.base.model.Pagination;
+import com.chelvc.platform.base.util.ErrorUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 客户端接口
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@Validated
+@RestController
+@UnifiedResponseBody
+@PreAuthorize("isType('ADMIN')")
+public class ClientController {
+    @DubboReference
+    private ClientService clientService;
+
+    /**
+     * 新增客户端
+     *
+     * @param param 新增参数
+     * @return 客户端主键
+     */
+    @PostMapping("/client")
+    public Long addClient(@RequestBody @Valid ClientModifyParam param) {
+        return this.clientService.addClient(param);
+    }
+
+    /**
+     * 修改客户端
+     *
+     * @param id    客户端主键
+     * @param param 修改参数
+     */
+    @PutMapping("/client/{id}")
+    public void updateClient(@PathVariable("id") @Min(value = 1, message = "客户端主键不能小于1") Long id,
+                             @RequestBody @Valid ClientModifyParam param) {
+        this.clientService.updateClient(id, param);
+    }
+
+    /**
+     * 获取客户端信息
+     *
+     * @param id 客户端主键
+     * @return 客户端信息
+     */
+    @GetMapping("/client/{id}")
+    public ClientDTO getClient(@PathVariable("id") @Min(value = 1, message = "客户端主键不能小于1") Long id) {
+        ClientDTO client = this.clientService.getClient(id);
+        ErrorUtils.requireResource(client, "客户端不存在");
+        return client;
+    }
+
+    /**
+     * 查询客户端分页
+     *
+     * @param param 查询参数
+     * @return 客户端分页信息
+     */
+    @GetMapping("/client/paging")
+    public Pagination<ClientDTO> getClientPaging(@Valid ClientPagingParam param) {
+        return this.clientService.getClientPaging(param);
+    }
+}

+ 83 - 0
src/main/java/com/chelvc/cloud/admin/controller/DepartmentController.java

@@ -0,0 +1,83 @@
+package com.chelvc.cloud.admin.controller;
+
+import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+import com.chelvc.cloud.uc.api.dto.DepartmentDTO;
+import com.chelvc.cloud.uc.api.param.DepartmentModifyParam;
+import com.chelvc.cloud.uc.api.param.DepartmentQueryParam;
+import com.chelvc.cloud.uc.api.service.DepartmentService;
+import com.chelvc.platform.base.annotation.UnifiedResponseBody;
+import com.chelvc.platform.base.util.ErrorUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 组织接口
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@Validated
+@RestController
+@UnifiedResponseBody
+@PreAuthorize("isType('ADMIN')")
+public class DepartmentController {
+    @DubboReference
+    private DepartmentService departmentService;
+
+    /**
+     * 新增部门
+     *
+     * @param param 新增参数
+     * @return 部门主键
+     */
+    @PostMapping("/department")
+    public Long addDepartment(@RequestBody @Valid DepartmentModifyParam param) {
+        return this.departmentService.addDepartment(param);
+    }
+
+    /**
+     * 修改部门
+     *
+     * @param id    部门主键
+     * @param param 修改参数
+     */
+    @PutMapping("/department/{id}")
+    public void updateDepartment(@PathVariable("id") @Min(value = 1, message = "部门主键不能小于1") Long id,
+                                 @RequestBody @Valid DepartmentModifyParam param) {
+        this.departmentService.updateDepartment(id, param);
+    }
+
+    /**
+     * 获取部门信息
+     *
+     * @param id 部门主键
+     * @return 部门信息
+     */
+    @GetMapping("/department/{id}")
+    public DepartmentDTO getDepartment(@PathVariable("id") @Min(value = 1, message = "部门主键不能小于1") Long id) {
+        DepartmentDTO department = this.departmentService.getDepartment(id);
+        ErrorUtils.requireResource(department, "部门不存在");
+        return department;
+    }
+
+    /**
+     * 查询部门树列表
+     *
+     * @param param 查询参数
+     * @return 部门树列表
+     */
+    @GetMapping("/department/trees")
+    public List<DepartmentDTO> listDepartmentTrees(@Valid DepartmentQueryParam param) {
+        return this.departmentService.listDepartmentTrees(param);
+    }
+}

+ 123 - 0
src/main/java/com/chelvc/cloud/admin/controller/EmployeeController.java

@@ -0,0 +1,123 @@
+package com.chelvc.cloud.admin.controller;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+import com.chelvc.cloud.admin.copier.EmployeeCopier;
+import com.chelvc.cloud.admin.vo.MineVO;
+import com.chelvc.cloud.uc.api.dto.EmployeeDTO;
+import com.chelvc.cloud.uc.api.dto.EmployeeDetailDTO;
+import com.chelvc.cloud.uc.api.param.EmployeeModifyParam;
+import com.chelvc.cloud.uc.api.param.EmployeePagingParam;
+import com.chelvc.cloud.uc.api.param.PasswordResetParam;
+import com.chelvc.cloud.uc.api.param.PasswordUpdateParam;
+import com.chelvc.cloud.uc.api.service.EmployeeService;
+import com.chelvc.platform.base.annotation.UnifiedResponseBody;
+import com.chelvc.platform.base.context.SessionContextHolder;
+import com.chelvc.platform.base.model.Pagination;
+import com.chelvc.platform.base.util.ErrorUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 员工接口
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@Validated
+@RestController
+@UnifiedResponseBody
+@PreAuthorize("isType('ADMIN')")
+public class EmployeeController {
+    @DubboReference
+    private EmployeeService employeeService;
+
+    /**
+     * 新增员工
+     *
+     * @param param 新增参数
+     * @return 员工主键
+     */
+    @PostMapping("/employee")
+    public Long addEmployee(@RequestBody @Valid EmployeeModifyParam param) {
+        return this.employeeService.addEmployee(param);
+    }
+
+    /**
+     * 修改员工
+     *
+     * @param id    员工主键
+     * @param param 修改参数
+     */
+    @PutMapping("/employee/{id}")
+    public void updateEmployee(@PathVariable("id") @Min(value = 1, message = "员工主键不能小于1") Long id,
+                               @RequestBody @Valid EmployeeModifyParam param) {
+        this.employeeService.updateEmployee(id, param);
+    }
+
+    /**
+     * 需改当前员工密码
+     *
+     * @param param 修改参数
+     */
+    @PutMapping("/employee/mine/password")
+    public void updateMinePassword(@RequestBody @Valid PasswordUpdateParam param) {
+        Long id = SessionContextHolder.getSession().getId();
+        this.employeeService.updateEmployeePassword(id, param);
+    }
+
+    /**
+     * 重置员工密码
+     *
+     * @param id    员工主键
+     * @param param 修改参数
+     */
+    @PutMapping("/employee/{id}/password")
+    public void updateEmployeePassword(@PathVariable("id") @Min(value = 1, message = "员工主键不能小于1") Long id,
+                                       @RequestBody @Valid PasswordResetParam param) {
+        this.employeeService.resetEmployeePassword(id, param);
+    }
+
+    /**
+     * 获取当前员工信息
+     *
+     * @return 员工信息
+     */
+    @GetMapping("/employee/mine")
+    public MineVO getMine() {
+        EmployeeDetailDTO employee = this.employeeService.getMine();
+        return EmployeeCopier.INSTANCE.employee2mine(employee);
+    }
+
+    /**
+     * 获取员工信息
+     *
+     * @param id 员工主键
+     * @return 员工信息
+     */
+    @GetMapping("/employee/{id}")
+    public EmployeeDTO getEmployee(@PathVariable("id") @Min(value = 1, message = "员工主键不能小于1") Long id) {
+        EmployeeDTO employee = this.employeeService.getEmployee(id);
+        ErrorUtils.requireResource(employee, "员工不存在");
+        return employee;
+    }
+
+    /**
+     * 查询员工分页
+     *
+     * @param param 查询参数
+     * @return 员工分页信息
+     */
+    @GetMapping("/employee/paging")
+    public Pagination<EmployeeDTO> getEmployeePaging(@Valid EmployeePagingParam param) {
+        return this.employeeService.getEmployeePaging(param);
+    }
+}

+ 83 - 0
src/main/java/com/chelvc/cloud/admin/controller/MenuController.java

@@ -0,0 +1,83 @@
+package com.chelvc.cloud.admin.controller;
+
+import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+import com.chelvc.cloud.uc.api.dto.MenuDTO;
+import com.chelvc.cloud.uc.api.param.MenuModifyParam;
+import com.chelvc.cloud.uc.api.param.MenuQueryParam;
+import com.chelvc.cloud.uc.api.service.MenuService;
+import com.chelvc.platform.base.annotation.UnifiedResponseBody;
+import com.chelvc.platform.base.util.ErrorUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 菜单接口
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@Validated
+@RestController
+@UnifiedResponseBody
+@PreAuthorize("isType('ADMIN')")
+public class MenuController {
+    @DubboReference
+    private MenuService menuService;
+
+    /**
+     * 新增菜单
+     *
+     * @param param 新增参数
+     * @return 菜单主键
+     */
+    @PostMapping("/menu")
+    public Long addMenu(@RequestBody @Valid MenuModifyParam param) {
+        return this.menuService.addMenu(param);
+    }
+
+    /**
+     * 修改菜单
+     *
+     * @param id    菜单主键
+     * @param param 修改参数
+     */
+    @PutMapping("/menu/{id}")
+    public void updateMenu(@PathVariable("id") @Min(value = 1, message = "菜单主键不能小于1") Long id,
+                           @RequestBody @Valid MenuModifyParam param) {
+        this.menuService.updateMenu(id, param);
+    }
+
+    /**
+     * 获取菜单信息
+     *
+     * @param id 菜单主键
+     * @return 菜单信息
+     */
+    @GetMapping("/menu/{id}")
+    public MenuDTO getMenu(@PathVariable("id") @Min(value = 1, message = "菜单主键不能小于1") Long id) {
+        MenuDTO menu = this.menuService.getMenu(id);
+        ErrorUtils.requireResource(menu, "菜单不存在");
+        return menu;
+    }
+
+    /**
+     * 查询菜单树列表
+     *
+     * @param param 查询参数
+     * @return 菜单树列表
+     */
+    @GetMapping("/menu/trees")
+    public List<MenuDTO> listMenuTrees(@Valid MenuQueryParam param) {
+        return this.menuService.listMenuTrees(param);
+    }
+}

+ 83 - 0
src/main/java/com/chelvc/cloud/admin/controller/ResourceController.java

@@ -0,0 +1,83 @@
+package com.chelvc.cloud.admin.controller;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+import com.chelvc.cloud.uc.api.dto.ResourceDTO;
+import com.chelvc.cloud.uc.api.param.ResourceModifyParam;
+import com.chelvc.cloud.uc.api.param.ResourcePagingParam;
+import com.chelvc.cloud.uc.api.service.ResourceService;
+import com.chelvc.platform.base.annotation.UnifiedResponseBody;
+import com.chelvc.platform.base.model.Pagination;
+import com.chelvc.platform.base.util.ErrorUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 资源接口
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@Validated
+@RestController
+@UnifiedResponseBody
+@PreAuthorize("isType('ADMIN')")
+public class ResourceController {
+    @DubboReference
+    private ResourceService resourceService;
+
+    /**
+     * 新增资源
+     *
+     * @param param 新增参数
+     * @return 资源主键
+     */
+    @PostMapping("/resource")
+    public Long addResource(@RequestBody @Valid ResourceModifyParam param) {
+        return this.resourceService.addResource(param);
+    }
+
+    /**
+     * 修改资源
+     *
+     * @param id    资源主键
+     * @param param 修改参数
+     */
+    @PutMapping("/resource/{id}")
+    public void updateResource(@PathVariable("id") @Min(value = 1, message = "资源主键不能小于1") Long id,
+                               @RequestBody @Valid ResourceModifyParam param) {
+        this.resourceService.updateResource(id, param);
+    }
+
+    /**
+     * 获取资源信息
+     *
+     * @param id 资源主键
+     * @return 资源信息
+     */
+    @GetMapping("/resource/{id}")
+    public ResourceDTO getResource(@PathVariable("id") @Min(value = 1, message = "资源主键不能小于1") Long id) {
+        ResourceDTO resource = this.resourceService.getResource(id);
+        ErrorUtils.requireResource(resource, "资源不存在");
+        return resource;
+    }
+
+    /**
+     * 查询资源分页
+     *
+     * @param param 查询参数
+     * @return 资源分页信息
+     */
+    @GetMapping("/resource/paging")
+    public Pagination<ResourceDTO> getResourcePaging(@Valid ResourcePagingParam param) {
+        return this.resourceService.getResourcePaging(param);
+    }
+}

+ 110 - 0
src/main/java/com/chelvc/cloud/admin/controller/RoleController.java

@@ -0,0 +1,110 @@
+package com.chelvc.cloud.admin.controller;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+import com.chelvc.cloud.uc.api.dto.RoleDTO;
+import com.chelvc.cloud.uc.api.dto.RoleDetailDTO;
+import com.chelvc.cloud.uc.api.param.PermissionModifyParam;
+import com.chelvc.cloud.uc.api.param.RoleModifyParam;
+import com.chelvc.cloud.uc.api.param.RolePagingParam;
+import com.chelvc.cloud.uc.api.service.RoleService;
+import com.chelvc.platform.base.annotation.UnifiedResponseBody;
+import com.chelvc.platform.base.model.Pagination;
+import com.chelvc.platform.base.util.ErrorUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 角色接口
+ *
+ * @author Woody
+ * @date 2021/10/20
+ */
+@Validated
+@RestController
+@UnifiedResponseBody
+@PreAuthorize("isType('ADMIN')")
+public class RoleController {
+    @DubboReference
+    private RoleService roleService;
+
+    /**
+     * 新增角色
+     *
+     * @param param 新增参数
+     * @return 角色主键
+     */
+    @PostMapping("/role")
+    public Long addRole(@RequestBody @Valid RoleModifyParam param) {
+        return this.roleService.addRole(param);
+    }
+
+    /**
+     * 修改角色
+     *
+     * @param id    角色主键
+     * @param param 修改参数
+     */
+    @PutMapping("/role/{id}")
+    public void updateRole(@PathVariable("id") @Min(value = 1, message = "角色主键不能小于1") Long id,
+                           @RequestBody @Valid RoleModifyParam param) {
+        this.roleService.updateRole(id, param);
+    }
+
+    /**
+     * 修改角色权限
+     *
+     * @param id    角色主键
+     * @param param 修改参数
+     */
+    @PutMapping("/role/{id}/permission")
+    public void updateRolePermission(@PathVariable("id") @Min(value = 1, message = "角色主键不能小于1") Long id,
+                                     @RequestBody @Valid PermissionModifyParam param) {
+        this.roleService.updateRolePermission(id, param);
+    }
+
+    /**
+     * 获取角色信息
+     *
+     * @param id 角色主键
+     * @return 角色信息
+     */
+    @GetMapping("/role/{id}")
+    public RoleDTO getRole(@PathVariable("id") @Min(value = 1, message = "角色主键不能小于1") Long id) {
+        RoleDTO role = this.roleService.getRole(id);
+        ErrorUtils.requireResource(role, "角色不存在");
+        return role;
+    }
+
+    /**
+     * 获取角色详细信息
+     *
+     * @param id 角色主键
+     * @return 角色信息
+     */
+    @GetMapping("/role/{id}/detail")
+    public RoleDetailDTO getRoleDetail(@PathVariable("id") @Min(value = 1, message = "角色主键不能小于1") Long id) {
+        RoleDetailDTO detail = this.roleService.getRoleDetail(id);
+        ErrorUtils.requireResource(detail, "角色不存在");
+        return detail;
+    }
+
+    /**
+     * 查询角色分页
+     *
+     * @param param 查询参数
+     * @return 角色分页信息
+     */
+    @GetMapping("/role/paging")
+    public Pagination<RoleDTO> getRolePaging(@Valid RolePagingParam param) {
+        return this.roleService.getRolePaging(param);
+    }
+}

+ 29 - 0
src/main/java/com/chelvc/cloud/admin/copier/EmployeeCopier.java

@@ -0,0 +1,29 @@
+package com.chelvc.cloud.admin.copier;
+
+import com.chelvc.cloud.admin.vo.MineVO;
+import com.chelvc.cloud.uc.api.dto.EmployeeDetailDTO;
+import org.mapstruct.Builder;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 员工对象拷贝接口
+ *
+ * @author Woody
+ * @date 2022/8/28
+ */
+@Mapper(builder = @Builder(disableBuilder = true))
+public interface EmployeeCopier {
+    /**
+     * 对象拷贝接口实例
+     */
+    EmployeeCopier INSTANCE = Mappers.getMapper(EmployeeCopier.class);
+
+    /**
+     * 我的信息拷贝
+     *
+     * @param employee 员工详细信息
+     * @return 我的信息
+     */
+    MineVO employee2mine(EmployeeDetailDTO employee);
+}

+ 123 - 0
src/main/java/com/chelvc/cloud/admin/vo/MineVO.java

@@ -0,0 +1,123 @@
+package com.chelvc.cloud.admin.vo;
+
+import java.io.Serializable;
+import java.util.List;
+
+import com.chelvc.platform.base.model.Tree;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * 我的信息
+ *
+ * @author Woody
+ * @date 2021/11/1
+ */
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MineVO implements Serializable {
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 员工姓名
+     */
+    private String name;
+
+    /**
+     * 电子邮箱
+     */
+    private String email;
+
+    /**
+     * 电话号码
+     */
+    private String mobile;
+
+    /**
+     * 角色列表
+     */
+    private List<RoleVO> roles;
+
+    /**
+     * 菜单列表
+     */
+    private List<MenuVO> menus;
+
+    /**
+     * 所属部门
+     */
+    private DepartmentVO department;
+
+    /**
+     * 部门信息
+     */
+    @Data
+    @SuperBuilder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class DepartmentVO implements Serializable {
+        /**
+         * 组织主键
+         */
+        private Long id;
+
+        /**
+         * 组织名称
+         */
+        private String name;
+    }
+
+    /**
+     * 角色信息
+     */
+    @Data
+    @SuperBuilder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class RoleVO implements Serializable {
+        /**
+         * 主键
+         */
+        private Long id;
+
+        /**
+         * 角色名称
+         */
+        private String name;
+    }
+
+    /**
+     * 组织信息
+     */
+    @Data
+    @SuperBuilder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ToString(callSuper = true)
+    @EqualsAndHashCode(callSuper = true)
+    public static class MenuVO extends Tree.Simple<Long, MenuVO> {
+        /**
+         * 菜单名称
+         */
+        private String name;
+
+        /**
+         * 菜单图标
+         */
+        private String icon;
+
+        /**
+         * 菜单路径
+         */
+        private String path;
+    }
+}

+ 21 - 0
src/main/resources/application-dev.yml

@@ -0,0 +1,21 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        server-addr: localhost:8848
+  redis:
+    host: localhost
+    port: 6379
+
+dubbo:
+  registry:
+    address: nacos://localhost:8848
+
+nacos:
+  config:
+    server-addr: localhost:8848
+
+platform:
+  security:
+    token:
+      secret: chelvc@2023!2#4%6&8

+ 22 - 0
src/main/resources/application-pre.yml

@@ -0,0 +1,22 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 172.19.158.134:8848
+  redis:
+    host: 172.19.158.134
+    port: 9527
+    password: Chelvc@2022
+
+dubbo:
+  registry:
+    address: nacos://172.19.158.134:8848
+
+nacos:
+  config:
+    server-addr: 172.19.158.134:8848
+
+platform:
+  security:
+    token:
+      secret: chelvc@2023!2#4%6&8

+ 22 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,22 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 172.19.158.134:8848
+  redis:
+    host: 172.19.158.134
+    port: 9527
+    password: Chelvc@2022
+
+dubbo:
+  registry:
+    address: nacos://172.19.158.134:8848
+
+nacos:
+  config:
+    server-addr: 172.19.158.134:8848
+
+platform:
+  security:
+    token:
+      secret: chelvc@2023!2#4%6&8

+ 22 - 0
src/main/resources/application-test.yml

@@ -0,0 +1,22 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 172.19.158.134:8848
+  redis:
+    host: 172.19.158.134
+    port: 9527
+    password: Chelvc@2022
+
+dubbo:
+  registry:
+    address: nacos://172.19.158.134:8848
+
+nacos:
+  config:
+    server-addr: 172.19.158.134:8848
+
+platform:
+  security:
+    token:
+      secret: chelvc@2023!2#4%6&8

+ 43 - 0
src/main/resources/application.yml

@@ -0,0 +1,43 @@
+server:
+  port: 10080
+
+spring:
+  main:
+    allow-bean-definition-overriding: true
+  profiles:
+    active: dev
+  application:
+    name: admin
+  jackson:
+    time-zone: GMT+8
+    serialization:
+      write-dates-as-timestamps: true
+  cloud:
+    nacos:
+      discovery:
+        namespace: ${spring.profiles.active}
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 40MB
+      max-request-size: 40MB
+
+nacos:
+  config:
+    namespace: ${spring.profiles.active}
+
+dubbo:
+  protocol:
+    name: dubbo
+    port: 20080
+  application:
+    name: ${spring.application.name}
+    register-mode: instance
+  provider:
+    group: ${spring.profiles.active}
+    filter: -exception,customException
+  consumer:
+    group: ${spring.profiles.active}
+    check: false
+    timeout: 10000
+    retries: 0

+ 2 - 0
src/main/resources/bootstrap.yml

@@ -0,0 +1,2 @@
+logging:
+  config: classpath:logback-spring.xml

+ 33 - 0
src/main/resources/logback-spring.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+	<contextName>admin</contextName>
+
+	<springProperty name="LOG_PATH" source="logging.path" defaultValue="./"/>
+
+	<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger: %msg%n</pattern>
+			<charset>UTF-8</charset>
+		</encoder>
+	</appender>
+
+	<appender name="FILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<file>${LOG_PATH}/admin.log</file>
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger: %msg%n</pattern>
+			<charset>UTF-8</charset>
+		</encoder>
+		<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+			<fileNamePattern>${LOG_PATH}/admin-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+			<maxFileSize>10MB</maxFileSize>
+			<maxHistory>7</maxHistory>
+		</rollingPolicy>
+	</appender>
+
+	<logger name="RocketmqClient" level="error"/>
+
+	<root level="info">
+		<appender-ref ref="CONSOLE_APPENDER"/>
+		<appender-ref ref="FILE_APPENDER"/>
+	</root>
+</configuration>