CRM项目改进Mapper类及XML文件的SQL实现多表联查信息拼接改进Model封装修改人和创建人信息通过解析JWT获取创建人信息用加密密码后存储到后端数据库------CRM项目

package com.alatus.service.impl;

import com.alatus.constant.Constants;
import com.alatus.mapper.TUserMapper;
import com.alatus.model.TUser;
import com.alatus.query.UserQuery;
import com.alatus.util.JWTUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.beans.BeanUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;

@Service
public class UserServiceImpl implements com.alatus.service.UserService {
    @Resource
    private TUserMapper tUserMapper;
//    注入一个密码加密器
    @Resource
    private PasswordEncoder passwordEncoder;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        TUser tUser = tUserMapper.selectByLoginAct(username);
        if(tUser == null){
            throw new UsernameNotFoundException("登陆账号不存在");
        }
        return tUser;
    }

    @Override
    public PageInfo<TUser> getUserByPage(Integer current) {
//        设置PageHelper和分页情况
        PageHelper.startPage(current, Constants.PAGE_SIZE);
//        查询
        ArrayList<TUser> list = tUserMapper.selectUserByPage();
//        封装分页到PageInfo中
        PageInfo<TUser> info = new PageInfo<>(list);
        return info;
    }

    @Override
    public TUser getUserById(Integer id) {
        return tUserMapper.selectDetailByPrimaryKey(id);
    }

    @Override
    public int saveUser(UserQuery userQuery) {
        TUser tUser = new TUser();
//        把query对象的数据复制到user对象里面
//        这个工具类的复制要求是两个对象的属性名要相同,属性要相同
        BeanUtils.copyProperties(userQuery,tUser);
        tUser.setLoginPwd(passwordEncoder.encode(userQuery.getLoginPwd()));
//        创建时间
        tUser.setCreateTime(new Date());
//        通过token解析出的用户获取ID作为创建者的ID
        Integer loginId = JWTUtils.parseUserFromJWT(userQuery.getToken()).getId();
        tUser.setCreateBy(loginId);
        return tUserMapper.insertSelective(tUser);
    }
}
package com.alatus.service.impl;

import com.alatus.constant.Constants;
import com.alatus.mapper.TUserMapper;
import com.alatus.model.TUser;
import com.alatus.query.UserQuery;
import com.alatus.util.JWTUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.beans.BeanUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;

@Service
public class UserServiceImpl implements com.alatus.service.UserService {
    @Resource
    private TUserMapper tUserMapper;
//    注入一个密码加密器
    @Resource
    private PasswordEncoder passwordEncoder;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        TUser tUser = tUserMapper.selectByLoginAct(username);
        if(tUser == null){
            throw new UsernameNotFoundException("登陆账号不存在");
        }
        return tUser;
    }

    @Override
    public PageInfo<TUser> getUserByPage(Integer current) {
//        设置PageHelper和分页情况
        PageHelper.startPage(current, Constants.PAGE_SIZE);
//        查询
        ArrayList<TUser> list = tUserMapper.selectUserByPage();
//        封装分页到PageInfo中
        PageInfo<TUser> info = new PageInfo<>(list);
        return info;
    }

    @Override
    public TUser getUserById(Integer id) {
        return tUserMapper.selectDetailByPrimaryKey(id);
    }

    @Override
    public int saveUser(UserQuery userQuery) {
        TUser tUser = new TUser();
//        把query对象的数据复制到user对象里面
//        这个工具类的复制要求是两个对象的属性名要相同,属性要相同
        BeanUtils.copyProperties(userQuery,tUser);
        tUser.setLoginPwd(passwordEncoder.encode(userQuery.getLoginPwd()));
//        创建时间
        tUser.setCreateTime(new Date());
//        通过token解析出的用户获取ID作为创建者的ID
        Integer loginId = JWTUtils.parseUserFromJWT(userQuery.getToken()).getId();
        tUser.setCreateBy(loginId);
        return tUserMapper.insertSelective(tUser);
    }
}
package com.alatus.config.filter;

import com.alatus.constant.Constants;
import com.alatus.model.TUser;
import com.alatus.result.R;
import com.alatus.service.RedisService;
import com.alatus.util.JSONUtils;
import com.alatus.util.JWTUtils;
import com.alatus.util.ResponseUtils;
import com.alatus.result.CodeEnum;
import jakarta.annotation.Resource;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.filter.OncePerRequestFilter;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import static com.alatus.result.CodeEnum.TOKEN_IS_EXPIRED;


@Component
public class TokenVerifyFilter extends OncePerRequestFilter {

    @Resource
    private RedisService redisService;
    @Resource
    //    springboot框架提供的线程池,ioc容器内已经存在
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        if (request.getRequestURI().equals(Constants.LOGIN_URI)) { //如果是登录请求,此时还没有生成jwt,那不需要对登录请求进行jwt验证
            //验证jwt通过了 ,让Filter链继续执行,也就是继续执行下一个Filter
            filterChain.doFilter(request, response);
        } else {
            String token = request.getHeader("Authorization");
            if(!StringUtils.hasText("Authorization")){
//                没拿到token,将失败这个枚举传回去,解析并取出常量拼接
                R result = R.FAIL(CodeEnum.TOKEN_IS_EMPTY);
//                封装
                String resultJSON = JSONUtils.toJSON(result);
//                返回
                ResponseUtils.write(response,resultJSON);
                return;
            }
//            验证token有没有被篡改过,也是验证token合法性
            if (!(JWTUtils.verifyJWT(token))){
//                token不合法
                R result = R.FAIL(CodeEnum.TOKEN_IS_NONE_MATCH);
//                封装
                String resultJSON = JSONUtils.toJSON(result);
//                返回
                ResponseUtils.write(response,resultJSON);
                return;
            }
            TUser tUser = JWTUtils.parseUserFromJWT(token);
            String redisToken = (String) redisService.getValue(Constants.REDIS_JWT_KEY + tUser.getId());
            if(!StringUtils.hasText(redisToken)){
//                没有获取到内容说明token过期了
                R fail = R.FAIL(TOKEN_IS_EXPIRED);
                String json = JSONUtils.toJSON(fail);
                ResponseUtils.write(response,json);
                return;
            }
            if (!redisToken.equals(token)) {
//                登陆失败token错误
                R result = R.FAIL(CodeEnum.TOKEN_IS_ERROR);
//                把R对象转为JSON
                String json = JSONUtils.toJSON(result);
                ResponseUtils.write(response,json);
                return;
            }
//            jwt验证通过了
            UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(tUser,tUser.getLoginPwd(),tUser.getAuthorities());
            SecurityContextHolder.getContext().setAuthentication(authenticationToken);
//            刷新一下token
//            做异步执行
//            new Thread(new Runnable() {
//                @Override
//                public void run() {
                    这里刷新token即可
                    从请求头中获取
//                    String rememberMe = request.getHeader("rememberMe");
//                    if (!Boolean.parseBoolean(rememberMe)) {
//                        redisService.expire(Constants.REDIS_JWT_KEY + tUser.getId(), Constants.DEFAULT_EXPIRE_TIME, TimeUnit.SECONDS);
//                    }
//                }
//            }).start();
//            最好使用线程池的方式去执行
            threadPoolTaskExecutor.execute(() -> {
//                    这里刷新token即可
//                    从请求头中获取
                    String rememberMe = request.getHeader("rememberMe");
                    if (!Boolean.parseBoolean(rememberMe)) {
                        redisService.expire(Constants.REDIS_JWT_KEY + tUser.getId(), Constants.DEFAULT_EXPIRE_TIME, TimeUnit.SECONDS);
                    }
            });
//            验证jwt通过了,让filter链继续执行
            filterChain.doFilter(request,response);
        }
    }
}
package com.alatus.config.filter;

import com.alatus.constant.Constants;
import com.alatus.model.TUser;
import com.alatus.result.R;
import com.alatus.service.RedisService;
import com.alatus.util.JSONUtils;
import com.alatus.util.JWTUtils;
import com.alatus.util.ResponseUtils;
import com.alatus.result.CodeEnum;
import jakarta.annotation.Resource;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.filter.OncePerRequestFilter;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import static com.alatus.result.CodeEnum.TOKEN_IS_EXPIRED;


@Component
public class TokenVerifyFilter extends OncePerRequestFilter {

    @Resource
    private RedisService redisService;
    @Resource
    //    springboot框架提供的线程池,ioc容器内已经存在
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        if (request.getRequestURI().equals(Constants.LOGIN_URI)) { //如果是登录请求,此时还没有生成jwt,那不需要对登录请求进行jwt验证
            //验证jwt通过了 ,让Filter链继续执行,也就是继续执行下一个Filter
            filterChain.doFilter(request, response);
        } else {
            String token = request.getHeader("Authorization");
            if(!StringUtils.hasText("Authorization")){
//                没拿到token,将失败这个枚举传回去,解析并取出常量拼接
                R result = R.FAIL(CodeEnum.TOKEN_IS_EMPTY);
//                封装
                String resultJSON = JSONUtils.toJSON(result);
//                返回
                ResponseUtils.write(response,resultJSON);
                return;
            }
//            验证token有没有被篡改过,也是验证token合法性
            if (!(JWTUtils.verifyJWT(token))){
//                token不合法
                R result = R.FAIL(CodeEnum.TOKEN_IS_NONE_MATCH);
//                封装
                String resultJSON = JSONUtils.toJSON(result);
//                返回
                ResponseUtils.write(response,resultJSON);
                return;
            }
            TUser tUser = JWTUtils.parseUserFromJWT(token);
            String redisToken = (String) redisService.getValue(Constants.REDIS_JWT_KEY + tUser.getId());
            if(!StringUtils.hasText(redisToken)){
//                没有获取到内容说明token过期了
                R fail = R.FAIL(TOKEN_IS_EXPIRED);
                String json = JSONUtils.toJSON(fail);
                ResponseUtils.write(response,json);
                return;
            }
            if (!redisToken.equals(token)) {
//                登陆失败token错误
                R result = R.FAIL(CodeEnum.TOKEN_IS_ERROR);
//                把R对象转为JSON
                String json = JSONUtils.toJSON(result);
                ResponseUtils.write(response,json);
                return;
            }
//            jwt验证通过了
            UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(tUser,tUser.getLoginPwd(),tUser.getAuthorities());
            SecurityContextHolder.getContext().setAuthentication(authenticationToken);
//            刷新一下token
//            做异步执行
//            new Thread(new Runnable() {
//                @Override
//                public void run() {
                    这里刷新token即可
                    从请求头中获取
//                    String rememberMe = request.getHeader("rememberMe");
//                    if (!Boolean.parseBoolean(rememberMe)) {
//                        redisService.expire(Constants.REDIS_JWT_KEY + tUser.getId(), Constants.DEFAULT_EXPIRE_TIME, TimeUnit.SECONDS);
//                    }
//                }
//            }).start();
//            最好使用线程池的方式去执行
            threadPoolTaskExecutor.execute(() -> {
//                    这里刷新token即可
//                    从请求头中获取
                    String rememberMe = request.getHeader("rememberMe");
                    if (!Boolean.parseBoolean(rememberMe)) {
                        redisService.expire(Constants.REDIS_JWT_KEY + tUser.getId(), Constants.DEFAULT_EXPIRE_TIME, TimeUnit.SECONDS);
                    }
            });
//            验证jwt通过了,让filter链继续执行
            filterChain.doFilter(request,response);
        }
    }
}
<?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.alatus.mapper.TUserMapper">
  <resultMap id="BaseResultMap" type="com.alatus.model.TUser">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="login_act" jdbcType="VARCHAR" property="loginAct" />
    <result column="login_pwd" jdbcType="VARCHAR" property="loginPwd" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="account_no_expired" jdbcType="INTEGER" property="accountNoExpired" />
    <result column="credentials_no_expired" jdbcType="INTEGER" property="credentialsNoExpired" />
    <result column="account_no_locked" jdbcType="INTEGER" property="accountNoLocked" />
    <result column="account_enabled" jdbcType="INTEGER" property="accountEnabled" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="INTEGER" property="createBy" />
    <result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
    <result column="edit_by" jdbcType="INTEGER" property="editBy" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
  </resultMap>
  <resultMap id="UserDetailResultMap" type="com.alatus.model.TUser">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="login_act" jdbcType="VARCHAR" property="loginAct" />
    <result column="login_pwd" jdbcType="VARCHAR" property="loginPwd" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="account_no_expired" jdbcType="INTEGER" property="accountNoExpired" />
    <result column="credentials_no_expired" jdbcType="INTEGER" property="credentialsNoExpired" />
    <result column="account_no_locked" jdbcType="INTEGER" property="accountNoLocked" />
    <result column="account_enabled" jdbcType="INTEGER" property="accountEnabled" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="INTEGER" property="createBy" />
    <result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
    <result column="edit_by" jdbcType="INTEGER" property="editBy" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
    <!--一对一关联-->
    <association property="createByPO" javaType="com.alatus.model.TUser">
      <id column="createById" jdbcType="INTEGER" property="id" />
      <result column="createByName" jdbcType="VARCHAR" property="name" />
    </association>
    <!--一对一关联-->
    <association property="editByPO" javaType="com.alatus.model.TUser">
      <id column="editById" jdbcType="INTEGER" property="id" />
      <result column="editName" jdbcType="VARCHAR" property="name" />
    </association>
  </resultMap>

  <sql id="Base_Column_List">
    id, login_act, login_pwd, `name`, phone, email, account_no_expired, credentials_no_expired, 
    account_no_locked, account_enabled, create_time, create_by, edit_time, edit_by, last_login_time
  </sql>
  <select id="selectByLoginAct" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_user
    where login_act = #{username,jdbcType=VARCHAR}
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_user
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectDetailByPrimaryKey" parameterType="java.lang.Integer" resultMap="UserDetailResultMap">
    select
      tu.*,
      tu2.id createById, tu2.name createByName,
      tu3.id editById, tu3.name editName
    from t_user tu left join t_user tu2 on tu.create_by = tu2.id
                   left join t_user tu3 on tu.edit_by = tu3.id
    where tu.id = #{id, jdbcType=INTEGER}
  </select>
  <select id="selectUserByPage" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_user
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_user
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TUser" useGeneratedKeys="true">
    insert into t_user (login_act, login_pwd, `name`, 
      phone, email, a
ccount_no_expired,
      credentials_no_expired, account_no_locked, 
      account_enabled, create_time, create_by, 
      edit_time, edit_by, last_login_time
      )
    values (#{loginAct,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{accountNoExpired,jdbcType=INTEGER}, 
      #{credentialsNoExpired,jdbcType=INTEGER}, #{accountNoLocked,jdbcType=INTEGER}, 
      #{accountEnabled,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, 
      #{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER}, #{lastLoginTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TUser" useGeneratedKeys="true">
    insert into t_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="loginAct != null">
        login_act,
      </if>
      <if test="loginPwd != null">
        login_pwd,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="accountNoExpired != null">
        account_no_expired,
      </if>
      <if test="credentialsNoExpired != null">
        credentials_no_expired,
      </if>
      <if test="accountNoLocked != null">
        account_no_locked,
      </if>
      <if test="accountEnabled != null">
        account_enabled,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="editTime != null">
        edit_time,
      </if>
      <if test="editBy != null">
        edit_by,
      </if>
      <if test="lastLoginTime != null">
        last_login_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="loginAct != null">
        #{loginAct,jdbcType=VARCHAR},
      </if>
      <if test="loginPwd != null">
        #{loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="accountNoExpired != null">
        #{accountNoExpired,jdbcType=INTEGER},
      </if>
      <if test="credentialsNoExpired != null">
        #{credentialsNoExpired,jdbcType=INTEGER},
      </if>
      <if test="accountNoLocked != null">
        #{accountNoLocked,jdbcType=INTEGER},
      </if>
      <if test="accountEnabled != null">
        #{accountEnabled,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=INTEGER},
      </if>
      <if test="editTime != null">
        #{editTime,jdbcType=TIMESTAMP},
      </if>
      <if test="editBy != null">
        #{editBy,jdbcType=INTEGER},
      </if>
      <if test="lastLoginTime != null">
        #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TUser">
    update t_user
    <set>
      <if test="loginAct != null">
        login_act = #{loginAct,jdbcType=VARCHAR},
      </if>
      <if test="loginPwd != null">
        login_pwd = #{loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="accountNoExpired != null">
        account_no_expired = #{accountNoExpired,jdbcType=INTEGER},
      </if>
      <if test="credentialsNoExpired != null">
        credentials_no_expired = #{credentialsNoExpired,jdbcType=INTEGER},
      </if>
      <if test="accountNoLocked != null">
        account_no_locked = #{accountNoLocked,jdbcType=INTEGER},
      </if>
      <if test="accountEnabled != null">
        account_enabled = #{accountEnabled,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=INTEGER},
      </if>
      <if test="editTime != null">
        edit_time = #{editTime,jdbcType=TIMESTAMP},
      </if>
      <if test="editBy != null">
        edit_by = #{editBy,jdbcType=INTEGER},
      </if>
      <if test="lastLoginTime != null">
        last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.alatus.model.TUser">
    update t_user
    set login_act = #{loginAct,jdbcType=VARCHAR},
      login_pwd = #{loginPwd,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      account_no_expired = #{accountNoExpired,jdbcType=INTEGER},
      credentials_no_expired = #{credentialsNoExpired,jdbcType=INTEGER},
      account_no_locked = #{accountNoLocked,jdbcType=INTEGER},
      account_enabled = #{accountEnabled,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_by = #{createBy,jdbcType=INTEGER},
      edit_time = #{editTime,jdbcType=TIMESTAMP},
      edit_by = #{editBy,jdbcType=INTEGER},
      last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>
<?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.alatus.mapper.TUserMapper">
  <resultMap id="BaseResultMap" type="com.alatus.model.TUser">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="login_act" jdbcType="VARCHAR" property="loginAct" />
    <result column="login_pwd" jdbcType="VARCHAR" property="loginPwd" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="account_no_expired" jdbcType="INTEGER" property="accountNoExpired" />
    <result column="credentials_no_expired" jdbcType="INTEGER" property="credentialsNoExpired" />
    <result column="account_no_locked" jdbcType="INTEGER" property="accountNoLocked" />
    <result column="account_enabled" jdbcType="INTEGER" property="accountEnabled" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="INTEGER" property="createBy" />
    <result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
    <result column="edit_by" jdbcType="INTEGER" property="editBy" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
  </resultMap>
  <resultMap id="UserDetailResultMap" type="com.alatus.model.TUser">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="login_act" jdbcType="VARCHAR" property="loginAct" />
    <result column="login_pwd" jdbcType="VARCHAR" property="loginPwd" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="account_no_expired" jdbcType="INTEGER" property="accountNoExpired" />
    <result column="credentials_no_expired" jdbcType="INTEGER" property="credentialsNoExpired" />
    <result column="account_no_locked" jdbcType="INTEGER" property="accountNoLocked" />
    <result column="account_enabled" jdbcType="INTEGER" property="accountEnabled" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="INTEGER" property="createBy" />
    <result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
    <result column="edit_by" jdbcType="INTEGER" property="editBy" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
    <!--一对一关联-->
    <association property="createByPO" javaType="com.alatus.model.TUser">
      <id column="createById" jdbcType="INTEGER" property="id" />
      <result column="createByName" jdbcType="VARCHAR" property="name" />
    </association>
    <!--一对一关联-->
    <association property="editByPO" javaType="com.alatus.model.TUser">
      <id column="editById" jdbcType="INTEGER" property="id" />
      <result column="editName" jdbcType="VARCHAR" property="name" />
    </association>
  </resultMap>

  <sql id="Base_Column_List">
    id, login_act, login_pwd, `name`, phone, email, account_no_expired, credentials_no_expired, 
    account_no_locked, account_enabled, create_time, create_by, edit_time, edit_by, last_login_time
  </sql>
  <select id="selectByLoginAct" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_user
    where login_act = #{username,jdbcType=VARCHAR}
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_user
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectDetailByPrimaryKey" parameterType="java.lang.Integer" resultMap="UserDetailResultMap">
    select
      tu.*,
      tu2.id createById, tu2.name createByName,
      tu3.id editById, tu3.name editName
    from t_user tu left join t_user tu2 on tu.create_by = tu2.id
                   left join t_user tu3 on tu.edit_by = tu3.id
    where tu.id = #{id, jdbcType=INTEGER}
  </select>
  <select id="selectUserByPage" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_user
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_user
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TUser" useGeneratedKeys="true">
    insert into t_user (login_act, login_pwd, `name`, 
      phone, email, a
ccount_no_expired,
      credentials_no_expired, account_no_locked, 
      account_enabled, create_time, create_by, 
      edit_time, edit_by, last_login_time
      )
    values (#{loginAct,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{accountNoExpired,jdbcType=INTEGER}, 
      #{credentialsNoExpired,jdbcType=INTEGER}, #{accountNoLocked,jdbcType=INTEGER}, 
      #{accountEnabled,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, 
      #{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER}, #{lastLoginTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TUser" useGeneratedKeys="true">
    insert into t_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="loginAct != null">
        login_act,
      </if>
      <if test="loginPwd != null">
        login_pwd,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="accountNoExpired != null">
        account_no_expired,
      </if>
      <if test="credentialsNoExpired != null">
        credentials_no_expired,
      </if>
      <if test="accountNoLocked != null">
        account_no_locked,
      </if>
      <if test="accountEnabled != null">
        account_enabled,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="editTime != null">
        edit_time,
      </if>
      <if test="editBy != null">
        edit_by,
      </if>
      <if test="lastLoginTime != null">
        last_login_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="loginAct != null">
        #{loginAct,jdbcType=VARCHAR},
      </if>
      <if test="loginPwd != null">
        #{loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="accountNoExpired != null">
        #{accountNoExpired,jdbcType=INTEGER},
      </if>
      <if test="credentialsNoExpired != null">
        #{credentialsNoExpired,jdbcType=INTEGER},
      </if>
      <if test="accountNoLocked != null">
        #{accountNoLocked,jdbcType=INTEGER},
      </if>
      <if test="accountEnabled != null">
        #{accountEnabled,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=INTEGER},
      </if>
      <if test="editTime != null">
        #{editTime,jdbcType=TIMESTAMP},
      </if>
      <if test="editBy != null">
        #{editBy,jdbcType=INTEGER},
      </if>
      <if test="lastLoginTime != null">
        #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TUser">
    update t_user
    <set>
      <if test="loginAct != null">
        login_act = #{loginAct,jdbcType=VARCHAR},
      </if>
      <if test="loginPwd != null">
        login_pwd = #{loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="accountNoExpired != null">
        account_no_expired = #{accountNoExpired,jdbcType=INTEGER},
      </if>
      <if test="credentialsNoExpired != null">
        credentials_no_expired = #{credentialsNoExpired,jdbcType=INTEGER},
      </if>
      <if test="accountNoLocked != null">
        account_no_locked = #{accountNoLocked,jdbcType=INTEGER},
      </if>
      <if test="accountEnabled != null">
        account_enabled = #{accountEnabled,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=INTEGER},
      </if>
      <if test="editTime != null">
        edit_time = #{editTime,jdbcType=TIMESTAMP},
      </if>
      <if test="editBy != null">
        edit_by = #{editBy,jdbcType=INTEGER},
      </if>
      <if test="lastLoginTime != null">
        last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.alatus.model.TUser">
    update t_user
    set login_act = #{loginAct,jdbcType=VARCHAR},
      login_pwd = #{loginPwd,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      account_no_expired = #{accountNoExpired,jdbcType=INTEGER},
      credentials_no_expired = #{credentialsNoExpired,jdbcType=INTEGER},
      account_no_locked = #{accountNoLocked,jdbcType=INTEGER},
      account_enabled = #{accountEnabled,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_by = #{createBy,jdbcType=INTEGER},
      edit_time = #{editTime,jdbcType=TIMESTAMP},
      edit_by = #{editBy,jdbcType=INTEGER},
      last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>
package com.alatus.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 用户表
 * t_user
 */
@Data
public class TUser implements UserDetails,Serializable {
    /**
     * 主键,自动增长,用户ID
     */
    private Integer id;

    /**
     * 登录账号
     */
    private String loginAct;

    /**
     * 登录密码
     */
    private String loginPwd;

    /**
     * 用户姓名
     */
    private String name;

    /**
     * 用户手机
     */
    private String phone;

    /**
     * 用户邮箱
     */
    private String email;

    /**
     * 账户是否没有过期,0已过期 1正常
     */
    private Integer accountNoExpired;

    /**
     * 密码是否没有过期,0已过期 1正常
     */
    private Integer credentialsNoExpired;

    /**
     * 账号是否没有锁定,0已锁定 1正常
     */
    private Integer accountNoLocked;

    /**
     * 账号是否启用,0禁用 1启用
     */
    private Integer accountEnabled;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private Integer createBy;

    /**
     * 编辑时间
     */
    private Date editTime;

    /**
     * 编辑人
     */
    private Integer editBy;

    /**
     * 最近登录时间
     */
    private Date lastLoginTime;

    /**
     * 一对一关联:创建人
     */
    private TUser createByPO;

    /**
     * 一对一关联:编辑人
     */
    private TUser editByPO;

    private static final long serialVersionUID = 1L;

//    角色的List
    private List<String> roleList;

//    权限标识符List
    private List<String> permissionList;
//    让以下的都JSON忽略,不然会报异常,而且也用不着他们
    @JsonIgnore
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        List<GrantedAuthority> list = new ArrayList<>();
//        角色列表遍历,做非空判断避免空指针
        if(this.getRoleList() != null){
            this.getRoleList().forEach(role -> {
                list.add(new SimpleGrantedAuthority(role));
            });
        }
//        权限标识符
        if(this.getPermissionList() != null){
            this.getPermissionList().forEach(permission -> {
                list.add(new SimpleGrantedAuthority(permission));
            });
        }
        return list;
    }
    @JsonIgnore
    @Override
    public String getPassword() {
        return this.getLoginPwd();
    }
    @JsonIgnore
    @Override
    public String getUsername() {
        return this.getLoginAct();
    }
//    以下的设计都是为1可用,为0不可用
    @JsonIgnore
    @Override
    public boolean isAccountNonExpired() {
        return this.getAccountNoExpired() == 1;
    }
    @JsonIgnore
    @Override
    public boolean isAccountNonLocked() {
        return this.getAccountNoLocked() == 1;
    }
    @JsonIgnore
    @Override
    public boolean isCredentialsNonExpired() {
        return this.getCredentialsNoExpired() == 1;
    }
    @JsonIgnore
    @Override
    public boolean isEnabled() {
        return this.getAccountEnabled() == 1;
    }
}
package com.alatus.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 用户表
 * t_user
 */
@Data
public class TUser implements UserDetails,Serializable {
    /**
     * 主键,自动增长,用户ID
     */
    private Integer id;

    /**
     * 登录账号
     */
    private String loginAct;

    /**
     * 登录密码
     */
    private String loginPwd;

    /**
     * 用户姓名
     */
    private String name;

    /**
     * 用户手机
     */
    private String phone;

    /**
     * 用户邮箱
     */
    private String email;

    /**
     * 账户是否没有过期,0已过期 1正常
     */
    private Integer accountNoExpired;

    /**
     * 密码是否没有过期,0已过期 1正常
     */
    private Integer credentialsNoExpired;

    /**
     * 账号是否没有锁定,0已锁定 1正常
     */
    private Integer accountNoLocked;

    /**
     * 账号是否启用,0禁用 1启用
     */
    private Integer accountEnabled;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private Integer createBy;

    /**
     * 编辑时间
     */
    private Date editTime;

    /**
     * 编辑人
     */
    private Integer editBy;

    /**
     * 最近登录时间
     */
    private Date lastLoginTime;

    /**
     * 一对一关联:创建人
     */
    private TUser createByPO;

    /**
     * 一对一关联:编辑人
     */
    private TUser editByPO;

    private static final long serialVersionUID = 1L;

//    角色的List
    private List<String> roleList;

//    权限标识符List
    private List<String> permissionList;
//    让以下的都JSON忽略,不然会报异常,而且也用不着他们
    @JsonIgnore
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        List<GrantedAuthority> list = new ArrayList<>();
//        角色列表遍历,做非空判断避免空指针
        if(this.getRoleList() != null){
            this.getRoleList().forEach(role -> {
                list.add(new SimpleGrantedAuthority(role));
            });
        }
//        权限标识符
        if(this.getPermissionList() != null){
            this.getPermissionList().forEach(permission -> {
                list.add(new SimpleGrantedAuthority(permission));
            });
        }
        return list;
    }
    @JsonIgnore
    @Override
    public String getPassword() {
        return this.getLoginPwd();
    }
    @JsonIgnore
    @Override
    public String getUsername() {
        return this.getLoginAct();
    }
//    以下的设计都是为1可用,为0不可用
    @JsonIgnore
    @Override
    public boolean isAccountNonExpired() {
        return this.getAccountNoExpired() == 1;
    }
    @JsonIgnore
    @Override
    public boolean isAccountNonLocked() {
        return this.getAccountNoLocked() == 1;
    }
    @JsonIgnore
    @Override
    public boolean isCredentialsNonExpired() {
        return this.getCredentialsNoExpired() == 1;
    }
    @JsonIgnore
    @Override
    public boolean isEnabled() {
        return this.getAccountEnabled() == 1;
    }
}
package com.alatus.mapper;

import com.alatus.model.TUser;

import java.util.ArrayList;

public interface TUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TUser record);

    int insertSelective(TUser record);

    TUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TUser record);

    int updateByPrimaryKey(TUser record);

    TUser selectByLoginAct(String username);

    ArrayList<TUser> selectUserByPage();

    TUser selectDetailByPrimaryKey(Integer id);
}
package com.alatus.mapper;

import com.alatus.model.TUser;

import java.util.ArrayList;

public interface TUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TUser record);

    int insertSelective(TUser record);

    TUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TUser record);

    int updateByPrimaryKey(TUser record);

    TUser selectByLoginAct(String username);

    ArrayList<TUser> selectUserByPage();

    TUser selectDetailByPrimaryKey(Integer id);
}
package com.alatus.service;

import com.alatus.model.TUser;
import com.alatus.query.UserQuery;
import com.github.pagehelper.PageInfo;
import org.springframework.security.core.userdetails.UserDetailsService;

public interface UserService extends UserDetailsService {

    PageInfo<TUser> getUserByPage(Integer current);

    TUser getUserById(Integer id);

    int saveUser(UserQuery userQuery);
}
package com.alatus.service;

import com.alatus.model.TUser;
import com.alatus.query.UserQuery;
import com.github.pagehelper.PageInfo;
import org.springframework.security.core.userdetails.UserDetailsService;

public interface UserService extends UserDetailsService {

    PageInfo<TUser> getUserByPage(Integer current);

    TUser getUserById(Integer id);

    int saveUser(UserQuery userQuery);
}
package com.alatus.web;

import com.alatus.model.TUser;
import com.alatus.query.UserQuery;
import com.alatus.result.R;
import com.alatus.service.UserService;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    @Resource
    private UserService userService;
//    获取登录信息
    @GetMapping(value = "/api/login/info")
    public R loginInfo(Authentication authentication){
        TUser tUser = (TUser) authentication.getPrincipal();
        return R.OK(tUser);
    }
    //免登录验证
    //因为发送的请求过来首先会过filter那一关,能到这说明token验证都通过了,我们直接返回200即可
    @GetMapping(value = "/api/login/free")
    public R freeLogin(){
        return R.OK();
    }
//    查询用户列表
    @GetMapping(value = "/api/users")
//    传递参数current,可传可不传,
    public R userPage(@RequestParam(value = "current",required = false) Integer current){
        if(current == null){
            current = 1;
        }
//        返回结果为PageInfo
        PageInfo<TUser> userByPage = userService.getUserByPage(current);
        return R.OK(userByPage);
    }
    @GetMapping(value = "/api/user/{id}")
    public R userDetail(@PathVariable(value = "id")Integer id){
        TUser tUser = userService.getUserById(id);
        return R.OK(tUser);
    }
    @PostMapping(value = "/api/user/add")
    public R addUser(UserQuery userQuery,@RequestHeader(value = "Authorization")String token){
        userQuery.setToken(token);
        int save = userService.saveUser(userQuery);
        return save >= 1 ? R.OK() : R.FAIL();
    }
}
package com.alatus.web;

import com.alatus.model.TUser;
import com.alatus.query.UserQuery;
import com.alatus.result.R;
import com.alatus.service.UserService;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    @Resource
    private UserService userService;
//    获取登录信息
    @GetMapping(value = "/api/login/info")
    public R loginInfo(Authentication authentication){
        TUser tUser = (TUser) authentication.getPrincipal();
        return R.OK(tUser);
    }
    //免登录验证
    //因为发送的请求过来首先会过filter那一关,能到这说明token验证都通过了,我们直接返回200即可
    @GetMapping(value = "/api/login/free")
    public R freeLogin(){
        return R.OK();
    }
//    查询用户列表
    @GetMapping(value = "/api/users")
//    传递参数current,可传可不传,
    public R userPage(@RequestParam(value = "current",required = false) Integer current){
        if(current == null){
            current = 1;
        }
//        返回结果为PageInfo
        PageInfo<TUser> userByPage = userService.getUserByPage(current);
        return R.OK(userByPage);
    }
    @GetMapping(value = "/api/user/{id}")
    public R userDetail(@PathVariable(value = "id")Integer id){
        TUser tUser = userService.getUserById(id);
        return R.OK(tUser);
    }
    @PostMapping(value = "/api/user/add")
    public R addUser(UserQuery userQuery,@RequestHeader(value = "Authorization")String token){
        userQuery.setToken(token);
        int save = userService.saveUser(userQuery);
        return save >= 1 ? R.OK() : R.FAIL();
    }
}
package com.alatus.query;

import lombok.Data;

@Data
public class BaseQuery {
//    这里是JWT
    private String token;
}
package com.alatus.query;

import lombok.Data;

@Data
public class BaseQuery {
//    这里是JWT
    private String token;
}
package com.alatus.query;

import lombok.Data;

@Data
public class UserQuery extends BaseQuery{
    /**
     * 主键,自动增长,用户ID
     */
    private Integer id;

    /**
     * 登录账号
     */
    private String loginAct;

    /**
     * 登录密码
     */
    private String loginPwd;

    /**
     * 用户姓名
     */
    private String name;

    /**
     * 用户手机
     */
    private String phone;

    /**
     * 用户邮箱
     */
    private String email;

    /**
     * 账户是否没有过期,0已过期 1正常
     */
    private Integer accountNoExpired;

    /**
     * 密码是否没有过期,0已过期 1正常
     */
    private Integer credentialsNoExpired;

    /**
     * 账号是否没有锁定,0已锁定 1正常
     */
    private Integer accountNoLocked;

    /**
     * 账号是否启用,0禁用 1启用
     */
    private Integer accountEnabled;
}
package com.alatus.query;

import lombok.Data;

@Data
public class UserQuery extends BaseQuery{
    /**
     * 主键,自动增长,用户ID
     */
    private Integer id;

    /**
     * 登录账号
     */
    private String loginAct;

    /**
     * 登录密码
     */
    private String loginPwd;

    /**
     * 用户姓名
     */
    private String name;

    /**
     * 用户手机
     */
    private String phone;

    /**
     * 用户邮箱
     */
    private String email;

    /**
     * 账户是否没有过期,0已过期 1正常
     */
    private Integer accountNoExpired;

    /**
     * 密码是否没有过期,0已过期 1正常
     */
    private Integer credentialsNoExpired;

    /**
     * 账号是否没有锁定,0已锁定 1正常
     */
    private Integer accountNoLocked;

    /**
     * 账号是否启用,0禁用 1启用
     */
    private Integer accountEnabled;
}

最近更新

  1. TCP协议是安全的吗?

    2024-02-11 19:56:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-11 19:56:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-11 19:56:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-11 19:56:02       20 阅读

热门阅读

  1. PVST详解

    2024-02-11 19:56:02       30 阅读
  2. 关于LLaMA Tokenizer的一些坑...

    2024-02-11 19:56:02       31 阅读
  3. 蓝桥杯2023年第十四届省赛真题----棋盘

    2024-02-11 19:56:02       38 阅读
  4. 【Linux】Ubuntu 22.04 升级 nodejs 到 v18

    2024-02-11 19:56:02       28 阅读
  5. fpga 需要掌握哪些基础知识?

    2024-02-11 19:56:02       27 阅读
  6. 修改GI文件的权限

    2024-02-11 19:56:02       31 阅读
  7. python字串节对象Bytes

    2024-02-11 19:56:02       21 阅读