parent
b24626ee9b
commit
158066bc9d
|
@ -0,0 +1,67 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.obs.services.ObsClient;
|
||||||
|
import com.obs.services.exception.ObsException;
|
||||||
|
import com.obs.services.model.DownloadFileRequest;
|
||||||
|
import com.obs.services.model.DownloadFileResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/3/8
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RequestMapping("/downFile")
|
||||||
|
@RestController
|
||||||
|
public class DownloadFile {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ObsClient obsClient;
|
||||||
|
|
||||||
|
@Value("${huawei.obs.bucketName}")
|
||||||
|
private String bucketName;
|
||||||
|
|
||||||
|
@GetMapping("/down")
|
||||||
|
public R down(@RequestParam String objectKey, String path) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
DownloadFileRequest request = new DownloadFileRequest(bucketName, objectKey);
|
||||||
|
// 设置下载对象的本地文件路径
|
||||||
|
request.setDownloadFile(path);
|
||||||
|
// 设置分段下载时的最大并发数
|
||||||
|
request.setTaskNum(10);
|
||||||
|
// 设置分段大小为10MB
|
||||||
|
request.setPartSize(10 * 1024 * 1024);
|
||||||
|
// 开启断点续传模式
|
||||||
|
request.setEnableCheckpoint(true);
|
||||||
|
// 进行断点续传下载
|
||||||
|
DownloadFileResult result = obsClient.downloadFile(request);
|
||||||
|
System.out.println("downloadFile successfully");
|
||||||
|
System.out.println("Etag:" + result.getObjectMetadata().getEtag());
|
||||||
|
} catch (ObsException e) {
|
||||||
|
System.out.println("downloadFile failed");
|
||||||
|
// 请求失败,打印http状态码
|
||||||
|
System.out.println("HTTP Code:" + e.getResponseCode());
|
||||||
|
// 请求失败,打印服务端错误码
|
||||||
|
System.out.println("Error Code:" + e.getErrorCode());
|
||||||
|
// 请求失败,打印详细错误信息
|
||||||
|
System.out.println("Error Message:" + e.getErrorMessage());
|
||||||
|
// 请求失败,打印请求id
|
||||||
|
System.out.println("Request ID:" + e.getErrorRequestId());
|
||||||
|
System.out.println("Host ID:" + e.getErrorHostId());
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("downloadFile failed");
|
||||||
|
// 其他异常信息打印
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,7 @@ import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 官方app
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:mcwl-ai
|
* @Project:mcwl-ai
|
||||||
* @Package:com.mcwl.web.controller.communityCenter
|
* @Package:com.mcwl.web.controller.communityCenter
|
||||||
|
@ -36,7 +37,7 @@ public class PlaFormController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 平台官方联系列表
|
* 平台官方联系列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "模型列表")
|
@ApiOperation(value = "官方连接方式二维码列表")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public List<PlatForm> list(@RequestBody PlatForm platForm) {
|
public List<PlatForm> list(@RequestBody PlatForm platForm) {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.utils.obs.ObsUtils;
|
import com.mcwl.common.utils.obs.ObsUtils;
|
||||||
import com.mcwl.resource.service.impl.FileServiceImpl;
|
import com.mcwl.resource.service.impl.FileServiceImpl;
|
||||||
import com.mcwl.web.controller.common.OssUtil;
|
import com.mcwl.web.controller.common.OssUtil;
|
||||||
|
@ -251,4 +252,15 @@ public class FileController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验文件内容时候重复
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "校验文件hash是否重复")
|
||||||
|
@GetMapping("/selectHash")
|
||||||
|
public R selectHash(String hashCode,Integer type){
|
||||||
|
|
||||||
|
return fileService.selectHash(hashCode,type);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,11 +143,11 @@ mall:
|
||||||
alipayCertPath: cert/dev/alipayPublicCert.crt
|
alipayCertPath: cert/dev/alipayPublicCert.crt
|
||||||
# 沙箱支付宝根证书路径
|
# 沙箱支付宝根证书路径
|
||||||
alipayRootCertPath: cert/dev/alipayRootCert.crt
|
alipayRootCertPath: cert/dev/alipayRootCert.crt
|
||||||
notifyUrl: https://53a65908.r27.cpolar.top/ali/pay/notify
|
notifyUrl: http://1.13.246.108:8080/ali/pay/notify
|
||||||
# 沙箱支付宝网关
|
# 沙箱支付宝网关
|
||||||
gatewayUrl: https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
gatewayUrl: https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
||||||
# 绑定回调
|
# 绑定回调
|
||||||
bindUrl: https://4b0ca615.r27.cpolar.top/ali/pay/callback
|
bindUrl: http://1.13.246.108:8080/ali/pay/callback
|
||||||
|
|
||||||
huawei:
|
huawei:
|
||||||
obs:
|
obs:
|
||||||
|
|
|
@ -158,7 +158,8 @@ public class SecurityConfig {
|
||||||
"/WorkFlowVersion/selectVersionByWorkId",
|
"/WorkFlowVersion/selectVersionByWorkId",
|
||||||
"/memberLevel/list",
|
"/memberLevel/list",
|
||||||
"/memberLevel/getMemberBenefitList",
|
"/memberLevel/getMemberBenefitList",
|
||||||
"/attention/selectAttentionList"
|
"/attention/selectAttentionList",
|
||||||
|
"/downFile/down"
|
||||||
).permitAll()
|
).permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
|
|
|
@ -201,4 +201,10 @@ public class ModelVersion extends BaseEntity {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer isCollect = 1;
|
private Integer isCollect = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件hash
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件hash")
|
||||||
|
private String fileHash;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,4 +104,10 @@ public class WorkFlowVersion {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "是否收藏")
|
@ApiModelProperty(value = "是否收藏")
|
||||||
private Integer isCollect =1;
|
private Integer isCollect =1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件hash
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件hash")
|
||||||
|
private String fileHash;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,6 @@ public interface ModelVersionMapper extends BaseMapper<ModelVersion> {
|
||||||
|
|
||||||
void addModelVersion (ModelVersion modelVersion);
|
void addModelVersion (ModelVersion modelVersion);
|
||||||
|
|
||||||
|
ModelVersion selectByHash(@Param("hashCode") String hashCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,5 +13,5 @@ import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ReportMapper extends BaseMapper<Report> {
|
public interface ReportMapper extends BaseMapper<Report> {
|
||||||
void updateStatus(@Param("productId") Long productId, @Param("type") Integer type);
|
void updateStatus(@Param("productId") Long productId, @Param("type") Integer type, @Param("status") Integer status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,6 @@ public interface WorkFlowVersionMapper extends BaseMapper<WorkFlowVersion> {
|
||||||
|
|
||||||
WorkFlowVersion selectByFileName(@Param("name") String name);
|
WorkFlowVersion selectByFileName(@Param("name") String name);
|
||||||
|
|
||||||
|
WorkFlowVersion selectByHash(@Param("hashCode") String hashCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.mcwl.resource.service;
|
package com.mcwl.resource.service;
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DaiZibo
|
* @author DaiZibo
|
||||||
|
@ -12,4 +13,6 @@ public interface FileService {
|
||||||
AjaxResult selectFileName(String name, String type);
|
AjaxResult selectFileName(String name, String type);
|
||||||
|
|
||||||
AjaxResult selectFile(String name, String type);
|
AjaxResult selectFile(String name, String type);
|
||||||
|
|
||||||
|
R selectHash(String hashCode, Integer type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.core.domain.R;
|
||||||
import com.mcwl.common.utils.StringUtils;
|
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;
|
||||||
|
@ -85,4 +86,27 @@ public class FileServiceImpl implements FileService {
|
||||||
return AjaxResult.error("type不合法");
|
return AjaxResult.error("type不合法");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R selectHash(String hashCode, Integer type) {
|
||||||
|
|
||||||
|
//0模型 1工作流
|
||||||
|
if (type == 0){
|
||||||
|
|
||||||
|
ModelVersion modelVersion = versionMapper.selectByHash(hashCode);
|
||||||
|
if (modelVersion != null){
|
||||||
|
|
||||||
|
return R.ok(0);
|
||||||
|
}
|
||||||
|
return R.ok(1);
|
||||||
|
}else {
|
||||||
|
|
||||||
|
WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByHash(hashCode);
|
||||||
|
if (workFlowVersion != null){
|
||||||
|
|
||||||
|
return R.ok(0);
|
||||||
|
}
|
||||||
|
return R.ok(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.mcwl.common.constant.Constants;
|
|
||||||
import com.mcwl.common.constant.DictConstants;
|
import com.mcwl.common.constant.DictConstants;
|
||||||
import com.mcwl.common.constant.HttpStatus;
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.R;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
@ -18,7 +17,6 @@ import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.common.utils.StringUtils;
|
import com.mcwl.common.utils.StringUtils;
|
||||||
import com.mcwl.common.utils.baidu.BaiduCensor;
|
import com.mcwl.common.utils.baidu.BaiduCensor;
|
||||||
import com.mcwl.common.utils.http.HttpUtils;
|
|
||||||
import com.mcwl.resource.domain.ModelProduct;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.ModelVersion;
|
import com.mcwl.resource.domain.ModelVersion;
|
||||||
import com.mcwl.resource.domain.SysUserAttention;
|
import com.mcwl.resource.domain.SysUserAttention;
|
||||||
|
@ -42,7 +40,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**模型 业务实现层
|
/**模型 业务实现层
|
||||||
|
@ -301,7 +302,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
private void audit(RequestModel requestModel) {
|
private void audit(RequestModel requestModel) {
|
||||||
|
|
||||||
// 执行审核操作
|
// 执行审核操作
|
||||||
// threadPoolTaskExecutor.submit(() -> {
|
threadPoolTaskExecutor.submit(() -> {
|
||||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||||
|
|
||||||
if (modelProduct != null){
|
if (modelProduct != null){
|
||||||
|
@ -437,41 +438,41 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
String key = modelVersion.getObjectKey();
|
String key = modelVersion.getObjectKey();
|
||||||
|
|
||||||
//审核成功,查看时候加密,拉取文件到ui
|
//审核成功,查看时候加密,拉取文件到ui
|
||||||
if (modelVersion.getIsEncrypt() == 1){
|
// if (modelVersion.getIsEncrypt() == 1){
|
||||||
|
//
|
||||||
|
// //调用加密/创建参数
|
||||||
|
// HashMap<String, String> param = new HashMap<>();
|
||||||
|
// param.put("object_key",modelVersion.getObjectKey());
|
||||||
|
// param.put("model_id",modelVersion.getId()+"");
|
||||||
|
// param.put("file_type", Constants.MODEL);
|
||||||
|
//
|
||||||
|
// String s = HttpUtils.pythonPost("http://1.13.246.108:9090/encrypt_and_upload", param);
|
||||||
|
//
|
||||||
|
// JSONObject jsonObject = JSONObject.parseObject(s);
|
||||||
|
// JSONObject data = JSONObject.parseObject(jsonObject.getString("data"));
|
||||||
|
// String objectKey = data.getString("objectKey");
|
||||||
|
// String path = data.getString("path");
|
||||||
|
// String secretKey = data.getString("secret_key");
|
||||||
|
//
|
||||||
|
// key = objectKey;
|
||||||
|
//
|
||||||
|
// ModelVersion modelVersion1 = ModelVersion.builder().id(modelVersion.getId())
|
||||||
|
// .encryptionObjectKey(objectKey)
|
||||||
|
// .encryptionFilePath(path)
|
||||||
|
// .keyRate(secretKey).build();
|
||||||
|
// //更新加密后数据
|
||||||
|
// modelVersionMapper.updateById(modelVersion1);
|
||||||
|
// }
|
||||||
|
|
||||||
//调用加密/创建参数
|
// //调用ui拉取文件接口
|
||||||
HashMap<String, String> param = new HashMap<>();
|
// log.info("开始拉取文件...");
|
||||||
param.put("object_key",modelVersion.getObjectKey());
|
// HashMap<String, String> hashMap = new HashMap<>();
|
||||||
param.put("model_id",modelVersion.getId()+"");
|
// hashMap.put("objectKey",key);
|
||||||
param.put("file_type", Constants.MODEL);
|
// log.info("整体版本数据:{}",modelVersion);
|
||||||
|
// log.info("拉取文件数据:{}",key);
|
||||||
String s = HttpUtils.pythonPost("http://1.13.246.108:9090/encrypt_and_upload", param);
|
// hashMap.put("type",DictInit.getDictValue(DictConstants.MODEL_TYPE,modelProduct.getModelType()+""));
|
||||||
|
// String s = HttpUtils.pythonPost("http://1.13.246.108:8188/api/experiment/models/upload", hashMap);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
// log.info("文件拉取结果:{}",s);
|
||||||
JSONObject data = JSONObject.parseObject(jsonObject.getString("data"));
|
|
||||||
String objectKey = data.getString("objectKey");
|
|
||||||
String path = data.getString("path");
|
|
||||||
String secretKey = data.getString("secret_key");
|
|
||||||
|
|
||||||
key = objectKey;
|
|
||||||
|
|
||||||
ModelVersion modelVersion1 = ModelVersion.builder().id(modelVersion.getId())
|
|
||||||
.encryptionObjectKey(objectKey)
|
|
||||||
.encryptionFilePath(path)
|
|
||||||
.keyRate(secretKey).build();
|
|
||||||
//更新加密后数据
|
|
||||||
modelVersionMapper.updateById(modelVersion1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//调用ui拉取文件接口
|
|
||||||
log.info("开始拉取文件...");
|
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("objectKey",key);
|
|
||||||
log.info("整体版本数据:{}",modelVersion);
|
|
||||||
log.info("拉取文件数据:{}",key);
|
|
||||||
hashMap.put("type",DictInit.getDictValue(DictConstants.MODEL_TYPE,modelProduct.getModelType()+""));
|
|
||||||
String s = HttpUtils.pythonPost("http://1.13.246.108:8188/api/experiment/models/upload", hashMap);
|
|
||||||
log.info("文件拉取结果:{}",s);
|
|
||||||
|
|
||||||
//修改为合格
|
//修改为合格
|
||||||
modelProduct.setAuditText("");
|
modelProduct.setAuditText("");
|
||||||
|
@ -481,7 +482,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// });
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class ReportServiceImpl implements ReportService {
|
||||||
public void updateStatus(Long productId,Integer type,Integer status,String text) {
|
public void updateStatus(Long productId,Integer type,Integer status,String text) {
|
||||||
|
|
||||||
//修改所有同类举报申请
|
//修改所有同类举报申请
|
||||||
reportMapper.updateStatus(productId,type);
|
reportMapper.updateStatus(productId,type,status);
|
||||||
if (status == 2){
|
if (status == 2){
|
||||||
|
|
||||||
//修改状态回退
|
//修改状态回退
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
model_id,version_name,version_description,model_version_type, file_path,file_name, trigger_words, sampling, high, vae, cfg,
|
model_id,version_name,version_description,model_version_type, file_path,file_name, trigger_words, sampling, high, vae, cfg,
|
||||||
is_free, is_public, is_encrypt, is_online_use, allow_download_image,
|
is_free, is_public, is_encrypt, is_online_use, allow_download_image,
|
||||||
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
|
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
|
||||||
is_exclusive_model, sample_image_paths, hide_image_gen_info, del_flag,file_size
|
is_exclusive_model, sample_image_paths, hide_image_gen_info, del_flag,file_size,file_hash
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
(
|
(
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
#{isFree}, #{isPublic}, #{isEncrypt}, #{isOnlineUse},
|
#{isFree}, #{isPublic}, #{isEncrypt}, #{isOnlineUse},
|
||||||
#{allowDownloadImage}, #{allowSoftwareUse}, #{allowFusion},
|
#{allowDownloadImage}, #{allowSoftwareUse}, #{allowFusion},
|
||||||
#{allowCommercialUse}, #{allowUsage}, #{isExclusiveModel},
|
#{allowCommercialUse}, #{allowUsage}, #{isExclusiveModel},
|
||||||
#{sampleImagePaths}, #{hideImageGenInfo},'0',#{fileSize}
|
#{sampleImagePaths}, #{hideImageGenInfo},'0',#{fileSize},#{fileHash}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -51,5 +51,8 @@
|
||||||
<select id="selectByFileName" resultType="com.mcwl.resource.domain.ModelVersion">
|
<select id="selectByFileName" resultType="com.mcwl.resource.domain.ModelVersion">
|
||||||
select key_rate,is_encrypt from model_version where file_name = #{name}
|
select key_rate,is_encrypt from model_version where file_name = #{name}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByHash" resultType="com.mcwl.resource.domain.ModelVersion">
|
||||||
|
select * from model_version where file_hash = #{hashCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<update id="updateStatus">
|
<update id="updateStatus">
|
||||||
UPDATE report
|
UPDATE report
|
||||||
SET status = 0
|
SET status = #{status}
|
||||||
WHERE product_id = #{productId} and type = #{type}
|
WHERE product_id = #{productId} and type = #{type}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
|
|
||||||
<insert id="addWorkFlowVersion">
|
<insert id="addWorkFlowVersion">
|
||||||
INSERT INTO work_flow_version (version_name,version_description,file_path,image_paths,hide_gen_info,del_flag,
|
INSERT INTO work_flow_version (version_name,version_description,file_path,image_paths,hide_gen_info,del_flag,
|
||||||
work_flow_id,file_name,file_size)
|
work_flow_id,file_name,file_size,file_hash)
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="list" item="item" separator=",">
|
||||||
(#{item.versionName}, #{item.versionDescription}, #{item.filePath}, #{item.imagePaths},#{item.hideGenInfo},
|
(#{item.versionName}, #{item.versionDescription}, #{item.filePath}, #{item.imagePaths},#{item.hideGenInfo},
|
||||||
0,#{workFlow.id},#{item.fileName},#{item.fileSize})
|
0,#{workFlow.id},#{item.fileName},#{item.fileSize},#{item.fileHash})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateWorkFlowVersion">
|
<update id="updateWorkFlowVersion">
|
||||||
|
@ -26,4 +26,8 @@
|
||||||
<select id="selectByFileName" resultType="com.mcwl.resource.domain.WorkFlowVersion">
|
<select id="selectByFileName" resultType="com.mcwl.resource.domain.WorkFlowVersion">
|
||||||
select key_rate,is_encrypt from work_flow_version where file_name = #{name}
|
select key_rate,is_encrypt from work_flow_version where file_name = #{name}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByHash" resultType="com.mcwl.resource.domain.WorkFlowVersion">
|
||||||
|
select * from work_flow_version where file_hash = #{hashCode}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue