用户登陆功能实现,基本接口鉴权功能实现

This commit is contained in:
2025-06-12 13:31:52 +08:00
parent e8296042e3
commit 02eb5a7484
15 changed files with 510 additions and 14 deletions

View File

@@ -0,0 +1,32 @@
package com.yupi.springbootinit.model.dto.user;
import lombok.Data;
import java.util.Date;
/*
* @author: ziin
* @date: 2025/6/11 20:13
*/
/**
* 用户信息表
*/
@Data
public class SystemUsersDTO {
/**
* 用户账号
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 租户编号
*/
private Long tenantId;
}

View File

@@ -0,0 +1,124 @@
package com.yupi.springbootinit.model.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/*
* @author: ziin
* @date: 2025/6/11 20:13
*/
/**
* 用户信息表
*/
@Data
public class SystemUsers {
/**
* 用户ID
*/
private Long id;
/**
* 用户账号
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 用户昵称
*/
private String nickname;
/**
* 备注
*/
private String remark;
/**
* 部门ID
*/
@TableField("dept_id")
private Long deptId;
/**
* 岗位编号数组
*/
@TableField("post_ids")
private String postIds;
/**
* 用户邮箱
*/
private String email;
/**
* 手机号码
*/
private String mobile;
/**
* 用户性别
*/
private Byte sex;
/**
* 头像地址
*/
private String avatar;
/**
* 帐号状态0正常 1停用
*/
private Byte status;
/**
* 最后登录IP
*/
@TableField("login_ip")
private String loginIp;
/**
* 最后登录时间
*/
@TableField("login_date")
private Date loginDate;
/**
* 创建者
*/
private String creator;
/**
* 创建时间
*/
@TableField("create_time")
private Date createTime;
/**
* 更新者
*/
private String updater;
/**
* 更新时间
*/
@TableField("update_time")
private Date updateTime;
/**
* 是否删除
*/
private Boolean deleted;
/**
* 租户编号
*/
@TableField("tenant_id")
private Long tenantId;
}

View File

@@ -0,0 +1,47 @@
package com.yupi.springbootinit.model.enums;
import cn.hutool.core.util.ObjUtil;
import com.yupi.springbootinit.utils.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* 通用状态枚举
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
public enum CommonStatusEnum implements ArrayValuable<Integer> {
ENABLE(0, "开启"),
DISABLE(1, "关闭");
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CommonStatusEnum::getStatus).toArray(Integer[]::new);
/**
* 状态值
*/
private final Integer status;
/**
* 状态名
*/
private final String name;
@Override
public Integer[] array() {
return ARRAYS;
}
public static boolean isEnable(Integer status) {
return ObjUtil.equal(ENABLE.status, status);
}
public static boolean isDisable(Byte status) {
return ObjUtil.equal(DISABLE.status, status);
}
}

View File

@@ -0,0 +1,26 @@
package com.yupi.springbootinit.model.vo.user;
import lombok.Data;
import java.util.Date;
/*
* @author: ziin
* @date: 2025/6/11 20:13
*/
/**
* 用户信息表
*/
@Data
public class SystemUsersVO {
/**
* 用户ID
*/
private Long id;
/**
* 租户编号
*/
private Long tenantId;
}