forked from WeBankFinTech/DataSphereStudio
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev-1.9.0' into dev-1.9.0
- Loading branch information
Showing
14 changed files
with
405 additions
and
0 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
116 changes: 116 additions & 0 deletions
116
.../src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/itsm/ItsmRequest.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,116 @@ | ||
package com.webank.wedatasphere.dss.framework.workspace.bean.itsm; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.JsonArray; | ||
import com.google.gson.JsonObject; | ||
import com.google.gson.reflect.TypeToken; | ||
import org.springframework.util.StringUtils; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ItsmRequest { | ||
|
||
private static final String dataKey = "dataList"; | ||
|
||
private String createDate; | ||
private String createUser; | ||
private String data; | ||
private String externalId; | ||
private String flowId; | ||
private String operateUser; | ||
private String requestTitle; | ||
private String style; | ||
private String taskId; | ||
|
||
|
||
// getters和setters | ||
public String getCreateDate() { | ||
return createDate; | ||
} | ||
|
||
public void setCreateDate(String createDate) { | ||
this.createDate = createDate; | ||
} | ||
|
||
public String getCreateUser() { | ||
return createUser; | ||
} | ||
|
||
public void setCreateUser(String createUser) { | ||
this.createUser = createUser; | ||
} | ||
|
||
public String getData() { | ||
return data; | ||
} | ||
|
||
public void setData(String data) { | ||
this.data = data; | ||
} | ||
|
||
public String getExternalId() { | ||
return externalId; | ||
} | ||
|
||
public void setExternalId(String externalId) { | ||
this.externalId = externalId; | ||
} | ||
|
||
public String getFlowId() { | ||
return flowId; | ||
} | ||
|
||
public void setFlowId(String flowId) { | ||
this.flowId = flowId; | ||
} | ||
|
||
public String getOperateUser() { | ||
return operateUser; | ||
} | ||
|
||
public void setOperateUser(String operateUser) { | ||
this.operateUser = operateUser; | ||
} | ||
|
||
public String getRequestTitle() { | ||
return requestTitle; | ||
} | ||
|
||
public void setRequestTitle(String requestTitle) { | ||
this.requestTitle = requestTitle; | ||
} | ||
|
||
public String getStyle() { | ||
return style; | ||
} | ||
|
||
public void setStyle(String style) { | ||
this.style = style; | ||
} | ||
|
||
public String getTaskId() { | ||
return taskId; | ||
} | ||
|
||
public void setTaskId(String taskId) { | ||
this.taskId = taskId; | ||
} | ||
|
||
public List<Map<String,String>> getDataList(){ | ||
String dataStr = getData(); | ||
if(!StringUtils.isEmpty(dataStr)) | ||
{ | ||
Gson gson = new Gson(); | ||
JsonObject jsonObject = gson.fromJson(dataStr, JsonObject.class); | ||
JsonArray dataList = jsonObject.getAsJsonArray("dataList"); | ||
|
||
Type listType = new TypeToken<List<Map<String, String>>>(){}.getType(); | ||
return gson.fromJson(dataList.toString(), listType); | ||
} | ||
return Collections.emptyList(); | ||
} | ||
|
||
} |
58 changes: 58 additions & 0 deletions
58
...src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/itsm/ItsmResponse.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,58 @@ | ||
package com.webank.wedatasphere.dss.framework.workspace.bean.itsm; | ||
|
||
public class ItsmResponse { | ||
|
||
private String data; | ||
private int retCode; | ||
private String retDetail; | ||
|
||
public String getData() { | ||
return data; | ||
} | ||
|
||
public void setData(String data) { | ||
this.data = data; | ||
} | ||
|
||
public ItsmResponse data(String data) { | ||
this.data = data; | ||
return this; | ||
} | ||
|
||
public int getRetCode() { | ||
return retCode; | ||
} | ||
|
||
public void setRetCode(int retCode) { | ||
this.retCode = retCode; | ||
} | ||
|
||
public ItsmResponse retCode(int retCode) { | ||
this.retCode = retCode; | ||
return this; | ||
} | ||
|
||
public String getRetDetail() { | ||
return retDetail; | ||
} | ||
|
||
public void setRetDetail(String retDetail) { | ||
this.retDetail = retDetail; | ||
} | ||
|
||
public ItsmResponse retDetail(String retDetail) { | ||
this.retDetail = retDetail; | ||
return this; | ||
} | ||
|
||
public static ItsmResponse ok(){ | ||
ItsmResponse itsmResponse = new ItsmResponse(); | ||
return itsmResponse.retCode(0); | ||
} | ||
public static ItsmResponse error(){ | ||
ItsmResponse itsmResponse = new ItsmResponse(); | ||
return itsmResponse.retCode(-1); | ||
} | ||
|
||
|
||
} |
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
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
Oops, something went wrong.