Example #1
0
 public IActionResult Post(RowMode.Request request)
 {
     try
     {
         SiteService.RowService service = new SiteService.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("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;
     }
 }