Exemplo n.º 1
0
        public IActionResult GetAccountID(string uniacid, string code, string iv, string encryptedData)
        {
            try
            {
                JsonResponse1 <AccountModel> responseModel = new JsonResponse1 <AccountModel>();

                //WXSmallAppCommon.Models.WXAccountInfo wXAccount = WXSmallAppCommon.WXInteractions.WXLoginAction.ProcessRequest(code, iv, encryptedData);
                ///微擎方式
                WXSmallAppCommon.Models.WXAccountInfo wXAccount = We7Tools.We7Tools.GetWeChatUserInfo(uniacid, code, iv, encryptedData);
                var            accountCard = thisData.SaveOrdUpdateAccount(uniacid, wXAccount);
                ResponseStatus stautsCode  = ResponseStatus.请求失败;
                if (accountCard != null)
                {
                    responseModel.JsonData = accountCard;
                    stautsCode             = ResponseStatus.请求成功;
                }
                responseModel.StatusCode = stautsCode;
                string[] param = new string[] { "JsonData", "AccountID", "HasCarNumber", "HasPhone" };
                return(this.JsonSuccessWithLimit(responseModel, param));
            }
            catch (Exception e)
            {
                e.Save();
                return(this.JsonErrorStatus());
            }
        }
 /// <summary>
 /// 查询个人信息
 /// </summary>
 /// <param name="uniacid">商户识别ID</param>
 /// <param name="accountID">用户ID</param>
 /// <returns></returns>
 public IActionResult GetAccountInfo(string uniacid, string accountID)
 {
     try
     {
         var account  = thisData.GetAccountInfo(uniacid, new ObjectId(accountID));
         var response = new JsonResponse1 <AccountModel> {
             JsonData = account
         };
         var param = new string[] {
             "JsonData",
             "AccountName",
             "AccountPhoneNumber",
             nameof(Gender),
             "AccountAvatar",
             "Info",
             "Address",
             "Brief"
         };
         return(this.JsonSuccessWithLimit(response, param));
     }
     catch (Exception e)
     {
         e.Save();
         return(this.JsonErrorStatus());
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="controller"></param>
        /// <param name="limitParams"></param>
        /// <returns></returns>
        public static Microsoft.AspNetCore.Mvc.JsonResult ToJsonSuccessWithLimit(this object obj, Microsoft.AspNetCore.Mvc.Controller controller, string[] limitParams = null)
        {
            var resp = new JsonResponse1 <object> {
                JsonData = obj
            };

            return(controller.JsonSuccessWithLimit(resp, limitParams));
        }
        /// <summary>
        /// jsonResponse convert to jsonResult
        /// </summary>
        /// <param name="obj">object</param>
        /// <param name="controller">current controller</param>
        /// <returns></returns>
        public static Microsoft.AspNetCore.Mvc.JsonResult ToJsonSuccess(this object obj, Microsoft.AspNetCore.Mvc.Controller controller, JsonSerializerSettings serializerSettings = null)
        {
            var resp = new JsonResponse1 <object> {
                JsonData = obj
            };

            return(controller.JsonSuccess(resp, serializerSettings));
        }
Exemplo n.º 5
0
 /// <summary>
 /// 获取车辆信息
 /// </summary>
 /// <param name="uniacid">商户ID</param>
 /// <param name="accountID">用户ID</param>
 /// <returns></returns>
 public IActionResult GetCarInfo(string uniacid, string accountID)
 {
     try
     {
         var account       = thisData.GetAccountInfo(uniacid, new ObjectId(accountID));
         var responseModel = new JsonResponse1 <AccountModel>()
         {
             JsonData = account
         };
         string[] param = new string[] { "JsonData", "AccountID", "CarNumber", "AccountPhoneNumber" };
         return(this.JsonSuccessWithLimit(responseModel, param));
     }
     catch (Exception)
     {
         return(this.JsonErrorStatus());
     }
 }
 /// <summary>
 /// 获取我的收集列表
 /// </summary>
 /// <param name="uniacid">商户识别ID</param>
 /// <param name="accountID">用户ID</param>
 /// <returns></returns>
 public IActionResult GetAccountCollect(string uniacid, string accountID)
 {
     try
     {
         var account  = thisData.GetAccountInfo(uniacid, new ObjectId(accountID));
         var response = new JsonResponse1 <AccountModel> {
             JsonData = account
         };
         var param = new string[] {
             "JsonData",
             "CanOpenJackTimes",
             "JackType",
             "HasCount",
             "CanShareTimes",
             "Collect"
         };
         return(this.JsonSuccessWithLimit(response, param));
     }
     catch (Exception e)
     {
         e.Save();
         return(this.JsonErrorStatus());
     }
 }