-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: update dataservice config web
- Loading branch information
wangqi
committed
Feb 7, 2024
1 parent
90c07b7
commit 136cfbd
Showing
13 changed files
with
155 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
scaleph-common/src/main/java/cn/sliew/scaleph/common/dict/dataservice/HttpMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package cn.sliew.scaleph.common.dict.dataservice; | ||
|
||
import cn.sliew.scaleph.common.dict.DictInstance; | ||
import com.baomidou.mybatisplus.annotation.EnumValue; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
import java.util.Arrays; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||
public enum HttpMethod implements DictInstance { | ||
|
||
GET("GET", "GET"), | ||
POST("POST", "POST"), | ||
; | ||
|
||
@JsonCreator | ||
public static HttpMethod of(String value) { | ||
return Arrays.stream(values()) | ||
.filter(instance -> instance.getValue().equals(value)) | ||
.findAny().orElseThrow(() -> new EnumConstantNotPresentException(HttpMethod.class, value)); | ||
} | ||
|
||
@EnumValue | ||
private String value; | ||
private String label; | ||
|
||
HttpMethod(String value, String label) { | ||
this.value = value; | ||
this.label = label; | ||
} | ||
|
||
@Override | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
scaleph-common/src/main/java/cn/sliew/scaleph/common/dict/dataservice/QueryType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package cn.sliew.scaleph.common.dict.dataservice; | ||
|
||
import cn.sliew.scaleph.common.dict.DictInstance; | ||
import com.baomidou.mybatisplus.annotation.EnumValue; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
import java.util.Arrays; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||
public enum QueryType implements DictInstance { | ||
|
||
SELECT("SELECT", "SELECT"), | ||
UPSERT("UPSERT", "UPSERT"), | ||
INSERT("INSERT", "INSERT"), | ||
UPDATE("UPDATE", "UPDATE"), | ||
DELETE("DELETE", "DELETE"), | ||
; | ||
|
||
@JsonCreator | ||
public static QueryType of(String value) { | ||
return Arrays.stream(values()) | ||
.filter(instance -> instance.getValue().equals(value)) | ||
.findAny().orElseThrow(() -> new EnumConstantNotPresentException(QueryType.class, value)); | ||
} | ||
|
||
@EnumValue | ||
private String value; | ||
private String label; | ||
|
||
QueryType(String value, String label) { | ||
this.value = value; | ||
this.label = label; | ||
} | ||
|
||
@Override | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
...e/src/main/java/cn/sliew/scaleph/dataservice/service/param/DataserviceConfigAddParam.java
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
...rc/main/java/cn/sliew/scaleph/dataservice/service/param/DataserviceConfigUpdateParam.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters