예제 #1
0
 /// <summary>
 /// 操作成功
 /// </summary>
 /// <returns></returns>
 public static HttpResponseMessage ToJsonTrue()
 {
     return(ResponseStr.ToJson(new
     {
         errorCode = 0,
         errorMessage = "操作成功"
     }));
 }
예제 #2
0
 /// <summary>
 /// 操作失败
 /// </summary>
 /// <param name="code">返回Code</param>
 /// <param name="msg">返回文案</param>
 /// <returns></returns>
 public static HttpResponseMessage ToJsonError(string code, string msg)
 {
     return(ResponseStr.ToJson(new
     {
         errorCode = code,
         errorMessage = msg,
     }));
 }
예제 #3
0
 /// <summary>
 /// 操作失败
 /// </summary>
 /// <param name="msg">返回提示的文案</param>
 /// <param name="e">记录日志</param>
 /// <returns></returns>
 public static HttpResponseMessage ToJsonError(string msg, Exception e)
 {
     return(ResponseStr.ToJson(new
     {
         errorCode = 1,
         errorMessage = msg,
     }));
 }
예제 #4
0
 /// <summary>
 /// 操作成功
 /// </summary>
 /// <param name="obj">返回的数据对象</param>
 /// <returns></returns>
 public static HttpResponseMessage ToJsonTrue(object obj)
 {
     return(ResponseStr.ToJson(new
     {
         errorCode = 0,
         errorMessage = "操作成功",
         data = obj
     }));
 }