From 4c15e5247fa07565c4c7b00304e9252e500a2b3a Mon Sep 17 00:00:00 2001 From: yang <2119157836@qq.com> Date: Tue, 14 Jan 2025 16:34:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(resource):=20=E6=B7=BB=E5=8A=A0=E6=88=91?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E5=B8=83=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=9B=BE=E7=89=87=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 MallProductController 中添加了三个新的接口:selectByUserIdModel、selectByUserIdWorkFlow 和 selectByUserIdImage,用于获取用户发布的模型、工作流和图片信息 - 在 ModelCommentController 和 ModelImageController 中添加了 @RepeatSubmit 注解,用于防止重复提交 - 优化了 ModelImageController 中的 list 接口,使用 PageDomain 作为参数,提高了接口的通用性和灵活性 --- .../resource/MallProductController.java | 31 +++++++++++++++++++ .../resource/ModelCommentController.java | 3 ++ .../resource/ModelImageController.java | 9 ++++-- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java index b3c66b9..1a3e1a6 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java @@ -10,6 +10,7 @@ import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.request.RequestModel; import com.mcwl.resource.domain.request.RequestWorkFlow; import com.mcwl.resource.domain.vo.MallProductVo; +import com.mcwl.resource.service.ModelImageService; import com.mcwl.resource.service.ModelService; import com.mcwl.system.service.ISysUserService; import com.mcwl.web.controller.common.OssUtil; @@ -38,6 +39,9 @@ public class MallProductController extends BaseController { @Autowired private ModelService modelService; + @Autowired + private ModelImageService modelImageService; + /*** * @@ -145,4 +149,31 @@ public class MallProductController extends BaseController { return AjaxResult.success(mallProductList); } + + /** + * 我的发布-模型 + */ + @PostMapping("/selectByUserIdModel") + public AjaxResult selectByUserIdModel(@RequestBody MallProductVo mallProductVo){ + + return AjaxResult.success(); + } + + /** + * 我的发布-工作流 + */ + @PostMapping("/selectByUserIdWorkFlow") + public AjaxResult selectByUserIdWorkFlow(@RequestBody MallProductVo mallProductVo){ + + return AjaxResult.success(); + } + + /** + * 我的发布-图片 + */ + @PostMapping("/selectByUserIdImage") + public TableDataInfo selectByUserIdImage(@RequestBody ModelImagePageRes imagePageRes){ + + return modelImageService.listByPage(imagePageRes); + } } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java index b546f1f..eac3cba 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java @@ -1,5 +1,6 @@ package com.mcwl.web.controller.resource; +import com.mcwl.common.annotation.RepeatSubmit; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.resource.domain.ModelComment; import com.mcwl.resource.domain.vo.ModelCommentVo; @@ -36,6 +37,7 @@ public class ModelCommentController { /** * 模型点赞/取消 */ + @RepeatSubmit @GetMapping("/modelLike/{modelId}") public AjaxResult like(@PathVariable Long imageId) { modelLikeService.like(imageId); @@ -55,6 +57,7 @@ public class ModelCommentController { /** * 模型评论点赞/取消 */ + @RepeatSubmit @GetMapping("/commentLike/{commentId}") public AjaxResult commentLike(@PathVariable Long commentId) { modelCommentLikeService.like(commentId); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelImageController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelImageController.java index 5f29062..dbd2543 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelImageController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelImageController.java @@ -1,8 +1,10 @@ package com.mcwl.web.controller.resource; import cn.hutool.core.bean.BeanUtil; +import com.mcwl.common.annotation.RepeatSubmit; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.entity.SysUser; +import com.mcwl.common.core.page.PageDomain; import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.oss.OssUtil; @@ -48,8 +50,9 @@ public class ModelImageController { * 图片列表 */ @PostMapping("/list") - public TableDataInfo list(@RequestBody ModelImagePageRes imagePageRes) { - + public TableDataInfo list(@RequestBody PageDomain pageDomain) { + ModelImagePageRes imagePageRes = new ModelImagePageRes(); + BeanUtil.copyProperties(pageDomain, imagePageRes); return modelImageService.listByPage(imagePageRes); } @@ -112,6 +115,7 @@ public class ModelImageController { /** * 图片点赞/取消 */ + @RepeatSubmit @GetMapping("/imageLike/{imageId}") public AjaxResult like(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) { modelImageLikeService.like(imageId); @@ -131,6 +135,7 @@ public class ModelImageController { /** * 图片评论点赞/取消 */ + @RepeatSubmit @GetMapping("/commentLike/{commentId}") public AjaxResult commentLike(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) { modelImageCommentLikeService.like(commentId);