通用返回格式

2021-09-22 01:56:58 字數 1443 閱讀 6297

///

///     業務操作結果資訊類,對操作結果進行封裝

///

public class operationresult

///

///     初始化乙個 定義返回訊息的業務操作結果資訊類 的新例項

///

/// 業務操作結果型別

/// 業務返回訊息

public operationresult(operationresulttype resulttype, string message)

: this(resulttype)

///

///     初始化乙個 定義返回訊息與附加資料的業務操作結果資訊類 的新例項

///

/// 業務操作結果型別

///

///     初始化乙個 定義返回訊息與附加資料的業務操作結果資訊類 的新例項

///

/// 業務操作結果型別

/// 業務返回訊息

///

///     初始化乙個 定義返回訊息與日誌訊息的業務操作結果資訊類 的新例項

///

/// 業務操作結果型別

/// 業務返回訊息

/// 業務日誌記錄訊息

public operationresult(operationresulttype resulttype, string message, string logmessage)

: this(resulttype, message)

///

///     初始化乙個 定義返回訊息、日誌訊息與附加資料的業務操作結果資訊類 的新例項

///

/// 業務操作結果型別

/// 業務返回訊息

/// 業務日誌記錄訊息

#endregion

#region 屬性

///

///     獲取或設定 操作結果型別

///

public operationresulttype code = operationresulttype.undefined;

///

/// 

///

private string _message

///

///     獲取或設定 操作返回資訊

///

public string message

catch

}set

}///

///     獲取或設定 操作返回的日誌訊息,用於記錄日誌

///

public string logmessage

///

///     獲取或設定 操作結果附加資訊

///

public bool success

}#endregion

}

TRY CATCH 通用格式

use dorbengobegin try generate a divide by zero error.select 1 0 end trybegin catchselecterror number as errornumber,error severity as errorseverity,e...

java通用返回物件

中定義了 三個成員變數 status 返回的狀態碼 msg 返回的資訊 data 返回的物件.設定為泛型,以便擴充套件,服務端需要返回各種不一樣的data資料,由此接收.該類中私有了構造方法,保證了該類的準確性.定義了開發環境中需要返回的幾種型別 status status msg status d...

API通用返回模型

1 2 通用返回類 3 4public class result58 訊息 9public string msg 10 業務資料 11public object data 12 13 不帶資料成功返回型別 14 15 16public static result success 1723 24 帶資...