管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2023-12-22 4cc763706597d6ea82392f653333e33c31485b49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using JiangSu.cs;
using JiangSu.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
 
namespace JiangSu.Controllers
{
    public class OpController : ApiController
    {
        [HttpGet]
        public Model SelectById(long id)
        {
            try
            {
                return ModelDAL.SelectById(id);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                return null;
            }
        }
 
        [HttpGet]
        public int DeleteByIds([FromUri] List<long> ids)
        {
            try
            {
                if (null == ids || ids.Count == 0) return 0;
 
                return ModelDAL.DeleteByIds(ids);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                return 0;
            }
        }
 
        [HttpPost]
        public int insert([FromBody] Model model)
        {
            try
            {
                if (null == model) return 0;
 
                return ModelDAL.insert(model);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                return 0;
            }
        }
 
        [HttpPost]
        public int UpdateById([FromBody] Model model)
        {
            try
            {
                if (null == model) return 0;
 
                return ModelDAL.UpdateById(model);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                return 0;
            }
        }
    }
}