2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//package com.landtool.lanbase.modules.api.controller;
//
//import com.landtool.lanbase.modules.res.entity.Res_DiyLayerInfo;
//import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import java.sql.Timestamp;
//import java.util.List;
//import java.util.Date;
//
//@Controller
//@RequestMapping("/api/res/diylayerinfo")
//@Api(value = "", tags = {"自定义图层信息"})
//public class ResDiyLayerInfoApiController {
//    @Autowired
//    private ResDiyLayerInfoService resDiyLayerInfoService;
//
//    /**
//     * 新增/修改自定义图层信息
//     */
//    @PostMapping(path = "/addDiyLayerInfo")
//    @ApiOperation(value = "自定义图层信息 新增/修改", notes = "")
//    @ResponseBody
//    public String addDiyLayerInfo(
//            @ApiParam(name = "userid", value = "用户Id", required = true) @RequestParam(name = "userid") int userid,
//            @ApiParam(name = "resourceid", value = "信息资源Id", required = true) @RequestParam(name = "resourceid") int resourceid,
//            @ApiParam(name = "title", value = "标题", required = true) @RequestParam(name = "title") String title,
//            @ApiParam(name = "typename", value = "信息类型", required = true) @RequestParam(name = "typename") String typename,
//            @ApiParam(name = "content", value = "内容", required = true) @RequestParam(name = "content") String content) {
//        // 是否存在记录,存在则修改
//        Res_DiyLayerInfo info = resDiyLayerInfoService.queryObjectByUseridAndResid(userid, resourceid, title);
//        if (info == null) {// 新增
//            info = new Res_DiyLayerInfo();
//            info.setResourceid(resourceid);
//            info.setContent(content);
//            info.setTitle(title);
//            info.setTypename(typename);
//            info.setDiyuserid(userid);
//            Timestamp audittime = new Timestamp(new Date().getTime());
//            info.setDiytime(audittime);
//            resDiyLayerInfoService.insert(info);
//            return "添加成功";
//        } else {// 修改
//            info.setTitle(title);
//            info.setTypename(typename);
//            info.setContent(content);
//            Timestamp audittime = new Timestamp(new Date().getTime());
//            info.setDiytime(audittime);
//            resDiyLayerInfoService.updateByPrimaryKeySelective(info);
//            return "修改成功";
//        }
//    }
//
//    /**
//     * 编辑自定义图层信息风格内容
//     */
//    @PostMapping(path = "/updateDiyLayerInfo")
//    @ApiOperation(value = "编辑自定义图层信息风格内容", notes = "")
//    @ResponseBody
//    public String updateDiyLayerInfo(
//            @ApiParam(name = "diyid", value = "Id", required = true) @RequestParam(name = "diyid") int diyid,
//            @ApiParam(name = "title", value = "标题") String title,
//            @ApiParam(name = "typename", value = "信息类型") String typename,
//            @ApiParam(name = "content", value = "内容", required = true) @RequestParam(name = "content") String content) {
//        Res_DiyLayerInfo info = new Res_DiyLayerInfo();
//        if (content.length() != 0) {
//            info.setContent(content);
//        }
//        if (title != null && title.length() != 0) {
//            info.setTitle(title);
//        }
//        if (typename != null && typename.length() != 0) {
//            info.setTypename(typename);
//        }
//        info.setDiyid(diyid);
//        info.setDiyuserid(1); // 先写死id,后续改成读取当前登录人id
//        resDiyLayerInfoService.updateContentApi(info);
//        return "编辑成功";
//    }
//
//    /**
//     * 查询自定义图层信息列表
//     */
//    @ResponseBody
//    @GetMapping("/queryDiyLayerInfo")
//    @ApiOperation(value = "自定义图层信息列表", notes = "")
//    public List<Res_DiyLayerInfo> queryListByUserId(@ApiParam(name = "resourceid", value = "信息资源Id") Integer resourceid,
//            @ApiParam(name = "title", value = "标题") String title,
//            @ApiParam(name = "typename", value = "信息类型") String typename,
//            @ApiParam(name = "diyid", value = "diyid") Integer diyid) {
//        Res_DiyLayerInfo record = new Res_DiyLayerInfo();
//        record.setResourceid(resourceid);
//        record.setTitle(title);
//        record.setTypename(typename);
//        record.setDiyid(diyid);
//        ;
//        return resDiyLayerInfoService.queryApiList(record);
//    }
//
//    /**
//     * 删除自定义图层信息
//     */
//    @PostMapping(path = "/deleteDiyLayerInfo")
//    @ApiOperation(value = "删除自定义图层信息", notes = "")
//    @ResponseBody
//    public String deleteDiyLayerInfo(
//            @ApiParam(name = "diyid", value = "diyid", required = true) @RequestParam(name = "diyid") Long diyid) {
//        resDiyLayerInfoService.deleteDiyLayerInfo(diyid);
//        return "删除成功";
//    }
//}