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)); }
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); }
public static APITextResult PackageFail(OperateResCodeEnum code) { return(Package(code, code.ToString(), "")); }