修改角色管理中权限分配 新增登录日志表
修改 @Create 标识为 @since
This commit is contained in:
parent
623438ba57
commit
b160edca01
@ -1,6 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="central" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
|
@ -1,14 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-input disabled :value="$route.query.roleName" />
|
||||
<el-input :value="$route.query.roleName" disabled/>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
style="margin: 20px 0"
|
||||
:data="allPermissions"
|
||||
:default-checked-keys="assignPermission"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
node-key="id"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
:props="defaultProps"
|
||||
style="margin: 20px 0"
|
||||
/>
|
||||
<el-button :loading="loading" type="primary" @click="save">保存</el-button>
|
||||
<el-button @click="$router.replace({name: 'Role'})">取消</el-button>
|
||||
@ -48,8 +49,11 @@ export default {
|
||||
*/
|
||||
getPermissions(roleId) {
|
||||
this.$API.permission.toAssign(roleId).then(result => {
|
||||
const allPermissions = result.data
|
||||
const allPermissions = result.data.allPermissionList
|
||||
this.allPermissions = allPermissions
|
||||
const assignPermission = result.data.assignPermission
|
||||
this.assignPermission = assignPermission
|
||||
|
||||
const checkedIds = this.getCheckedIds(allPermissions)
|
||||
// console.log('getPermissions() checkedIds', checkedIds)
|
||||
this.$refs.tree.setCheckedKeys(checkedIds)
|
||||
|
@ -13,7 +13,7 @@ import java.util.Date;
|
||||
* 日期操作工具类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/12 18:04
|
||||
* @since 2023/10/12 18:04
|
||||
*/
|
||||
public class DateUtil {
|
||||
|
||||
|
@ -10,7 +10,7 @@ import java.util.Date;
|
||||
* Package: com.yovinchen.xlcs.common.utils
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/22 15:50
|
||||
* @since 2023/9/22 15:50
|
||||
*/
|
||||
public class JwtHelper {
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* Package: com.yovinchen.xlcs.mq.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 23:32
|
||||
* @since 2023/9/16 23:32
|
||||
*/
|
||||
@Configuration
|
||||
public class MQConfig {
|
||||
|
@ -13,7 +13,7 @@ import javax.annotation.PostConstruct;
|
||||
* Package: com.yovinchen.xlcs.mq.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 23:33
|
||||
* @since 2023/9/16 23:33
|
||||
*/
|
||||
@Component
|
||||
public class MQProducerAckConfig implements RabbitTemplate.ReturnCallback, RabbitTemplate.ConfirmCallback {
|
||||
|
@ -5,7 +5,7 @@ package com.yovinchen.xlcs.mq.constant;
|
||||
* Package: com.yovinchen.xlcs.mq.constant
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 23:34
|
||||
* @since 2023/9/16 23:34
|
||||
*/
|
||||
public class MqConst {
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
|
||||
* Package: com.yovinchen.xlcs.common.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 18:12
|
||||
* @since 2023/9/16 18:12
|
||||
*/
|
||||
@Service
|
||||
public class RabbitService {
|
||||
|
@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* Package: com.yovinchen.xlcs.common.aspect
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2024/1/23 10:43
|
||||
* @since 2024/1/23 10:43
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
|
@ -7,7 +7,7 @@ import com.yovinchen.xlcs.vo.user.UserLoginVo;
|
||||
* Package: com.yovinchen.xlcs.common.auth
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/22 17:40
|
||||
* @since 2023/9/22 17:40
|
||||
*/
|
||||
//ThreadLocal工具类
|
||||
public class AuthContextHolder {
|
||||
|
@ -12,7 +12,7 @@ import javax.annotation.Resource;
|
||||
* Package: com.yovinchen.xlcs.common.auth
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/22 23:58
|
||||
* @since 2023/9/22 23:58
|
||||
*/
|
||||
@Configuration
|
||||
public class LoginMvcConfigurerAdapter extends WebMvcConfigurationSupport {
|
||||
|
@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
* Package: com.yovinchen.xlcs.common.auth
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/22 23:47
|
||||
* @since 2023/9/22 23:47
|
||||
*/
|
||||
public class UserLoginInterceptor implements HandlerInterceptor {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
* MybatisPlus配置类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 12:56
|
||||
* @since 2023/9/13 12:56
|
||||
*/
|
||||
@EnableTransactionManagement
|
||||
@Configuration
|
||||
|
@ -26,7 +26,7 @@ import java.time.Duration;
|
||||
* Redis配置类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/22 15:55
|
||||
* @since 2023/9/22 15:55
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
|
@ -15,7 +15,7 @@ import org.springframework.util.StringUtils;
|
||||
* Package: com.yovinchen.xlcs.common.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/12 16:48
|
||||
* @since 2023/10/12 16:48
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.common.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 13:18
|
||||
* @since 2023/9/13 13:18
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2WebMvc
|
||||
|
@ -6,7 +6,7 @@ package com.yovinchen.xlcs.common.constant;
|
||||
* Redis常量配置类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/22 15:57
|
||||
* @since 2023/9/22 15:57
|
||||
*/
|
||||
public class RedisConst {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
* 统一异常处理类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 13:03
|
||||
* @since 2023/9/13 13:03
|
||||
*/
|
||||
|
||||
@ControllerAdvice
|
||||
|
@ -9,7 +9,7 @@ import lombok.Data;
|
||||
* 自定义异常类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 13:05
|
||||
* @since 2023/9/13 13:05
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -8,7 +8,7 @@ import lombok.Data;
|
||||
* 统一返回结果类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 13:01
|
||||
* @since 2023/9/13 13:01
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> {
|
||||
|
@ -8,7 +8,7 @@ import lombok.Getter;
|
||||
* 统一返回结果状态信息类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 12:59
|
||||
* @since 2023/9/13 12:59
|
||||
*/
|
||||
@Getter
|
||||
public enum ResultCodeEnum {
|
||||
|
@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 08:49
|
||||
* @since 2023/9/14 08:49
|
||||
*/
|
||||
public class CodeGet {
|
||||
|
||||
@ -25,7 +25,7 @@ public class CodeGet {
|
||||
// 2、全局配置
|
||||
// 全局配置
|
||||
GlobalConfig gc = new GlobalConfig();
|
||||
gc.setOutputDir("yovinchen-xlcs-parent/service/service-order" + "/src/main/java");
|
||||
gc.setOutputDir("xlcs-parent/service/service-acl" + "/src/main/java");
|
||||
|
||||
gc.setServiceName("%sService"); //去掉Service接口的首字母I
|
||||
gc.setAuthor("yovinchen");
|
||||
@ -34,17 +34,17 @@ public class CodeGet {
|
||||
|
||||
// 3、数据源配置
|
||||
DataSourceConfig dsc = new DataSourceConfig();
|
||||
dsc.setUrl("jdbc:mysql://82.157.68.223:3306/shequ-order?serverTimezone=GMT%2B8&useSSL=false");
|
||||
dsc.setUrl("jdbc:mysql://82.157.68.223:3306/shequ-acl?serverTimezone=GMT%2B8&useSSL=false");
|
||||
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||
dsc.setUsername("shequ-order");
|
||||
dsc.setPassword("shequ-order");
|
||||
dsc.setUsername("shequ-acl");
|
||||
dsc.setPassword("shequ-acl");
|
||||
dsc.setDbType(DbType.MYSQL);
|
||||
mpg.setDataSource(dsc);
|
||||
|
||||
// 4、包配置
|
||||
PackageConfig pc = new PackageConfig();
|
||||
pc.setParent("com.yovinchen.xlcs");
|
||||
pc.setModuleName("order"); //模块名
|
||||
pc.setModuleName("acl"); //模块名
|
||||
pc.setController("controller");
|
||||
pc.setService("service");
|
||||
pc.setMapper("mapper");
|
||||
@ -53,7 +53,7 @@ public class CodeGet {
|
||||
// 5、策略配置
|
||||
StrategyConfig strategy = new StrategyConfig();
|
||||
|
||||
strategy.setInclude("cart_info", "order_info", "order_deliver", "order_item", "order_log", "order_return_apply", "order_return_reason", "order_set", "payment_info", "refund_info");
|
||||
strategy.setInclude("role_permission", "admin_login_log");
|
||||
|
||||
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.model.acl;
|
||||
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -12,8 +12,8 @@ import lombok.Data;
|
||||
* 用户
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "用户")
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.yovinchen.xlcs.model.acl;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 后台用户登录日志表
|
||||
* </p>
|
||||
*
|
||||
* @author yovinchen
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "后台用户登录日志表")
|
||||
@TableName("admin_login_log")
|
||||
public class AdminLoginLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@TableField("admin_id")
|
||||
private Long adminId;
|
||||
|
||||
@ApiModelProperty(value = "IP地址")
|
||||
@TableField("ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
@TableField("address")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "浏览器登录类型")
|
||||
@TableField("user_agent")
|
||||
private String userAgent;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.model.acl;
|
||||
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -12,8 +12,8 @@ import lombok.Data;
|
||||
* 用户角色
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "用户角色")
|
||||
|
@ -2,9 +2,9 @@
|
||||
//
|
||||
package com.yovinchen.xlcs.model.acl;
|
||||
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -16,8 +16,8 @@ import java.util.List;
|
||||
* 权限
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "权限")
|
||||
|
@ -2,9 +2,9 @@
|
||||
//
|
||||
package com.yovinchen.xlcs.model.acl;
|
||||
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -14,8 +14,8 @@ import lombok.Data;
|
||||
* 角色
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "角色")
|
||||
|
@ -2,9 +2,9 @@
|
||||
//
|
||||
package com.yovinchen.xlcs.model.acl;
|
||||
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -14,8 +14,8 @@ import lombok.Data;
|
||||
* 角色权限
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "角色权限")
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.yovinchen.xlcs.model.activity;
|
||||
|
||||
import com.yovinchen.xlcs.enums.ActivityType;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yovinchen.xlcs.enums.ActivityType;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -16,7 +16,7 @@ import java.util.Date;
|
||||
* ActivityInfo
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "ActivityInfo")
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.yovinchen.xlcs.model.activity;
|
||||
|
||||
import com.yovinchen.xlcs.enums.ActivityType;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.enums.ActivityType;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -15,7 +15,7 @@ import java.math.BigDecimal;
|
||||
* ActivityRule
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "ActivityRule")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.model.activity;
|
||||
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -12,7 +12,7 @@ import lombok.Data;
|
||||
* ActivitySku
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "ActivitySku")
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.yovinchen.xlcs.model.activity;
|
||||
|
||||
import com.yovinchen.xlcs.enums.CouponRangeType;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.enums.CouponRangeType;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -13,7 +13,7 @@ import lombok.Data;
|
||||
* CouponRange
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "CouponRange")
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.yovinchen.xlcs.model.activity;
|
||||
|
||||
import com.yovinchen.xlcs.enums.CouponStatus;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yovinchen.xlcs.enums.CouponStatus;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -15,7 +15,7 @@ import java.util.Date;
|
||||
* CouponUse
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "优惠券领取记录表")
|
||||
|
@ -13,8 +13,8 @@ import java.io.Serializable;
|
||||
* 用户查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "用户查询实体")
|
||||
|
@ -13,8 +13,8 @@ import java.io.Serializable;
|
||||
* 角色查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @since 2019-11-08
|
||||
* @author yovinchen
|
||||
* @since 2023-09-21
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "角色查询实体")
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
* OrderDetailActivity
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
public class CartInfoVo implements Serializable {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.vo.order;
|
||||
|
||||
import com.yovinchen.xlcs.vo.user.LeaderAddressVo;
|
||||
import com.yovinchen.xlcs.model.activity.CouponInfo;
|
||||
import com.yovinchen.xlcs.vo.user.LeaderAddressVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ -14,7 +14,7 @@ import java.util.List;
|
||||
* OrderDetailActivity
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
public class OrderConfirmVo implements Serializable {
|
||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||
* OrderDetailActivity
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
public class OrderMqVo implements Serializable {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.yovinchen.xlcs.vo.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -10,7 +9,7 @@ import lombok.Data;
|
||||
* UserAddress
|
||||
* </p>
|
||||
*
|
||||
* @author qy
|
||||
* @author yovinchen
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "用户地址")
|
||||
|
@ -19,7 +19,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.client.activity
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/26 14:10
|
||||
* @since 2023/9/26 14:10
|
||||
*/
|
||||
@FeignClient(value = "service-activity")
|
||||
public interface ActivityFeignClient {
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.client.cart
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/12 15:49
|
||||
* @since 2023/10/12 15:49
|
||||
*/
|
||||
@FeignClient(value = "service-cart")
|
||||
public interface CartFeignClient {
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
* Package: com.yovinchen.xlcs.client.order
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 11:03
|
||||
* @since 2023/10/13 11:03
|
||||
*/
|
||||
@FeignClient(value = "service-order")
|
||||
public interface OrderFeignClient {
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.client.product
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 17:45
|
||||
* @since 2023/9/16 17:45
|
||||
*/
|
||||
@FeignClient(value = "service-product")
|
||||
public interface ProductFeignClient {
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.client.search
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/25 22:44
|
||||
* @since 2023/9/25 22:44
|
||||
*/
|
||||
@FeignClient("service-search")
|
||||
public interface SkuFeignClient {
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
* Package: com.yovinchen.xlcs.client.user
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/25 12:27
|
||||
* @since 2023/9/25 12:27
|
||||
*/
|
||||
@FeignClient(value = "service-user")
|
||||
public interface UserFeignClient {
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/20 16:51
|
||||
* @since 2023/9/20 16:51
|
||||
*/
|
||||
|
||||
@SpringBootApplication
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
* Package: com.yovinchen.xlcs.config.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/20 16:52
|
||||
* @since 2023/9/20 16:52
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsConfig {
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* 权限管理模块启动类
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 17:38
|
||||
* @since 2023/9/13 17:38
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
|
@ -1,14 +1,14 @@
|
||||
package com.yovinchen.xlcs.acl.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yovinchen.xlcs.acl.service.AdminService;
|
||||
import com.yovinchen.xlcs.acl.service.RoleService;
|
||||
import com.yovinchen.xlcs.common.result.Result;
|
||||
import com.yovinchen.xlcs.common.utils.MD5;
|
||||
import com.yovinchen.xlcs.model.acl.Admin;
|
||||
import com.yovinchen.xlcs.vo.acl.AdminQueryVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
@ -25,7 +25,7 @@ import java.util.Map;
|
||||
* 用户管理 前端控制器
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 10:38
|
||||
* @since 2023/9/14 10:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/acl/user")
|
||||
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.acl.controller
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/13 18:00
|
||||
* @since 2023/9/13 18:00
|
||||
*/
|
||||
|
||||
@Api(tags = "登录接口")
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.yovinchen.xlcs.acl.controller;
|
||||
|
||||
import com.yovinchen.xlcs.acl.service.PermissionService;
|
||||
import com.yovinchen.xlcs.acl.service.RoleService;
|
||||
import com.yovinchen.xlcs.common.result.Result;
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ClassName: PermissionController
|
||||
@ -17,7 +19,7 @@ import java.util.List;
|
||||
* 菜单服务
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 14:03
|
||||
* @since 2023/9/14 14:03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/acl/permission")
|
||||
@ -28,6 +30,8 @@ public class PermissionController {
|
||||
@Autowired
|
||||
private PermissionService permissionService;
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
@ApiOperation(value = "获取菜单")
|
||||
@GetMapping
|
||||
public Result index() {
|
||||
@ -71,4 +75,29 @@ public class PermissionController {
|
||||
throw new RuntimeException("递归删除菜单异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据角色获取菜单数据")
|
||||
@GetMapping("/toAssign/{roleId}")
|
||||
public Result toAssign(@PathVariable Long roleId) {
|
||||
Map<String, Object> roleMap = permissionService.findPermissionByRoleId(roleId);
|
||||
return Result.ok(roleMap);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据用户分配角色")
|
||||
@PostMapping("/doAssign")
|
||||
public Result doAssign(@RequestParam Long roleId, @RequestParam Long[] permissionId) {
|
||||
permissionService.saveRolePermissionRealtionShip(roleId, permissionId);
|
||||
return Result.ok(null);
|
||||
}
|
||||
// @ApiOperation(value = "获取一个角色的所有权限列表")
|
||||
// @GetMapping("toAssign/{id}")
|
||||
// public Result toAssign(@PathVariable Long id) {
|
||||
// try {
|
||||
// Map<String, Object> result = permissionService.getPermissionById(id);
|
||||
// return Result.ok(result);
|
||||
// } catch (Exception e) {
|
||||
// // 处理异常,例如记录日志或者抛出自定义异常
|
||||
// throw new RuntimeException("获取一个角色的所有权限列表异常", e);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ClassName: RoleController
|
||||
@ -23,7 +22,7 @@ import java.util.Map;
|
||||
* 角色管理 前端控制器
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 09:09
|
||||
* @since 2023/9/14 09:09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/acl/role")
|
||||
@ -111,16 +110,4 @@ public class RoleController {
|
||||
throw new RuntimeException("根据id列表删除角色异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取一个角色的所有权限列表")
|
||||
@GetMapping("toAssign/{id}")
|
||||
public Result toAssign(@PathVariable Long id) {
|
||||
try {
|
||||
Map<String, Object> result = permissionService.getPermissionById(id);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
// 处理异常,例如记录日志或者抛出自定义异常
|
||||
throw new RuntimeException("获取一个角色的所有权限列表异常", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.acl.mapper;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.Admin;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yovinchen.xlcs.model.acl.Admin;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
|
||||
* 用户管理
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 10:45
|
||||
* @since 2023/9/14 10:45
|
||||
*/
|
||||
@Repository
|
||||
public interface AdminMapper extends BaseMapper<Admin> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.acl.mapper;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.AdminRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yovinchen.xlcs.model.acl.AdminRole;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
|
||||
* Package: com.yovinchen.xlcs.acl.mapper
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 11:15
|
||||
* @since 2023/9/14 11:15
|
||||
*/
|
||||
@Repository
|
||||
public interface AdminRoleMapper extends BaseMapper<AdminRole> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.acl.mapper;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
|
||||
* 菜单Mapper接口
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 13:59
|
||||
* @since 2023/9/14 13:59
|
||||
*/
|
||||
@Repository
|
||||
public interface PermissionMapper extends BaseMapper<Permission> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.acl.mapper;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.Role;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yovinchen.xlcs.model.acl.Role;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
|
||||
* 角色管理
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 09:11
|
||||
* @since 2023/9/14 09:11
|
||||
*/
|
||||
@Repository
|
||||
public interface RoleMapper extends BaseMapper<Role> {
|
||||
|
@ -1,14 +1,14 @@
|
||||
package com.yovinchen.xlcs.acl.mapper;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.RolePermission;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yovinchen.xlcs.model.acl.RolePermission;
|
||||
|
||||
/**
|
||||
* ClassName: RolePermissionMapper
|
||||
* Package: com.yovinchen.xlcs.acl.mapper
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 15:07
|
||||
* @since 2023/9/14 15:07
|
||||
*/
|
||||
public interface RolePermissionMapper extends BaseMapper<RolePermission> {
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
package com.yovinchen.xlcs.acl.service;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.AdminRole;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yovinchen.xlcs.model.acl.AdminRole;
|
||||
|
||||
/**
|
||||
* ClassName: AdminRoleService
|
||||
* Package: com.yovinchen.xlcs.acl.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 11:15
|
||||
* @since 2023/9/14 11:15
|
||||
*/
|
||||
public interface AdminRoleService extends IService<AdminRole> {
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.yovinchen.xlcs.acl.service;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.Admin;
|
||||
import com.yovinchen.xlcs.vo.acl.AdminQueryVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yovinchen.xlcs.model.acl.Admin;
|
||||
import com.yovinchen.xlcs.vo.acl.AdminQueryVo;
|
||||
|
||||
/**
|
||||
* ClassName: AdminService
|
||||
@ -12,7 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* 用户管理
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 10:44
|
||||
* @since 2023/9/14 10:44
|
||||
*/
|
||||
public interface AdminService extends IService<Admin> {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.acl.service;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -12,7 +12,7 @@ import java.util.Map;
|
||||
* 权限服务
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 14:01
|
||||
* @since 2023/9/14 14:01
|
||||
*/
|
||||
public interface PermissionService extends IService<Permission> {
|
||||
|
||||
@ -23,4 +23,8 @@ public interface PermissionService extends IService<Permission> {
|
||||
boolean removeChildById(Long id);
|
||||
|
||||
Map<String, Object> getPermissionById(Long id);
|
||||
|
||||
void saveRolePermissionRealtionShip(Long roleId, Long[] permissionId);
|
||||
|
||||
Map<String, Object> findPermissionByRoleId(Long roleId);
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.yovinchen.xlcs.acl.service;
|
||||
|
||||
import com.yovinchen.xlcs.model.acl.Role;
|
||||
import com.yovinchen.xlcs.vo.acl.RoleQueryVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yovinchen.xlcs.model.acl.Role;
|
||||
import com.yovinchen.xlcs.vo.acl.RoleQueryVo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -14,7 +14,7 @@ import java.util.Map;
|
||||
* 用户管理
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 09:10
|
||||
* @since 2023/9/14 09:10
|
||||
*/
|
||||
public interface RoleService extends IService<Role> {
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.yovinchen.xlcs.acl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yovinchen.xlcs.acl.mapper.AdminRoleMapper;
|
||||
import com.yovinchen.xlcs.acl.service.AdminRoleService;
|
||||
import com.yovinchen.xlcs.model.acl.AdminRole;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
* Package: com.yovinchen.xlcs.acl.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 11:15
|
||||
* @since 2023/9/14 11:15
|
||||
*/
|
||||
@Service
|
||||
public class AdminRoleServiceImpl extends ServiceImpl<AdminRoleMapper, AdminRole>
|
||||
|
@ -20,7 +20,7 @@ import org.springframework.util.StringUtils;
|
||||
* 用户管理
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 10:44
|
||||
* @since 2023/9/14 10:44
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
@ -1,27 +1,38 @@
|
||||
package com.yovinchen.xlcs.acl.service.impl;
|
||||
|
||||
import com.yovinchen.xlcs.acl.mapper.PermissionMapper;
|
||||
import com.yovinchen.xlcs.acl.service.PermissionService;
|
||||
import com.yovinchen.xlcs.acl.utils.PermissionHelper;
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yovinchen.xlcs.acl.mapper.PermissionMapper;
|
||||
import com.yovinchen.xlcs.acl.service.PermissionService;
|
||||
import com.yovinchen.xlcs.acl.service.RolePermissionService;
|
||||
import com.yovinchen.xlcs.acl.utils.PermissionHelper;
|
||||
import com.yovinchen.xlcs.model.acl.Permission;
|
||||
import com.yovinchen.xlcs.model.acl.RolePermission;
|
||||
import com.yovinchen.xlcs.model.base.BaseEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* ClassName: PermissionServiceImpl
|
||||
* Package: com.yovinchen.xlcs.acl.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 14:02
|
||||
* @since 2023/9/14 14:02
|
||||
*/
|
||||
@Service
|
||||
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {
|
||||
|
||||
@Autowired
|
||||
private RolePermissionService rolePermissionService;
|
||||
|
||||
/**
|
||||
* 获取所有菜单
|
||||
@ -57,6 +68,71 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配菜单
|
||||
*
|
||||
* @param roleId
|
||||
* @param permissionIds
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveRolePermissionRealtionShip(Long roleId, Long[] permissionIds) {
|
||||
//删除用户分配的角色数据
|
||||
rolePermissionService.remove(new LambdaQueryWrapper<RolePermission>().eq(RolePermission::getRoleId, roleId));
|
||||
|
||||
//分配新的角色
|
||||
List<RolePermission> rolePermissionList = new ArrayList<>();
|
||||
for (Long permissionId : permissionIds) {
|
||||
if (StringUtils.isEmpty(roleId)) {
|
||||
continue;
|
||||
}
|
||||
RolePermission rolePermission = new RolePermission();
|
||||
rolePermission.setRoleId(roleId);
|
||||
rolePermission.setPermissionId(permissionId);
|
||||
rolePermissionList.add(rolePermission);
|
||||
}
|
||||
rolePermissionService.saveBatch(rolePermissionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户获取菜单数据
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> findPermissionByRoleId(Long roleId) {
|
||||
//查询所有的角色
|
||||
List<Permission> allPermissionList = queryAllMenu();
|
||||
List<Permission> assignPermission1 = baseMapper.selectList(null);
|
||||
|
||||
//拥有的角色id
|
||||
List<RolePermission> existRolePermissionList = rolePermissionService.list(new LambdaQueryWrapper<RolePermission>().eq(RolePermission::getRoleId, roleId)
|
||||
.select(RolePermission::getPermissionId));
|
||||
|
||||
List<Long> existPermissionList = existRolePermissionList.stream()
|
||||
.map(RolePermission::getPermissionId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//对角色进行分类
|
||||
List<Permission> assignPermission2 = new ArrayList<>();
|
||||
for (Permission permission : assignPermission1) {
|
||||
//已分配
|
||||
if (existPermissionList.contains(permission.getId())) {
|
||||
assignPermission2.add(permission);
|
||||
}
|
||||
}
|
||||
List<Long> assignPermission = assignPermission2.stream()
|
||||
.map(BaseEntity::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Map<String, Object> roleMap = new HashMap<>();
|
||||
roleMap.put("assignPermission", assignPermission);
|
||||
roleMap.put("allPermissionList", allPermissionList);
|
||||
return roleMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归获取子节点
|
||||
*
|
||||
@ -64,8 +140,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
||||
* @param idList
|
||||
*/
|
||||
private void selectChildListById(Long id, List<Long> idList) {
|
||||
List<Permission> childList = baseMapper.selectList(new QueryWrapper<Permission>()
|
||||
.eq("pid", id)
|
||||
List<Permission> childList = baseMapper.selectList(new QueryWrapper<Permission>().eq("pid", id)
|
||||
.select("id"));
|
||||
childList.forEach(item -> {
|
||||
idList.add(item.getId());
|
||||
|
@ -1,16 +1,16 @@
|
||||
package com.yovinchen.xlcs.acl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yovinchen.xlcs.acl.mapper.RoleMapper;
|
||||
import com.yovinchen.xlcs.acl.service.AdminRoleService;
|
||||
import com.yovinchen.xlcs.acl.service.RoleService;
|
||||
import com.yovinchen.xlcs.model.acl.AdminRole;
|
||||
import com.yovinchen.xlcs.model.acl.Role;
|
||||
import com.yovinchen.xlcs.vo.acl.RoleQueryVo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -28,7 +28,7 @@ import java.util.stream.Collectors;
|
||||
* 角色管理
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 09:11
|
||||
* @since 2023/9/14 09:11
|
||||
*/
|
||||
@Service
|
||||
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.acl.utils
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/14 14:23
|
||||
* @since 2023/9/14 14:23
|
||||
*/
|
||||
public class PermissionHelper {
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/17 12:08
|
||||
* @since 2023/9/17 12:08
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
|
@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.activity.api
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/26 14:12
|
||||
* @since 2023/9/26 14:12
|
||||
*/
|
||||
@Api(tags = "促销与优惠券接口")
|
||||
@RestController
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/8 22:26
|
||||
* @since 2023/10/8 22:26
|
||||
*/
|
||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//取消数据源自动配置
|
||||
@EnableDiscoveryClient
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.cart.cart.controller
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/8 22:32
|
||||
* @since 2023/10/8 22:32
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/cart")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.cart.receiver;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.yovinchen.xlcs.cart.service.CartInfoService;
|
||||
import com.yovinchen.xlcs.mq.constant.MqConst;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
@ -18,7 +18,7 @@ import java.io.IOException;
|
||||
* Package: com.yovinchen.xlcs.cart.cart.receiver
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 08:56
|
||||
* @since 2023/10/13 08:56
|
||||
*/
|
||||
@Component
|
||||
public class CartReceiver {
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.cart.cart.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/8 22:33
|
||||
* @since 2023/10/8 22:33
|
||||
*/
|
||||
public interface CartInfoService {
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ import java.util.stream.Collectors;
|
||||
* Package: com.yovinchen.xlcs.cart.cart.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/8 22:34
|
||||
* @since 2023/10/8 22:34
|
||||
*/
|
||||
@Service
|
||||
public class CartInfoServiceImpl implements CartInfoService {
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/25 12:06
|
||||
* @since 2023/9/25 12:06
|
||||
*/
|
||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//取消数据源自动配置
|
||||
@EnableDiscoveryClient
|
||||
|
@ -13,7 +13,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* Package: com.yovinchen.xlcs.home.config
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/8 14:47
|
||||
* @since 2023/10/8 14:47
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
|
@ -22,7 +22,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.home.controller
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/25 12:10
|
||||
* @since 2023/9/25 12:10
|
||||
*/
|
||||
|
||||
@Api(tags = "首页接口")
|
||||
|
@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.home.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/25 12:12
|
||||
* @since 2023/9/25 12:12
|
||||
*/
|
||||
public interface HomeService {
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.home.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/7 15:01
|
||||
* @since 2023/10/7 15:01
|
||||
*/
|
||||
public interface ItemService {
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.home.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/25 12:12
|
||||
* @since 2023/9/25 12:12
|
||||
*/
|
||||
@Service
|
||||
public class HomeServiceImpl implements HomeService {
|
||||
|
@ -19,7 +19,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
* Package: com.yovinchen.xlcs.home.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/7 15:02
|
||||
* @since 2023/10/7 15:02
|
||||
*/
|
||||
@Service
|
||||
public class ItemServiceImpl implements ItemService {
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/11 19:09
|
||||
* @since 2023/10/11 19:09
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.order.receiver;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.yovinchen.xlcs.mq.constant.MqConst;
|
||||
import com.yovinchen.xlcs.order.service.OrderInfoService;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
@ -19,7 +19,7 @@ import java.io.IOException;
|
||||
* Package: com.yovinchen.xlcs.order.receiver
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 14:15
|
||||
* @since 2023/10/13 14:15
|
||||
*/
|
||||
@Component
|
||||
public class OrderReceiver {
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
* Package: vom.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:29
|
||||
* @since 2023/10/13 10:29
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
|
@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* 微信支付API
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:32
|
||||
* @since 2023/10/13 10:32
|
||||
*/
|
||||
@Api(tags = "微信支付接口")
|
||||
@RestController
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.yovinchen.xlcs.payment.service;
|
||||
|
||||
import com.yovinchen.xlcs.model.order.PaymentInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yovinchen.xlcs.model.order.PaymentInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -10,7 +10,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.payment.payment.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:33
|
||||
* @since 2023/10/13 10:33
|
||||
*/
|
||||
|
||||
public interface PaymentInfoService extends IService<PaymentInfo> {
|
||||
|
@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.payment.payment.controller.payment.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:32
|
||||
* @since 2023/10/13 10:32
|
||||
*/
|
||||
public interface WeixinService {
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.yovinchen.xlcs.payment.service.impl;
|
||||
|
||||
import com.github.wxpay.sdk.WXPayUtil;
|
||||
import com.yovinchen.xlcs.common.constant.RedisConst;
|
||||
import com.yovinchen.xlcs.model.order.PaymentInfo;
|
||||
import com.yovinchen.xlcs.payment.service.PaymentInfoService;
|
||||
@ -7,7 +8,6 @@ import com.yovinchen.xlcs.payment.service.WeixinService;
|
||||
import com.yovinchen.xlcs.payment.utils.ConstantPropertiesUtils;
|
||||
import com.yovinchen.xlcs.payment.utils.HttpClient;
|
||||
import com.yovinchen.xlcs.vo.user.UserLoginVo;
|
||||
import com.github.wxpay.sdk.WXPayUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -23,7 +23,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.payment.payment.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:33
|
||||
* @since 2023/10/13 10:33
|
||||
*/
|
||||
@Service
|
||||
public class WeXinServiceImpl implements WeixinService {
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
|
||||
* Package: com.yovinchen.xlcs.payment.payment.utils
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:48
|
||||
* @since 2023/10/13 10:48
|
||||
*/
|
||||
@Component
|
||||
public class ConstantPropertiesUtils implements InitializingBean {
|
||||
|
@ -33,7 +33,7 @@ import java.util.Map;
|
||||
* Package: com.yovinchen.xlcs.payment.payment.utils
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 10:47
|
||||
* @since 2023/10/13 10:47
|
||||
*/
|
||||
public class HttpClient {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/15 09:47
|
||||
* @since 2023/9/15 09:47
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.product.api
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 17:28
|
||||
* @since 2023/9/16 17:28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/product")
|
||||
|
@ -15,7 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
* Package: com.yovinchen.xlcs.product.controller
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/15 13:56
|
||||
* @since 2023/9/15 13:56
|
||||
*/
|
||||
@Api(tags = "文件上传接口")
|
||||
@RestController
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.product.receiver;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.yovinchen.xlcs.mq.constant.MqConst;
|
||||
import com.yovinchen.xlcs.product.service.SkuInfoService;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
@ -19,7 +19,7 @@ import java.io.IOException;
|
||||
* Package: com.yovinchen.xlcs.product.receiver
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 15:05
|
||||
* @since 2023/10/13 15:05
|
||||
*/
|
||||
@Component
|
||||
public class StockReceiver {
|
||||
|
@ -7,7 +7,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
* Package: com.yovinchen.xlcs.product.service
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/15 13:57
|
||||
* @since 2023/9/15 13:57
|
||||
*/
|
||||
public interface FileUploadService {
|
||||
String fileUpload(MultipartFile file) throws Exception;
|
||||
|
@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
* Package: com.yovinchen.xlcs.product.service.impl
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/15 13:57
|
||||
* @since 2023/9/15 13:57
|
||||
*/
|
||||
@Service
|
||||
public class FileUploadServiceImpl implements FileUploadService {
|
||||
|
@ -15,7 +15,7 @@ import java.security.NoSuchAlgorithmException;
|
||||
* Package: com.yovinchen.xlcs.product.utils
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/13 17:55
|
||||
* @since 2023/10/13 17:55
|
||||
*/
|
||||
public class FileUploader {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
* Package: com.yovinchen.xlcs
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 17:20
|
||||
* @since 2023/9/16 17:20
|
||||
*/
|
||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//取消数据源自动配置
|
||||
@EnableDiscoveryClient
|
||||
|
@ -5,7 +5,7 @@ package com.yovinchen.xlcs.search.api;
|
||||
* Package: com.yovinchen.xlcs.search.api
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/26 14:21
|
||||
* @since 2023/9/26 14:21
|
||||
*/
|
||||
public class SearchApiController {
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||
* Package: com.yovinchen.xlcs.search.controller
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 17:22
|
||||
* @since 2023/9/16 17:22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/search/sku")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.yovinchen.xlcs.search.receiver;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.yovinchen.xlcs.mq.constant.MqConst;
|
||||
import com.yovinchen.xlcs.search.service.SkuService;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
@ -18,7 +18,7 @@ import java.io.IOException;
|
||||
* Package: com.yovinchen.xlcs.search.receiver
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/9/16 23:57
|
||||
* @since 2023/9/16 23:57
|
||||
*/
|
||||
@Component
|
||||
public class SkuReceiver {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user