//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 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 "删除成功"; // } //}