|
|
@@ -33,6 +33,8 @@ import com.fs.company.domain.CompanyMoneyLogs;
|
|
|
import com.fs.company.service.ICompanyMoneyLogsService;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
+import com.fs.course.domain.FsProjectAddressConfig;
|
|
|
+import com.fs.course.service.IFsProjectAddressConfigService;
|
|
|
import com.fs.course.service.IHuaweiVodService;
|
|
|
import com.fs.event.TemplateBean;
|
|
|
import com.fs.event.TemplateEvent;
|
|
|
@@ -78,6 +80,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import static com.fs.common.utils.SecurityUtils.getUserId;
|
|
|
|
|
|
@@ -134,6 +137,8 @@ public class CommonController {
|
|
|
|
|
|
@Autowired
|
|
|
private IQwAppContactWayService qwAppContactWayService;
|
|
|
+ @Autowired
|
|
|
+ private IFsProjectAddressConfigService projectAddressConfigService;
|
|
|
|
|
|
// @Autowired
|
|
|
// private RocketMQTemplate rocketMQTemplate;
|
|
|
@@ -636,4 +641,25 @@ public class CommonController {
|
|
|
return ResponseResult.ok(config.getIsOpenIM());
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("获取项目对应api请求域名地址")
|
|
|
+ @GetMapping("/getDomain")
|
|
|
+ public R getDomain(@RequestParam String projectCode) {
|
|
|
+ String redisKey = "projectCode:" + projectCode;
|
|
|
+ FsProjectAddressConfig config = redisCache.getCacheObject(redisKey);
|
|
|
+ if (Objects.isNull(config)) {
|
|
|
+ config = projectAddressConfigService.selectDomainByCode(projectCode);
|
|
|
+ redisCache.setCacheObject(redisKey, config, 5, TimeUnit.MINUTES);
|
|
|
+ }
|
|
|
+ String addressUrl = "";
|
|
|
+ String imgPath = "";
|
|
|
+ Integer sendType = null;
|
|
|
+
|
|
|
+ if (Objects.nonNull(config)) {
|
|
|
+ addressUrl = config.getAddressUrl();
|
|
|
+ imgPath = config.getBucketPath();
|
|
|
+ sendType = config.getSendType();
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok().put("addressUrl", addressUrl).put("imgpath", imgPath).put("sendType", sendType);
|
|
|
+ }
|
|
|
}
|