예제 #1
0
 public ApiResult(ResultCode resultCode,
                  string message = null,
                  object result  = null)
 {
     Success = resultCode == ResultCode.Success;
     Code    = resultCode.GetEnumDescription();
     Message = message ?? resultCode.ToString();
     Result  = result;
 }
예제 #3
0
        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));
        }