From 2ad2c4eb9631b19bff8f6c688427ac240eece056 Mon Sep 17 00:00:00 2001 From: yang <2119157836@qq.com> Date: Tue, 11 Mar 2025 17:35:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=B6=88=E6=81=AF=E8=BF=94=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityCenter/InviteController.java | 3 ++- .../communityCenter/PublishController.java | 3 ++- .../communityCenter/QuestionController.java | 7 ++++--- .../controller/memberCenter/MemberController.java | 13 +++++++------ .../memberCenter/PromotionController.java | 3 ++- .../myInvitation/CommissionRatioController.java | 7 ++++--- .../myInvitation/InvitationController.java | 3 ++- .../web/controller/pay/AliPay/AliPayController.java | 11 ++++++----- .../controller/pay/AliPay/OrderTradeController.java | 5 +++-- .../mcwl/web/controller/tool/TestController.java | 2 ++ .../service/impl/InviteServiceImpl.java | 9 +++++---- .../service/impl/PublishCommentServiceImpl.java | 5 +++-- .../service/impl/PublishServiceImpl.java | 4 ++-- .../service/impl/QuestionCommentServiceImpl.java | 12 ++++++------ .../service/impl/QuestionServiceImpl.java | 2 +- .../service/impl/PromotionServiceImpl.java | 10 +++++----- .../mcwl/pay/service/impl/AliPayServiceImpl.java | 7 ++++--- .../service/impl/DownloadRecordServiceImpl.java | 3 ++- .../resource/service/impl/ModelServiceImpl.java | 2 +- .../service/impl/ModelVersionServiceImpl.java | 5 +++-- .../service/impl/SysUserAttentionServiceImpl.java | 3 ++- .../resource/service/impl/WorkFlowServiceImpl.java | 6 +++--- .../service/impl/WorkFlowVersionServiceImpl.java | 5 +++-- 23 files changed, 74 insertions(+), 56 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/InviteController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/InviteController.java index 8902ad5..b442706 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/InviteController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/InviteController.java @@ -1,6 +1,7 @@ package com.mcwl.web.controller.communityCenter; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.utils.StringUtils; @@ -44,7 +45,7 @@ public class InviteController { // 获取邀请码链接 String inviteCode = inviteService.getInviteCode(communityId); if (StringUtils.isBlank(inviteCode)) { - return R.fail("获取邀请码失败"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取邀请码失败"); } return R.ok(inviteCode); } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PublishController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PublishController.java index 6c86498..d993a54 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PublishController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/PublishController.java @@ -1,6 +1,7 @@ package com.mcwl.web.controller.communityCenter; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.core.page.TableDataInfo; @@ -49,7 +50,7 @@ public class PublishController { PublishVo publishVo = publishService.getDetail(publishDetailRes); if (Objects.isNull(publishVo)) { - return R.fail("获取详情失败"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取详情失败"); } return R.ok(publishVo); } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/QuestionController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/QuestionController.java index 16c8123..eaf37e0 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/QuestionController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/communityCenter/QuestionController.java @@ -1,6 +1,7 @@ package com.mcwl.web.controller.communityCenter; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.entity.SysUser; @@ -51,7 +52,7 @@ public class QuestionController { // 类型为1时,付费金额不能为空 if (Objects.equals(type, 1) && Objects.isNull(amount)) { - return R.fail("付费金额不能为空"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"付费金额不能为空"); } // 付费类型为1时,判断钱包余额是否充足 @@ -60,7 +61,7 @@ public class QuestionController { SysUser sysUser = sysUserService.selectUserById(userId); Double wallet = sysUser.getWallet(); if (wallet < amount) { - return R.fail("钱包余额不足"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"钱包余额不足"); } } else { questionRes.setAmount(0.0); @@ -99,7 +100,7 @@ public class QuestionController { public R getQuestionDetail(@RequestBody @Valid QuestionDetailRes questionDetailRes) { QuestionVo questionVo = questionService.getDetail(questionDetailRes); if (Objects.isNull(questionVo)) { - return R.fail("获取详情失败"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取详情失败"); } return R.ok(questionVo); } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/MemberController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/MemberController.java index a523f38..7461ec9 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/MemberController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/MemberController.java @@ -1,6 +1,7 @@ package com.mcwl.web.controller.memberCenter; import cn.hutool.core.bean.BeanUtil; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.entity.SysUser; @@ -65,17 +66,17 @@ public class MemberController { SysUser sysUser = sysUserService.selectUserById(userId); if (!Optional.ofNullable(sysUser).isPresent()) { - return R.fail("用户不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户不存在"); } MemberLevel memberLevel = memberLevelService.getById(memberLevelId); if (!Optional.ofNullable(memberLevel).isPresent()) { - return R.fail("会员等级不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"会员等级不存在"); } Member member = memberService.createUserMember(userId, memberLevelId, paymentMethod, promotionId); if (!Optional.ofNullable(member).isPresent()) { - return R.fail("创建会员失败"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"创建会员失败"); } return R.ok(member); @@ -128,14 +129,14 @@ public class MemberController { SysUser sysUser = sysUserService.selectUserById(userId); if (!Optional.ofNullable(sysUser).isPresent()) { - return R.fail("用户不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户不存在"); } Member member = memberService.rechargePoints(userId, amount * 100); // 返回充值积分 if (!Optional.ofNullable(member).isPresent()) { - return R.fail("充值积分失败"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"充值积分失败"); } return R.ok(); @@ -150,7 +151,7 @@ public class MemberController { public R consumePoints(@PathVariable Double consumePoints) { if (consumePoints == null || consumePoints <= 0) { - return R.fail("消费积分不能为空或小于0"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"消费积分不能为空或小于0"); } memberService.consumePoints(consumePoints); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/PromotionController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/PromotionController.java index fcacbfc..1a883b6 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/PromotionController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/memberCenter/PromotionController.java @@ -2,6 +2,7 @@ package com.mcwl.web.controller.memberCenter; import cn.hutool.core.bean.BeanUtil; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.core.page.PageDomain; @@ -54,7 +55,7 @@ public class PromotionController { Date startTime = promotionDto.getStartTime(); Date endTime = promotionDto.getEndTime(); if (startTime.after(endTime)) { - return R.fail("活动开始时间不能大于结束时间"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"活动开始时间不能大于结束时间"); } Promotion promotion = new Promotion(); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/CommissionRatioController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/CommissionRatioController.java index eab3b0b..28549b0 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/CommissionRatioController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/CommissionRatioController.java @@ -1,6 +1,7 @@ package com.mcwl.web.controller.myInvitation; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.R; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.myInvitation.domain.CommissionRatio; @@ -55,7 +56,7 @@ public class CommissionRatioController { public R detail(@Valid @NotNull(message = "提成比例id不能为空") Long id) { CommissionRatioVo detail = commissionRatioService.detail(id); if (detail == null) { - return R.fail("提成比例不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"提成比例不存在"); } return R.ok(detail); } @@ -74,12 +75,12 @@ public class CommissionRatioController { Double ratio) { if (ratio < 0 || ratio > 1) { - return R.fail("提成比例必须在0-1之间"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"提成比例必须在0-1之间"); } CommissionRatioVo detail = commissionRatioService.updateRatio(id, ratio); if (detail == null) { - return R.fail("提成比例不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"提成比例不存在"); } return R.ok(detail); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/InvitationController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/InvitationController.java index 62d9b0a..f887c72 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/InvitationController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/myInvitation/InvitationController.java @@ -1,6 +1,7 @@ package com.mcwl.web.controller.myInvitation; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.R; import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.utils.SecurityUtils; @@ -50,7 +51,7 @@ public class InvitationController { Long userId = SecurityUtils.getUserId(); String invitationCode = invitationService.getInvitationCode(userId); if (StringUtils.isEmpty(invitationCode)) { - return R.fail("获取邀请码失败"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取邀请码失败"); } return R.ok("操作成功", invitationCode); } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java index 29b0211..a70a6d0 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java @@ -5,6 +5,7 @@ import cn.hutool.extra.qrcode.QrCodeUtil; import com.alipay.api.domain.AlipayAccount; import com.alipay.easysdk.factory.Factory; import com.mcwl.common.annotation.Anonymous; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.controller.BaseController; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; @@ -167,7 +168,7 @@ public class AliPayController extends BaseController { if ("member".equalsIgnoreCase(type)) { if (!Optional.ofNullable(orderTradeDto.getProductId()).isPresent()) { - return R.fail("商品id不能为空"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"商品id不能为空"); } payVo = aliPayService.memberPay(orderTradeDto); // QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream()); @@ -177,12 +178,12 @@ public class AliPayController extends BaseController { } else if ("wallet".equalsIgnoreCase(type)) { // 充值金额只能是整数 if (orderTradeDto.getAmount() % 1 != 0) { - return R.fail("充值金额只能是整数"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"充值金额只能是整数"); } payVo = aliPayService.walletPay(orderTradeDto.getAmount()); // QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream()); } else { - return R.fail("订单类型错误"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"订单类型错误"); } return R.ok(payVo); @@ -206,12 +207,12 @@ public class AliPayController extends BaseController { .one(); if (Objects.isNull(sysUserPayAccount)) { - return R.fail("请先绑定支付宝"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"请先绑定支付宝"); } if (Double.parseDouble(amount) < 0.1) { - return R.fail("提现金额最小为0.1"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"提现金额最小为0.1"); } return aliPayService.fetch(amount.toString()); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/OrderTradeController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/OrderTradeController.java index 2b767ca..b073694 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/OrderTradeController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/OrderTradeController.java @@ -6,6 +6,7 @@ import com.alipay.easysdk.payment.common.models.AlipayTradeCancelResponse; import com.alipay.easysdk.payment.common.models.AlipayTradeCloseResponse; import com.alipay.easysdk.payment.common.models.AlipayTradeQueryResponse; import com.mcwl.common.JSONUtils; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.controller.BaseController; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; @@ -87,7 +88,7 @@ public class OrderTradeController extends BaseController { // 获取当前用户 Long userId = SecurityUtils.getUserId(); if (userId == null) { - return R.fail("用户未登录"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户未登录"); } orderTrade.setUserId(userId); return R.ok(orderTradeService.insertMallProduct(orderTrade)); @@ -102,7 +103,7 @@ public class OrderTradeController extends BaseController { // 获取当前用户 Long userId = SecurityUtils.getUserId(); if (userId == null) { - return R.fail("用户未登录"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户未登录"); } orderTrade.setUserId(userId); orderTradeService.updateMallProduct(orderTrade); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/tool/TestController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/tool/TestController.java index 4b40ba3..ea698fa 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/tool/TestController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/tool/TestController.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; + +import com.mcwl.common.constant.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/InviteServiceImpl.java b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/InviteServiceImpl.java index cf02761..3ebf8d3 100644 --- a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/InviteServiceImpl.java +++ b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/InviteServiceImpl.java @@ -2,6 +2,7 @@ package com.mcwl.communityCenter.service.impl; import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.utils.SecurityUtils; @@ -67,12 +68,12 @@ public class InviteServiceImpl extends ServiceImpl impleme // 解析邀请码 Long userId = ShareCodeUtils.codeToId(inviteCode); if (Objects.isNull(userId)) { - return R.fail("邀请码有误"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"邀请码有误"); } // 判断是否是同一个人 if (Objects.equals(userId, SecurityUtils.getUserId())) { - return R.fail("不能邀请自己"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"不能邀请自己"); } // 查询邀请码 @@ -84,13 +85,13 @@ public class InviteServiceImpl extends ServiceImpl impleme .one(); if (Objects.isNull(inviteCodeMapping)) { - return R.fail("没查询到该邀请码"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"没查询到该邀请码"); } // 判断是否已经邀请过 Invite inv = inviteMapper.isInvite(userId, communityId, SecurityUtils.getUserId()); if (Objects.nonNull(inv)) { - return R.fail("不能重复邀请"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"不能重复邀请"); } diff --git a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/PublishCommentServiceImpl.java b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/PublishCommentServiceImpl.java index 4760e4f..bc9d58c 100644 --- a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/PublishCommentServiceImpl.java +++ b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/PublishCommentServiceImpl.java @@ -3,6 +3,7 @@ package com.mcwl.communityCenter.service.impl; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.entity.SysUser; @@ -81,7 +82,7 @@ public class PublishCommentServiceImpl extends ServiceImpl impl Community community = communityMapper.getByTenantIdAndCommunityId(publishRes.getTenantId(), publishRes.getCommunityId()); if (Objects.isNull(community)) { - return R.fail("用户社区未创建"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户社区未创建"); } @@ -83,7 +83,7 @@ public class PublishServiceImpl extends ServiceImpl impl if (!Objects.equals(userId, publishRes.getTenantId())) { // 判断用户是否被邀请 if (invites.isEmpty() || !invites.contains(userId)) { - return R.fail("您没有被邀请"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"您没有被邀请"); } } Publish publish = new Publish(); diff --git a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java index 6343f18..e9c0fe2 100644 --- a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java +++ b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java @@ -48,7 +48,7 @@ public class QuestionCommentServiceImpl extends ServiceImpl i Community community = communityMapper.getByTenantIdAndCommunityId(tenantId, communityId); if (Objects.isNull(community)) { - return R.fail("租户或社区不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"租户或社区不存在"); } // if (Objects.equals(tenantId, userId)) { diff --git a/mcwl-memberCenter/src/main/java/com/mcwl/memberCenter/service/impl/PromotionServiceImpl.java b/mcwl-memberCenter/src/main/java/com/mcwl/memberCenter/service/impl/PromotionServiceImpl.java index 41e8f71..dff35ca 100644 --- a/mcwl-memberCenter/src/main/java/com/mcwl/memberCenter/service/impl/PromotionServiceImpl.java +++ b/mcwl-memberCenter/src/main/java/com/mcwl/memberCenter/service/impl/PromotionServiceImpl.java @@ -153,21 +153,21 @@ public class PromotionServiceImpl extends ServiceImpl impl ModelProduct modelProduct = postMapper.selectById(id); if (modelProduct == null){ - return R.fail("该模型不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"该模型不存在"); } //翻译属性 垂类 diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelVersionServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelVersionServiceImpl.java index 8bbe8c1..916bbba 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelVersionServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelVersionServiceImpl.java @@ -3,6 +3,7 @@ package com.mcwl.resource.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mcwl.common.constant.DictConstants; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.R; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.StringUtils; @@ -123,11 +124,11 @@ public class ModelVersionServiceImpl extends ServiceImpl< ModelVersionMapper,Mo ModelVersion modelVersion = modelVersionMapper.selectById(id); if (modelVersion == null){ - return R.fail("文件为空"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件为空"); } if (modelVersion.getAllowDownloadImage().equals(0)){ - return R.fail("此文件不可下载"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"此文件不可下载"); } if (modelVersion.getIsEncrypt() == 1){ diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/SysUserAttentionServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/SysUserAttentionServiceImpl.java index c68115a..a367a4f 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/SysUserAttentionServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/SysUserAttentionServiceImpl.java @@ -3,6 +3,7 @@ package com.mcwl.resource.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +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.utils.SecurityUtils; @@ -57,7 +58,7 @@ public class SysUserAttentionServiceImpl extends ServiceImpl i //查询详情 WorkFlow workFlow = flowMapper.selectById(id); if (workFlow == null) { - return R.fail("工作流不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"工作流不存在"); } //类别 @@ -466,12 +466,12 @@ public class WorkFlowServiceImpl extends ServiceImpl i WorkFlow workFlow = baseMapper.selectById(id); if (workFlow == null) { - return R.fail("数据不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"数据不存在"); } if (workFlow.getDelFlag() == 2) { - return R.fail("数据不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"数据不存在"); } LambdaQueryWrapper workFlowVersionLambdaQueryWrapper = new LambdaQueryWrapper<>(); diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowVersionServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowVersionServiceImpl.java index eb677d5..b3b8b4b 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowVersionServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowVersionServiceImpl.java @@ -1,6 +1,7 @@ package com.mcwl.resource.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.R; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.resource.domain.Collect; @@ -67,12 +68,12 @@ public class WorkFlowVersionServiceImpl implements WorkFlowVersionService { //查找数据 WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectById(id); if (workFlowVersion == null) { - return R.fail("文件不存在"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件不存在"); } WorkFlow workFlow = workFlowMapper.selectById(workFlowVersion.getWorkFlowId()); if (workFlow.getDownload().equals(1)) { - return R.fail("该文件不允许下载"); + return R.fail(HttpStatus.SHOW_ERROR_MSG,"该文件不允许下载"); } return R.ok(workFlowVersion.getFilePath(), workFlowVersion.getFileName());