小程序登录相关
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.czg.account.dto.auth;
|
||||
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
public class LoginTokenDTO {
|
||||
private String token;
|
||||
private UserInfo userInfo;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.czg.account.dto.auth;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class UserAuthorizationLoginDTO {
|
||||
/**
|
||||
* 登录类型
|
||||
*/
|
||||
@NotEmpty(message = "登录类型")
|
||||
private String source;
|
||||
/**
|
||||
* 登录code
|
||||
*/
|
||||
@NotEmpty(message = "登录code")
|
||||
private String code;
|
||||
/**
|
||||
* 登录返回的data
|
||||
*/
|
||||
private String rawData;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.czg.account.dto.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class WechatRawDataDTO {
|
||||
private String nickName;
|
||||
private Integer gender;
|
||||
private String language;
|
||||
private String city;
|
||||
private String province;
|
||||
private String country;
|
||||
private String avatarUrl;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-11
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_user_info")
|
||||
public class UserInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String headImg;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 会员生日
|
||||
*/
|
||||
private String birthDay;
|
||||
|
||||
/**
|
||||
* 0-女 1男
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 微信 openid
|
||||
*/
|
||||
private String wechatOpenId;
|
||||
|
||||
/**
|
||||
* 支付宝 openid
|
||||
*/
|
||||
private String alipayOpenId;
|
||||
|
||||
/**
|
||||
* 1正常
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 最近登录时间
|
||||
*/
|
||||
private LocalDateTime lastLoginTime;
|
||||
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
private String payPwd;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.auth.LoginTokenDTO;
|
||||
import com.czg.account.dto.auth.UserAuthorizationLoginDTO;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface UserAuthorizationService {
|
||||
LoginTokenDTO login(UserAuthorizationLoginDTO userAuthorizationLoginDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
* 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-02-11
|
||||
*/
|
||||
public interface UserInfoService extends IService<UserInfo> {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user