diff --git a/mcwl-admin/Dockerfile b/mcwl-admin/Dockerfile new file mode 100644 index 0000000..aed499f --- /dev/null +++ b/mcwl-admin/Dockerfile @@ -0,0 +1,24 @@ +# docker一定要有openjdk8的镜像如果没有执行以下命令 +# docker pull openjdk:8 +FROM openjdk:8 +# 作者信息 +#LABEL authors="${发布人} <${邮箱}>" + +# 创建我的工作目录(手动创建文件夹,此步骤省略) +#RUN mkdir /root/yun + +# 暴露端口(和服务端口保持一致) +EXPOSE 8080 + +# 创建着陆点(创建文件夹) 后续路径和这个路径一致 +WORKDIR "/root/mcwl" + + +# 复制新的运行程序 ./代表的是相对路径 读取的着陆点 +COPY ./ncwl-ai.jar /root/mcwl/ncwl-ai.jar + +# 挂载出去日志目录 项目名不加jar +VOLUME /root/mcwl/logs/ncwl-ai + +# 运行你的jar 运行的是你copy出来的新的jar包 +CMD ["java", "-jar", "/root/mcwl/ncwl-ai.jar"] diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/FileEncryptDecryptUtil.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/FileEncryptDecryptUtil.java new file mode 100644 index 0000000..e4ca01f --- /dev/null +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/FileEncryptDecryptUtil.java @@ -0,0 +1,75 @@ +package com.mcwl.web.controller.resource; + +import javax.crypto.Cipher; +import javax.crypto.CipherInputStream; +import javax.crypto.CipherOutputStream; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.security.AlgorithmParameters; +import java.util.Base64; + +/** + * @author DaiZibo + * @date 2025/1/25 + * @apiNote + */ + +public class FileEncryptDecryptUtil { + + private static final String ALGORITHM = "AES/CBC/PKCS5Padding"; + private static final String TRANSFORMATION = "AES"; + private static final String KEY = "iamkeyeeddzasdfs"; // 实际应用中应使用更安全的密钥生成方式 + private static byte[] SAVED_IV; // 静态变量存储IV,确保解密时可访问 + + public static void main(String[] args) throws Exception { +// 示例:加密文件 + encryptFile("D:\\ASE\\encryption\\测试文件1.txt", "D:\\ASE\\decode\\加密测试文件1.txt"); +// 解密文件 +// decryptFile("D:\\Temp\\test\\test\\caaaa", "D:\\Temp\\test\\test\\日报.xlsx"); + } + + public static void encryptFile(String sourcePath, String encryptedPath) throws Exception { + Cipher cipher = initCipher(Cipher.ENCRYPT_MODE); + try (FileInputStream fis = new FileInputStream(sourcePath); + FileOutputStream fos = new FileOutputStream(encryptedPath); + CipherOutputStream cos = new CipherOutputStream(fos, cipher)) { + byte[] buffer = new byte[1024]; + int read; + while ((read = fis.read(buffer)) != -1) { + cos.write(buffer, 0, read); + } + } + System.out.println("加密完成"); + } + + public static void decryptFile(String encryptedPath, String decryptedPath) throws Exception { + Cipher cipher = initCipher(Cipher.DECRYPT_MODE); + try (FileInputStream fis = new FileInputStream(encryptedPath); + CipherInputStream cis = new CipherInputStream(fis, cipher); + FileOutputStream fos = new FileOutputStream(decryptedPath)) { + byte[] buffer = new byte[1024]; + int read; + while ((read = cis.read(buffer)) != -1) { + fos.write(buffer, 0, read); + } + } + System.out.println("解密完成"); + } + + private static Cipher initCipher(int mode) throws Exception { + Cipher cipher = Cipher.getInstance(ALGORITHM); + SecretKey secretKey = new SecretKeySpec(KEY.getBytes(), TRANSFORMATION); + if (mode == Cipher.ENCRYPT_MODE && SAVED_IV == null) { + cipher.init(mode, secretKey); + AlgorithmParameters params = cipher.getParameters(); + SAVED_IV = params.getParameterSpec(IvParameterSpec.class).getIV(); + System.out.println("Generated IV: " + Base64.getEncoder().encodeToString(SAVED_IV)); + } else { + cipher.init(mode, secretKey, new IvParameterSpec(SAVED_IV)); + } + return cipher; + } +} diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java index 3631b1a..1a3ecb5 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java @@ -1,6 +1,5 @@ package com.mcwl.web.controller.resource; -import cn.hutool.core.bean.BeanUtil; import com.mcwl.common.annotation.Anonymous; import com.mcwl.common.core.controller.BaseController; import com.mcwl.common.core.domain.AjaxResult; @@ -24,7 +23,8 @@ import java.util.List; /** - *模型 + * 模型 + * * @Author:ChenYan * @Project:McWl * @Package:com.mcwl.web.controller.resource @@ -150,39 +150,39 @@ public class MallProductController extends BaseController { modelService.removeById(modelVersion.getId()); return AjaxResult.success(); } + /** * 查询模型详情 + * * @param id * @return */ @ApiOperation(value = "查询模型详情") @GetMapping("/selectModelById") - public AjaxResult selectModelById(@RequestParam Long id){ + public AjaxResult selectModelById(@RequestParam Long id) { return modelService.selectModelById(id); } -/** + /** * 设置模型置顶状态 + * * @param id * @param isTop * @return */ @ApiOperation(value = "设置模型置顶状态") - @PutMapping("/{id}/top") - public ResponseEntity setModelTop(@PathVariable Long id, @RequestParam boolean isTop) { - try { - modelService.setModelTop(id, isTop); - return ResponseEntity.ok().build(); - } catch (Exception e) { - return ResponseEntity.badRequest().build(); - } + @GetMapping("/{id}/top") + public AjaxResult setModelTop(@PathVariable Long id, @RequestParam boolean isTop) { + modelService.setModelTop(id, isTop); + return AjaxResult.success(); } /** * 获取置顶的模型列表 + * * @return */ @ApiOperation(value = "获取置顶的模型列表") @@ -193,11 +193,6 @@ public class MallProductController extends BaseController { } - - - - - /** * 我的发布-模型列表 */ @@ -256,6 +251,4 @@ public class MallProductController extends BaseController { } - - } 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 d3d3bb6..ce75038 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 @@ -3,12 +3,9 @@ package com.mcwl.web.controller.resource; import cn.hutool.core.bean.BeanUtil; import com.mcwl.common.annotation.RepeatSubmit; 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.resource.domain.ModelImage; -import com.mcwl.resource.domain.ModelProduct; import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.dto.ModelImageRes; import com.mcwl.resource.domain.vo.ModelImageVo; @@ -23,7 +20,6 @@ import org.springframework.web.bind.annotation.*; import javax.validation.constraints.NotNull; import java.util.List; -import java.util.Objects; /** * 图片 @@ -107,24 +103,22 @@ public class ModelImageController { /** * 设置图片置顶 + * * @param id * @param isTop * @return */ @ApiOperation(value = "设置图片置顶状态") - @PutMapping("/{id}/top") - public ResponseEntity setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) { - try { - modelImageLikeService.setModelImageTop(id, isTop); - return ResponseEntity.ok().build(); - } catch (Exception e) { - return ResponseEntity.badRequest().build(); - } + @GetMapping("/{id}/top") + public AjaxResult setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) { + modelImageLikeService.setModelImageTop(id, isTop); + return AjaxResult.success(); } /** * 获取置顶的图片列表 + * * @return */ @ApiOperation(value = "获取置顶的图片列表") diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java index 3262471..54609f6 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java @@ -2,7 +2,6 @@ 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.ModelProduct; import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.request.RequestWorkFlow; import com.mcwl.resource.domain.vo.PageVo; @@ -44,14 +43,12 @@ public class WorkFlowController extends BaseController { * @return */ @ApiOperation(value = "设置工作流的置顶状态") - @PutMapping("/{id}/top") - public ResponseEntity setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) { - try { + @GetMapping("/{id}/top") + public AjaxResult setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) { + workFlowService.setworkFlowTop(id, isTop); - return ResponseEntity.ok().build(); - } catch (Exception e) { - return ResponseEntity.badRequest().build(); - } + return AjaxResult.success(); + } @@ -168,9 +165,9 @@ public class WorkFlowController extends BaseController { */ @ApiOperation(value = "查询工作流详情") @GetMapping("/selectWorkFlowById") - public AjaxResult selectWorkFlowById(@RequestParam Long id){ + public AjaxResult selectWorkFlowById(@RequestParam Long id,Integer type){ - return workFlowService.selectWorkFlowById(id); + return workFlowService.selectWorkFlowById(id,type); } } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelImageVo.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelImageVo.java index 95048d3..e38c465 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelImageVo.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelImageVo.java @@ -92,6 +92,15 @@ public class ModelImageVo { @ApiModelProperty(value = "点赞数") private Integer likeNum; + /** + * 是否置顶 + */ + @ApiModelProperty(value = "是否置顶") + private Integer isTop; - + /** + * 审核状态 + */ + @ApiModelProperty(value = "审核状态") + private Integer auditStatus; } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelVo.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelVo.java index 8eab518..6d13a6b 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelVo.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/ModelVo.java @@ -48,6 +48,15 @@ public class ModelVo { @ApiModelProperty(value = "下载数") private Integer numbers; + /** + * 是否置顶 + */ + @ApiModelProperty(value = "是否置顶") + private Integer isTop; - + /** + * 审核状态 + */ + @ApiModelProperty(value = "审核状态") + private Integer auditStatus; } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/WorkFlowVo.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/WorkFlowVo.java index 5d6b984..aebfc87 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/WorkFlowVo.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/vo/WorkFlowVo.java @@ -48,6 +48,16 @@ public class WorkFlowVo { @ApiModelProperty(value = "下载数") private Integer downloadNumber; + /** + * 是否置顶 + */ + @ApiModelProperty(value = "是否置顶") + private Integer isTop; + /** + * 审核状态 + */ + @ApiModelProperty(value = "审核状态") + private Integer auditStatus; } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/mapper/WorkFlowMapper.java b/mcwl-resource/src/main/java/com/mcwl/resource/mapper/WorkFlowMapper.java index 89f4a27..73441bc 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/mapper/WorkFlowMapper.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/mapper/WorkFlowMapper.java @@ -3,6 +3,7 @@ package com.mcwl.resource.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mcwl.resource.domain.WorkFlow; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -21,6 +22,6 @@ public interface WorkFlowMapper extends BaseMapper { List fetchWorkFlowSortedByTopStatus(); - void setworkFlowTop(Long id, int i); + void setworkFlowTop(@Param("id") Long id, @Param("i") int i); } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java index 0a9475f..1545f62 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java @@ -26,7 +26,7 @@ public interface WorkFlowService extends IService { AjaxResult selectWorkFlow(PageVo pageVo); - AjaxResult selectWorkFlowById(Long id); + AjaxResult selectWorkFlowById(Long id,Integer type); TableDataInfo listByPage(ModelImagePageRes imagePageRes); diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java index 0e549cc..4ce3bca 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java @@ -1,12 +1,10 @@ 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.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.AjaxResult; import com.mcwl.common.core.domain.entity.SysUser; import com.mcwl.common.core.page.PageDomain; import com.mcwl.common.core.page.TableDataInfo; @@ -15,13 +13,10 @@ import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.StringUtils; import com.mcwl.resource.domain.ModelImage; import com.mcwl.resource.domain.ModelImageLike; -import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.vo.ModelImageLikeVo; -import com.mcwl.resource.domain.vo.ModelImageVo; import com.mcwl.resource.mapper.ModelImageLikeMapper; import com.mcwl.resource.mapper.ModelImageMapper; import com.mcwl.resource.service.ModelImageLikeService; -import com.mcwl.resource.service.ModelImageService; import com.mcwl.system.service.ISysUserService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -81,7 +76,7 @@ public class ModelImageLikeServiceImpl extends ServiceImpl orderItemList = new ArrayList<>(); + orderItemList.add(OrderItem.desc("is_top")); + orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn())); + page.addOrder(orderItemList); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.eq(imagePageRes.getStatus() != null, ModelImage::getStatus, imagePageRes.getStatus()) + lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0, ModelImage::getStatus, imagePageRes.getStatus()) .eq(ModelImage::getUserId, SecurityUtils.getUserId()) .ge(imagePageRes.getStartTime() != null, ModelImage::getCreateTime, imagePageRes.getStartTime()) .le(imagePageRes.getEndTime() != null, ModelImage::getCreateTime, imagePageRes.getEndTime()); diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowLikeServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowLikeServiceImpl.java index e8d7a85..58b92d1 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowLikeServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowLikeServiceImpl.java @@ -11,11 +11,8 @@ import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.exception.ServiceException; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.StringUtils; -import com.mcwl.resource.domain.ModelLike; -import com.mcwl.resource.domain.ModelProduct; import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.WorkFlowLike; -import com.mcwl.resource.domain.vo.ModelLikeVo; import com.mcwl.resource.domain.vo.WorkFlowLikeVo; import com.mcwl.resource.mapper.WorkFlowLikeMapper; import com.mcwl.resource.mapper.WorkFlowMapper; @@ -108,6 +105,9 @@ public class WorkFlowLikeServiceImpl extends ServiceImpl i } @Override - public AjaxResult selectWorkFlowById(Long id) { + public AjaxResult selectWorkFlowById(Long id,Integer type) { //查询详情 WorkFlow workFlow = flowMapper.selectById(id); - - //翻译属性 垂类 - if (StringUtils.isNotEmpty(workFlow.getCategory())) { - workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY, workFlow.getCategory())); + if (workFlow == null){ + return AjaxResult.error("工作流不存在"); } - //主体 - if (StringUtils.isNotEmpty(workFlow.getTheme())) { - ArrayList strings = new ArrayList<>(); - String[] split = workFlow.getTheme().split(","); - for (String s : split) { - if (s != "") { - strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_THEME, workFlow.getCategory())); - } + if (type == 1){ + + String category = workFlow.getCategory(); + //翻译属性 垂类 + if (StringUtils.isNotEmpty(category)) { + workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY, workFlow.getCategory())); } - workFlow.setThemeList(strings); - } - //风格 - if (StringUtils.isNotEmpty(workFlow.getStyle())) { - ArrayList strings = new ArrayList<>(); - String[] split = workFlow.getTheme().split(","); - for (String s : split) { - if (s != "") { - strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE, workFlow.getStyle())); + //主体 + String theme = workFlow.getTheme(); + if (StringUtils.isNotEmpty(theme)) { + ArrayList strings = new ArrayList<>(); + String[] split = workFlow.getTheme().split(","); + for (String s : split) { + if (s != "") { + strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_THEME, workFlow.getCategory())); + } } + workFlow.setThemeList(strings); } - workFlow.setStyleList(strings); - } - //功能 - if (StringUtils.isNotEmpty(workFlow.getFunctions())) { - workFlow.setCategory(DictInit.getDictValue(DictConstants.WORK_FLOW_FUNCTIONS, workFlow.getFunctions())); - } + //风格 + if (StringUtils.isNotEmpty(workFlow.getStyle())) { + ArrayList strings = new ArrayList<>(); + String[] split = workFlow.getStyle().split(","); + for (String s : split) { + if (s != "") { + strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE, workFlow.getStyle())); + } + } + workFlow.setStyleList(strings); + } + + //功能 + if (StringUtils.isNotEmpty(workFlow.getFunctions())) { + workFlow.setCategory(DictInit.getDictValue(DictConstants.WORK_FLOW_FUNCTIONS, workFlow.getFunctions())); + } + + //活动 + if (StringUtils.isNotEmpty(workFlow.getActivityParticipation())) { + workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName()); + } - //活动 - if (StringUtils.isNotEmpty(workFlow.getActivityParticipation())) { - workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName()); } return AjaxResult.success(workFlow); @@ -349,14 +357,18 @@ public class WorkFlowServiceImpl extends ServiceImpl i imagePageRes.setOrderByColumn("create_time"); } // 设置排序 - OrderItem orderItem = OrderItem.desc(imagePageRes.getOrderByColumn()); - page.addOrder(orderItem); + // 设置排序 + List orderItemList = new ArrayList<>(); + orderItemList.add(OrderItem.desc("is_top")); + orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn())); + page.addOrder(orderItemList); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.eq(imagePageRes.getStatus() != null, WorkFlow::getAuditStatus, imagePageRes.getStatus()) + lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0 , WorkFlow::getAuditStatus, imagePageRes.getStatus()) .eq(WorkFlow::getUserId, SecurityUtils.getUserId()) .ge(imagePageRes.getStartTime() != null, WorkFlow::getCreateTime, imagePageRes.getStartTime()) - .le(imagePageRes.getEndTime() != null, WorkFlow::getCreateTime, imagePageRes.getEndTime()); + .le(imagePageRes.getEndTime() != null, WorkFlow::getCreateTime, imagePageRes.getEndTime()) + .eq(WorkFlow::getDelFlag,0); baseMapper.selectPage(page, lqw); // 获取分页数据 @@ -388,7 +400,7 @@ public class WorkFlowServiceImpl extends ServiceImpl i @Override public void setworkFlowTop(Long id, boolean isTop) { - flowMapper.setworkFlowTop(id,isTop?0:1); + flowMapper.setworkFlowTop(id,isTop?1:0); } @Override diff --git a/mcwl-resource/src/main/resources/mapper/resource/ModelImageMapper.xml b/mcwl-resource/src/main/resources/mapper/resource/ModelImageMapper.xml index 103d1a7..911fc07 100644 --- a/mcwl-resource/src/main/resources/mapper/resource/ModelImageMapper.xml +++ b/mcwl-resource/src/main/resources/mapper/resource/ModelImageMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - UPDATE model_image SET is_top = #{isTop} WHERE image_id = #{imageId} + UPDATE model_image SET is_top = #{isTop} WHERE id = #{id} SELECT is_top FROM model_image ORDER BY is_top DESC; diff --git a/mcwl-resource/src/main/resources/mapper/resource/WorkFlowMapper.xml b/mcwl-resource/src/main/resources/mapper/resource/WorkFlowMapper.xml index a025369..ed6fd35 100644 --- a/mcwl-resource/src/main/resources/mapper/resource/WorkFlowMapper.xml +++ b/mcwl-resource/src/main/resources/mapper/resource/WorkFlowMapper.xml @@ -32,7 +32,7 @@ WHERE id = #{id} - UPDATE work_flow SET is_top = #{isTop} WHERE id = #{id} + UPDATE work_flow SET is_top = #{i} WHERE id = #{id}