联调工作流

新增上传文件接口
新增举报api文档
master
Diyu0904 2025-02-18 13:16:31 +08:00
parent 461b75cce2
commit cb5dbc7919
4 changed files with 27 additions and 3 deletions

View File

@ -1,11 +1,11 @@
package com.mcwl.web.controller.resource; package com.mcwl.web.controller.resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.common.core.domain.R;
import com.mcwl.resource.domain.Report; import com.mcwl.resource.domain.Report;
import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.domain.vo.PageVo;
import com.mcwl.resource.service.ReportService; import com.mcwl.resource.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
* @apiNote * @apiNote
*/ */
@Api(tags = "举报")
@RequestMapping("/report") @RequestMapping("/report")
@RestController @RestController
public class ReportController { public class ReportController {

View File

@ -2,6 +2,8 @@ package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@ -12,6 +14,7 @@ import java.util.Date;
/** /**
* *
*
* @author DaiZibo * @author DaiZibo
* @date 2025/1/18 * @date 2025/1/18
* @apiNote * @apiNote
@ -21,53 +24,63 @@ import java.util.Date;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ApiModel(description = "举报表")
@TableName("report") @TableName("report")
public class Report { public class Report {
/** /**
* ID * ID
*/ */
@ApiModelProperty(value = "举报ID")
private Long id; private Long id;
/** /**
* ID * ID
*/ */
@ApiModelProperty(value = "被举报作品ID")
private Long productId; private Long productId;
/** /**
* ID * ID
*/ */
@ApiModelProperty(value = "举报人ID")
private Long userId; private Long userId;
/** /**
* *
*/ */
@ApiModelProperty(value = "举报类型 字典值")
private Integer reportId; private Integer reportId;
/** /**
* (1 2 3) * (1 2 3)
*/ */
@ApiModelProperty(value = "作品类型 (1模型 2图片 3工作流)")
private Integer type; private Integer type;
/** /**
* *
*/ */
@ApiModelProperty(value = "举报描述")
private String text; private String text;
/** /**
* 0 1 * 0 1
*/ */
@ApiModelProperty(value = "状态0未处理 1已处理 )")
private Integer status = 0; private Integer status = 0;
/** /**
* *
*/ */
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @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; private Date createTime;
/** /**
* 0 2 * 0 2
*/ */
@ApiModelProperty(value = "逻辑删除0展示 2删除")
private Integer delFlag = 0; private Integer delFlag = 0;
} }

View File

@ -1,6 +1,7 @@
package com.mcwl.resource.service.impl; package com.mcwl.resource.service.impl;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.resource.domain.ModelVersion; import com.mcwl.resource.domain.ModelVersion;
import com.mcwl.resource.domain.WorkFlowVersion; import com.mcwl.resource.domain.WorkFlowVersion;
import com.mcwl.resource.mapper.ModelVersionMapper; import com.mcwl.resource.mapper.ModelVersionMapper;
@ -27,6 +28,11 @@ public class FileServiceImpl implements FileService {
@Override @Override
public AjaxResult selectFileName(String name, String type) { public AjaxResult selectFileName(String name, String type) {
if (StringUtils.isEmpty(type)){
return AjaxResult.error("请输入type");
}
if (type.equals("model")) { if (type.equals("model")) {
ModelVersion modelVersion = versionMapper.selectByFileName(name); ModelVersion modelVersion = versionMapper.selectByFileName(name);
@ -36,7 +42,7 @@ public class FileServiceImpl implements FileService {
} }
return AjaxResult.success(modelVersion); return AjaxResult.success(modelVersion);
}else if (type.equals("workFlow")){ }else if (type.equals("workflow")){
WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name); WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name);
if (workFlowVersion == null) { if (workFlowVersion == null) {

View File

@ -510,6 +510,10 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
List<ResponseWorkFlow> responseWorkFlowList = baseMapper.workFlowList(pageVo); List<ResponseWorkFlow> responseWorkFlowList = baseMapper.workFlowList(pageVo);
for (ResponseWorkFlow responseWorkFlow : responseWorkFlowList) {
responseWorkFlow.setType(DictInit.getDictValue(DictConstants.WORK_FLOW_TYPE_CHILD,responseWorkFlow.getType()));
}
return new PageInfo<ResponseWorkFlow>(responseWorkFlowList); return new PageInfo<ResponseWorkFlow>(responseWorkFlowList);