Compare commits
No commits in common. "a2090eecb854edd86f3410783cb50b50aeebe685" and "ef826ce25ff45c3fee19f4ea3ba0468935a7d70c" have entirely different histories.
a2090eecb8
...
ef826ce25f
|
@ -289,7 +289,6 @@ public class FileController {
|
|||
@PostMapping("/updateFileData")
|
||||
public R updateFileData(@RequestBody RequestFile requestFile){
|
||||
|
||||
log.info("加密后获取到的数据:{}",requestFile);
|
||||
return fileService.updateFileData(requestFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,20 +2,20 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.R;
|
||||
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.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.response.ResponseModelProduct;
|
||||
import com.mcwl.resource.domain.request.RequestModel;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.resource.service.*;
|
||||
import com.mcwl.system.service.impl.SysUserServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -95,24 +95,6 @@ public class MallProductController extends BaseController {
|
|||
@ApiOperation(value = "修改模型")
|
||||
@PostMapping("/update")
|
||||
public AjaxResult updateModel(@RequestBody RequestModel requestModel) {
|
||||
|
||||
|
||||
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
||||
|
||||
//校验名字
|
||||
ModelVersion modelVersion1 = modelVersionMapper.selectByFileName(modelVersion.getFileName());
|
||||
if (modelVersion1 != null) {
|
||||
|
||||
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
|
||||
}
|
||||
//校验hash
|
||||
ModelVersion modelVersion2 = modelVersionMapper.selectByHash(modelVersion.getFileHash());
|
||||
if (modelVersion2 != null){
|
||||
|
||||
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
|
||||
}
|
||||
}
|
||||
|
||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
|
|
@ -90,8 +90,8 @@ public class ModelImageController {
|
|||
@ApiOperation(value = "图片发布")
|
||||
@PostMapping("/publish")
|
||||
public R<Object> publish(@Valid @RequestBody ModelImageRes modelImageRes) {
|
||||
|
||||
return modelImageService.publish(modelImageRes);
|
||||
modelImageService.publish(modelImageRes);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,16 +2,13 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
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.R;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.domain.dto.AddRequestWorkFlow;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.response.ResponseWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||
import com.mcwl.resource.service.WorkFlowService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -43,9 +40,6 @@ public class WorkFlowController extends BaseController {
|
|||
@Autowired
|
||||
private WorkFlowService workFlowService;
|
||||
|
||||
@Autowired
|
||||
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 设置工作流的置顶状态
|
||||
|
@ -100,23 +94,6 @@ public class WorkFlowController extends BaseController {
|
|||
@PostMapping("/updateWorkFlow")
|
||||
public R<Object> updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow) {
|
||||
|
||||
|
||||
for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) {
|
||||
|
||||
//校验名字
|
||||
WorkFlowVersion workFlowVersion1 = workFlowVersionMapper.selectByFileName(workFlowVersion.getFileName());
|
||||
if (workFlowVersion1 != null) {
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
|
||||
}
|
||||
//校验hash
|
||||
WorkFlowVersion workFlowVersion2 = workFlowVersionMapper.selectByHash(workFlowVersion.getFileHash());
|
||||
if (workFlowVersion2 != null){
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
|
||||
}
|
||||
}
|
||||
|
||||
workFlowService.updateWorkFlow(requestWorkFlow);
|
||||
|
||||
return R.ok();
|
||||
|
|
|
@ -178,9 +178,3 @@ mqtt:
|
|||
max-reconnect-attempts: 5
|
||||
clean-session: true
|
||||
|
||||
#用户头像与背景
|
||||
mcwl:
|
||||
encryptUrl: http://113.45.190.154:9090/encrypt_and_upload
|
||||
user:
|
||||
avatar: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/7/53/3f5cc1d7-b062-4a22-9f7e-d442bc6dcf42.png
|
||||
backgroundImg: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/8/2/c8387681-8138-4a29-a1c9-4a143da34c5a.png
|
||||
|
|
|
@ -13,6 +13,10 @@ mcwl:
|
|||
# 验证码类型 math 数字计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
user:
|
||||
avatar: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/7/53/3f5cc1d7-b062-4a22-9f7e-d442bc6dcf42.png
|
||||
backgroundImg: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/8/2/c8387681-8138-4a29-a1c9-4a143da34c5a.png
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
package com.mcwl.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Builder;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
|
@ -41,7 +42,7 @@ public class BaseEntity implements Serializable
|
|||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
package com.mcwl.memberCenter.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -43,14 +48,14 @@ public class PromotionVo {
|
|||
* 活动开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "活动开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "活动结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,6 @@ public class ConsumeVo {
|
|||
|
||||
// 消费时间
|
||||
@ApiModelProperty(value = "消费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date consumeDate;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class OrderTrade extends BaseEntity {
|
|||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date orderTime;
|
||||
/**
|
||||
|
|
|
@ -33,7 +33,7 @@ public class WalletConsumeRecordVo {
|
|||
* 消费时间
|
||||
*/
|
||||
@ApiModelProperty(value = "消费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderTime;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class WalletRechargeRecordVo {
|
|||
* 下单时间
|
||||
*/
|
||||
@ApiModelProperty(value = "下单时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderTime;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.mcwl.quartz.util.CronUtils;
|
|||
|
||||
/**
|
||||
* 定时任务调度表 sys_job
|
||||
*
|
||||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
public class SysJob extends BaseEntity
|
||||
|
@ -110,7 +110,7 @@ public class SysJob extends BaseEntity
|
|||
this.cronExpression = cronExpression;
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date getNextValidTime()
|
||||
{
|
||||
if (StringUtils.isNotEmpty(cronExpression))
|
||||
|
|
|
@ -155,6 +155,7 @@ public class ModelVersion extends BaseEntity {
|
|||
/**
|
||||
* 文件解密秘钥
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "文件解密秘钥")
|
||||
private String keyRate;
|
||||
|
||||
|
|
|
@ -66,6 +66,18 @@ public class AddWorkFlowVersion {
|
|||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
// /**
|
||||
// * 审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)
|
||||
// */
|
||||
// @ApiModelProperty("审核状态(0全部状态 1已发布-公开 2已发布-仅自己可见 3审核中 4审核未通过)")
|
||||
// private Integer auditStatus = 3;
|
||||
//
|
||||
// /**
|
||||
// * 审核失败原因
|
||||
// */
|
||||
// @ApiModelProperty("审核失败原因")
|
||||
// private String auditText;
|
||||
|
||||
/**
|
||||
* 模型ID
|
||||
*/
|
||||
|
@ -77,20 +89,4 @@ public class AddWorkFlowVersion {
|
|||
*/
|
||||
@ApiModelProperty("文件名字")
|
||||
private String fileName;
|
||||
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@ApiModelProperty("文件名字")
|
||||
private String fileSize;
|
||||
|
||||
/**
|
||||
* 文件标识
|
||||
*/
|
||||
@ApiModelProperty("文件标识")
|
||||
private String objectKey;
|
||||
|
||||
@ApiModelProperty("文件hash")
|
||||
private String fileHash;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,9 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -33,14 +35,14 @@ public class ModelImagePageRes extends PageDomain {
|
|||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class AdviceVo {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class AttentionAdviceVo {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class CommentAdviceVo {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ 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 com.mcwl.resource.domain.dto.AddWorkFlowVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -19,7 +18,7 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface WorkFlowVersionMapper extends BaseMapper<WorkFlowVersion> {
|
||||
|
||||
void addWorkFlowVersion(@Param("workFlow") WorkFlow workFlow, @Param("list") List<AddWorkFlowVersion> workFlowVersionList);
|
||||
void addWorkFlowVersion(@Param("workFlow") WorkFlow workFlow, @Param("list") List<WorkFlowVersion> workFlowVersionList);
|
||||
|
||||
void updateWorkFlowVersion(WorkFlowVersion workFlowVersion);
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
|
@ -22,7 +21,7 @@ public interface ModelImageService extends IService<ModelImage> {
|
|||
* 发布
|
||||
* @param modelImageRes 发布对象
|
||||
*/
|
||||
R publish(ModelImageRes modelImageRes);
|
||||
void publish(ModelImageRes modelImageRes);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
|
|
@ -8,7 +8,6 @@ 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.R;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
|
@ -65,15 +64,7 @@ public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelIm
|
|||
}
|
||||
|
||||
@Override
|
||||
public R publish(ModelImageRes modelImageRes) {
|
||||
|
||||
//校验是否实名
|
||||
SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId());
|
||||
if (sysUser.getName() == null){
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布");
|
||||
}
|
||||
|
||||
public void publish(ModelImageRes modelImageRes) {
|
||||
|
||||
ModelImage modelImage = new ModelImage();
|
||||
BeanUtil.copyProperties(modelImageRes, modelImage);
|
||||
|
@ -82,8 +73,6 @@ public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelIm
|
|||
modelImageMapper.insert(modelImage);
|
||||
|
||||
audit(modelImage);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
private void audit(ModelImage modelImage) {
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mcwl.common.constant.Constants;
|
||||
import com.mcwl.common.constant.DictConstants;
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
|
@ -19,7 +18,6 @@ import com.mcwl.common.core.page.TableDataInfo;
|
|||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.common.utils.baidu.BaiduCensor;
|
||||
import com.mcwl.common.utils.http.HttpUtils;
|
||||
import com.mcwl.resource.domain.*;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.request.RequestModel;
|
||||
|
@ -37,11 +35,13 @@ import com.mcwl.system.init.DictInit;
|
|||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**模型 业务实现层
|
||||
|
@ -78,10 +78,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
@Autowired
|
||||
private CollectServiceImpl collectService;
|
||||
|
||||
@Value("${mcwl.encryptUrl}")
|
||||
private String encryptUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 设置模型置顶状态
|
||||
*
|
||||
|
@ -270,33 +266,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
|
||||
@Override
|
||||
public R<String> addModel(RequestModel requestModel) {
|
||||
|
||||
//校验是否实名
|
||||
SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId());
|
||||
if (sysUser.getName() == null){
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布");
|
||||
}
|
||||
|
||||
|
||||
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
||||
|
||||
//校验名字
|
||||
ModelVersion modelVersion1 = modelVersionMapper.selectByFileName(modelVersion.getFileName());
|
||||
if (modelVersion1 != null) {
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
|
||||
}
|
||||
//校验hash
|
||||
ModelVersion modelVersion2 = modelVersionMapper.selectByHash(modelVersion.getFileHash());
|
||||
if (modelVersion2 != null){
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//获取封面图
|
||||
String filePath = requestModel.getModelVersionList().get(0).getSampleImagePaths();
|
||||
String[] split = filePath.split(",");
|
||||
|
@ -502,18 +471,16 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
String key = modelVersion.getObjectKey();
|
||||
|
||||
//审核成功,查看时候加密,拉取文件到ui
|
||||
if (modelVersion.getIsEncrypt() == 1){
|
||||
|
||||
//调用加密/创建参数
|
||||
HashMap<String, String> param = new HashMap<>();
|
||||
param.put("objectKey",modelVersion.getObjectKey());
|
||||
param.put("id",modelVersion.getId()+"");
|
||||
param.put("fileType", Constants.MODEL);
|
||||
|
||||
String s = HttpUtils.pythonPost(encryptUrl, param);
|
||||
|
||||
log.info("调用加密服务结果:{}",s);
|
||||
|
||||
// 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");
|
||||
|
@ -528,7 +495,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
// .keyRate(secretKey).build();
|
||||
// //更新加密后数据
|
||||
// modelVersionMapper.updateById(modelVersion1);
|
||||
}
|
||||
// }
|
||||
|
||||
// //调用ui拉取文件接口
|
||||
// log.info("开始拉取文件...");
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.mcwl.common.utils.StringUtils;
|
|||
import com.mcwl.common.utils.baidu.BaiduCensor;
|
||||
import com.mcwl.resource.domain.*;
|
||||
import com.mcwl.resource.domain.dto.AddRequestWorkFlow;
|
||||
import com.mcwl.resource.domain.dto.AddWorkFlowVersion;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.response.ResponseWorkFlow;
|
||||
|
@ -80,30 +79,6 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
@Override
|
||||
public R<Object> addWorkFlow(AddRequestWorkFlow addRequestWorkFlo) {
|
||||
|
||||
//校验是否实名
|
||||
SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId());
|
||||
if (sysUser.getName() == null){
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布");
|
||||
}
|
||||
|
||||
|
||||
for (AddWorkFlowVersion addWorkFlowVersion : addRequestWorkFlo.getWorkFlowVersionList()) {
|
||||
|
||||
//校验名字
|
||||
WorkFlowVersion workFlowVersion1 = workFlowVersionMapper.selectByFileName(addWorkFlowVersion.getFileName());
|
||||
if (workFlowVersion1 != null) {
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
|
||||
}
|
||||
//校验hash
|
||||
WorkFlowVersion workFlowVersion2 = workFlowVersionMapper.selectByHash(addWorkFlowVersion.getFileHash());
|
||||
if (workFlowVersion2 != null){
|
||||
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
|
||||
}
|
||||
}
|
||||
|
||||
RequestWorkFlow requestWorkFlow = new RequestWorkFlow();
|
||||
BeanUtil.copyProperties(addRequestWorkFlo, requestWorkFlow);
|
||||
// RequestWorkFlow requestWorkFlow = JSON.parseObject(JSON.toJSONString(addRequestWorkFlo), RequestWorkFlow.class);
|
||||
|
@ -115,7 +90,6 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
WorkFlow workFlow = requestWorkFlow.getWorkFlow();
|
||||
workFlow.setUserId(SecurityUtils.getUserId());
|
||||
workFlow.setCoverPath(split[0]);
|
||||
|
||||
workFlow.setCreateTime(new Date());
|
||||
//添加模型表数据
|
||||
flowMapper.insert(workFlow);
|
||||
|
@ -123,7 +97,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
log.info("获取到的入参:{}", requestWorkFlow.getWorkFlow());
|
||||
|
||||
//批量添加版本
|
||||
workFlowVersionMapper.addWorkFlowVersion(requestWorkFlow.getWorkFlow(), addRequestWorkFlo.getWorkFlowVersionList());
|
||||
workFlowVersionMapper.addWorkFlowVersion(requestWorkFlow.getWorkFlow(), requestWorkFlow.getWorkFlowVersionList());
|
||||
|
||||
audit(requestWorkFlow);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
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,
|
||||
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
|
||||
is_exclusive_model, sample_image_paths, hide_image_gen_info, del_flag,file_size,file_hash,object_key
|
||||
is_exclusive_model, sample_image_paths, hide_image_gen_info, del_flag,file_size,file_hash
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
|
@ -17,7 +17,7 @@
|
|||
#{isFree}, #{isPublic}, #{isEncrypt}, #{isOnlineUse},
|
||||
#{allowDownloadImage}, #{allowSoftwareUse}, #{allowFusion},
|
||||
#{allowCommercialUse}, #{allowUsage}, #{isExclusiveModel},
|
||||
#{sampleImagePaths}, #{hideImageGenInfo},'0',#{fileSize},#{fileHash},#{objectKey}
|
||||
#{sampleImagePaths}, #{hideImageGenInfo},'0',#{fileSize},#{fileHash}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SysLogininfor extends BaseEntity
|
|||
private String msg;
|
||||
|
||||
/** 访问时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginTime;
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
package com.mcwl.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mcwl.common.annotation.Excel;
|
||||
import com.mcwl.common.annotation.Excel.ColumnType;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 操作日志记录表 oper_log
|
||||
*
|
||||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
public class SysOperLog extends BaseEntity
|
||||
|
@ -80,7 +79,7 @@ public class SysOperLog extends BaseEntity
|
|||
private String errorMsg;
|
||||
|
||||
/** 操作时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date operTime;
|
||||
|
||||
|
|
Loading…
Reference in New Issue