Compare commits
6 Commits
f445567505
...
2385b58bb0
Author | SHA1 | Date |
---|---|---|
|
2385b58bb0 | |
|
c8bc835644 | |
|
9ef5a22665 | |
|
573ccd5ef8 | |
|
821dce5654 | |
|
db353dbb83 |
|
@ -6,8 +6,12 @@ import com.mcwl.common.core.domain.AjaxResult;
|
|||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
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.ModelService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -29,8 +33,8 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/model")
|
||||
public class MallProductController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private ModelService modelService;
|
||||
|
@ -82,14 +86,12 @@ public class MallProductController extends BaseController {
|
|||
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
* 模型列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody ModelProduct mallProduct)
|
||||
{
|
||||
startPage();
|
||||
List<ModelProduct> list = modelService.selectMallProductList(mallProduct);
|
||||
return getDataTable(list);
|
||||
public TableDataInfo list(@RequestBody ModelImagePageRes imagePageRes) {
|
||||
|
||||
return modelService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,6 +125,24 @@ public class MallProductController extends BaseController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult addupdateModel(@RequestBody RequestModel requestModel){
|
||||
|
||||
return modelService.addModel(requestModel);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult updateModel(@RequestBody RequestModel requestModel){
|
||||
|
||||
modelService.updaModel(requestModel);
|
||||
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("delete")
|
||||
public AjaxResult delete(@RequestBody ModelProduct modelVersion)
|
||||
{
|
||||
|
|
|
@ -2,12 +2,16 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.ModelComment;
|
||||
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
||||
import com.mcwl.resource.service.ModelCommentLikeService;
|
||||
import com.mcwl.resource.service.ModelCommentService;
|
||||
import com.mcwl.resource.service.ModelLikeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
|
@ -27,10 +31,12 @@ public class ModelCommentController {
|
|||
@Autowired
|
||||
private ModelCommentLikeService modelCommentLikeService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 模型点赞/取消
|
||||
*/
|
||||
@GetMapping("/imageLike/{imageId}")
|
||||
@GetMapping("/modelLike/{modelId}")
|
||||
public AjaxResult like(@PathVariable Long imageId) {
|
||||
modelLikeService.like(imageId);
|
||||
return AjaxResult.success();
|
||||
|
@ -57,8 +63,24 @@ public class ModelCommentController {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* 获取模型评论
|
||||
*/
|
||||
@GetMapping("/comment/{modelId}")
|
||||
public AjaxResult getComment(@PathVariable @NotNull(message = "模型id不能为空") Long modelId) {
|
||||
List<ModelCommentVo> modelCommentList = modelCommentService.getComment(modelId);
|
||||
return AjaxResult.success(modelCommentList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除模型评论
|
||||
*/
|
||||
@GetMapping("/commentDelete/{commentId}")
|
||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelCommentService.removeById(commentId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
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.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.StringUtils;
|
||||
import com.mcwl.common.utils.oss.OssUtil;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import com.mcwl.resource.domain.ModelImageCommentLike;
|
||||
import com.mcwl.resource.domain.ModelImageLike;
|
||||
import com.mcwl.resource.domain.dto.ModelImageCommentRes;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.dto.ModelImageRes;
|
||||
|
@ -32,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
|
@ -25,9 +25,10 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
public class WorkFlowController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private WorkFlowServiceImpl workFlowService;
|
||||
|
||||
/***
|
||||
*
|
||||
* 图片
|
||||
* @param file
|
||||
* @return
|
||||
|
@ -39,7 +40,6 @@ public class WorkFlowController extends BaseController {
|
|||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* zip
|
||||
|
@ -53,8 +53,6 @@ public class WorkFlowController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* 下载zip
|
||||
|
@ -68,6 +66,20 @@ public class WorkFlowController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
// @PostMapping("/add")
|
||||
// public AjaxResult
|
||||
@PostMapping("/addWorkFlow")
|
||||
public AjaxResult addWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||
|
||||
return workFlowService.addWorkFlow(requestWorkFlow);
|
||||
}
|
||||
|
||||
@PostMapping("/updateWorkFlow")
|
||||
public AjaxResult updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||
|
||||
workFlowService.updateWorkFlow(requestWorkFlow);
|
||||
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -56,4 +56,29 @@ public class WorkFlow {
|
|||
*/
|
||||
private String del_flag;
|
||||
|
||||
/**
|
||||
* 审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)
|
||||
*/
|
||||
private Integer auditStatus = 0;
|
||||
|
||||
/**
|
||||
* 审核失败原因
|
||||
*/
|
||||
private String auditText;
|
||||
|
||||
/**
|
||||
* 原文作者名字
|
||||
*/
|
||||
private String authorName;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
private Long useNumber = 0L;
|
||||
|
||||
/**
|
||||
*下载数量
|
||||
*/
|
||||
private Long downloadNumber = 0L;
|
||||
|
||||
}
|
||||
|
|
|
@ -44,9 +44,74 @@ public class WorkFlowVersion {
|
|||
/**
|
||||
* 是否隐藏图片生成信息
|
||||
*/
|
||||
private String hideGenInfo;
|
||||
private Integer hideGenInfo;
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)
|
||||
*/
|
||||
private Integer auditStatus = 0;
|
||||
|
||||
/**
|
||||
* 审核失败原因
|
||||
*/
|
||||
private String auditText;
|
||||
|
||||
/**
|
||||
* 模型ID
|
||||
*/
|
||||
private Long workFlowId;
|
||||
|
||||
/**
|
||||
* 基础模型
|
||||
*/
|
||||
private Integer basicModel;
|
||||
|
||||
/**
|
||||
* 权限状态
|
||||
*/
|
||||
private Integer jurisdiction;
|
||||
|
||||
/**
|
||||
*是否允许在本软件使用(0授权 1不允许
|
||||
*/
|
||||
private Integer itselfUse;
|
||||
|
||||
/**
|
||||
* 是否允许在旗下软件使用(0授权 1不允许)
|
||||
*/
|
||||
private Integer subordinateUse;
|
||||
|
||||
/**
|
||||
* 是否允许下载生图(0授权 1不允许)
|
||||
*/
|
||||
private Integer download;
|
||||
|
||||
/**
|
||||
* 是否允许下载融合(0授权 1不允许)
|
||||
*/
|
||||
private Integer fuse;
|
||||
|
||||
/**
|
||||
* 生成的图片是否允许出售(0授权 1不允许)
|
||||
*/
|
||||
private Integer sell;
|
||||
|
||||
/**
|
||||
* 是否允许融合后(0授权 1不允许)
|
||||
*/
|
||||
private Integer fuseSell;
|
||||
|
||||
/**
|
||||
* 是否独家设置(0授权 1不允许)
|
||||
*/
|
||||
private Integer exclusive;
|
||||
|
||||
/**
|
||||
* 文件名字
|
||||
*/
|
||||
private String fileName;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.mcwl.resource.domain.request;
|
||||
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模型入参 模型+版本
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/9
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class RequestModel {
|
||||
|
||||
private ModelProduct modelProduct;
|
||||
|
||||
private List<ModelVersion> modelVersionList;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.mcwl.resource.domain.request;
|
||||
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流入参 工作流+版本
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/9
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class RequestWorkFlow {
|
||||
|
||||
private WorkFlow workFlow;
|
||||
|
||||
private List<WorkFlowVersion> workFlowVersionList;
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.mcwl.resource.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 评论区评论
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
public class ModelCommentVo {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 评论id
|
||||
*/
|
||||
private Long commentId;
|
||||
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 子评论
|
||||
*/
|
||||
private List<ModelCommentVo> contentList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 评论点赞数
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
/**
|
||||
* 评论时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.mcwl.resource.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelVo {
|
||||
/**
|
||||
* 图片ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
/**
|
||||
* 图片地址(最多8张,切割)
|
||||
*/
|
||||
private String imagePaths;
|
||||
/**
|
||||
* 是否添加水印
|
||||
*/
|
||||
private Integer hasWatermark;
|
||||
/**
|
||||
* 是否会员下载
|
||||
*/
|
||||
private Integer isMemberDownload;
|
||||
/**
|
||||
* 是否不可下载
|
||||
*/
|
||||
private Integer isNotDownloadable;
|
||||
/**
|
||||
* 是否隐藏生成信息
|
||||
*/
|
||||
private Integer hideGenInfo;
|
||||
/**
|
||||
* 图片标题(最多30字)
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 图片标签(多个,切割)
|
||||
*/
|
||||
private String tags;
|
||||
/**
|
||||
* 描述信息(最多500)
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 在线生成数
|
||||
*/
|
||||
private Integer onlineGenNum;
|
||||
/**
|
||||
* 下载数
|
||||
*/
|
||||
private Integer downloadNum;
|
||||
/**
|
||||
* 返图数
|
||||
*/
|
||||
private Integer returnNum;
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -27,5 +27,6 @@ public interface MallProductMapper extends BaseMapper<ModelProduct> {
|
|||
Long sumNumber(@Param("userId") Long userId);
|
||||
|
||||
|
||||
void updateModel(ModelProduct modelProduct);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
|
@ -14,4 +18,8 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface ModelVersionMapper extends BaseMapper<ModelVersion> {
|
||||
void addModelVersion(@Param("modelProduct") ModelProduct modelProduct, @Param("modelVersionList") List<ModelVersion> modelVersionList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,5 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface WorkFlowMapper extends BaseMapper<WorkFlow> {
|
||||
|
||||
void updateWorkFlow(WorkFlow workFlow);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流版本 业务实现层
|
||||
|
@ -13,4 +17,9 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
|
||||
@Mapper
|
||||
public interface WorkFlowVersionMapper extends BaseMapper<WorkFlowVersion> {
|
||||
|
||||
void addWorkFlowVersion(@Param("workFlow") WorkFlow workFlow, @Param("list") List<WorkFlowVersion> workFlowVersionList);
|
||||
|
||||
void updateWorkFlowVersion(WorkFlowVersion workFlowVersion);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,11 @@ package com.mcwl.resource.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.resource.domain.ModelComment;
|
||||
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
||||
import com.mcwl.resource.domain.vo.ModelImageCommentVo;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
|
@ -14,4 +19,11 @@ import com.mcwl.resource.domain.ModelComment;
|
|||
public interface ModelCommentService extends IService<ModelComment> {
|
||||
void comment(ModelComment modelComment);
|
||||
|
||||
/**
|
||||
* 获取评论
|
||||
* @param imageId 图片id
|
||||
* @return 评论区
|
||||
*/
|
||||
List<ModelCommentVo> getComment(Long imageId);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,9 +2,13 @@ package com.mcwl.resource.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.request.RequestModel;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -19,17 +23,15 @@ import java.util.List;
|
|||
*/
|
||||
public interface ModelService extends IService<ModelProduct> {
|
||||
|
||||
List<ModelProduct> selectMallProductList(ModelProduct sysJob);
|
||||
|
||||
int insertMallProduct(ModelProduct mallProduct);
|
||||
|
||||
int updateMallProduct(ModelProduct mallProduct);
|
||||
|
||||
|
||||
void deleteMallProductByIds(IdsParam ids);
|
||||
|
||||
Page<ModelProduct> selectByUserId(MallProductVo mallProductVo);
|
||||
|
||||
Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
|
||||
|
||||
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
||||
|
||||
AjaxResult addModel(RequestModel requestModel);
|
||||
|
||||
|
||||
void updaModel(RequestModel requestModel);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
|
||||
/**
|
||||
* 工作流 业务层
|
||||
* @author DaiZibo
|
||||
|
@ -8,4 +11,8 @@ package com.mcwl.resource.service;
|
|||
*/
|
||||
|
||||
public interface WorkFlowService {
|
||||
AjaxResult addWorkFlow(RequestWorkFlow requestWorkFlow);
|
||||
|
||||
void updateWorkFlow(RequestWorkFlow requestWorkFlow);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,21 +1,42 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.AjaxResult;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.core.redis.RedisCache;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
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.domain.vo.ModelImageVo;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**模型 业务实现层
|
||||
|
@ -26,39 +47,20 @@ import java.util.List;
|
|||
* @Description TODO
|
||||
* @Date:2024/12/30 18:22
|
||||
*/
|
||||
@Log4j2
|
||||
@Service
|
||||
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements ModelService {
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ModelVersionMapper modelVersionMapper;
|
||||
@Autowired
|
||||
private MallProductMapper postMapper;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<ModelProduct> selectMallProductList(ModelProduct mallProduct) {
|
||||
QueryWrapper<ModelProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ModelProduct::getModelName, mallProduct.getModelName());
|
||||
queryWrapper.lambda().eq(ModelProduct::getOriginalAuthorName, mallProduct.getOriginalAuthorName());
|
||||
return postMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insertMallProduct(ModelProduct mallProduct) {
|
||||
return postMapper.insert(mallProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMallProduct(ModelProduct mallProduct) {
|
||||
return postMapper.updateById(mallProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMallProductByIds(IdsParam ids) {
|
||||
postMapper.deleteBatchIds(ids.getIds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
|
||||
|
||||
|
@ -95,4 +97,93 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelP
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param imagePageRes 分页参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo listByPage(ModelImagePageRes imagePageRes) {
|
||||
|
||||
Page<ModelProduct> page = new Page<>(imagePageRes.getPageNum(), imagePageRes.getPageSize());
|
||||
if (StringUtils.isEmpty(imagePageRes.getOrderByColumn())) {
|
||||
imagePageRes.setOrderByColumn("create_time");
|
||||
}
|
||||
// 设置排序
|
||||
boolean isAsc = Objects.equals(imagePageRes.getIsAsc(), "asc");
|
||||
OrderItem orderItem = new OrderItem(imagePageRes.getOrderByColumn(), isAsc);
|
||||
page.addOrder(orderItem);
|
||||
|
||||
LambdaQueryWrapper<ModelProduct> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(imagePageRes.getStatus() != null, ModelProduct::getAuditSatus, imagePageRes.getStatus())
|
||||
.eq(imagePageRes.getUserId() != null, ModelProduct::getUserId, imagePageRes.getUserId())
|
||||
.eq(imagePageRes.getPageNum() != null, ModelProduct::getUserId, imagePageRes.getUserId())
|
||||
.ge(imagePageRes.getStartTime() != null, ModelProduct::getCreateTime, imagePageRes.getStartTime())
|
||||
.le(imagePageRes.getEndTime() != null, ModelProduct::getCreateTime, imagePageRes.getEndTime());
|
||||
|
||||
postMapper.selectPage(page, lqw);
|
||||
// 获取分页数据
|
||||
List<ModelProduct> modelImageList = page.getRecords();
|
||||
|
||||
// Model数据转为ModelPageVo
|
||||
List<ModelImageVo> modelImageVoList = new ArrayList<>();
|
||||
for (ModelProduct modelImage : modelImageList) {
|
||||
ModelImageVo modelImageVo = new ModelImageVo();
|
||||
BeanUtil.copyProperties(modelImage, modelImageVo);
|
||||
// 获取用户信息
|
||||
SysUser sysUser = sysUserService.selectUserById(modelImage.getUserId());
|
||||
modelImageVo.setUserId(sysUser.getUserId());
|
||||
modelImageVo.setUserName(sysUser.getUserName());
|
||||
modelImageVo.setUserAvatar(sysUser.getAvatar());
|
||||
modelImageVoList.add(modelImageVo);
|
||||
}
|
||||
|
||||
// 封装分页数据
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(modelImageVoList);
|
||||
rspData.setTotal(page.getTotal());
|
||||
|
||||
return rspData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult addModel(RequestModel requestModel) {
|
||||
//添加模型表数据
|
||||
postMapper.insert(requestModel.getModelProduct());
|
||||
|
||||
log.info("获取到的入参:{}",requestModel.getModelProduct());
|
||||
|
||||
//批量添加版本
|
||||
modelVersionMapper.addModelVersion(requestModel.getModelProduct(),requestModel.getModelVersionList());
|
||||
|
||||
return AjaxResult.success("添加成功,等待审核");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updaModel(RequestModel requestModel) {
|
||||
//修改模版的信息
|
||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||
if (ObjectUtils.isEmpty(modelProduct)){
|
||||
|
||||
}
|
||||
if (StringUtils.isNotNull(modelProduct.getId())){
|
||||
modelProduct.setAuditSatus(3);
|
||||
postMapper.updateModel(requestModel.getModelProduct());
|
||||
}
|
||||
|
||||
//修改工作流版本的信息
|
||||
if (requestModel.getModelVersionList().size() != 0){
|
||||
|
||||
//批量修改
|
||||
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
||||
modelVersion.setAuditSatus(3);
|
||||
modelVersionMapper.updateById(modelVersion);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +1,27 @@
|
|||
package com.mcwl.resource.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.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelComment;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import com.mcwl.resource.domain.dto.ModelImageCommentRes;
|
||||
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
||||
import com.mcwl.resource.domain.vo.ModelImageCommentVo;
|
||||
import com.mcwl.resource.mapper.ModelCommentMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageCommentMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||
import com.mcwl.resource.service.ModelCommentService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +35,8 @@ import java.util.Objects;
|
|||
@Service
|
||||
public class ModelCommentServiceImpl extends ServiceImpl<ModelCommentMapper, ModelComment> implements ModelCommentService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ModelCommentMapper modelCommentMapper;
|
||||
|
||||
|
@ -48,4 +58,89 @@ public class ModelCommentServiceImpl extends ServiceImpl<ModelCommentMapper, Mod
|
|||
modelCommentMapper.insert(modelComment);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModelCommentVo> getComment(Long imageId) {
|
||||
List<ModelCommentVo> modelCommentVoList = new ArrayList<>();
|
||||
|
||||
// 查询所有父评论
|
||||
LambdaQueryWrapper<ModelComment> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(ModelComment::getModelId, imageId)
|
||||
.isNull(ModelComment::getParentId)
|
||||
.orderByDesc(ModelComment::getCreateTime);
|
||||
// 添加父评论
|
||||
List<ModelComment> modelCommentList = modelCommentMapper.selectList(lqw);
|
||||
for (ModelComment modelComment : modelCommentList) {
|
||||
ModelCommentVo modelCommentVo = getModelCommentVo(modelComment);
|
||||
modelCommentVoList.add(modelCommentVo);
|
||||
}
|
||||
|
||||
return modelCommentVoList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建ModelCommentVo对象
|
||||
*
|
||||
* @param modelComment 父评论对象
|
||||
* @return ModelCommentVo对象
|
||||
*/
|
||||
@NotNull
|
||||
private ModelCommentVo getModelCommentVo(ModelComment modelComment) {
|
||||
Long userId = modelComment.getUserId();
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
|
||||
// 构建ModelCommentVo对象
|
||||
ModelCommentVo modelCommentVo = new ModelCommentVo();
|
||||
modelCommentVo.setUserId(userId);
|
||||
modelCommentVo.setUserName(sysUser.getUserName());
|
||||
modelCommentVo.setUserAvatar(sysUser.getAvatar());
|
||||
modelCommentVo.setCommentId(modelComment.getId());
|
||||
modelCommentVo.setContent(modelComment.getContent());
|
||||
// 查询子评论
|
||||
modelCommentVo.setContentList(getContentList(modelComment.getId()));
|
||||
modelCommentVo.setLikeNum(modelComment.getLikeNum());
|
||||
modelCommentVo.setCreateTime(modelComment.getCreateTime());
|
||||
return modelCommentVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归查询子评论
|
||||
*
|
||||
* @param modelCommentId 父评论id
|
||||
* @return List<ModelCommentVo>
|
||||
*/
|
||||
private List<ModelCommentVo> getContentList(Long modelCommentId) {
|
||||
List<ModelCommentVo> modelCommentVoList = new ArrayList<>();
|
||||
if (Objects.isNull(modelCommentId)) {
|
||||
return modelCommentVoList;
|
||||
}
|
||||
|
||||
// 查询子评论
|
||||
LambdaQueryWrapper<ModelComment> lqw = new LambdaQueryWrapper<ModelComment>()
|
||||
.eq(ModelComment::getParentId, modelCommentId)
|
||||
.orderByDesc(ModelComment::getCreateTime);
|
||||
|
||||
List<ModelComment> modelCommentList = modelCommentMapper.selectList(lqw);
|
||||
|
||||
for (ModelComment modelComment : modelCommentList) {
|
||||
Long userId = modelComment.getUserId();
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
ModelCommentVo modelCommentVo = new ModelCommentVo();
|
||||
modelCommentVo.setUserId(userId);
|
||||
modelCommentVo.setUserName(sysUser.getUserName());
|
||||
modelCommentVo.setUserAvatar(sysUser.getAvatar());
|
||||
modelCommentVo.setCommentId(modelComment.getId());
|
||||
modelCommentVo.setContent(modelComment.getContent());
|
||||
modelCommentVo.setLikeNum(modelComment.getLikeNum());
|
||||
modelCommentVo.setCreateTime(modelComment.getCreateTime());
|
||||
|
||||
|
||||
modelCommentVoList.add(modelCommentVo);
|
||||
}
|
||||
return modelCommentVoList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.mapper.WorkFlowMapper;
|
||||
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||
import com.mcwl.resource.service.WorkFlowService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -10,8 +17,48 @@ import org.springframework.stereotype.Service;
|
|||
* @apiNote
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class WorkFlowServiceImpl implements WorkFlowService {
|
||||
|
||||
@Autowired
|
||||
private WorkFlowMapper flowMapper;
|
||||
|
||||
@Autowired
|
||||
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult addWorkFlow(RequestWorkFlow requestWorkFlow) {
|
||||
|
||||
//添加模型表数据
|
||||
flowMapper.insert(requestWorkFlow.getWorkFlow());
|
||||
|
||||
log.info("获取到的入参:{}",requestWorkFlow.getWorkFlow());
|
||||
|
||||
//批量添加版本
|
||||
workFlowVersionMapper.addWorkFlowVersion(requestWorkFlow.getWorkFlow(),requestWorkFlow.getWorkFlowVersionList());
|
||||
|
||||
return AjaxResult.success("添加成功,等待审核");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWorkFlow(RequestWorkFlow requestWorkFlow) {
|
||||
|
||||
//修改工作流的信息
|
||||
if (requestWorkFlow.getWorkFlow().getId() != null){
|
||||
|
||||
requestWorkFlow.getWorkFlow().setAuditStatus(3);
|
||||
flowMapper.updateWorkFlow(requestWorkFlow.getWorkFlow());
|
||||
}
|
||||
|
||||
//修改工作流版本的信息
|
||||
if (requestWorkFlow.getWorkFlowVersionList().size() != 0){
|
||||
|
||||
//批量修改
|
||||
for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) {
|
||||
workFlowVersion.setAuditStatus(3);
|
||||
workFlowVersionMapper.updateWorkFlowVersion(workFlowVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.mcwl.resource.service.WorkFlowService;
|
||||
import com.mcwl.resource.service.WorkFlowVersionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,6 @@ import org.springframework.stereotype.Service;
|
|||
*/
|
||||
|
||||
@Service
|
||||
public class WorkFlowVersionServiceImpl implements WorkFlowService {
|
||||
public class WorkFlowVersionServiceImpl implements WorkFlowVersionService {
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,72 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
|
||||
|
||||
<update id="updateModel">
|
||||
update model
|
||||
<set>
|
||||
<if test="modelName != null and modelName != ''">
|
||||
model_name = #{modelName},
|
||||
</if>
|
||||
<if test="versionDescription != null and versionDescription != ''">
|
||||
version_description = #{versionDescription},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="modelTypeId != null">
|
||||
model_type_id = #{modelTypeId},
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
category = #{category},
|
||||
</if>
|
||||
<if test="functions != null and functions != ''">
|
||||
functions = #{functions},
|
||||
</if>
|
||||
<if test="tags != null and tags != ''">
|
||||
tags = #{tags},
|
||||
</if>
|
||||
<if test="activityId != null and activityId != ''">
|
||||
activity_id = #{activityId},
|
||||
</if>
|
||||
<if test="isOriginal != null">
|
||||
is_original = #{isOriginal},
|
||||
</if>
|
||||
<if test="originalAuthorName != null and originalAuthorName != ''">
|
||||
original_author_name = #{originalAuthorName},
|
||||
</if>
|
||||
<if test="reals != null">
|
||||
reals = #{reals},
|
||||
</if>
|
||||
<if test="numbers != null">
|
||||
numbers = #{numbers},
|
||||
</if>
|
||||
<if test="auditSatus != null">
|
||||
audit_satus = #{auditSatus},
|
||||
</if>
|
||||
<if test="isRecommend != null">
|
||||
is_recommend = #{isRecommend},
|
||||
</if>
|
||||
<if test="delFlag != null and delFlag != ''">
|
||||
del_flag = #{delFlag},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="auditText != null and auditText != ''">
|
||||
audit_text = #{auditText},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="versionId != null">
|
||||
version_id = #{versionId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="sumNumber" resultType="java.lang.Long">
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.ModelVersionMapper">
|
||||
|
||||
|
||||
<insert id="addModelVersion">
|
||||
INSERT INTO model_version (
|
||||
version_name, model_type, file_path, trigger_words, sampling, high, vae, cfg,
|
||||
is_free, is_public, is_encrypt, is_online_use, allow_download_image,
|
||||
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
|
||||
is_exclusive_model, sample_image_paths, hide_image_gen_info, audit_status,
|
||||
audit_text, del_flag
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.versionName}, #{item.modelType}, #{item.filePath}, #{item.triggerWords},
|
||||
#{item.sampling}, #{item.high}, #{item.vae}, #{item.cfg},
|
||||
#{item.isFree}, #{item.isPublic}, #{item.isEncrypt}, #{item.isOnlineUse},
|
||||
#{item.allowDownloadImage}, #{item.allowSoftwareUse}, #{item.allowFusion},
|
||||
#{item.allowCommercialUse}, #{item.allowUsage}, #{item.isExclusiveModel},
|
||||
#{item.sampleImagePaths}, #{item.hideImageGenInfo}, #{item.auditStatus},
|
||||
#{item.auditText}, #{item.delFlag}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.WorkFlowMapper">
|
||||
|
||||
<update id="updateWorkFlow">
|
||||
UPDATE work_flow
|
||||
<set>
|
||||
<if test="workflowName != null and workflowName != ''">
|
||||
workflow_name = #{workflowName},
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
category = #{category},
|
||||
</if>
|
||||
<if test="theme != null and theme != ''">
|
||||
theme = #{theme},
|
||||
</if>
|
||||
<if test="style != null and style != ''">
|
||||
style = #{style},
|
||||
</if>
|
||||
<if test="functions != null and functions != ''">
|
||||
functions = #{functions},
|
||||
</if>
|
||||
<if test="activityParticipation != null">
|
||||
activity_participation = #{activityParticipation}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
audit_status = #{auditStatus}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.WorkFlowVersionMapper">
|
||||
|
||||
|
||||
<insert id="addWorkFlowVersion">
|
||||
INSERT INTO work_flow_version (version_name,version_description,file_path,image_paths,hide_gen_info,del_flag,
|
||||
audit_status,work_flow_id,basic_model,jurisdiction,itself_use,subordinate_use,
|
||||
download,fuse,sell,fuse_sell,exclusive,file_name)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.versionName}, #{item.versionDescription}, #{item.filePath}, #{item.imagePaths},#{item.hideGenInfo},
|
||||
0,#{item.auditStatus},#{workFlow.id},#{item.basicModel},#{item.jurisdiction},#{item.itselfUse},
|
||||
#{item.subordinateUse},#{item.download},#{item.fuse},#{item.sell},#{item.fuseSell},#{item.exclusive},#{item.fileName})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updateWorkFlowVersion">
|
||||
-- update work_flow_version
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue