From 337a72b06cf49e69d6927bdd5471ffc02c75c8b6 Mon Sep 17 00:00:00 2001 From: yang <2119157836@qq.com> Date: Sat, 8 Mar 2025 09:40:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(communityCenter):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=AE=98=E6=96=B9=E8=81=94=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityCenter/PlaFormController.java | 16 ++++++++-------- .../service/impl/PlatFormServiceImpl.java | 13 +++++-------- .../resources/mapper/resource/PlatFormMapper.xml | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PlaFormController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PlaFormController.java index 64e34af..32c8040 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PlaFormController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PlaFormController.java @@ -25,8 +25,8 @@ import java.util.List; * @Date:2025/3/4 16:36 */ @Api(tags = "官方app") - @RestController - @RequestMapping("app") +@RestController +@RequestMapping("app") public class PlaFormController extends BaseController { @Autowired @@ -37,10 +37,10 @@ public class PlaFormController extends BaseController { * 平台官方联系列表 */ @ApiOperation(value = "模型列表") - @PostMapping("/list") - public List list(@RequestBody PlatForm platForm) { + @GetMapping("/list") + public List list() { - return platFormService.listplatForm(platForm); + return platFormService.list(); } /*** @@ -53,8 +53,9 @@ public class PlaFormController extends BaseController { @PostMapping("/UrlFile") public AjaxResult zipUrlFile(@RequestParam MultipartFile file) { String s = OssUtil.uploadMultipartFile(file); - return AjaxResult.success(s); + return AjaxResult.success("上传成功", s); } + /** * 添加平台官方联系 */ @@ -92,7 +93,7 @@ public class PlaFormController extends BaseController { /** * 删除联系 - * */ + */ @ApiOperation(value = "删除联系") @GetMapping("delete") public AjaxResult delete(@Valid @NotNull(message = "id不能为空") @RequestParam Long id) { @@ -101,5 +102,4 @@ public class PlaFormController extends BaseController { } - } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/PlatFormServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/PlatFormServiceImpl.java index c9bc841..b1e989b 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/PlatFormServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/PlatFormServiceImpl.java @@ -27,9 +27,6 @@ import java.util.List; @Service public class PlatFormServiceImpl extends ServiceImpl implements PlatFormService { - @Autowired - private PlatFormService platFormService; - /** * 平台官方app联系方式列表 @@ -39,7 +36,7 @@ public class PlatFormServiceImpl extends ServiceImpl i */ @Override public List listplatForm(PlatForm platForm) { - return platFormService.listplatForm(platForm); + return baseMapper.listplatForm(platForm); } @@ -52,7 +49,7 @@ public class PlatFormServiceImpl extends ServiceImpl i @ApiOperation(value = "详情") @PostMapping("finById") public R finById(@RequestBody PlatForm platForm) { - platFormService.getById(platForm.getId()); + baseMapper.selectById(platForm.getId()); return R.ok(); } @@ -65,7 +62,7 @@ public class PlatFormServiceImpl extends ServiceImpl i @ApiOperation(value = "添加") @PostMapping("add") public R add(@RequestBody PlatForm platForm) { - platFormService.save(platForm); + baseMapper.insert(platForm); return R.ok(); } @@ -78,7 +75,7 @@ public class PlatFormServiceImpl extends ServiceImpl i @ApiOperation(value = "修改") @PostMapping("update") public R update(@RequestBody PlatForm platForm) { - platFormService.updateById(platForm); + baseMapper.updateById(platForm); return R.ok(); } @@ -91,7 +88,7 @@ public class PlatFormServiceImpl extends ServiceImpl i @ApiOperation(value = "删除") @PostMapping("delete") public R delete(@RequestBody PlatForm platForm) { - platFormService.removeById(platForm); + baseMapper.deleteById(platForm); return R.ok(); } diff --git a/mcwl-resource/src/main/resources/mapper/resource/PlatFormMapper.xml b/mcwl-resource/src/main/resources/mapper/resource/PlatFormMapper.xml index 623fa53..67c1aaa 100644 --- a/mcwl-resource/src/main/resources/mapper/resource/PlatFormMapper.xml +++ b/mcwl-resource/src/main/resources/mapper/resource/PlatFormMapper.xml @@ -4,6 +4,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">