mirror of
https://github.com/vran-dev/databasir.git
synced 2025-09-20 10:49:20 +08:00
feat: change appType to enum
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.databasir.core.domain.app.data;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -14,8 +15,8 @@ public class OAuthAppCreateRequest {
|
||||
@NotBlank
|
||||
private String appName;
|
||||
|
||||
@NotBlank
|
||||
private String appType;
|
||||
@NotNull
|
||||
private OAuthAppType appType;
|
||||
|
||||
private String appIcon;
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.databasir.core.domain.app.data;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -13,7 +14,7 @@ public class OAuthAppDetailResponse {
|
||||
|
||||
private String appIcon;
|
||||
|
||||
private String appType;
|
||||
private OAuthAppType appType;
|
||||
|
||||
private String registrationId;
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.databasir.core.domain.app.data;
|
||||
|
||||
import com.databasir.dao.Tables;
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import lombok.Data;
|
||||
import org.jooq.Condition;
|
||||
import org.jooq.impl.DSL;
|
||||
@@ -13,7 +14,7 @@ public class OAuthAppPageCondition {
|
||||
|
||||
private String appNameContains;
|
||||
|
||||
private String appType;
|
||||
private OAuthAppType appType;
|
||||
|
||||
public Condition toCondition() {
|
||||
List<Condition> conditions = new ArrayList<>();
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.databasir.core.domain.app.data;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -13,7 +14,7 @@ public class OAuthAppPageResponse {
|
||||
|
||||
private String appIcon;
|
||||
|
||||
private String appType;
|
||||
private OAuthAppType appType;
|
||||
|
||||
private String registrationId;
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.databasir.core.domain.app.data;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -19,7 +20,7 @@ public class OAuthAppResponse {
|
||||
|
||||
private String appIcon;
|
||||
|
||||
private String appType;
|
||||
private OAuthAppType appType;
|
||||
|
||||
private String registrationId;
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.databasir.core.domain.app.data;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -17,8 +18,8 @@ public class OAuthAppUpdateRequest {
|
||||
@NotBlank
|
||||
private String appName;
|
||||
|
||||
@NotBlank
|
||||
private String appType;
|
||||
@NotNull
|
||||
private OAuthAppType appType;
|
||||
|
||||
private String appIcon;
|
||||
|
||||
|
@@ -21,8 +21,8 @@ public class GithubOpenAuthHandler implements OpenAuthHandler {
|
||||
private final GithubRemoteService githubRemoteService;
|
||||
|
||||
@Override
|
||||
public boolean support(String oauthAppType) {
|
||||
return OAuthAppType.GITHUB.isSame(oauthAppType);
|
||||
public boolean support(OAuthAppType oauthAppType) {
|
||||
return OAuthAppType.GITHUB == oauthAppType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -19,8 +19,8 @@ public class GitlabOpenAuthHandler implements OpenAuthHandler {
|
||||
private final GitlabRemoteService gitlabRemoteService;
|
||||
|
||||
@Override
|
||||
public boolean support(String oauthAppType) {
|
||||
return OAuthAppType.GITLAB.isSame(oauthAppType);
|
||||
public boolean support(OAuthAppType oauthAppType) {
|
||||
return OAuthAppType.GITLAB == oauthAppType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,12 +1,13 @@
|
||||
package com.databasir.core.domain.app.handler;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface OpenAuthHandler {
|
||||
|
||||
boolean support(String oauthAppType);
|
||||
boolean support(OAuthAppType oauthAppType);
|
||||
|
||||
String authorizationUrl(OauthAppPojo app, Map<String, String[]> requestParams);
|
||||
|
||||
|
Reference in New Issue
Block a user