public static string Error(OperateResCodeEnum resCodeEnum, string ERR = "")
        {
            APIResultBase result = new APIResultBase();

            result.code = resCodeEnum.GetHashCode();
            result.msg  = string.IsNullOrWhiteSpace(ERR) ? resCodeEnum.ToString() : ERR;
            return(JsonConvert.SerializeObject(result));
        }
Example #2
0
        public static APITextResult Package(OperateResCodeEnum code, string msg, string data)
        {
            APITextResult textRes = new APITextResult();

            textRes.code = code.GetHashCode();
            textRes.msg  = msg;
            textRes.data = data;
            return(textRes);
        }
Example #3
0
 public static APITextResult PackageFail(OperateResCodeEnum code)
 {
     return(Package(code, code.ToString(), ""));
 }