添加网关服务,更新包名

This commit is contained in:
2026-02-02 17:00:42 +08:00
parent b271f0aa87
commit 5d8816fb2f
54 changed files with 238 additions and 110 deletions
+1
View File
@@ -19,6 +19,7 @@
<modules>
<module>xiaoyi-auth</module>
<module>xiaoyi-framework</module>
<module>xiaoyi-gateway</module>
</modules>
<properties>
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth;
package top.crushtj.xiaoyi.auth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -1,13 +1,13 @@
package top.crushtj.xiaoyishu.auth.alarm;
package top.crushtj.xiaoyi.auth.alarm;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.crushtj.xiaoyishu.auth.alarm.impl.MailAlarmHelper;
import top.crushtj.xiaoyishu.auth.alarm.impl.SmsAlarmHelper;
import top.crushtj.xiaoyishu.auth.constant.XiaoyiAuthConstants;
import top.crushtj.xiaoyi.auth.alarm.impl.MailAlarmHelper;
import top.crushtj.xiaoyi.auth.alarm.impl.SmsAlarmHelper;
import top.crushtj.xiaoyi.auth.constant.XiaoyiAuthConstants;
/**
* @author ayi
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.alarm;
package top.crushtj.xiaoyi.auth.alarm;
/**
* @author ayi
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.alarm.impl;
package top.crushtj.xiaoyi.auth.alarm.impl;
import lombok.extern.slf4j.Slf4j;
import top.crushtj.xiaoyishu.auth.alarm.AlarmInterface;
import top.crushtj.xiaoyi.auth.alarm.AlarmInterface;
/**
* @author ayi
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.alarm.impl;
package top.crushtj.xiaoyi.auth.alarm.impl;
import lombok.extern.slf4j.Slf4j;
import top.crushtj.xiaoyishu.auth.alarm.AlarmInterface;
import top.crushtj.xiaoyi.auth.alarm.AlarmInterface;
/**
* @author ayi
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.config;
package top.crushtj.xiaoyi.auth.config;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.config;
package top.crushtj.xiaoyi.auth.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.config;
package top.crushtj.xiaoyi.auth.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -7,7 +7,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import static top.crushtj.xiaoyishu.auth.constant.ConfigConstants.*;
import static top.crushtj.xiaoyi.auth.constant.ConfigConstants.*;
/**
* @author ayi
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.constant;
package top.crushtj.xiaoyi.auth.constant;
/**
* @author ayi
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.constant;
package top.crushtj.xiaoyi.auth.constant;
/**
*
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.constant;
package top.crushtj.xiaoyi.auth.constant;
/**
* @author ayi
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.constant;
package top.crushtj.xiaoyi.auth.constant;
/**
* @author ayi
@@ -1,11 +1,11 @@
package top.crushtj.xiaoyishu.auth.controller;
package top.crushtj.xiaoyi.auth.controller;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.crushtj.xiaoyishu.auth.alarm.AlarmInterface;
import top.crushtj.xiaoyi.auth.alarm.AlarmInterface;
@Slf4j
@RestController
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.controller;
package top.crushtj.xiaoyi.auth.controller;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@@ -9,8 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.model.vo.user.UserLoginReqVO;
import top.crushtj.xiaoyishu.auth.service.UserService;
import top.crushtj.xiaoyi.auth.model.vo.user.UserLoginReqVO;
import top.crushtj.xiaoyi.auth.service.UserService;
/**
* @author ayi
@@ -1,9 +1,9 @@
package top.crushtj.xiaoyishu.auth.controller;
package top.crushtj.xiaoyi.auth.controller;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.xiaoyishu.auth.service.VerificationCodeService;
import top.crushtj.xiaoyi.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.xiaoyi.auth.service.VerificationCodeService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.domain.entity;
package top.crushtj.xiaoyi.auth.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.domain.entity;
package top.crushtj.xiaoyi.auth.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.domain.entity;
package top.crushtj.xiaoyi.auth.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.domain.entity;
package top.crushtj.xiaoyi.auth.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.domain.entity;
package top.crushtj.xiaoyi.auth.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.domain.mappers;
package top.crushtj.xiaoyi.auth.domain.mappers;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import top.crushtj.xiaoyishu.auth.domain.entity.PermissionEntity;
import top.crushtj.xiaoyi.auth.domain.entity.PermissionEntity;
import java.util.List;
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.domain.mappers;
package top.crushtj.xiaoyi.auth.domain.mappers;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import top.crushtj.xiaoyishu.auth.domain.entity.RoleEntity;
import top.crushtj.xiaoyi.auth.domain.entity.RoleEntity;
import java.util.List;
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.domain.mappers;
package top.crushtj.xiaoyi.auth.domain.mappers;
import org.apache.ibatis.annotations.Param;
import top.crushtj.xiaoyishu.auth.domain.entity.RolePermissionRelEntity;
import top.crushtj.xiaoyi.auth.domain.entity.RolePermissionRelEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.domain.mappers;
package top.crushtj.xiaoyi.auth.domain.mappers;
import org.apache.ibatis.annotations.Param;
import top.crushtj.xiaoyishu.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyi.auth.domain.entity.UserEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
@@ -1,6 +1,6 @@
package top.crushtj.xiaoyishu.auth.domain.mappers;
package top.crushtj.xiaoyi.auth.domain.mappers;
import top.crushtj.xiaoyishu.auth.domain.entity.UserRoleRelEntity;
import top.crushtj.xiaoyi.auth.domain.entity.UserRoleRelEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
@@ -1,8 +1,8 @@
<?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="top.crushtj.xiaoyishu.auth.domain.mappers.PermissionMapper">
<mapper namespace="top.crushtj.xiaoyi.auth.domain.mappers.PermissionMapper">
<resultMap type="top.crushtj.xiaoyishu.auth.domain.entity.PermissionEntity" id="PermissionMap">
<resultMap type="top.crushtj.xiaoyi.auth.domain.entity.PermissionEntity" id="PermissionMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
@@ -16,7 +16,7 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="BOOLEAN"/>
</resultMap>
<select id="selectAppEnabledList" resultType="top.crushtj.xiaoyishu.auth.domain.entity.PermissionEntity">
<select id="selectAppEnabledList" resultType="top.crushtj.xiaoyi.auth.domain.entity.PermissionEntity">
SELECT id, name, permission_key
FROM t_permission p
WHERE p.status = 1
@@ -1,8 +1,8 @@
<?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="top.crushtj.xiaoyishu.auth.domain.mappers.RoleMapper">
<mapper namespace="top.crushtj.xiaoyi.auth.domain.mappers.RoleMapper">
<resultMap type="top.crushtj.xiaoyishu.auth.domain.entity.RoleEntity" id="RoleMap">
<resultMap type="top.crushtj.xiaoyi.auth.domain.entity.RoleEntity" id="RoleMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
<result property="roleKey" column="role_key" jdbcType="VARCHAR"/>
@@ -14,7 +14,7 @@
<result property="isDeleted" column="is_deleted" jdbcType="BOOLEAN"/>
</resultMap>
<select id="selectEnabledRoleList" resultType="top.crushtj.xiaoyishu.auth.domain.entity.RoleEntity">
<select id="selectEnabledRoleList" resultType="top.crushtj.xiaoyi.auth.domain.entity.RoleEntity">
SELECT id, role_name, role_key
FROM t_role
WHERE status = 1
@@ -1,8 +1,8 @@
<?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="top.crushtj.xiaoyishu.auth.domain.mappers.RolePermissionRelMapper">
<mapper namespace="top.crushtj.xiaoyi.auth.domain.mappers.RolePermissionRelMapper">
<resultMap type="top.crushtj.xiaoyishu.auth.domain.entity.RolePermissionRelEntity" id="RolePermissionRelMap">
<resultMap type="top.crushtj.xiaoyi.auth.domain.entity.RolePermissionRelEntity" id="RolePermissionRelMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
<result property="permissionId" column="permission_id" jdbcType="INTEGER"/>
@@ -10,7 +10,7 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="BOOLEAN"/>
</resultMap>
<select id="selectByRoleIds" resultType="top.crushtj.xiaoyishu.auth.domain.entity.RolePermissionRelEntity">
<select id="selectByRoleIds" resultType="top.crushtj.xiaoyi.auth.domain.entity.RolePermissionRelEntity">
SELECT role_id, permission_id FROM t_role_permission_rel
<where>
<if test="roleIds!=null and !roleIds.empty">
@@ -1,8 +1,8 @@
<?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="top.crushtj.xiaoyishu.auth.domain.mappers.UserMapper">
<mapper namespace="top.crushtj.xiaoyi.auth.domain.mappers.UserMapper">
<resultMap type="top.crushtj.xiaoyishu.auth.domain.entity.UserEntity" id="UserMap">
<resultMap type="top.crushtj.xiaoyi.auth.domain.entity.UserEntity" id="UserMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="xiaoyishuId" column="xiaoyishu_id" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
@@ -18,7 +18,7 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="BOOLEAN"/>
</resultMap>
<select id = "selectByPhone" resultType = "top.crushtj.xiaoyishu.auth.domain.entity.UserEntity">
<select id = "selectByPhone" resultType = "top.crushtj.xiaoyi.auth.domain.entity.UserEntity">
SELECT id, password, xiaoyishu_id
FROM t_user
WHERE phone = #{phone}
@@ -1,8 +1,8 @@
<?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="top.crushtj.xiaoyishu.auth.domain.mappers.UserRoleRelMapper">
<mapper namespace="top.crushtj.xiaoyi.auth.domain.mappers.UserRoleRelMapper">
<resultMap type="top.crushtj.xiaoyishu.auth.domain.entity.UserRoleRelEntity" id="UserRoleRelMap">
<resultMap type="top.crushtj.xiaoyi.auth.domain.entity.UserRoleRelEntity" id="UserRoleRelMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.enums;
package top.crushtj.xiaoyi.auth.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.enums;
package top.crushtj.xiaoyi.auth.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.exception;
package top.crushtj.xiaoyi.auth.exception;
import java.util.Optional;
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import top.crushtj.framework.common.exception.BizException;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.enums.ResponseCodeEnum;
import top.crushtj.xiaoyi.auth.enums.ResponseCodeEnum;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.model.vo.user;
package top.crushtj.xiaoyi.auth.model.vo.user;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.model.vo.verificationcode;
package top.crushtj.xiaoyi.auth.model.vo.verificationcode;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.runner;
package top.crushtj.xiaoyi.auth.runner;
import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Lists;
@@ -9,13 +9,13 @@ import org.springframework.boot.ApplicationRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import top.crushtj.framework.common.utils.JsonUtils;
import top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyishu.auth.domain.entity.PermissionEntity;
import top.crushtj.xiaoyishu.auth.domain.entity.RoleEntity;
import top.crushtj.xiaoyishu.auth.domain.entity.RolePermissionRelEntity;
import top.crushtj.xiaoyishu.auth.domain.mappers.PermissionMapper;
import top.crushtj.xiaoyishu.auth.domain.mappers.RoleMapper;
import top.crushtj.xiaoyishu.auth.domain.mappers.RolePermissionRelMapper;
import top.crushtj.xiaoyi.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyi.auth.domain.entity.PermissionEntity;
import top.crushtj.xiaoyi.auth.domain.entity.RoleEntity;
import top.crushtj.xiaoyi.auth.domain.entity.RolePermissionRelEntity;
import top.crushtj.xiaoyi.auth.domain.mappers.PermissionMapper;
import top.crushtj.xiaoyi.auth.domain.mappers.RoleMapper;
import top.crushtj.xiaoyi.auth.domain.mappers.RolePermissionRelMapper;
import java.util.HashMap;
import java.util.List;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.runner.cache;
package top.crushtj.xiaoyi.auth.runner.cache;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.annotation.PostConstruct;
@@ -6,11 +6,11 @@ import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import top.crushtj.xiaoyishu.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyishu.auth.domain.mappers.UserMapper;
import top.crushtj.xiaoyi.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyi.auth.domain.mappers.UserMapper;
import static top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants.XIAOYI_ID_GENERATOR_KEY;
import static top.crushtj.xiaoyishu.auth.constant.XiaoyiAuthConstants.XIAOYI_ID_INITIAL_VALUE;
import static top.crushtj.xiaoyi.auth.constant.RedisKeyConstants.XIAOYI_ID_GENERATOR_KEY;
import static top.crushtj.xiaoyi.auth.constant.XiaoyiAuthConstants.XIAOYI_ID_INITIAL_VALUE;
/**
* @author ayi
@@ -1,9 +1,9 @@
package top.crushtj.xiaoyishu.auth.service;
package top.crushtj.xiaoyi.auth.service;
import com.baomidou.mybatisplus.extension.service.IService;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyishu.auth.model.vo.user.UserLoginReqVO;
import top.crushtj.xiaoyi.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyi.auth.model.vo.user.UserLoginReqVO;
/**
* @author ayi
@@ -1,7 +1,7 @@
package top.crushtj.xiaoyishu.auth.service;
package top.crushtj.xiaoyi.auth.service;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.xiaoyi.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
/**
*
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.service.impl;
package top.crushtj.xiaoyi.auth.service.impl;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
@@ -18,25 +18,25 @@ import top.crushtj.framework.common.response.Response;
import top.crushtj.framework.common.utils.IdGenerator;
import top.crushtj.framework.common.utils.JsonUtils;
import top.crushtj.framework.common.utils.MaskUtils;
import top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyishu.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyishu.auth.domain.entity.UserRoleRelEntity;
import top.crushtj.xiaoyishu.auth.domain.mappers.UserMapper;
import top.crushtj.xiaoyishu.auth.domain.mappers.UserRoleRelMapper;
import top.crushtj.xiaoyishu.auth.enums.LoginTypeEnum;
import top.crushtj.xiaoyishu.auth.enums.ResponseCodeEnum;
import top.crushtj.xiaoyishu.auth.model.vo.user.UserLoginReqVO;
import top.crushtj.xiaoyishu.auth.service.UserService;
import top.crushtj.xiaoyi.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyi.auth.domain.entity.UserEntity;
import top.crushtj.xiaoyi.auth.domain.entity.UserRoleRelEntity;
import top.crushtj.xiaoyi.auth.domain.mappers.UserMapper;
import top.crushtj.xiaoyi.auth.domain.mappers.UserRoleRelMapper;
import top.crushtj.xiaoyi.auth.enums.LoginTypeEnum;
import top.crushtj.xiaoyi.auth.enums.ResponseCodeEnum;
import top.crushtj.xiaoyi.auth.model.vo.user.UserLoginReqVO;
import top.crushtj.xiaoyi.auth.service.UserService;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants.XIAOYI_ID_GENERATOR_KEY;
import static top.crushtj.xiaoyishu.auth.constant.RoleConstants.COMMON_USER_ROLE_ID;
import static top.crushtj.xiaoyishu.auth.constant.XiaoyiAuthConstants.NICK_NAME_PREFIX;
import static top.crushtj.xiaoyishu.auth.constant.XiaoyiAuthConstants.XIAOYI_ID_INITIAL_VALUE;
import static top.crushtj.xiaoyi.auth.constant.RedisKeyConstants.XIAOYI_ID_GENERATOR_KEY;
import static top.crushtj.xiaoyi.auth.constant.RoleConstants.COMMON_USER_ROLE_ID;
import static top.crushtj.xiaoyi.auth.constant.XiaoyiAuthConstants.NICK_NAME_PREFIX;
import static top.crushtj.xiaoyi.auth.constant.XiaoyiAuthConstants.XIAOYI_ID_INITIAL_VALUE;
/**
* @author ayi
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.service.impl;
package top.crushtj.xiaoyi.auth.service.impl;
import cn.hutool.core.util.RandomUtil;
import jakarta.annotation.Resource;
@@ -9,15 +9,15 @@ import org.springframework.stereotype.Service;
import top.crushtj.framework.common.exception.BizException;
import top.crushtj.framework.common.response.Response;
import top.crushtj.framework.common.utils.MaskUtils;
import top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyishu.auth.enums.ResponseCodeEnum;
import top.crushtj.xiaoyishu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.xiaoyishu.auth.service.VerificationCodeService;
import top.crushtj.xiaoyishu.auth.sms.AliyunSmsHelper;
import top.crushtj.xiaoyi.auth.constant.RedisKeyConstants;
import top.crushtj.xiaoyi.auth.enums.ResponseCodeEnum;
import top.crushtj.xiaoyi.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import top.crushtj.xiaoyi.auth.service.VerificationCodeService;
import top.crushtj.xiaoyi.auth.sms.AliyunSmsHelper;
import java.util.concurrent.TimeUnit;
import static top.crushtj.xiaoyishu.auth.constant.RedisKeyConstants.VERIFICATION_CODE_EXPIRE_TIME;
import static top.crushtj.xiaoyi.auth.constant.RedisKeyConstants.VERIFICATION_CODE_EXPIRE_TIME;
/**
* 验证码服务实现类
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.sms;
package top.crushtj.xiaoyi.auth.sms;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.sms;
package top.crushtj.xiaoyi.auth.sms;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth.sms;
package top.crushtj.xiaoyi.auth.sms;
import com.aliyun.dypnsapi20170525.models.SendSmsVerifyCodeResponse;
import jakarta.annotation.Resource;
@@ -1,7 +1,3 @@
server:
servlet:
context-path: /xiaoyishu-auth
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth;
package top.crushtj.xiaoyi.auth;
import com.alibaba.druid.filter.config.ConfigTools;
import lombok.SneakyThrows;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth;
package top.crushtj.xiaoyi.auth;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@@ -1,4 +1,4 @@
package top.crushtj.xiaoyishu.auth;
package top.crushtj.xiaoyi.auth;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
+49
View File
@@ -0,0 +1,49 @@
<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>top.crushtj</groupId>
<artifactId>xiaoyishu</artifactId>
<version>${revision}</version>
</parent>
<artifactId>xiaoyi-gateway</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>网关服务</description>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<!-- 服务发现 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- 网关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<!-- 负载均衡 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,20 @@
package top.crushtj.xiaoyi.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author ayi
* @version V1.0
* @title XiaoyiGatewayApplication
* @date 2026/2/2 16:46
* @description 网关启动类
*/
@SpringBootApplication
public class XiaoyiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(XiaoyiGatewayApplication.class, args);
}
}
@@ -0,0 +1,12 @@
server:
port: 8000 # 指定启动端口
spring:
cloud:
gateway:
routes:
- id: auth
uri: lb://xiaoyishu-auth
predicates:
- Path=/auth/**
filters:
- StripPrefix=1
@@ -0,0 +1,12 @@
spring:
application:
name: xiaoyi-gateway # 应用名称
profiles:
active: dev
cloud:
nacos:
discovery:
enabled: true # 启用服务发现
group: DEFAULT_GROUP # 所属组
namespace: xiaoyishu # 命名空间
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
@@ -0,0 +1,38 @@
package top.crushtj.xiaoyi.gateway;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}