feat:小程序平台-登录
This commit is contained in:
1 parent
43e6df6f72
commit
ee870fb9d1
18 files changed
+433
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.miniplatform;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 小程序平台登录错误
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MiniPlatformLoginErrorEnum {
|
||||
|
||||
GET_PHONE_ERROR("10", "获取手机号错误"),
|
||||
USER_NOT_EXIST("20", "用户不存在"),
|
||||
LOGIN_ERROR("30", "登录错误"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static MiniPlatformLoginErrorEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.miniplatform;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.thirdparty.constant.ThirdKeyTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MiniPlatformTypeEnum {
|
||||
|
||||
WECAHT("10", "微信小程序"),
|
||||
ALI_PAY("20", "支付宝"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static MiniPlatformTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.oathmini;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.MiniPlatformTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdMinAppOAth2LoginDto {
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@NotNull(message = "小程序平台标识不能为空")
|
||||
private MiniPlatformTypeEnum miniPlatformType;
|
||||
|
||||
@NotEmpty(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.oathmini;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdMinAppOAth2LoginVo {
|
||||
|
||||
private String accessToken;
|
||||
|
||||
private String refreshToken;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user