|
@@ -2,6 +2,8 @@ package com.cicv.oss.config.adapter.controller;
|
|
|
|
|
|
import com.cicv.oss.config.adapter.entity.OssConfigInfo;
|
|
|
import com.cicv.oss.config.infra.config.OssConfig;
|
|
|
+import com.cicv.oss.config.infra.config.PjiOssConfig;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -14,6 +16,8 @@ import javax.annotation.Resource;
|
|
|
public class OssController {
|
|
|
@Resource
|
|
|
private OssConfig ossConfig;
|
|
|
+ @Resource
|
|
|
+ private PjiOssConfig pjiOssConfig;
|
|
|
|
|
|
/**
|
|
|
* endpoint: "http://open-bucket.oss.icvdc.com"
|
|
@@ -38,5 +42,28 @@ public class OssController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * endpoint: "http://open-bucket.oss.icvdc.com"
|
|
|
+ * access-key-id:
|
|
|
+ * access-key-secret:
|
|
|
+ * bucket-name:
|
|
|
+ *
|
|
|
+ * @param token
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/pji")
|
|
|
+ public OssConfigInfo pji(@RequestParam("token") String token) {
|
|
|
+ if ("nXonLUcMtGcrQqqKiyygIwyVbvizE0wD".equals(token)) {
|
|
|
+ return new OssConfigInfo(
|
|
|
+ pjiOssConfig.getEndpoint(),
|
|
|
+ pjiOssConfig.getAccessKeyId(),
|
|
|
+ pjiOssConfig.getAccessKeySecret(),
|
|
|
+ pjiOssConfig.getBucketName()
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|