mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-05-14 12:45:41 +08:00
登录与注册
This commit is contained in:
@@ -16,13 +16,14 @@ public class User implements Serializable {
|
||||
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
private Integer id; // 主键
|
||||
private String sn; // 编号
|
||||
private Integer sn; // 编号
|
||||
private String avatar; // 用户头像
|
||||
private String realName; // 真实姓名
|
||||
private String nickname; // 用户昵称
|
||||
private String username; // 用户账号
|
||||
private String password; // 用户密码
|
||||
private String mobile; // 用户电话
|
||||
private Integer channel; // 注册渠道
|
||||
private String salt; // 加密盐巴
|
||||
private Integer sex; // 用户性别: [1=男, 2=女]
|
||||
private Integer is_delete; // 是否删除: [0=否, 1=是]
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mdd.common.entity.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户授权实体
|
||||
*/
|
||||
@Data
|
||||
public class UserAuth implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
private Integer id; // 主键
|
||||
private Integer userId; // 用户Id
|
||||
private String openid; // Openid
|
||||
private String unionid; // Unionid
|
||||
private Integer client; // 客户端类型: [1=微信小程序, 2=微信公众号, 3=手机H5;4=电脑PC, 5=苹果APP, 6=安卓APP]
|
||||
private Long createTime; // 创建时间
|
||||
private Long updateTime; // 更新时间
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.mdd.common.enums;
|
||||
|
||||
/**
|
||||
* 客户端枚举类
|
||||
*/
|
||||
public enum ClientEnum {
|
||||
|
||||
MNP(1, "微信小程序"),
|
||||
OA(2, "微信公众号"),
|
||||
H5(3, "手机H5"),
|
||||
PC(4, "电脑PC"),
|
||||
IOS(5, "苹果APP"),
|
||||
APK(5, "安卓APP");
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
private final int code;
|
||||
private final String msg;
|
||||
ClientEnum(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型获取Code
|
||||
*
|
||||
* @author fzr
|
||||
* @param type 类型
|
||||
* @return Integer
|
||||
*/
|
||||
public static Integer getCodeByType(String type){
|
||||
for(ClientEnum enumItem: ClientEnum.values()) {
|
||||
if (enumItem.toString().equals(type.toUpperCase())) {
|
||||
return enumItem.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型获取Msg
|
||||
*
|
||||
* @author fzr
|
||||
* @param type 类型
|
||||
* @return String
|
||||
*/
|
||||
public static String getMsgByType(String type){
|
||||
for(ClientEnum enumItem: ClientEnum.values()) {
|
||||
if (enumItem.toString().equals(type)) {
|
||||
return enumItem.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取状态码
|
||||
*
|
||||
* @author fzr
|
||||
* @return Long
|
||||
*/
|
||||
public int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提示
|
||||
*
|
||||
* @author fzr
|
||||
* @return String
|
||||
*/
|
||||
public String getMsg() {
|
||||
return this.msg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mdd.common.mapper.user;
|
||||
|
||||
import com.mdd.common.core.basics.IBaseMapper;
|
||||
import com.mdd.common.entity.user.UserAuth;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户授权Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserAuthMapper extends IBaseMapper<UserAuth> {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.mdd.common.plugin.wechat;
|
||||
|
||||
public class WechatDriver {
|
||||
}
|
||||
Reference in New Issue
Block a user