管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2023-12-22 8195d1905b8030829c8ade0d21825553a171bbf0
JiangSu/Controllers/OpController.cs
@@ -12,6 +12,20 @@
    public class OpController : ApiController
    {
        [HttpGet]
        public List<Model> SelectByPage(string name, int pageSize = 10, int pageIndex = 1)
        {
            try
            {
                return ModelDAL.SelectByPage(string.IsNullOrWhiteSpace(name) ? "" : name.ToString(), pageSize, pageIndex);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return null;
            }
        }
        [HttpGet]
        public Model SelectById(long id)
        {
            try
@@ -20,7 +34,7 @@
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return null;
            }
        }
@@ -36,23 +50,23 @@
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return 0;
            }
        }
        [HttpPost]
        public int insert([FromBody] Model model)
        public int Insert([FromBody] Model model)
        {
            try
            {
                if (null == model) return 0;
                return ModelDAL.insert(model);
                return ModelDAL.Insert(model);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return 0;
            }
        }
@@ -68,7 +82,7 @@
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return 0;
            }
        }