From 8753c08c4a756d00b23421af7a194b5644f41be9 Mon Sep 17 00:00:00 2001 From: Diyu0904 <1819728964@qq.com> Date: Mon, 17 Mar 2025 18:12:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B/=E5=9B=BE=E7=89=87/=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E5=AE=9E=E5=90=8D=E5=88=B6=E5=90=8E=E6=89=8D?= =?UTF-8?q?=E5=8F=AF=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/resource/ModelImageController.java | 4 ++-- .../mcwl/resource/service/ModelImageService.java | 3 ++- .../service/impl/ModelImageServiceImpl.java | 13 ++++++++++++- .../resource/service/impl/ModelServiceImpl.java | 9 +++++++++ .../resource/service/impl/WorkFlowServiceImpl.java | 7 +++++++ 5 files changed, 32 insertions(+), 4 deletions(-) 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 feed5ca..6f94676 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 @@ -90,8 +90,8 @@ public class ModelImageController { @ApiOperation(value = "图片发布") @PostMapping("/publish") public R publish(@Valid @RequestBody ModelImageRes modelImageRes) { - modelImageService.publish(modelImageRes); - return R.ok(); + + return modelImageService.publish(modelImageRes); } /** diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelImageService.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelImageService.java index 46224c0..4354ab9 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelImageService.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelImageService.java @@ -1,6 +1,7 @@ package com.mcwl.resource.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.mcwl.common.core.domain.R; import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.resource.domain.ModelImage; import com.mcwl.resource.domain.dto.ModelImagePageRes; @@ -21,7 +22,7 @@ public interface ModelImageService extends IService { * 发布 * @param modelImageRes 发布对象 */ - void publish(ModelImageRes modelImageRes); + R publish(ModelImageRes modelImageRes); /** * 分页查询 diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageServiceImpl.java index fa689c4..1f5b87c 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mcwl.common.constant.HttpStatus; +import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.entity.SysUser; import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.utils.SecurityUtils; @@ -64,7 +65,15 @@ public class ModelImageServiceImpl extends ServiceImpl impl @Override public R addModel(RequestModel requestModel) { + + //校验是否实名 + SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId()); + if (sysUser.getName() == null){ + + return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布"); + } + + //获取封面图 String filePath = requestModel.getModelVersionList().get(0).getSampleImagePaths(); String[] split = filePath.split(","); diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java index f006ef6..9e6c342 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java @@ -79,6 +79,13 @@ public class WorkFlowServiceImpl extends ServiceImpl i @Override public R addWorkFlow(AddRequestWorkFlow addRequestWorkFlo) { + //校验是否实名 + SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId()); + if (sysUser.getName() == null){ + + return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布"); + } + RequestWorkFlow requestWorkFlow = new RequestWorkFlow(); BeanUtil.copyProperties(addRequestWorkFlo, requestWorkFlow); // RequestWorkFlow requestWorkFlow = JSON.parseObject(JSON.toJSONString(addRequestWorkFlo), RequestWorkFlow.class);