|
|
@@ -3,12 +3,17 @@ package com.fdkankan.contro.service.impl;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
+import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.contro.service.IBuildService;
|
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
|
+import com.fdkankan.redis.constant.RedisLockKey;
|
|
|
+import com.fdkankan.redis.util.RedisLockUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
@@ -19,6 +24,9 @@ import java.util.Objects;
|
|
|
@Service
|
|
|
public class BuildServiceImpl implements IBuildService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisLockUtil lockUtil;
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, String> getTypeString(String cameraType, String algorithm, String resolution, JSONObject fdageData){
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
@@ -111,4 +119,13 @@ public class BuildServiceImpl implements IBuildService {
|
|
|
}
|
|
|
ComputerUtil.createProjectAndDataFile(message.getPath(), message.getSceneNum(), dataMap.get("splitType"), dataMap.get("skyboxType"),null, dataExtras);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void lockUnicode(String unicode, int lockTime) {
|
|
|
+ String lockKey = "notice:build:unicode:" + unicode;
|
|
|
+ boolean lock = lockUtil.lock(lockKey, lockTime);
|
|
|
+ if(!lock){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_2001);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|