feat: 添加用户、角色服务和验证工具类

新增用户服务实现类UsersServiceImpl,包含用户CRUD操作
新增角色服务实现类RolesServiceImpl,包含角色管理功能
新增验证工具类ValidateUtil,提供参数验证功能
更新所有实体类添加@Builder注解
更新所有Mapper接口添加selectInfo和updateInfo方法
更新application.properties添加server.port配置
修复OrdersServiceImpl中Logger使用问题
添加updateInfo方法使用文档
This commit is contained in:
qingfeng1121
2025-11-25 15:30:27 +08:00
parent 5aa2017eef
commit 7536c8087e
48 changed files with 1107 additions and 31 deletions

View File

@@ -1,5 +1,9 @@
package com.qf.backend.mapper;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.backend.entity.Users;
@@ -7,4 +11,41 @@ import com.qf.backend.entity.Users;
* 用户基本信息表 Mapper 接口
*/
public interface UsersMapper extends BaseMapper<Users> {
/**
* 根据用户名查询用户
* @param username 用户名
* @return 用户对象
*/
@Select("select * from users where username = #{username}")
Users selectByUsername(String username);
/**
* 根据邮箱查询用户
* @param email 邮箱
* @return 用户对象
*/
@Select("select * from Users where email = #{email}")
Users selectByEmail(String email);
/**
* 根据手机号查询用户
* @param phone 手机号
* @return 用户对象
*/
@Select("select * from Users where phone = #{phone}")
Users selectByPhone(String phone);
/**
* 查询用户信息
* @param users 用户信息
* @param queryWrapper 查询条件包装器
* @return 用户对象
*/
Users selectInfo(Users users, QueryWrapper<Users> queryWrapper);
/**
* 更新用户信息
* @param users 用户信息
* @param updateWrapper 更新条件包装器
* @return 是否成功
*/
int updateInfo(Users users, UpdateWrapper<Users> updateWrapper);
}