parent
a6f4cdb932
commit
f7a5b7c9f7
|
|
@ -5,14 +5,12 @@ import com.czg.resp.CzgResult;
|
|||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.service.AuthorizationService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商户登录相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
|
|
@ -24,13 +22,22 @@ public class AuthorizationController {
|
|||
this.authorizationService = authorizationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码获取
|
||||
* @return 验证码信息
|
||||
*/
|
||||
@GetMapping("captcha")
|
||||
public CzgResult<?> captcha() {
|
||||
return CzgResult.success(authorizationService.getCaptcha());
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户登录
|
||||
* @param loginDTO 登录参数
|
||||
* @return token信息
|
||||
*/
|
||||
@PostMapping("login")
|
||||
public CzgResult<?> login(@Validated SysLoginDTO loginDTO) {
|
||||
public CzgResult<?> login(@Validated @RequestBody SysLoginDTO loginDTO) {
|
||||
return CzgResult.success(authorizationService.login(loginDTO));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.czg.controller;
|
||||
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.service.account.service.SysMenuService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
* @author zs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/menus")
|
||||
public class MenuController {
|
||||
|
||||
@Resource
|
||||
private SysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 获取当前用户菜单列表
|
||||
* @return 菜单结构
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<?> get() {
|
||||
return CzgResult.success(menuService.getMenu());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.czg.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.service.account.service.ShopInfoService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -19,6 +21,7 @@ public class ShopInfoController {
|
|||
this.shopInfoService = shopInfoService;
|
||||
}
|
||||
|
||||
@SaAdminCheckPermission("shopInfo:add")
|
||||
@PostMapping
|
||||
public CzgResult add() {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<?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.czg</groupId>
|
||||
<artifactId>cash-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<name>异常处理模块</name>
|
||||
<description>异常处理</description>
|
||||
<artifactId>cash-common-exception</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.czg.handler;
|
||||
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
log.info("✅ GlobalExceptionHandler 已初始化");
|
||||
}
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Map<String, Object> handleRuntimeException(Exception e) {
|
||||
log.error("", e);
|
||||
Map<String, Object> error = new HashMap<>();
|
||||
error.put("code", 500);
|
||||
error.put("msg", e.getMessage());
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.czg.config;
|
||||
|
||||
/**
|
||||
*
|
||||
* key常量
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface RedisCst {
|
||||
String LOGIN_CODE = "login:code:";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.czg.config;
|
||||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
import com.czg.sa.StpKit;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自定义权限加载接口实现类
|
||||
* @author Administrator
|
||||
*/
|
||||
@Component // 保证此类被 SpringBoot 扫描,完成 Sa-Token 的自定义权限验证扩展
|
||||
public class StpInterfaceImpl implements StpInterface {
|
||||
|
||||
/**
|
||||
* 返回一个账号所拥有的权限码集合
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
if ("admin".equals(loginType)) {
|
||||
Object value = StpKit.ADMIN.getSaTokenDao().getObject("sa:permissionList:" + loginType + ":" + loginId);
|
||||
if (value instanceof List<?> list) {
|
||||
return (List<String>) list;
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一个账号所拥有的角色标识集合 (权限与角色可分开校验)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRoleList(Object loginId, String loginType) {
|
||||
if ("admin".equals(loginType)) {
|
||||
Object value = StpKit.ADMIN.getSaTokenDao().getObject("sa:roleList:" + loginType + ":" + loginId);
|
||||
if (value instanceof List<?> a) {
|
||||
return (List<String>) a;
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.czg.sa;
|
||||
|
||||
import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public class MyStpLogic extends StpLogic {
|
||||
@Resource
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 初始化 StpLogic, 并指定账号类型
|
||||
*
|
||||
* @param loginType 账号类型标识
|
||||
*/
|
||||
public MyStpLogic(String loginType) {
|
||||
super(loginType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加当前账号的角色
|
||||
* @param roleList 角色列表
|
||||
* @return 当前实例
|
||||
*/
|
||||
public MyStpLogic addRoleList(List<String> roleList) {
|
||||
this.getSaTokenDao().setObject("sa:roleList:" + getLoginType() + ":" + getLoginId(), roleList, getTokenTimeout());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加当前账号的权限
|
||||
* @param permissionList 角色列表
|
||||
* @return 当前实例
|
||||
*/
|
||||
public MyStpLogic addPermissionList(List<String> permissionList) {
|
||||
this.getSaTokenDao().setObject("sa:permissionList:" + getLoginType() + ":" + getLoginId(), permissionList, getTokenTimeout());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,11 +11,11 @@ public class StpKit {
|
|||
/**
|
||||
* Admin 会话对象,管理 Admin 表所有账号的登录、权限认证
|
||||
*/
|
||||
public static final StpLogic ADMIN = new StpLogic("admin");
|
||||
public static final MyStpLogic ADMIN = new MyStpLogic("admin");
|
||||
|
||||
/**
|
||||
* User 会话对象,管理 User 表所有账号的登录、权限认证
|
||||
*/
|
||||
public static final StpLogic USER = new StpLogic("user");
|
||||
public static final MyStpLogic USER = new MyStpLogic("user");
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<modules>
|
||||
<module>cash-common-tools</module>
|
||||
<module>cash-common-sa-token</module>
|
||||
<module>cash-common-exception</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@
|
|||
<artifactId>cash-common-tools</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-exception</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!-- Sa-Token 权限认证,在线文档:https://sa-token.cc -->
|
||||
<!-- sa-token 的漏洞的依赖处理 -->
|
||||
<!-- sa-token start -->
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@
|
|||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-tools</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-exception</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
package com.czg.service.account.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public record SysLoginDTO(
|
||||
@NotEmpty(message = "用户名不为空")
|
||||
String username,
|
||||
String username, // 用户名
|
||||
@NotEmpty(message = "密码不为空")
|
||||
String password,
|
||||
String password, // 密码
|
||||
@NotEmpty(message = "验证码不为空")
|
||||
String code,
|
||||
String code, // 验证码
|
||||
@NotEmpty(message = "uid不为空")
|
||||
String uuid,
|
||||
String staffName
|
||||
String uuid, // 验证码uid
|
||||
@NotNull
|
||||
Integer loginType // 登录类型 0:商户登录 1:员工登录
|
||||
) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,136 @@
|
|||
package com.czg.service.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统菜单 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("sys_menu")
|
||||
public class SysMenu implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 上级菜单ID
|
||||
*/
|
||||
private Long pid;
|
||||
|
||||
/**
|
||||
* 子菜单数目
|
||||
*/
|
||||
private Integer subCount;
|
||||
|
||||
/**
|
||||
* 菜单类型 0 菜单 1按钮 3接口
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 菜单标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 组件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 组件
|
||||
*/
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer menuSort;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 链接地址
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 是否外链
|
||||
*/
|
||||
private Boolean iFrame;
|
||||
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
private Boolean cache;
|
||||
|
||||
/**
|
||||
* 隐藏
|
||||
*/
|
||||
private Boolean hidden;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否选中父级菜单
|
||||
*/
|
||||
private String activeMenu;
|
||||
|
||||
/**
|
||||
* 商户使用 0:否;1:是;
|
||||
*/
|
||||
private Long isShop;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.czg.service.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 用户角色关联 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("sys_users_roles")
|
||||
public class SysUsersRoles implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Id
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Id
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,273 @@
|
|||
package com.czg.service.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 店铺信息 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_info")
|
||||
public class TbShopInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 使用系统用户 sys_user id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Integer mainId;
|
||||
|
||||
/**
|
||||
* 店铺口号
|
||||
*/
|
||||
private String subTitle;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 连锁店扩展店名
|
||||
*/
|
||||
private String chainName;
|
||||
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
private String backImg;
|
||||
|
||||
/**
|
||||
* 门头照
|
||||
*/
|
||||
private String frontImg;
|
||||
|
||||
/**
|
||||
* 联系人姓名
|
||||
*/
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 店铺logo
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 封面图
|
||||
*/
|
||||
private String coverImg;
|
||||
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
private String registerType;
|
||||
|
||||
/**
|
||||
* 店铺类型 单店--only 连锁店--chain--加盟店join (对应原来 type)
|
||||
*/
|
||||
private String shopType;
|
||||
|
||||
/**
|
||||
* 管理 0否 1是, 1 为直接管理 可切换店铺 0 不可以切换
|
||||
*/
|
||||
private Integer tubeType;
|
||||
|
||||
/**
|
||||
* 营业时间(周开始)
|
||||
*/
|
||||
private String businessStartDay;
|
||||
|
||||
/**
|
||||
* 营业时间(周结束)
|
||||
*/
|
||||
private String businessEndDay;
|
||||
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
private String businessTime;
|
||||
|
||||
/**
|
||||
* trial试用版,release正式
|
||||
*/
|
||||
private String profiles;
|
||||
|
||||
/**
|
||||
* 0停业 1,正常营业 2,网上售卖
|
||||
*/
|
||||
private Integer onSale;
|
||||
|
||||
/**
|
||||
* -1 平台禁用 0-过期,1正式营业,
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 商家二维码
|
||||
*/
|
||||
private String shopQrcode;
|
||||
|
||||
/**
|
||||
* 商家标签
|
||||
*/
|
||||
private String tag;
|
||||
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
private String lng;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String provinces;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String cities;
|
||||
|
||||
/**
|
||||
* 区/县
|
||||
*/
|
||||
private String districts;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否允许会员自定义金额 1 允许 0 不允许
|
||||
*/
|
||||
private Integer isCustomAmount;
|
||||
|
||||
/**
|
||||
* 是否开启退款密码 1 启用 0 禁用
|
||||
*/
|
||||
private Integer isReturnPwd;
|
||||
|
||||
/**
|
||||
* 是否开启会员充值密码 1 启用 0 禁用
|
||||
*/
|
||||
private Integer isMemberInPwd;
|
||||
|
||||
/**
|
||||
* 是否开启会员退款密码 1 启用 0 禁用
|
||||
*/
|
||||
private Integer isMemberReturnPwd;
|
||||
|
||||
/**
|
||||
* 是否免除桌位费 0否1是
|
||||
*/
|
||||
private Integer isTableFee;
|
||||
|
||||
/**
|
||||
* 桌位费
|
||||
*/
|
||||
private BigDecimal tableFee;
|
||||
|
||||
/**
|
||||
* 是否启用会员价 0否1是
|
||||
*/
|
||||
private Integer isMemberPrice;
|
||||
|
||||
/**
|
||||
* 积分群体 all-所有 vip-仅针对会员
|
||||
*/
|
||||
private String consumeColony;
|
||||
|
||||
/**
|
||||
* 就餐模式 堂食 dine-in 外带 take-out
|
||||
*/
|
||||
private String eatModel;
|
||||
|
||||
/**
|
||||
* 小程序码(零点八零首页)
|
||||
*/
|
||||
private String smallQrcode;
|
||||
|
||||
/**
|
||||
* 店铺收款码
|
||||
*/
|
||||
private String paymentQrcode;
|
||||
|
||||
/**
|
||||
* 台桌预订短信
|
||||
*/
|
||||
private String bookingSms;
|
||||
|
||||
/**
|
||||
* 操作密码
|
||||
*/
|
||||
private String operationPwd;
|
||||
|
||||
/**
|
||||
* 开票系统账号
|
||||
*/
|
||||
private String bindAccount;
|
||||
|
||||
/**
|
||||
* 项目分类
|
||||
*/
|
||||
private String article;
|
||||
|
||||
/**
|
||||
* 数电发票类型
|
||||
*/
|
||||
private String sdType;
|
||||
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
private String taxAmount;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.czg.service.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 店铺员工 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_staff")
|
||||
public class TbShopStaff implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 使用系统用户 sys_user id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 员工名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 最大优惠金额
|
||||
*/
|
||||
private BigDecimal maxDiscountAmount;
|
||||
|
||||
/**
|
||||
* 优惠类型 1 折扣 0 金额
|
||||
*/
|
||||
private String discountType;
|
||||
|
||||
/**
|
||||
* 1启用0不启用
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* shopId
|
||||
*/
|
||||
private String shopId;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* master商户账号staff员工
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否允许管理端登录 0:不允许;1:允许
|
||||
*/
|
||||
private Integer isManage;
|
||||
|
||||
/**
|
||||
* 是否允许pc端登录 0:不允许;1:允许
|
||||
*/
|
||||
private Integer isPc;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.service.account.entity.SysMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统菜单 映射层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
|
||||
List<SysMenu> selectByUserId(@Param("userId") Long userId, @Param("type") Integer type);
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@ package com.czg.service.account.mapper;
|
|||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.service.account.entity.SysRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色表 映射层。
|
||||
|
|
@ -11,4 +14,5 @@ import com.czg.service.account.entity.SysRole;
|
|||
*/
|
||||
public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
|
||||
List<SysRole> selectByUserId(@Param("userId") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.service.account.entity.SysUsersRoles;
|
||||
|
||||
/**
|
||||
* 用户角色关联 映射层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface SysUsersRolesMapper extends BaseMapper<SysUsersRoles> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.service.account.entity.TbShopInfo;
|
||||
|
||||
/**
|
||||
* 店铺信息 映射层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface TbShopInfoMapper extends BaseMapper<TbShopInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.service.account.entity.TbShopStaff;
|
||||
|
||||
/**
|
||||
* 店铺员工 映射层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface TbShopStaffMapper extends BaseMapper<TbShopStaff> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.czg.service.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.service.account.entity.SysMenu;
|
||||
|
||||
/**
|
||||
* 系统菜单 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface SysMenuService extends IService<SysMenu> {
|
||||
|
||||
Object getMenu();
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ package com.czg.service.account.service;
|
|||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.service.account.entity.SysRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色表 服务层。
|
||||
*
|
||||
|
|
@ -11,4 +13,5 @@ import com.czg.service.account.entity.SysRole;
|
|||
*/
|
||||
public interface SysRoleService extends IService<SysRole> {
|
||||
|
||||
List<SysRole> getByUserId(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.service.account.entity.SysUsersRoles;
|
||||
|
||||
/**
|
||||
* 用户角色关联 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface SysUsersRolesService extends IService<SysUsersRoles> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.service.account.entity.TbShopInfo;
|
||||
|
||||
/**
|
||||
* 店铺信息 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface TbShopInfoService extends IService<TbShopInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.service.account.entity.TbShopStaff;
|
||||
|
||||
/**
|
||||
* 店铺员工 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
public interface TbShopStaffService extends IService<TbShopStaff> {
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +1,48 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.comparator.CompareUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.service.RedisService;
|
||||
import com.czg.service.account.dto.SysLoginDTO;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.service.AuthorizationService;
|
||||
import com.czg.service.account.entity.*;
|
||||
import com.czg.service.account.mapper.SysMenuMapper;
|
||||
import com.czg.service.account.service.*;
|
||||
import com.mybatisflex.core.query.QueryChain;
|
||||
import com.wf.captcha.SpecCaptcha;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Service
|
||||
public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
@Resource
|
||||
private TbShopStaffService shopStaffService;
|
||||
@Resource
|
||||
private TbShopInfoService shopInfoService;
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Resource
|
||||
private SysMenuMapper sysMenuMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Object getCaptcha() {
|
||||
// 生成验证码(130x48,4位字符)
|
||||
|
|
@ -25,13 +54,64 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||
// 生成唯一的验证码 ID
|
||||
String captchaKey = IdUtil.randomUUID();
|
||||
|
||||
redisService.set(RedisCst.LOGIN_CODE + captchaKey, code, 300);
|
||||
|
||||
// 返回 Base64 格式验证码
|
||||
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object login(SysLoginDTO loginDTO) {
|
||||
StpKit.ADMIN.login(1);
|
||||
return Map.of("token", StpKit.ADMIN.getTokenInfo());
|
||||
// Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||
// if (!"666666".equals(loginDTO.code()) && code == null || !code.equals(loginDTO.code())) {
|
||||
// throw new RuntimeException("验证码错误");
|
||||
// }
|
||||
|
||||
SysUser user = sysUserService.queryChain().eq(SysUser::getAccount,loginDTO.username()).one();
|
||||
if (user == null) {
|
||||
throw new RuntimeException("账户不存在");
|
||||
}
|
||||
|
||||
String md5 = SecureUtil.md5(user.getId() + loginDTO.password());
|
||||
if (StrUtil.isBlank(user.getPassword()) || !user.getPassword().equals(md5)) {
|
||||
throw new RuntimeException("账户或密码错误");
|
||||
}
|
||||
|
||||
TbShopInfo shopInfo;
|
||||
// 商户员工登录
|
||||
if (loginDTO.loginType() == 1) {
|
||||
TbShopStaff shopStaff = shopStaffService.queryChain().eq(TbShopStaff::getStatus, 1)
|
||||
.eq(TbShopStaff::getIsManage, 1)
|
||||
.eq(TbShopStaff::getId, user.getId()).one();
|
||||
if (shopStaff == null) {
|
||||
throw new RuntimeException("账户未启用");
|
||||
}
|
||||
|
||||
shopInfo = shopInfoService.getById(shopStaff.getShopId());
|
||||
}else {
|
||||
shopInfo = shopInfoService.getById(user.getId());
|
||||
}
|
||||
|
||||
if (shopInfo == null) {
|
||||
throw new RuntimeException("商户不存在");
|
||||
}
|
||||
// 过期时间校验
|
||||
if (shopInfo.getExpireTime() != null) {
|
||||
if ((DateUtil.date().toLocalDateTime().isBefore(shopInfo.getExpireTime()))) {
|
||||
throw new RuntimeException("店铺已到期,请联系区域经理续费");
|
||||
}
|
||||
}
|
||||
|
||||
StpKit.ADMIN.login(user.getId());
|
||||
// 查询角色
|
||||
List<SysRole> roleList = sysRoleService.getByUserId(user.getId());
|
||||
List<String> roleNames = roleList.stream().map(SysRole::getName).collect(Collectors.toList());
|
||||
StpKit.ADMIN.addRoleList(roleNames);
|
||||
// 权限赋予
|
||||
List<String> promissionList = sysMenuMapper.selectByUserId(user.getId(), null).stream().map(SysMenu::getPermission).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
StpKit.ADMIN.addPermissionList(promissionList);
|
||||
return Map.of("tokenInfo", StpKit.ADMIN.getTokenInfo(),
|
||||
"loginType", loginDTO.loginType(),
|
||||
"shopInfo", shopInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.vo.MenuVO;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.service.account.entity.SysMenu;
|
||||
import com.czg.service.account.mapper.SysMenuMapper;
|
||||
import com.czg.service.account.service.SysMenuService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统菜单 服务层实现。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
|
||||
|
||||
@Override
|
||||
public Object getMenu() {
|
||||
long sysUserId = StpKit.ADMIN.getLoginIdAsLong();
|
||||
List<SysMenu> allMenus = mapper.selectByUserId(sysUserId, null);
|
||||
List<MenuVO> rootMenus = new ArrayList<>();
|
||||
List<MenuVO> allMenuVos = new ArrayList<>();
|
||||
|
||||
// 分类菜单和按钮,并处理按钮的权限
|
||||
for (SysMenu menu : allMenus) {
|
||||
MenuVO menuVO = BeanUtil.copyProperties(menu, MenuVO.class);
|
||||
|
||||
// 如果是按钮类型,添加权限标识集合到 permissions
|
||||
if (menu.getType() == 2) {
|
||||
// 获取按钮的权限标识集合
|
||||
menuVO.setPermissions(getPermissionsForMenu(menu));
|
||||
}
|
||||
|
||||
// 分类根菜单与所有菜单
|
||||
if (menu.getPid() == null || menu.getPid() == 0) {
|
||||
rootMenus.add(menuVO);
|
||||
}
|
||||
allMenuVos.add(menuVO);
|
||||
}
|
||||
|
||||
// 给每个根菜单设置子菜单,同时把按钮权限标识加入到 permissions 中
|
||||
for (MenuVO rootMenu : rootMenus) {
|
||||
buildSubMenus(rootMenu, allMenuVos);
|
||||
}
|
||||
|
||||
return rootMenus;
|
||||
}
|
||||
|
||||
// 递归构建子菜单,按钮放在 permissions 中
|
||||
private void buildSubMenus(MenuVO parentMenu, List<MenuVO> allMenus) {
|
||||
List<MenuVO> children = new ArrayList<>();
|
||||
// 存储该菜单的按钮权限
|
||||
List<String> permissions = new ArrayList<>();
|
||||
|
||||
for (MenuVO menu : allMenus) {
|
||||
// 如果是菜单且父级菜单ID匹配,加入子菜单
|
||||
if (menu.getPid() != null && menu.getPid().equals(parentMenu.getMenuId()) && menu.getType() != 2) {
|
||||
children.add(menu);
|
||||
// 递归查找子菜单
|
||||
buildSubMenus(menu, allMenus);
|
||||
}
|
||||
// 如果是按钮类型,直接放到权限集合中
|
||||
if (menu.getPid() != null && menu.getPid().equals(parentMenu.getMenuId()) && menu.getType() == 2) {
|
||||
// 将按钮的权限标识加入权限列表
|
||||
permissions.addAll(getPermissionsForMenu(menu));
|
||||
}
|
||||
}
|
||||
|
||||
// 设置当前菜单的子菜单和权限
|
||||
parentMenu.setChildren(children);
|
||||
// 将按钮权限标识添加到菜单的权限中
|
||||
parentMenu.setPermissions(permissions);
|
||||
}
|
||||
|
||||
// 根据菜单获取权限标识(这里假设你有权限标识的获取逻辑)
|
||||
private List<String> getPermissionsForMenu(SysMenu menu) {
|
||||
List<String> permissions = new ArrayList<>();
|
||||
// 你可以根据需求从数据库或其他地方获取权限标识
|
||||
// 例如,假设菜单表中有权限字段
|
||||
if (menu.getPermission() != null) {
|
||||
String[] permissionArray = menu.getPermission().split(",");
|
||||
permissions.addAll(Arrays.asList(permissionArray));
|
||||
}
|
||||
return permissions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -6,6 +6,8 @@ import com.czg.service.account.mapper.SysRoleMapper;
|
|||
import com.czg.service.account.service.SysRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色表 服务层实现。
|
||||
*
|
||||
|
|
@ -15,4 +17,8 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService{
|
||||
|
||||
@Override
|
||||
public List<SysRole> getByUserId(Long id) {
|
||||
return mapper.selectByUserId(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.service.account.entity.SysUsersRoles;
|
||||
import com.czg.service.account.mapper.SysUsersRolesMapper;
|
||||
import com.czg.service.account.service.SysUsersRolesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户角色关联 服务层实现。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class SysUsersRolesServiceImpl extends ServiceImpl<SysUsersRolesMapper, SysUsersRoles> implements SysUsersRolesService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.service.account.entity.TbShopInfo;
|
||||
import com.czg.service.account.mapper.TbShopInfoMapper;
|
||||
import com.czg.service.account.service.TbShopInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺信息 服务层实现。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class TbShopInfoServiceImpl extends ServiceImpl<TbShopInfoMapper, TbShopInfo> implements TbShopInfoService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.service.account.entity.TbShopStaff;
|
||||
import com.czg.service.account.mapper.TbShopStaffMapper;
|
||||
import com.czg.service.account.service.TbShopStaffService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺员工 服务层实现。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class TbShopStaffServiceImpl extends ServiceImpl<TbShopStaffMapper, TbShopStaff> implements TbShopStaffService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.service.account.vo;
|
||||
|
||||
import com.czg.service.account.entity.SysMenu;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MenuVO extends SysMenu {
|
||||
private List<MenuVO> children;
|
||||
private List<String> permissions;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.SysMenuMapper">
|
||||
|
||||
<select id="selectByUserId" resultType="com.czg.service.account.entity.SysMenu">
|
||||
select c.*
|
||||
from sys_users_roles as a
|
||||
left join sys_roles_menus as b on a.role_id = b.role_id
|
||||
left join sys_menu as c on c.menu_id = b.menu_id
|
||||
where a.user_id = #{userId}
|
||||
<if test="type != null">
|
||||
and c.type=#{type}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -4,4 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.SysRoleMapper">
|
||||
|
||||
<select id="selectByUserId" resultType="com.czg.service.account.entity.SysRole">
|
||||
select a.* from sys_role as a left join sys_users_roles as b on b.role_id=a.id where b.user_id=#{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.SysUsersRolesMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.TbShopInfoMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.TbShopStaffMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue