From 8ddec1fa60bdbd2d970cff7b4bf2ae5b4ded1627 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期日, 29 十二月 2024 14:58:28 +0800 Subject: [PATCH] 1.腾讯地图:定时任务每天凌晨5点 --- src/main/java/com/mzl/flower/web/v2/district/DistrictTengxunController.java | 76 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/mzl/flower/web/v2/district/DistrictTengxunController.java b/src/main/java/com/mzl/flower/web/v2/district/DistrictTengxunController.java new file mode 100644 index 0000000..0bcd675 --- /dev/null +++ b/src/main/java/com/mzl/flower/web/v2/district/DistrictTengxunController.java @@ -0,0 +1,76 @@ +package com.mzl.flower.web.v2.district; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mzl.flower.base.BaseController; +import com.mzl.flower.base.R; +import com.mzl.flower.base.ReturnDataDTO; +import com.mzl.flower.dto.request.district.CreateDistrictTengxunDTO; +import com.mzl.flower.dto.request.district.QueryDistrictTengxunDTO; +import com.mzl.flower.dto.response.district.DistrictTengxunVO; +import com.mzl.flower.entity.district.DistrictDO; +import com.mzl.flower.entity.district.DistrictTengxunDO; +import com.mzl.flower.service.district.DistrictTengxunService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 对接腾讯地图行政区划前端控制器 + * +* @author @TaoJie +* @since 2024-12-19 +*/ +@RestController +@RequestMapping("/v2/district-tengxun") +public class DistrictTengxunController extends BaseController { + + @Autowired + private DistrictTengxunService districtTengxunService; + + @PostMapping("") + @ApiOperation(value = "新增", notes = "新增") + public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody CreateDistrictTengxunDTO dto) { + return returnData(R.SUCCESS.getCode(), districtTengxunService.createDistrict(dto)); + } + + @PutMapping("/{id}") + @ApiOperation(value = "修改", notes = "修改") + public ResponseEntity<ReturnDataDTO> update(@PathVariable String id,@Validated @RequestBody CreateDistrictTengxunDTO dto) { + dto.setId(id); + return returnData(R.SUCCESS.getCode(), districtTengxunService.updateDistrict(dto)); + } + + @DeleteMapping("/{id}") + @ApiOperation(value = "删除", notes = "删除") + public ResponseEntity<ReturnDataDTO> delete(@PathVariable String id) { + return returnData(R.SUCCESS.getCode(), districtTengxunService.deleteDistrict(id)); + } + + @GetMapping("/{id}") + @ApiOperation(value = "详情", notes = "详情") + public ResponseEntity<DistrictTengxunDO> get(@PathVariable String id) { + return returnData(R.SUCCESS.getCode(), districtTengxunService.getById(id)); + } + + @GetMapping("/page") + @ApiOperation(value = "查询-分页", notes = "查询-分页") + public ResponseEntity<ReturnDataDTO<Page<DistrictDO>>> page(Page page, QueryDistrictTengxunDTO dto + ) { +// return returnData(R.SUCCESS.getCode(), ConverterUtil.transPage(resultPage, CouponTemplateActivyVO.class)); + return null; + } + + @GetMapping("/list") + @ApiOperation(value = "查询-全部", notes = "查询-全部") + public ResponseEntity<ReturnDataDTO<Page<DistrictTengxunVO>>> list(QueryDistrictTengxunDTO dto) { + + return returnData(R.SUCCESS.getCode(), districtTengxunService.getDistrictTreeList()); + + } + + + +} -- Gitblit v1.9.3