Beispiel #1
0
        public IActionResult Post(RowMode.Request request)
        {
            try
            {
                UserService.RowService service = new UserService.RowService();
                // Request验证
                if (request == null)
                {
                    throw new Exception("Request无效!");
                }
                // 指向具体执行的方法
                switch (request.Function.Name.ToLower())
                {
                case "bywechatno":
                    return(base.ResponseOk(
                               request.ToResponse(
                                   service.ByWeChatNo(request.Function.Args[0] ?? "", ToParams(request.Function.Args, 1))
                                   )
                               ));

                case "bywechatopenid":
                    return(base.ResponseOk(
                               request.ToResponse(
                                   service.ByWeChatOpenId(request.Function.Args[0] ?? "", ToParams(request.Function.Args, 1))
                                   )
                               ));

                case "bymobile":
                    return(base.ResponseOk(
                               request.ToResponse(
                                   service.ByMobile(request.Function.Args[0] ?? "", ToParams(request.Function.Args, 1))
                                   )
                               ));

                default:
                    if (string.IsNullOrEmpty(request.Function.Name) || request.Function.Name.ToLower().Equals("byid"))
                    {
                        return(base.ResponseOk(
                                   request.ToResponse(
                                       service.ById(int.Parse(request.Function.Args[0] ?? ""), ToParams(request.Function.Args, 1))
                                       )
                                   ));
                    }
                    else
                    {
                        throw new Exception("未发现对应函数方法!");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 public IActionResult Post(RowMode.Request request)
 {
     try
     {
         UserPowerService.RowService service = new UserPowerService.RowService();
         // Request验证
         if (request == null)
         {
             throw new Exception("Request无效!");
         }
         // 指向具体执行的方法
         switch (request.Function.Name.ToLower())
         {
         default:
             if (string.IsNullOrEmpty(request.Function.Name) || request.Function.Name.ToLower().Equals("only"))
             {
                 return(base.ResponseOk(
                            request.ToResponse(
                                service.Only(ParseInt(request.Function.Args[0] ?? ""), ParseInt(request.Function.Args[1] ?? ""), ToParams(request.Function.Args, 2))
                                )
                            ));
             }
             else
             {
                 throw new Exception("未发现对应函数方法!");
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
        public IActionResult Post(RowMode.Request request)
        {
            try
            {
                DictionaryService.RowService service = new DictionaryService.RowService();
                // Request验证
                if (request == null)
                {
                    throw new Exception("Request无效!");
                }
                // 指向具体执行的方法
                switch (request.Function.Name.ToLower())
                {
                case "bykey":
                    return(base.ResponseOk(
                               request.ToResponse(
                                   service.ByKey(request.Function.Args[0] ?? "", ToParams(request.Function.Args, 1))
                                   )
                               ));

                default:
                    if (string.IsNullOrEmpty(request.Function.Name) || request.Function.Name.ToLower().Equals("byid"))
                    {
                        return(base.ResponseOk(
                                   request.ToResponse(
                                       service.ById(ParseInt(request.Function.Args[0] ?? ""), ToParams(request.Function.Args, 1))
                                       )
                                   ));
                    }
                    else
                    {
                        throw new Exception("未发现对应函数方法!");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        public IActionResult Post(RowMode.Request request)
        {
            try
            {
                StatusService.RowService service = new StatusService.RowService();
                // Request验证
                if (request == null)
                {
                    throw new Exception("Request无效!");
                }
                // 指向具体执行的方法
                switch (request.Function.Name.ToLower())
                {
                case "bykey":
                    return(base.ResponseOk(
                               request.ToResponse(
                                   service.ByKey(request.Function.Args[0] ?? "")
                                   )
                               ));

                default:
                    if (string.IsNullOrEmpty(request.Function.Name))
                    {
                        return(base.ResponseOk(
                                   request.ToResponse(
                                       service.ById(int.Parse(request.Function.Args[0] ?? ""))
                                       )
                                   ));
                    }
                    else
                    {
                        throw new Exception("未发现对应函数方法!");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }