✨ Introducing new features. 新增 app 端用户管理

This commit is contained in:
aeizzz committed 2022-12-07 14:19:00 +08:00
1 parent dd23663553
commit 669b20cf82
40 files changed
+2487 -25

No files matched your search

@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<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.pig4cloud</groupId>
<artifactId>pigx-app-server</artifactId>
<version>4.5.0</version>
</parent>
<artifactId>pigx-app-server-api</artifactId>
<dependencies>
<!--core 工具类-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-core</artifactId>
</dependency>
<!--mybatis plus extension,包含了mybatis plus core-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
</dependency>
<!--feign 工具类-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-feign</artifactId>
</dependency>
<!-- excel 导入导出 -->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-excel</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,22 @@
package com.pig4cloud.pigx.app.api.dto;
import com.pig4cloud.pigx.app.api.entity.AppUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
@ApiModel(value = "APP用户传输对象")
@EqualsAndHashCode(callSuper = true)
public class AppUserDTO extends AppUser {
/**
* 角色ID
*/
@ApiModelProperty(value = "角色id集合")
private List<Long> role;
}
@@ -0,0 +1,130 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 菜单权限表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Data
@TableName("app_menu")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "菜单权限表")
public class AppMenu extends Model<AppMenu> {
private static final long serialVersionUID = 1L;
/**
* 菜单ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "菜单ID")
private Long menuId;
/**
* name
*/
@ApiModelProperty(value = "name")
private String name;
/**
* permission
*/
@ApiModelProperty(value = "permission")
private String permission;
/**
* path
*/
@ApiModelProperty(value = "path")
private String path;
/**
* 父菜单ID
*/
@ApiModelProperty(value = "父菜单ID")
private Long parentId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String visible;
/**
* 排序值
*/
@ApiModelProperty(value = "排序值")
private Integer sortOrder;
/**
* menuType
*/
@ApiModelProperty(value = "menuType")
private String menuType;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateTime;
/**
* delFlag
*/
@ApiModelProperty(value = "delFlag")
private String delFlag;
/**
* 租户ID
*/
@ApiModelProperty(value = "租户ID", hidden = true)
private Long tenantId;
}
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* app角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Data
@TableName("app_role")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "app角色表")
public class AppRole extends Model<AppRole> {
private static final long serialVersionUID = 1L;
/**
* roleId
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "roleId")
private Long roleId;
/**
* roleName
*/
@ApiModelProperty(value = "roleName")
private String roleName;
/**
* roleCode
*/
@ApiModelProperty(value = "roleCode")
private String roleCode;
/**
* roleDesc
*/
@ApiModelProperty(value = "roleDesc")
private String roleDesc;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String updateBy;
/**
* createTime
*/
@ApiModelProperty(value = "createTime")
private LocalDateTime createTime;
/**
* updateTime
*/
@ApiModelProperty(value = "updateTime")
private LocalDateTime updateTime;
/**
* delFlag
*/
@ApiModelProperty(value = "delFlag")
private String delFlag;
/**
* tenantId
*/
@ApiModelProperty(value = "tenantId", hidden = true)
private Long tenantId;
}
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 角色菜单表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Data
@TableName("app_role_menu")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "角色菜单表")
public class AppRoleMenu extends Model<AppRoleMenu> {
private static final long serialVersionUID = 1L;
/**
* 角色ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "角色ID")
private Long roleId;
/**
* 菜单ID
*/
@ApiModelProperty(value = "菜单ID")
private Long menuId;
}
@@ -0,0 +1,154 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.api.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* app用户表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Data
@TableName("app_user")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "app用户表")
public class AppUser extends Model<AppUser> {
private static final long serialVersionUID = 1L;
/**
* userId
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "userId")
private Long userId;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
private String username;
/**
* 密码
*/
@ApiModelProperty(value = "密码")
private String password;
/**
* 随机盐
*/
@JsonIgnore
@ApiModelProperty(value = "随机盐")
private String salt;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
private String phone;
/**
* 头像
*/
@ApiModelProperty(value = "头像")
private String avatar;
/**
* 昵称
*/
@ApiModelProperty(value = "拓展字段:昵称")
private String nickname;
/**
* 姓名
*/
@ApiModelProperty(value = "拓展字段:姓名")
private String name;
/**
* 邮箱
*/
@ApiModelProperty(value = "拓展字段:邮箱")
private String email;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
@TableField(fill = FieldFill.UPDATE)
private String updateBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime updateTime;
/**
* 删除标记
*/
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
@TableField(fill = FieldFill.INSERT)
@TableLogic
private String delFlag;
/**
* 所属租户
*/
@ApiModelProperty(value = "所属租户", hidden = true)
private Long tenantId;
/**
* 最后一次密码修改时间
*/
@ApiModelProperty(value = "最后一次密码修改时间")
private LocalDateTime lastModifiedTime;
/**
* 锁定标记
*/
@ApiModelProperty(value = "锁定标记")
private String lockFlag;
}
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Data
@TableName("app_user_role")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "用户角色表")
public class AppUserRole extends Model<AppUserRole> {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "用户ID")
private Long userId;
/**
* 角色ID
*/
@ApiModelProperty(value = "角色ID")
private Long roleId;
}
@@ -0,0 +1,83 @@
package com.pig4cloud.pigx.app.api.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
@Data
@ColumnWidth(30)
public class AppUserExcelVO {
/**
* 导入时候回显行号
*/
@ExcelLine
@ExcelIgnore
private Long lineNum;
/**
* 主键ID
*/
@ExcelProperty("用户编号")
private Long userId;
/**
* 用户名
*/
@NotBlank(message = "用户名不能为空")
@ExcelProperty("用户名")
private String username;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
@ExcelProperty("手机号")
private String phone;
/**
* 手机号
*/
@NotBlank(message = "昵称不能为空")
@ExcelProperty("昵称")
private String nickname;
/**
* 手机号
*/
@NotBlank(message = "姓名不能为空")
@ExcelProperty("姓名")
private String name;
/**
* 手机号
*/
@NotBlank(message = "邮箱不能为空")
@ExcelProperty("邮箱")
private String email;
/**
* 角色列表
*/
@NotBlank(message = "角色不能为空")
@ExcelProperty("角色")
private String roleNameList;
/**
* 锁定标记
*/
@ExcelProperty("锁定标记,0:正常,9:已锁定")
private String lockFlag;
/**
* 创建时间
*/
@ExcelProperty(value = "创建时间")
private LocalDateTime createTime;
}
@@ -0,0 +1,101 @@
package com.pig4cloud.pigx.app.api.vo;
import com.pig4cloud.pigx.app.api.entity.AppRole;
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
import com.pig4cloud.pigx.common.core.sensitive.SensitiveTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class AppUserVo implements Serializable {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private Long userId;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
private String username;
/**
* 密码
*/
@ApiModelProperty(value = "密码")
private String password;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
private String phone;
/**
* 头像
*/
@ApiModelProperty(value = "头像")
private String avatar;
/**
* 昵称
*/
@ApiModelProperty(value = "拓展字段:昵称")
private String nickname;
/**
* 姓名
*/
@ApiModelProperty(value = "拓展字段:姓名")
private String name;
/**
* 邮箱
*/
@ApiModelProperty(value = "拓展字段:邮箱")
private String email;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
/**
* 删除标记
*/
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
private String delFlag;
/**
* 所属租户
*/
@ApiModelProperty(value = "所属租户")
private Long tenantId;
/**
* 最后一次密码修改时间
*/
@ApiModelProperty(value = "最后一次密码修改时间")
private LocalDateTime lastModifiedTime;
/**
* 锁定标记
*/
@ApiModelProperty(value = "锁定标记")
private String lockFlag;
/**
* 角色列表
*/
@ApiModelProperty(value = "拥有的角色列表")
private List<AppRole> roleList;
}
+110
View File
@@ -0,0 +1,110 @@
<?xml version="1.0"?>
<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.pig4cloud</groupId>
<artifactId>pigx-app-server</artifactId>
<version>4.5.0</version>
</parent>
<artifactId>pigx-app-server-biz</artifactId>
<dependencies>
<!--必备: undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!--必备: spring boot web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--必备: 注册中心客户端-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!--必备: 配置中心客户端-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!--必备: 操作数据源相关-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-data</artifactId>
</dependency>
<!--必备:pigx安全模块-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-security</artifactId>
</dependency>
<!--必备:xss 过滤模块-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-xss</artifactId>
</dependency>
<!--必备: sentinel 依赖-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-sentinel</artifactId>
</dependency>
<!--必备: feign 依赖-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-feign</artifactId>
</dependency>
<!--必备: 依赖api模块-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-app-server-api</artifactId>
<version>4.5.0</version>
</dependency>
<!--必备: log 依赖-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-log</artifactId>
</dependency>
<!--选配: mybatis 依赖 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!--选配: druid 连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!--选配: mysql 数据库驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--选配: swagger文档-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-swagger</artifactId>
</dependency>
<!--测试: spring boot test-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,26 @@
package com.pig4cloud.pigx.app;
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* @author pigx archetype
* <p>
* 项目启动类
*/
@EnablePigxSwagger2
@EnablePigxFeignClients
@EnableDiscoveryClient
@EnablePigxResourceServer
@SpringBootApplication
public class PigxAppApplication {
public static void main(String[] args) {
SpringApplication.run(PigxAppApplication.class, args);
}
}
@@ -0,0 +1,125 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.app.api.entity.AppMenu;
import com.pig4cloud.pigx.app.service.AppMenuService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 菜单权限表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/appmenu")
@Api(value = "appmenu", tags = "菜单权限表管理")
public class AppMenuController {
private final AppMenuService appMenuService;
/**
* 分页查询
* @param page 分页对象
* @param appMenu 菜单权限表
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('app_appmenu_view')")
public R getAppMenuPage(Page page, AppMenu appMenu) {
return R.ok(appMenuService.page(page, Wrappers.query(appMenu)));
}
/**
* 通过id查询菜单权限表
* @param menuId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{menuId}")
@PreAuthorize("@pms.hasPermission('app_appmenu_view')")
public R getById(@PathVariable("menuId") Long menuId) {
return R.ok(appMenuService.getById(menuId));
}
/**
* 新增菜单权限表
* @param appMenu 菜单权限表
* @return R
*/
@ApiOperation(value = "新增菜单权限表", notes = "新增菜单权限表")
@SysLog("新增菜单权限表")
@PostMapping
@PreAuthorize("@pms.hasPermission('app_appmenu_add')")
public R save(@RequestBody AppMenu appMenu) {
return R.ok(appMenuService.save(appMenu));
}
/**
* 修改菜单权限表
* @param appMenu 菜单权限表
* @return R
*/
@ApiOperation(value = "修改菜单权限表", notes = "修改菜单权限表")
@SysLog("修改菜单权限表")
@PutMapping
@PreAuthorize("@pms.hasPermission('app_appmenu_edit')")
public R updateById(@RequestBody AppMenu appMenu) {
return R.ok(appMenuService.updateById(appMenu));
}
/**
* 通过id删除菜单权限表
* @param menuId id
* @return R
*/
@ApiOperation(value = "通过id删除菜单权限表", notes = "通过id删除菜单权限表")
@SysLog("通过id删除菜单权限表")
@DeleteMapping("/{menuId}")
@PreAuthorize("@pms.hasPermission('app_appmenu_del')")
public R removeById(@PathVariable Long menuId) {
return R.ok(appMenuService.removeById(menuId));
}
/**
* 导出excel 表格
* @param appMenu 查询条件
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('app_appmenu_export')")
public List<AppMenu> export(AppMenu appMenu) {
return appMenuService.list(Wrappers.query(appMenu));
}
}
@@ -0,0 +1,135 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.app.api.entity.AppRole;
import com.pig4cloud.pigx.app.service.AppRoleService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* app角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/approle")
@Api(value = "approle", tags = "app角色表管理")
public class AppRoleController {
private final AppRoleService appRoleService;
/**
* 分页查询
* @param page 分页对象
* @param appRole app角色表
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('app_approle_view')")
public R getAppRolePage(Page page, AppRole appRole) {
return R.ok(appRoleService.page(page, Wrappers.query(appRole)));
}
/**
* 查询全部角色
* @return
*/
@ApiOperation(value = "查询全部", notes = "查询全部")
@GetMapping("/list")
public R list() {
return R.ok(appRoleService.list(Wrappers.emptyWrapper()));
}
/**
* 通过id查询app角色表
* @param roleId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{roleId}")
@PreAuthorize("@pms.hasPermission('app_approle_view')")
public R getById(@PathVariable("roleId") Long roleId) {
return R.ok(appRoleService.getById(roleId));
}
/**
* 新增app角色表
* @param appRole app角色表
* @return R
*/
@ApiOperation(value = "新增app角色表", notes = "新增app角色表")
@SysLog("新增app角色表")
@PostMapping
@PreAuthorize("@pms.hasPermission('app_approle_add')")
public R save(@RequestBody AppRole appRole) {
return R.ok(appRoleService.save(appRole));
}
/**
* 修改app角色表
* @param appRole app角色表
* @return R
*/
@ApiOperation(value = "修改app角色表", notes = "修改app角色表")
@SysLog("修改app角色表")
@PutMapping
@PreAuthorize("@pms.hasPermission('app_approle_edit')")
public R updateById(@RequestBody AppRole appRole) {
return R.ok(appRoleService.updateById(appRole));
}
/**
* 通过id删除app角色表
* @param roleId id
* @return R
*/
@ApiOperation(value = "通过id删除app角色表", notes = "通过id删除app角色表")
@SysLog("通过id删除app角色表")
@DeleteMapping("/{roleId}")
@PreAuthorize("@pms.hasPermission('app_approle_del')")
public R removeById(@PathVariable Long roleId) {
return R.ok(appRoleService.removeById(roleId));
}
/**
* 导出excel 表格
* @param appRole 查询条件
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('app_approle_export')")
public List<AppRole> export(AppRole appRole) {
return appRoleService.list(Wrappers.query(appRole));
}
}
@@ -0,0 +1,125 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
import com.pig4cloud.pigx.app.service.AppRoleMenuService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 角色菜单表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/approlemenu")
@Api(value = "approlemenu", tags = "角色菜单表管理")
public class AppRoleMenuController {
private final AppRoleMenuService appRoleMenuService;
/**
* 分页查询
* @param page 分页对象
* @param appRoleMenu 角色菜单表
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('app_approlemenu_view')")
public R getAppRoleMenuPage(Page page, AppRoleMenu appRoleMenu) {
return R.ok(appRoleMenuService.page(page, Wrappers.query(appRoleMenu)));
}
/**
* 通过id查询角色菜单表
* @param roleId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{roleId}")
@PreAuthorize("@pms.hasPermission('app_approlemenu_view')")
public R getById(@PathVariable("roleId") Long roleId) {
return R.ok(appRoleMenuService.getById(roleId));
}
/**
* 新增角色菜单表
* @param appRoleMenu 角色菜单表
* @return R
*/
@ApiOperation(value = "新增角色菜单表", notes = "新增角色菜单表")
@SysLog("新增角色菜单表")
@PostMapping
@PreAuthorize("@pms.hasPermission('app_approlemenu_add')")
public R save(@RequestBody AppRoleMenu appRoleMenu) {
return R.ok(appRoleMenuService.save(appRoleMenu));
}
/**
* 修改角色菜单表
* @param appRoleMenu 角色菜单表
* @return R
*/
@ApiOperation(value = "修改角色菜单表", notes = "修改角色菜单表")
@SysLog("修改角色菜单表")
@PutMapping
@PreAuthorize("@pms.hasPermission('app_approlemenu_edit')")
public R updateById(@RequestBody AppRoleMenu appRoleMenu) {
return R.ok(appRoleMenuService.updateById(appRoleMenu));
}
/**
* 通过id删除角色菜单表
* @param roleId id
* @return R
*/
@ApiOperation(value = "通过id删除角色菜单表", notes = "通过id删除角色菜单表")
@SysLog("通过id删除角色菜单表")
@DeleteMapping("/{roleId}")
@PreAuthorize("@pms.hasPermission('app_approlemenu_del')")
public R removeById(@PathVariable Long roleId) {
return R.ok(appRoleMenuService.removeById(roleId));
}
/**
* 导出excel 表格
* @param appRoleMenu 查询条件
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('app_approlemenu_export')")
public List<AppRoleMenu> export(AppRoleMenu appRoleMenu) {
return appRoleMenuService.list(Wrappers.query(appRoleMenu));
}
}
@@ -0,0 +1,124 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.app.api.entity.AppUser;
import com.pig4cloud.pigx.app.service.AppUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* app用户表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/appuser")
@Api(value = "appuser", tags = "app用户表管理")
public class AppUserController {
private final AppUserService appUserService;
/**
* 分页查询
* @param page 分页对象
* @param appUserDTO app用户表
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getAppUserPage(Page page, AppUserDTO appUserDTO) {
return R.ok(appUserService.getUsersWithRolePage(page, appUserDTO));
}
/**
* 通过id查询app用户表
* @param userId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{userId}")
public R getById(@PathVariable("userId") Long userId) {
return R.ok(appUserService.getById(userId));
}
/**
* 新增app用户表
* @param appUser app用户表
* @return R
*/
@ApiOperation(value = "新增app用户表", notes = "新增app用户表")
@SysLog("新增app用户表")
@PostMapping
@PreAuthorize("@pms.hasPermission('app_appuser_add')")
public R save(@RequestBody AppUserDTO appUser) {
return R.ok(appUserService.saveUser(appUser));
}
/**
* 修改app用户表
* @param appUser app用户表
* @return R
*/
@ApiOperation(value = "修改app用户表", notes = "修改app用户表")
@SysLog("修改app用户表")
@PutMapping
@PreAuthorize("@pms.hasPermission('app_appuser_edit')")
public R updateById(@RequestBody AppUserDTO appUser) {
return R.ok(appUserService.updateUser(appUser));
}
/**
* 通过id删除app用户表
* @param userId id
* @return R
*/
@ApiOperation(value = "通过id删除app用户表", notes = "通过id删除app用户表")
@SysLog("通过id删除app用户表")
@DeleteMapping("/{userId}")
@PreAuthorize("@pms.hasPermission('app_appuser_del')")
public R removeById(@PathVariable Long userId) {
return R.ok(appUserService.deleteUserById(userId));
}
/**
* 导出excel 表格
* @param appUser 查询条件
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('app_appuser_export')")
public List<AppUserExcelVO> export(AppUserDTO appUser) {
return appUserService.listUser(appUser);
}
}
@@ -0,0 +1,125 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
import com.pig4cloud.pigx.app.service.AppUserRoleService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/appuserrole")
@Api(value = "appuserrole", tags = "用户角色表管理")
public class AppUserRoleController {
private final AppUserRoleService appUserRoleService;
/**
* 分页查询
* @param page 分页对象
* @param appUserRole 用户角色表
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
public R getAppUserRolePage(Page page, AppUserRole appUserRole) {
return R.ok(appUserRoleService.page(page, Wrappers.query(appUserRole)));
}
/**
* 通过id查询用户角色表
* @param userId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{userId}")
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
public R getById(@PathVariable("userId") Long userId) {
return R.ok(appUserRoleService.getById(userId));
}
/**
* 新增用户角色表
* @param appUserRole 用户角色表
* @return R
*/
@ApiOperation(value = "新增用户角色表", notes = "新增用户角色表")
@SysLog("新增用户角色表")
@PostMapping
@PreAuthorize("@pms.hasPermission('app_appuserrole_add')")
public R save(@RequestBody AppUserRole appUserRole) {
return R.ok(appUserRoleService.save(appUserRole));
}
/**
* 修改用户角色表
* @param appUserRole 用户角色表
* @return R
*/
@ApiOperation(value = "修改用户角色表", notes = "修改用户角色表")
@SysLog("修改用户角色表")
@PutMapping
@PreAuthorize("@pms.hasPermission('app_appuserrole_edit')")
public R updateById(@RequestBody AppUserRole appUserRole) {
return R.ok(appUserRoleService.updateById(appUserRole));
}
/**
* 通过id删除用户角色表
* @param userId id
* @return R
*/
@ApiOperation(value = "通过id删除用户角色表", notes = "通过id删除用户角色表")
@SysLog("通过id删除用户角色表")
@DeleteMapping("/{userId}")
@PreAuthorize("@pms.hasPermission('app_appuserrole_del')")
public R removeById(@PathVariable Long userId) {
return R.ok(appUserRoleService.removeById(userId));
}
/**
* 导出excel 表格
* @param appUserRole 查询条件
* @return excel 文件流
*/
@ResponseExcel
@GetMapping("/export")
@PreAuthorize("@pms.hasPermission('app_appuserrole_export')")
public List<AppUserRole> export(AppUserRole appUserRole) {
return appUserRoleService.list(Wrappers.query(appUserRole));
}
}
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.mapper;
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
import com.pig4cloud.pigx.app.api.entity.AppMenu;
import org.apache.ibatis.annotations.Mapper;
/**
* 菜单权限表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Mapper
public interface AppMenuMapper extends PigxBaseMapper<AppMenu> {
}
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.mapper;
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
import com.pig4cloud.pigx.app.api.entity.AppRole;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* app角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Mapper
public interface AppRoleMapper extends PigxBaseMapper<AppRole> {
List<AppRole> listRolesByUserId(Long userId);
}
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.mapper;
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
import org.apache.ibatis.annotations.Mapper;
/**
* 角色菜单表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Mapper
public interface AppRoleMenuMapper extends PigxBaseMapper<AppRoleMenu> {
}
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
import com.pig4cloud.pigx.app.api.vo.AppUserVo;
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
import com.pig4cloud.pigx.app.api.entity.AppUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* app用户表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Mapper
public interface AppUserMapper extends PigxBaseMapper<AppUser> {
IPage<AppUserVo> getUserVosPage(Page page, @Param("query") AppUserDTO appUserDTO);
}
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.mapper;
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Mapper
public interface AppUserRoleMapper extends PigxBaseMapper<AppUserRole> {
}
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.app.api.entity.AppMenu;
/**
* 菜单权限表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
public interface AppMenuService extends IService<AppMenu> {
}
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
/**
* 角色菜单表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
public interface AppRoleMenuService extends IService<AppRoleMenu> {
}
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.app.api.entity.AppRole;
/**
* app角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
public interface AppRoleService extends IService<AppRole> {
}
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
/**
* 用户角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
public interface AppUserRoleService extends IService<AppUserRole> {
}
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
import com.pig4cloud.pigx.app.api.entity.AppUser;
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
import java.util.List;
/**
* app用户表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
public interface AppUserService extends IService<AppUser> {
Boolean updateUser(AppUserDTO appUser);
Boolean saveUser(AppUserDTO appUser);
List<AppUserExcelVO> listUser(AppUserDTO appUser);
IPage getUsersWithRolePage(Page page, AppUserDTO appUserDTO);
Boolean deleteUserById(Long userId);
}
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.app.api.entity.AppMenu;
import com.pig4cloud.pigx.app.mapper.AppMenuMapper;
import com.pig4cloud.pigx.app.service.AppMenuService;
import org.springframework.stereotype.Service;
/**
* 菜单权限表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Service
public class AppMenuServiceImpl extends ServiceImpl<AppMenuMapper, AppMenu> implements AppMenuService {
}
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
import com.pig4cloud.pigx.app.mapper.AppRoleMenuMapper;
import com.pig4cloud.pigx.app.service.AppRoleMenuService;
import org.springframework.stereotype.Service;
/**
* 角色菜单表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Service
public class AppRoleMenuServiceImpl extends ServiceImpl<AppRoleMenuMapper, AppRoleMenu> implements AppRoleMenuService {
}
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.app.api.entity.AppRole;
import com.pig4cloud.pigx.app.mapper.AppRoleMapper;
import com.pig4cloud.pigx.app.service.AppRoleService;
import org.springframework.stereotype.Service;
/**
* app角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Service
public class AppRoleServiceImpl extends ServiceImpl<AppRoleMapper, AppRole> implements AppRoleService {
}
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
import com.pig4cloud.pigx.app.mapper.AppUserRoleMapper;
import com.pig4cloud.pigx.app.service.AppUserRoleService;
import org.springframework.stereotype.Service;
/**
* 用户角色表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Service
public class AppUserRoleServiceImpl extends ServiceImpl<AppUserRoleMapper, AppUserRole> implements AppUserRoleService {
}
@@ -0,0 +1,139 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.app.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.admin.api.entity.SysRole;
import com.pig4cloud.pigx.admin.api.entity.SysUserRole;
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
import com.pig4cloud.pigx.app.api.entity.AppUser;
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
import com.pig4cloud.pigx.app.mapper.AppUserMapper;
import com.pig4cloud.pigx.app.service.AppUserRoleService;
import com.pig4cloud.pigx.app.service.AppUserService;
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
import com.pig4cloud.pigx.common.data.resolver.ParamResolver;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* app用户表
*
* @author aeizzz
* @date 2022-12-07 09:52:03
*/
@Service
@AllArgsConstructor
public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements AppUserService {
private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();
private final AppUserRoleService appUserRoleService;
/**
* 更新用户
* @param userDTO
* @return
*/
@Override
public Boolean updateUser(AppUserDTO userDTO) {
AppUser appUser = new AppUser();
BeanUtils.copyProperties(userDTO, appUser);
if (StrUtil.isNotBlank(userDTO.getPassword())) {
appUser.setPassword(ENCODER.encode(userDTO.getPassword()));
}
this.updateById(appUser);
appUserRoleService.remove(Wrappers.<AppUserRole>lambdaQuery().eq(AppUserRole::getUserId, appUser.getUserId()));
userDTO.getRole().forEach(roleId -> {
AppUserRole appUserRole = new AppUserRole();
appUserRole.setRoleId(roleId);
appUserRole.setUserId(userDTO.getUserId());
appUserRole.insert();
});
return Boolean.TRUE;
}
/**
* 新增用户
* @param userDTO
* @return
*/
@Override
public Boolean saveUser(AppUserDTO userDTO) {
AppUser appUser = new AppUser();
BeanUtils.copyProperties(userDTO, appUser);
appUser.setDelFlag(CommonConstants.STATUS_NORMAL);
appUser.setPassword(ENCODER.encode(userDTO.getPassword()));
baseMapper.insert(appUser);
// 如果角色为空,赋默认角色
if (CollUtil.isNotEmpty(userDTO.getRole())) {
List<AppUserRole> userRoleList = userDTO.getRole().stream().map(roleId -> {
AppUserRole userRole = new AppUserRole();
userRole.setUserId(userDTO.getUserId());
userRole.setRoleId(roleId);
return userRole;
}).collect(Collectors.toList());
appUserRoleService.saveBatch(userRoleList);
}
return Boolean.TRUE;
}
/**
* 查询全部的用户
* @param appUser
* @return
*/
@Override
public List<AppUserExcelVO> listUser(AppUserDTO appUser) {
List<AppUser> appUsers = baseMapper.selectList(null);
List<AppUserExcelVO> appUserExcelVOS = appUsers.stream().map(item -> {
AppUserExcelVO appUserExcelVO = new AppUserExcelVO();
BeanUtils.copyProperties(item, appUserExcelVO);
return appUserExcelVO;
}).collect(Collectors.toList());
return appUserExcelVOS;
}
@Override
public IPage getUsersWithRolePage(Page page, AppUserDTO appUserDTO) {
return baseMapper.getUserVosPage(page, appUserDTO);
}
@Override
public Boolean deleteUserById(Long userId) {
baseMapper.deleteById(userId);
appUserRoleService.removeById(Wrappers.<AppUserRole>lambdaQuery().eq(AppUserRole::getUserId, userId));
return Boolean.TRUE;
}
}
@@ -0,0 +1,16 @@
server:
port: 6060
spring:
application:
name: @artifactId@
cloud:
nacos:
discovery:
server-addr: ${NACOS_HOST:pigx-register}:${NACOS_PORT:8848}
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
config:
import:
- optional:nacos:application-@profiles.active@.yml
- optional:nacos:${spring.application.name}-@profiles.active@.yml
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
小技巧: 在根pom里面设置统一存放路径,统一管理方便维护
<properties>
<log-path>/Users/lengleng</log-path>
</properties>
1. 其他模块加日志输出,直接copy本文件放在resources 目录即可
2. 注意修改 <property name="${log-path}/log.path" value=""/> 的value模块
-->
<configuration debug="false" scan="false">
<property name="log.path" value="logs/${project.artifactId}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- Log file debug output -->
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/debug.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- Log file error output -->
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<logger name="org.activiti.engine.impl.db" level="DEBUG">
<appender-ref ref="debug"/>
</logger>
<!--nacos 心跳 INFO 屏蔽-->
<logger name="com.alibaba.nacos" level="OFF">
<appender-ref ref="error"/>
</logger>
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
</root>
</configuration>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppMenuMapper">
<resultMap id="appMenuMap" type="com.pig4cloud.pigx.app.api.entity.AppMenu">
<id property="menuId" column="menu_id"/>
<result property="name" column="name"/>
<result property="permission" column="permission"/>
<result property="path" column="path"/>
<result property="parentId" column="parent_id"/>
<result property="visible" column="visible"/>
<result property="sortOrder" column="sort_order"/>
<result property="menuType" column="menu_type"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
</mapper>
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppRoleMapper">
<resultMap id="appRoleMap" type="com.pig4cloud.pigx.app.api.entity.AppRole">
<id property="roleId" column="role_id"/>
<result property="roleName" column="role_name"/>
<result property="roleCode" column="role_code"/>
<result property="roleDesc" column="role_desc"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
<select id="listRolesByUserId" resultType="com.pig4cloud.pigx.app.api.entity.AppRole">
SELECT app_role.role_id,
app_role.role_name,
app_role.role_code,
app_role.role_desc,
app_role.create_time,
app_role.update_time,
app_role.del_flag
FROM app_role,
app_user_role
WHERE app_role.role_id = app_user_role.role_id
AND app_role.del_flag = '0'
and app_user_role.user_id = #{userId}
</select>
</mapper>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppRoleMenuMapper">
<resultMap id="appRoleMenuMap" type="com.pig4cloud.pigx.app.api.entity.AppRoleMenu">
<id property="roleId" column="role_id"/>
<result property="menuId" column="menu_id"/>
</resultMap>
</mapper>
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppUserMapper">
<resultMap id="appUserMap" type="com.pig4cloud.pigx.app.api.vo.AppUserVo">
<id property="userId" column="user_id"/>
<result property="username" column="username"/>
<result property="password" column="password"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="nickname" column="nickname"/>
<result property="name" column="name"/>
<result property="email" column="email"/>
<result property="createTime" column="create_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
<result property="lastModifiedTime" column="last_modified_time"/>
<collection property="roleList" ofType="com.pig4cloud.pigx.app.api.entity.AppRole"
select="com.pig4cloud.pigx.app.mapper.AppRoleMapper.listRolesByUserId" column="user_id">
</collection>
</resultMap>
<select id="getUserVosPage" resultMap="appUserMap">
select
u.user_id,
u.username,
u.password,
u.phone,
u.avatar,
u.create_time,
u.del_flag,
u.lock_flag,
u.tenant_id,
u.nickname,
u.name,
u.email
from app_user u
<where>
u.del_flag = '0'
<if test="query.username != null and query.username != ''">
<bind name="usernameLike" value="'%'+query.username+'%'"/>
AND u.username LIKE #{usernameLike}
</if>
</where>
</select>
</mapper>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppUserRoleMapper">
<resultMap id="appUserRoleMap" type="com.pig4cloud.pigx.app.api.entity.AppUserRole">
<id property="userId" column="user_id"/>
<result property="roleId" column="role_id"/>
</resultMap>
</mapper>
+21
View File
@@ -0,0 +1,21 @@
<?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.pig4cloud</groupId>
<artifactId>pigx</artifactId>
<version>4.5.0</version>
</parent>
<artifactId>pigx-app-server</artifactId>
<packaging>pom</packaging>
<!--项目子模块-->
<modules>
<module>pigx-app-server-api</module>
<module>pigx-app-server-biz</module>
</modules>
</project>
+23 -25
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
@@ -17,9 +16,7 @@
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
--><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>
<groupId>com.pig4cloud</groupId>
@@ -64,29 +61,29 @@
<docker.username>admin</docker.username>
<docker.password>Harbor12345</docker.password>
<docker.plugin.version>0.33.0</docker.plugin.version>
<!-- 默认忽略docker构建 -->
<!-- Ĭ�Ϻ���docker���� -->
<docker.skip>false</docker.skip>
</properties>
<dependencies>
<!--配置文件处理器-->
<!--�����������-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!--jasypt配置文件加解密-->
<!--jasypt�����ļ��ӽ���-->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>${jasypt.version}</version>
</dependency>
<!--监控-->
<!--���-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--监控客户端-->
<!--��ؿͻ���-->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
@@ -104,7 +101,7 @@
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<!--测试依赖-->
<!--��������-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
@@ -119,11 +116,12 @@
<module>pigx-upms</module>
<module>pigx-common</module>
<module>pigx-visual</module>
</modules>
<module>pigx-app-server</module>
</modules>
<dependencyManagement>
<dependencies>
<!--pigx 公共版本定义-->
<!--pigx �����汾����-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-bom</artifactId>
@@ -131,7 +129,7 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!--spring boot 公共版本定义-->
<!--spring boot �����汾����-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
@@ -139,7 +137,7 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!--spring cloud 公共版本定义-->
<!--spring cloud �����汾����-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
@@ -155,13 +153,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!--web 模块-->
<!--web �-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<!--排除tomcat依赖-->
<!--�ų�tomcat����-->
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
@@ -181,7 +179,7 @@
</resources>
<pluginManagement>
<plugins>
<!--spring boot 默认插件-->
<!--spring boot Ĭ�ϲ��-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
@@ -194,7 +192,7 @@
</execution>
</executions>
</plugin>
<!--maven docker 打包插件 -->
<!--maven docker ������ -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
@@ -221,13 +219,13 @@
</plugins>
</pluginManagement>
<plugins>
<!--代码格式插件,默认使用spring 规则-->
<!--�����ʽ�����Ĭ��ʹ��spring ����-->
<plugin>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-maven-plugin</artifactId>
<version>${spring.checkstyle.version}</version>
</plugin>
<!--代码编译指定版本插件-->
<!--�������ָ���汾���-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -239,7 +237,7 @@
<skip>true</skip>
</configuration>
</plugin>
<!--打包关联最新 git commit 信息插件-->
<!--����������� git commit ��Ϣ���-->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
@@ -248,7 +246,7 @@
</plugins>
</build>
<!-- 增加云效nexus示例仓库 (演示使用,可自行删除) -->
<!-- ������Чnexusʾ���ֿ� ����ʾʹ�ã�������ɾ���� -->
<distributionManagement>
<repository>
<id>rdc-releases</id>
@@ -288,11 +286,11 @@
<profile>
<id>dev</id>
<properties>
<!-- 环境标识,需要与配置文件的名称相对应 -->
<!-- ������ʶ����Ҫ�������ļ����������Ӧ -->
<profiles.active>dev</profiles.active>
</properties>
<activation>
<!-- 默认环境 -->
<!-- Ĭ�ϻ��� -->
<activeByDefault>true</activeByDefault>
</activation>
</profile>