public ApiResult(ResultCode resultCode, string message = null, object result = null) { Success = resultCode == ResultCode.Success; Code = resultCode.GetEnumDescription(); Message = message ?? resultCode.ToString(); Result = result; }
public JsonResult WXRegister(string phone, string type, string uid) { int State = this._user.WXRegister(phone, type, uid); ResultCode Code = State == 1 ? ResultCode.SCCUESS : (State == 2 ? ResultCode.DATA_IS_WRONG : (State == 3 ? ResultCode.DATA_NOT_FOUND : ResultCode.PARAMS_TYPE_ERROR)); var response = new Response() { code = Code, msg = Code.GetEnumDescription() }; return(Json(response)); }