From cb5dbc7919357c4f286bb7e8b5279d37559947f1 Mon Sep 17 00:00:00 2001 From: Diyu0904 <1819728964@qq.com> Date: Tue, 18 Feb 2025 13:16:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E4=B8=BE=E6=8A=A5api?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/resource/ReportController.java | 3 ++- .../java/com/mcwl/resource/domain/Report.java | 15 ++++++++++++++- .../resource/service/impl/FileServiceImpl.java | 8 +++++++- .../service/impl/WorkFlowServiceImpl.java | 4 ++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ReportController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ReportController.java index 27a0412..60a645a 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ReportController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ReportController.java @@ -1,11 +1,11 @@ package com.mcwl.web.controller.resource; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.R; import com.mcwl.resource.domain.Report; import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.service.ReportService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*; * @apiNote */ +@Api(tags = "举报") @RequestMapping("/report") @RestController public class ReportController { diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/Report.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/Report.java index 675a170..9f38a3d 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/Report.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/Report.java @@ -2,6 +2,8 @@ package com.mcwl.resource.domain; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,6 +14,7 @@ import java.util.Date; /** * 举报表 + * * @author DaiZibo * @date 2025/1/18 * @apiNote @@ -21,53 +24,63 @@ import java.util.Date; @Data @NoArgsConstructor @AllArgsConstructor +@ApiModel(description = "举报表") @TableName("report") public class Report { /** * 主键ID */ + @ApiModelProperty(value = "举报ID") private Long id; /** * 被举报的商品ID */ + @ApiModelProperty(value = "被举报作品ID") private Long productId; /** * 举报人ID */ + @ApiModelProperty(value = "举报人ID") private Long userId; /** * 举报类型 */ + @ApiModelProperty(value = "举报类型 字典值") private Integer reportId; /** * 区分举报内容(1模型 2图片 3工作流) */ + @ApiModelProperty(value = "作品类型 (1模型 2图片 3工作流)") private Integer type; /** * 举报描述 */ + @ApiModelProperty(value = "举报描述") private String text; /** * 状态(0未处理 1已处理) */ + @ApiModelProperty(value = "状态(0未处理 1已处理 )") private Integer status = 0; /** * 创建时间 */ + @ApiModelProperty(value = "创建时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; /** * 逻辑删除(0展示 2删除) */ + @ApiModelProperty(value = "逻辑删除(0展示 2删除)") private Integer delFlag = 0; } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/FileServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/FileServiceImpl.java index e5089da..02c2257 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/FileServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/FileServiceImpl.java @@ -1,6 +1,7 @@ package com.mcwl.resource.service.impl; import com.mcwl.common.core.domain.AjaxResult; +import com.mcwl.common.utils.StringUtils; import com.mcwl.resource.domain.ModelVersion; import com.mcwl.resource.domain.WorkFlowVersion; import com.mcwl.resource.mapper.ModelVersionMapper; @@ -27,6 +28,11 @@ public class FileServiceImpl implements FileService { @Override public AjaxResult selectFileName(String name, String type) { + if (StringUtils.isEmpty(type)){ + + return AjaxResult.error("请输入type"); + } + if (type.equals("model")) { ModelVersion modelVersion = versionMapper.selectByFileName(name); @@ -36,7 +42,7 @@ public class FileServiceImpl implements FileService { } return AjaxResult.success(modelVersion); - }else if (type.equals("workFlow")){ + }else if (type.equals("workflow")){ WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name); if (workFlowVersion == null) { 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 56f342a..1565a76 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 @@ -510,6 +510,10 @@ public class WorkFlowServiceImpl extends ServiceImpl i List responseWorkFlowList = baseMapper.workFlowList(pageVo); + for (ResponseWorkFlow responseWorkFlow : responseWorkFlowList) { + + responseWorkFlow.setType(DictInit.getDictValue(DictConstants.WORK_FLOW_TYPE_CHILD,responseWorkFlow.getType())); + } return new PageInfo(responseWorkFlowList);