|
@@ -117,8 +117,9 @@ namespace TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse
|
|
|
object baseResponse = null;
|
|
|
if (error != null) {
|
|
|
ErrorJosnRPCResponse errorJosnRPCResponse = new ErrorJosnRPCResponse();
|
|
|
- errorJosnRPCResponse.error = error;
|
|
|
- // errorJosnRPCResponse.result = null;
|
|
|
+ errorJosnRPCResponse.error = error.data;
|
|
|
+ error.code = error.code;
|
|
|
+ error.message = error.message;
|
|
|
return errorJosnRPCResponse;
|
|
|
}
|
|
|
if (this.total > 0 && this.pageSize > 0)
|
|
@@ -127,37 +128,41 @@ namespace TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse
|
|
|
}
|
|
|
if (null != this.data && this.token != null)
|
|
|
{
|
|
|
- TokenJosnRPCResponse<object> tokenJosnRPCResponse = new TokenJosnRPCResponse<object>();
|
|
|
- tokenJosnRPCResponse.result.data = this.data;
|
|
|
- tokenJosnRPCResponse.result.extend = this.extend;
|
|
|
- tokenJosnRPCResponse.result.azureToken = this.token;
|
|
|
- tokenJosnRPCResponse.result.message = message;
|
|
|
- baseResponse = tokenJosnRPCResponse;
|
|
|
+ TokenJosnRPCResponse<object> response = new TokenJosnRPCResponse<object>();
|
|
|
+ response.result.data = this.data;
|
|
|
+ response.result.extend = this.extend;
|
|
|
+ response.result.azureToken = this.token;
|
|
|
+ response.code = 0;
|
|
|
+ response.message = message;
|
|
|
+
|
|
|
+ baseResponse = response;
|
|
|
}
|
|
|
else if (null != this.data && this.total > 0 && this.currPage > 0 && this.pageSize > 0 && this.totalPage > 0)
|
|
|
{
|
|
|
- PageJosnRPCResponse<object> pageDatasResponse = new PageJosnRPCResponse<object>();
|
|
|
- pageDatasResponse.result.data = this.data;
|
|
|
- pageDatasResponse.result.page = new Pagination(this.total, this.currPage, this.pageSize, this.totalPage);
|
|
|
- pageDatasResponse.result.extend = this.extend;
|
|
|
- pageDatasResponse.result.message = message;
|
|
|
- baseResponse = pageDatasResponse;
|
|
|
+ PageJosnRPCResponse<object> response = new PageJosnRPCResponse<object>();
|
|
|
+ response.result.data = this.data;
|
|
|
+ response.result.page = new Pagination(this.total, this.currPage, this.pageSize, this.totalPage);
|
|
|
+ response.result.extend = this.extend;
|
|
|
+ response.message = message;
|
|
|
+ response.code = 0;
|
|
|
+ baseResponse = response;
|
|
|
}
|
|
|
else if (this.data != null)
|
|
|
{
|
|
|
- DataJosnRPCResponse<object> datasResponse = new DataJosnRPCResponse<object>();
|
|
|
- datasResponse.result.data = this.data;
|
|
|
- datasResponse.result.extend = this.extend;
|
|
|
- datasResponse.result.message = message;
|
|
|
- baseResponse = datasResponse;
|
|
|
+ DataJosnRPCResponse<object> response = new DataJosnRPCResponse<object>();
|
|
|
+ response.result.data = this.data;
|
|
|
+ response.result.extend = this.extend;
|
|
|
+ response.message = message;
|
|
|
+ response.code = 0;
|
|
|
+ baseResponse = response;
|
|
|
}
|
|
|
else if (this.data == null) {
|
|
|
- DataJosnRPCResponse<object> datasResponse = new DataJosnRPCResponse<object>();
|
|
|
- datasResponse.result.data = this.data;
|
|
|
- datasResponse.result.extend = this.extend;
|
|
|
- datasResponse.result.message = message;
|
|
|
-
|
|
|
- baseResponse = datasResponse;
|
|
|
+ DataJosnRPCResponse<object> response = new DataJosnRPCResponse<object>();
|
|
|
+ response.result.data = this.data;
|
|
|
+ response.result.extend = this.extend;
|
|
|
+ response.message = message;
|
|
|
+ response.code = 0;
|
|
|
+ baseResponse = response;
|
|
|
}
|
|
|
else
|
|
|
{
|