service位置调整

This commit is contained in:
张松
2025-02-11 15:06:58 +08:00
parent 13a5838f55
commit c49248c47a
68 changed files with 463 additions and 766 deletions

View File

@@ -1,16 +0,0 @@
package com.czg.service.account.dto;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
public record PageDTO(
// 页码
@NotNull
@Min(1)
Integer page,
// 数量
@NotNull
@Min(1)
Integer size
) {
}

View File

@@ -1,18 +0,0 @@
package com.czg.service.account.dto;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
public record SysLoginDTO(
@NotEmpty(message = "用户名不为空")
String username, // 用户名
@NotEmpty(message = "密码不为空")
String password, // 密码
@NotEmpty(message = "验证码不为空")
String code, // 验证码
@NotEmpty(message = "uid不为空")
String uuid, // 验证码uid
@NotNull
Integer loginType // 登录类型 0:商户登录 1:员工登录
) {
}

View File

@@ -1,16 +0,0 @@
package com.czg.service.account.dto.register;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
public record MerchantRegisterDTO(
@NotNull(message = "激活时长不能为空")
@Min(1)
Integer periodMonth,
@NotNull(message = "数量不为空")
@Min(1)
@Max(10)
Integer num
) {
}

View File

@@ -1,21 +0,0 @@
package com.czg.service.account.dto.role;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;
public record RoleAddDTO(
/* 角色名称 */
@NotBlank
String name,
// 角色级别
Integer level,
// 菜单id
@NotEmpty(message = "菜单id不能为空")
List<Long> menuIdList,
// 描述
String description
) {
}

View File

@@ -1,24 +0,0 @@
package com.czg.service.account.dto.role;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;
public record RoleEditDTO(
// 角色id
@NotNull
Long id,
// 角色名称
@NotBlank
String name,
// 角色等级
Integer level,
// 菜单id
@NotNull
List<Long> menuIdList,
// 描述
String description
) {
}

View File

@@ -1,7 +0,0 @@
package com.czg.service.account.dto.role;
import jakarta.validation.constraints.NotNull;
public record RoleRemoveDTO(/* 角色id */@NotNull Long id) {
}

View File

@@ -1,38 +0,0 @@
package com.czg.service.account.dto.shopinfo;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
/**
* @author Administrator
*/
public record ShopInfoAddDTO(
@NotEmpty(message = "店铺名称不为空")
String shopName,
@NotEmpty(message = "店铺类型不为空")
String shopType,
String chainName,
@NotEmpty(message = "店铺logo不为空")
String logo,
@NotEmpty(message = "门头照不为空")
String frontImg,
@NotEmpty(message = "试用/正式不为空")
String profiles,
@NotEmpty(message = "激活码不为空")
String activateCode,
@NotEmpty(message = "登录账号不为空")
String accountName,
@NotEmpty(message = "登录密码不为空")
String accountPwd,
@NotEmpty(message = "经度不为空")
String lat,
@NotEmpty(message = "纬度不为空")
String lng,
@NotNull(message = "状态不为空")
String detail,
@NotNull(message = "角色id不为空")
Long roleId,
String address,
String phone
) {
}

View File

@@ -1,22 +0,0 @@
package com.czg.service.account.dto.shopuser;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
public record ShopUserAddDTO(@NotEmpty(message = "店铺名称不为空") String shopName,
@NotEmpty(message = "logo不为空") String logo,
@NotEmpty String profiles,
@NotNull(message = "店铺类型不为空") Integer shopType,
@NotEmpty(message = "经营模式不为空") String registerType,
@NotEmpty(message = "账号不为空") String loginName,
@NotEmpty(message = "密码不为空") String loginPwd,
@NotEmpty(message = "经度不为空") String lat,
@NotEmpty(message = "维度不为空") String lng,
@NotEmpty(message = "详细地址不为空") String address,
@NotNull(message = "店铺状态不为空") Integer status,
String detail,
String phone,
String activateCode,
String coverImg,
String chainName) {
}

View File

@@ -1,71 +0,0 @@
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-11
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("tb_merchant_register")
public class MerchantRegister implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id(keyType = KeyType.Auto)
private Integer id;
/**
* 激活码
*/
private String registerCode;
/**
* 店铺id
*/
private String shopId;
/**
* 激活码金额
*/
private BigDecimal amount;
/**
* 激活时长(月)
*/
private Integer periodMonth;
/**
* 状态0未使用1已使用
*/
private Integer status;
/**
* 创建时间
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -1,273 +0,0 @@
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 ShopInfo 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;
}

View File

@@ -1,91 +0,0 @@
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 ShopStaff 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;
}

View File

@@ -1,111 +0,0 @@
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-08
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("tb_shop_user")
public class ShopUser implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* (随机)
*/
@Id(keyType = KeyType.Auto)
private Long id;
/**
* 店铺Id
*/
private Long shopId;
/**
* 用户Id
*/
private Long userId;
/**
* 账户积分
*/
private Integer accountPoints;
/**
* 钱包余额
*/
private BigDecimal amount;
/**
* 消费累计
*/
private BigDecimal consumeAmount;
/**
* 消费次数累计
*/
private Integer consumeCount;
/**
* 0-不可使用 1可使用
*/
private Integer status;
/**
* 是否会员,
*/
private Integer isVip;
/**
* 会员编号
*/
private String code;
/**
* 会员码
*/
private String dynamicCode;
/**
* 最近一次积分变动时间
*/
private LocalDateTime lastPointsChangeTime;
/**
* 最近一次浮动积分
*/
private Integer lastFloatPoints;
/**
* 成为会员的时间
*/
private LocalDateTime joinTime;
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -1,136 +0,0 @@
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;
/**
* 商户使用 01
*/
private Long isShop;
}

View File

@@ -1,81 +0,0 @@
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-08
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("sys_role")
public class SysRole implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@Id(keyType = KeyType.Auto)
private Long id;
/**
* 名称
*/
private String name;
/**
* 角色级别
*/
private Integer level;
/**
* 商户id
*/
private Long shopId;
/**
* 描述
*/
private String description;
/**
* 创建者
*/
private Long createUserId;
/**
* 更新者
*/
private Long updateUserId;
/**
* 创建日期
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -1,42 +0,0 @@
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_roles_menus")
public class SysRolesMenus implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 菜单ID
*/
@Id
private Long menuId;
/**
* 角色ID
*/
@Id
private Long roleId;
}

View File

@@ -1,111 +0,0 @@
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-08
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("sys_user")
public class SysUser implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@Id(keyType = KeyType.Auto)
private Long id;
/**
* 账号
*/
private String account;
/**
* 昵称
*/
private String nickName;
/**
* 性别
*/
private String gender;
/**
* 手机号码
*/
private String phone;
/**
* 邮箱
*/
private String email;
/**
* 头像
*/
private String avatar;
/**
* 密码
*/
private String password;
/**
* 是否为admin账号
*/
private Boolean isAdmin;
/**
* 状态1启用、0禁用
*/
private Integer stauts;
/**
* 创建者
*/
private Long createUserId;
/**
* 更新者
*/
private Long updateUserId;
/**
* 修改密码的时间
*/
private LocalDateTime pwdResetTime;
/**
* 创建日期
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -1,42 +0,0 @@
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;
}

View File

@@ -1,7 +1,7 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.MerchantRegister;
import com.mybatisflex.core.BaseMapper;
import com.czg.service.account.entity.MerchantRegister;
/**
* 激活码 映射层。

View File

@@ -1,6 +1,6 @@
package com.czg.service.account.mapper;
import com.czg.service.account.entity.ShopInfo;
import com.czg.account.entity.ShopInfo;
import com.mybatisflex.core.BaseMapper;
/**

View File

@@ -0,0 +1,14 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.ShopMerchant;
import com.mybatisflex.core.BaseMapper;
/**
* 第三方商户进件 映射层。
*
* @author Administrator
* @since 2025-02-11
*/
public interface ShopMerchantMapper extends BaseMapper<ShopMerchant> {
}

View File

@@ -1,6 +1,6 @@
package com.czg.service.account.mapper;
import com.czg.service.account.entity.ShopStaff;
import com.czg.account.entity.ShopStaff;
import com.mybatisflex.core.BaseMapper;
/**

View File

@@ -1,6 +1,6 @@
package com.czg.service.account.mapper;
import com.czg.service.account.entity.ShopUser;
import com.czg.account.entity.ShopUser;
import com.mybatisflex.core.BaseMapper;
/**

View File

@@ -1,7 +1,7 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.SysMenu;
import com.mybatisflex.core.BaseMapper;
import com.czg.service.account.entity.SysMenu;
import org.apache.ibatis.annotations.Param;
import java.util.List;

View File

@@ -1,7 +1,7 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.SysRole;
import com.mybatisflex.core.BaseMapper;
import com.czg.service.account.entity.SysRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;

View File

@@ -1,7 +1,7 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.SysRolesMenus;
import com.mybatisflex.core.BaseMapper;
import com.czg.service.account.entity.SysRolesMenus;
/**
* 角色菜单关联 映射层。

View File

@@ -1,7 +1,7 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.SysUser;
import com.mybatisflex.core.BaseMapper;
import com.czg.service.account.entity.SysUser;
/**
* 系统用户 映射层。

View File

@@ -1,7 +1,7 @@
package com.czg.service.account.mapper;
import com.czg.account.entity.SysUsersRoles;
import com.mybatisflex.core.BaseMapper;
import com.czg.service.account.entity.SysUsersRoles;
/**
* 用户角色关联 映射层。

View File

@@ -1,14 +0,0 @@
package com.czg.service.account.service;
import com.czg.service.account.dto.SysLoginDTO;
import com.czg.service.account.vo.LoginVO;
/**
* @author Administrator
*/
public interface AuthorizationService {
Object getCaptcha();
LoginVO login(SysLoginDTO loginDTO);
}

View File

@@ -1,22 +0,0 @@
package com.czg.service.account.service;
import com.czg.service.account.dto.PageDTO;
import com.czg.service.account.dto.register.MerchantRegisterDTO;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.czg.service.account.entity.MerchantRegister;
import java.time.LocalDateTime;
/**
* 激活码 服务层。
*
* @author Administrator
* @since 2025-02-11
*/
public interface MerchantRegisterService extends IService<MerchantRegister> {
Page<MerchantRegister> get(PageDTO pageDTO, Integer state, String startTime, String endTime);
Boolean add(MerchantRegisterDTO merchantRegisterDTO);
}

View File

@@ -1,7 +0,0 @@
package com.czg.service.account.service;
/**
* @author Administrator
*/
public interface PermissionService {
}

View File

@@ -1,12 +0,0 @@
package com.czg.service.account.service;
import com.czg.service.account.dto.shopinfo.ShopInfoAddDTO;
import com.czg.service.account.entity.ShopInfo;
import com.mybatisflex.core.service.IService;
/**
* @author Administrator
*/
public interface ShopInfoService extends IService<ShopInfo> {
Object add(ShopInfoAddDTO shopInfoAddDTO);
}

View File

@@ -1,14 +0,0 @@
package com.czg.service.account.service;
import com.czg.service.account.entity.ShopStaff;
import com.mybatisflex.core.service.IService;
/**
* 店铺员工 服务层。
*
* @author Administrator
* @since 2025-02-10
*/
public interface ShopStaffService extends IService<ShopStaff> {
}

View File

@@ -1,14 +0,0 @@
package com.czg.service.account.service;
import com.czg.service.account.entity.ShopUser;
import com.mybatisflex.core.service.IService;
/**
* 商户储值会员 服务层。
*
* @author Administrator
* @since 2025-02-08
*/
public interface ShopUserService extends IService<ShopUser> {
}

View File

@@ -1,15 +0,0 @@
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();
}

View File

@@ -1,27 +0,0 @@
package com.czg.service.account.service;
import com.czg.service.account.dto.PageDTO;
import com.czg.service.account.dto.role.RoleAddDTO;
import com.czg.service.account.dto.role.RoleEditDTO;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.czg.service.account.entity.SysRole;
import java.util.List;
/**
* 角色表 服务层。
*
* @author Administrator
* @since 2025-02-08
*/
public interface SysRoleService extends IService<SysRole> {
List<SysRole> getByUserId(Long id);
Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime);
Boolean add(RoleAddDTO roleAddDTO);
Boolean edit(RoleEditDTO roleEditDTO);
}

View File

@@ -1,14 +0,0 @@
package com.czg.service.account.service;
import com.mybatisflex.core.service.IService;
import com.czg.service.account.entity.SysRolesMenus;
/**
* 角色菜单关联 服务层。
*
* @author Administrator
* @since 2025-02-10
*/
public interface SysRolesMenusService extends IService<SysRolesMenus> {
}

View File

@@ -1,14 +0,0 @@
package com.czg.service.account.service;
import com.mybatisflex.core.service.IService;
import com.czg.service.account.entity.SysUser;
/**
* 系统用户 服务层。
*
* @author Administrator
* @since 2025-02-08
*/
public interface SysUserService extends IService<SysUser> {
}

View File

@@ -1,14 +0,0 @@
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> {
}

View File

@@ -1,113 +0,0 @@
package com.czg.service.account.service.impl;
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.entity.*;
import com.czg.service.account.mapper.SysMenuMapper;
import com.czg.service.account.service.*;
import com.czg.service.account.vo.LoginVO;
import com.wf.captcha.SpecCaptcha;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Service
public class AuthorizationServiceImpl implements AuthorizationService {
@Resource
private RedisService redisService;
@Resource
private SysUserService sysUserService;
@Resource
private ShopStaffService shopStaffService;
@Resource
private ShopInfoService shopInfoService;
@Resource
private SysRoleService sysRoleService;
@Resource
private SysMenuMapper sysMenuMapper;
@Override
public Object getCaptcha() {
// 生成验证码130x484位字符
SpecCaptcha captcha = new SpecCaptcha(130, 48, 4);
// 获取验证码文本
String code = captcha.text();
// 生成唯一的验证码 ID
String captchaKey = IdUtil.randomUUID();
redisService.set(RedisCst.LOGIN_CODE + captchaKey, code, 300);
// 返回 Base64 格式验证码
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
}
@Override
public LoginVO login(SysLoginDTO loginDTO) {
// 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("账户或密码错误");
}
ShopInfo shopInfo;
// 商户员工登录
if (loginDTO.loginType() == 1) {
ShopStaff shopStaff = shopStaffService.queryChain().eq(ShopStaff::getStatus, 1)
.eq(ShopStaff::getIsManage, 1)
.eq(ShopStaff::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());
StpKit.ADMIN.setAdmin(user.getIsAdmin());
// 查询角色
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 new LoginVO(StpKit.ADMIN.getTokenInfo(), promissionList, loginDTO.loginType(), shopInfo);
}
}

View File

@@ -1,62 +0,0 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.czg.service.account.dto.PageDTO;
import com.czg.service.account.dto.register.MerchantRegisterDTO;
import com.czg.service.account.entity.SysRole;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.service.account.entity.MerchantRegister;
import com.czg.service.account.mapper.MerchantRegisterMapper;
import com.czg.service.account.service.MerchantRegisterService;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import static com.mybatisflex.core.query.QueryMethods.column;
/**
* 激活码 服务层实现。
*
* @author Administrator
* @since 2025-02-11
*/
@Service
public class MerchantRegisterServiceImpl extends ServiceImpl<MerchantRegisterMapper, MerchantRegister> implements MerchantRegisterService{
@Override
public Page<MerchantRegister> get(PageDTO pageDTO, Integer state, String startTime, String endTime) {
QueryWrapper queryWrapper = new QueryWrapper();
if (state != null) {
queryWrapper.eq(MerchantRegister::getStatus, state);
}
if (StrUtil.isNotBlank(startTime)) {
queryWrapper.ge(MerchantRegister::getCreateTime, DateUtil.parse(startTime).toLocalDateTime());
}
if (StrUtil.isNotBlank(endTime)) {
queryWrapper.le(MerchantRegister::getCreateTime, DateUtil.parse(endTime).toLocalDateTime());
}
return page(new Page<>(pageDTO.page(), pageDTO.size()), queryWrapper);
}
@Override
public Boolean add(MerchantRegisterDTO merchantRegisterDTO) {
ArrayList<MerchantRegister> registers = new ArrayList<>();
for (int i = 0; i < merchantRegisterDTO.num(); i++) {
MerchantRegister tbMerchantRegister = new MerchantRegister();
tbMerchantRegister.setRegisterCode(IdUtil.simpleUUID());
tbMerchantRegister.setStatus(0);
tbMerchantRegister.setPeriodMonth(merchantRegisterDTO.periodMonth());
registers.add(tbMerchantRegister);
}
return saveBatch(registers);
}
}

View File

@@ -1,11 +0,0 @@
package com.czg.service.account.service.impl;
import com.czg.service.account.service.PermissionService;
import org.springframework.stereotype.Service;
/**
* @author zs
*/
@Service
public class PermissionServiceImpl implements PermissionService {
}

View File

@@ -1,78 +0,0 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.crypto.SecureUtil;
import com.czg.exception.CzgException;
import com.czg.sa.StpKit;
import com.czg.service.account.dto.shopinfo.ShopInfoAddDTO;
import com.czg.service.account.entity.*;
import com.czg.service.account.mapper.ShopInfoMapper;
import com.czg.service.account.service.*;
import com.czg.utils.AssertUtil;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
* @author Administrator
*/
@Service
public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> implements ShopInfoService {
@Resource
private SysUserService sysUserService;
@Resource
private SysUsersRolesService sysUsersRolesService;
@Resource
private SysRoleService sysRoleService;
@Resource
private MerchantRegisterService merchantRegisterService;
@Override
@Transactional(rollbackFor = Exception.class)
public Object add(ShopInfoAddDTO shopInfoAddDTO) {
long count = sysUserService.queryChain().eq(SysUser::getAccount, shopInfoAddDTO.accountName()).count();
if (count > 0) {
throw new CzgException("账户已存在");
}
MerchantRegister merchantRegister = merchantRegisterService.queryChain().eq(MerchantRegister::getRegisterCode, shopInfoAddDTO.activateCode()).one();
AssertUtil.isNull(merchantRegister, "激活码不存在");
if (merchantRegister.getStatus() == 1) {
throw new CzgException("激活码已使用");
}
// 添加系统账号
SysUser sysUser = new SysUser();
sysUser.setAccount(shopInfoAddDTO.accountName());
sysUser.setNickName(shopInfoAddDTO.shopName());
sysUser.setPhone(shopInfoAddDTO.phone());
sysUser.setStauts(1);
sysUser.setCreateUserId(StpKit.ADMIN.getLoginIdAsLong());
sysUserService.save(sysUser);
sysUser.setPassword(SecureUtil.md5(sysUser.getId() + shopInfoAddDTO.accountPwd()));
sysUserService.updateById(sysUser);
// 绑定角色
long roleCount = sysRoleService.queryChain().eq(SysRole::getId, shopInfoAddDTO.roleId()).count();
if (roleCount == 0) {
throw new CzgException("角色不存在");
}
SysUsersRoles usersRoles = new SysUsersRoles();
usersRoles.setUserId(sysUser.getId());
usersRoles.setRoleId(shopInfoAddDTO.roleId());
sysUsersRolesService.save(usersRoles);
// 保存店铺信息
ShopInfo shopInfo = BeanUtil.copyProperties(shopInfoAddDTO, ShopInfo.class);
shopInfo.setId(sysUser.getId());
//设置激活码
shopInfo.setStatus(1);
shopInfo.setProfiles("release");
shopInfo.setExpireTime(DateUtil.offsetMonth(DateUtil.date(), merchantRegister.getPeriodMonth()).toLocalDateTime());
return save(shopInfo);
}
}

View File

@@ -0,0 +1,39 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.czg.account.dto.merchant.ShopMerchantEditDTO;
import com.czg.account.entity.ShopMerchant;
import com.czg.account.service.ShopMerchantService;
import com.czg.sa.StpKit;
import com.czg.service.account.mapper.ShopMerchantMapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 第三方商户进件 服务层实现。
*
* @author Administrator
* @since 2025-02-11
*/
@Service
public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, ShopMerchant> implements ShopMerchantService {
@Override
public ShopMerchant detail() {
ShopMerchant one = queryChain().eq(ShopMerchant::getShopId, StpKit.ADMIN.getLoginIdAsLong()).one();
return one == null ? new ShopMerchant() : one;
}
@Override
public Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO) {
ShopMerchant shopMerchant = queryChain().eq(ShopMerchant::getShopId, StpKit.ADMIN.getLoginIdAsLong()).one();
if (shopMerchant == null) {
shopMerchant = new ShopMerchant();
shopMerchant.setShopId(StpKit.ADMIN.getLoginIdAsLong());
BeanUtil.copyProperties(shopMerchantEditDTO, shopMerchant);
return save(shopMerchant);
}
BeanUtil.copyProperties(shopMerchantEditDTO, shopMerchant);
return updateById(shopMerchant);
}
}

View File

@@ -1,18 +0,0 @@
package com.czg.service.account.service.impl;
import com.czg.service.account.entity.ShopStaff;
import com.czg.service.account.mapper.ShopStaffMapper;
import com.czg.service.account.service.ShopStaffService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 店铺员工 服务层实现。
*
* @author Administrator
* @since 2025-02-10
*/
@Service
public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff> implements ShopStaffService {
}

View File

@@ -1,18 +0,0 @@
package com.czg.service.account.service.impl;
import com.czg.service.account.entity.ShopUser;
import com.czg.service.account.mapper.ShopUserMapper;
import com.czg.service.account.service.ShopUserService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 商户储值会员 服务层实现。
*
* @author Administrator
* @since 2025-02-08
*/
@Service
public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> implements ShopUserService {
}

View File

@@ -1,97 +0,0 @@
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;
}
}

View File

@@ -1,126 +0,0 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.czg.sa.StpKit;
import com.czg.service.account.dto.PageDTO;
import com.czg.service.account.dto.role.RoleAddDTO;
import com.czg.service.account.dto.role.RoleEditDTO;
import com.czg.service.account.entity.SysMenu;
import com.czg.service.account.entity.SysRolesMenus;
import com.czg.service.account.service.SysMenuService;
import com.czg.service.account.service.SysRolesMenusService;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.service.account.entity.SysRole;
import com.czg.service.account.mapper.SysRoleMapper;
import com.czg.service.account.service.SysRoleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import static com.mybatisflex.core.query.QueryMethods.column;
/**
* 角色表 服务层实现。
*
* @author Administrator
* @since 2025-02-08
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService{
@Resource
private SysMenuService sysMenuService;
@Resource
private SysRolesMenusService sysRolesMenusService;
@Override
public List<SysRole> getByUserId(Long id) {
return mapper.selectByUserId(id);
}
@Override
public Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
QueryWrapper queryWrapper = new QueryWrapper();
if (!StpKit.ADMIN.isAdmin()) {
queryWrapper.eq(SysRole::getCreateUserId, StpKit.ADMIN.getLoginIdAsLong());
}
if (StrUtil.isNotBlank(key)) {
queryWrapper.and(column(SysRole::getName).like(key).or(column(SysRole::getDescription).like(key)));
}
if (StrUtil.isNotBlank(startTime)) {
queryWrapper.ge(SysRole::getCreateTime, DateUtil.parse(startTime));
}
if (StrUtil.isNotBlank(endTime)) {
queryWrapper.le(SysRole::getCreateTime, DateUtil.parse(endTime));
}
return page(new Page<>(pageDTO.page(), pageDTO.size()), queryWrapper);
}
public boolean addMenu(Long roleId, List<Long> menuIds) {
long count = sysMenuService.queryChain().in(SysMenu::getMenuId, menuIds).count();
if (count != menuIds.size()) {
throw new RuntimeException("菜单id包含错误id");
}
ArrayList<SysRolesMenus> rolesMenus = new ArrayList<>();
for (Long id : menuIds) {
rolesMenus.add(new SysRolesMenus(id, roleId));
}
return sysRolesMenusService.saveBatch(rolesMenus);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean add(RoleAddDTO roleAddDTO) {
long roleCount = queryChain().eq(SysRole::getName, roleAddDTO.name()).count();
if (roleCount > 0) {
throw new RuntimeException("此角色名称已存在");
}
SysRole sysRole = new SysRole();
sysRole.setName(roleAddDTO.name());
sysRole.setLevel(roleAddDTO.level());
sysRole.setDescription(roleAddDTO.description());
sysRole.setShopId(StpKit.ADMIN.getLoginIdAsLong());
sysRole.setCreateUserId(StpKit.ADMIN.getLoginIdAsLong());
sysRole.setCreateTime(DateUtil.date().toLocalDateTime());
boolean save = save(sysRole);
if (save) {
return addMenu(sysRole.getId(), roleAddDTO.menuIdList());
}
throw new RuntimeException("保存失败");
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean edit(RoleEditDTO roleEditDTO) {
SysRole role = queryChain().eq(SysRole::getId, roleEditDTO.id()).eq(SysRole::getCreateUserId, StpKit.ADMIN.getLoginIdAsLong()).one();
if (role == null) {
throw new RuntimeException("角色不存在");
}
long roleCount = queryChain().eq(SysRole::getName, roleEditDTO.name()).count();
if (roleCount > 0) {
throw new RuntimeException("此角色名称已存在");
}
BeanUtil.copyProperties(roleEditDTO, role);
boolean b = updateById(role);
if (b) {
sysRolesMenusService.updateChain().eq(SysRolesMenus::getRoleId, role.getId()).remove();
return addMenu(role.getId(), roleEditDTO.menuIdList());
}
throw new RuntimeException("保存失败");
}
}

View File

@@ -1,18 +0,0 @@
package com.czg.service.account.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.service.account.entity.SysRolesMenus;
import com.czg.service.account.mapper.SysRolesMenusMapper;
import com.czg.service.account.service.SysRolesMenusService;
import org.springframework.stereotype.Service;
/**
* 角色菜单关联 服务层实现。
*
* @author Administrator
* @since 2025-02-10
*/
@Service
public class SysRolesMenusServiceImpl extends ServiceImpl<SysRolesMenusMapper, SysRolesMenus> implements SysRolesMenusService{
}

View File

@@ -1,18 +0,0 @@
package com.czg.service.account.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.service.account.entity.SysUser;
import com.czg.service.account.mapper.SysUserMapper;
import com.czg.service.account.service.SysUserService;
import org.springframework.stereotype.Service;
/**
* 系统用户 服务层实现。
*
* @author Administrator
* @since 2025-02-08
*/
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService{
}

View File

@@ -1,18 +0,0 @@
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{
}

View File

@@ -1,18 +0,0 @@
package com.czg.service.account.vo;
import cn.dev33.satoken.stp.SaTokenInfo;
import com.czg.service.account.entity.ShopInfo;
import java.util.List;
public record LoginVO(
// token信息
SaTokenInfo tokenInfo,
// 接口权限集合
List<String> promissionList,
// 登录类型
Integer loginType,
// 店铺信息
ShopInfo shopInfo
) {
}

View File

@@ -1,18 +0,0 @@
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;
}

View File

@@ -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.ShopMerchantMapper">
</mapper>

View File

@@ -4,7 +4,7 @@
"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 id="selectByUserId" resultType="com.czg.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

View File

@@ -4,7 +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 id="selectByUserId" resultType="com.czg.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>