优化启动报错
This commit is contained in:
parent
5b220e323e
commit
b098007a13
|
|
@ -1,9 +1,6 @@
|
||||||
package com.ruoyi.web.controller.tool;
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.ruoyi.framework.web.service.AliyunOSSClient;
|
|
||||||
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.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数配置 服务层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public interface AliyunOssClientService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 获取Policy签名等信息
|
||||||
|
*
|
||||||
|
* @param dir 存储在bucket的目录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject getPostObjectPolicy(String dir);
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
package com.ruoyi.framework.web.service;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.aliyun.oss.OSSClient;
|
import com.aliyun.oss.OSSClient;
|
||||||
import com.aliyun.oss.common.utils.BinaryUtil;
|
import com.aliyun.oss.common.utils.BinaryUtil;
|
||||||
import com.aliyun.oss.model.MatchMode;
|
import com.aliyun.oss.model.MatchMode;
|
||||||
import com.aliyun.oss.model.PolicyConditions;
|
import com.aliyun.oss.model.PolicyConditions;
|
||||||
|
import com.ruoyi.framework.web.service.ConfigService;
|
||||||
|
import com.ruoyi.system.service.AliyunOssClientService;
|
||||||
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -14,7 +17,7 @@ import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AliyunOSSClient {
|
public class AliyunOSSClient implements AliyunOssClientService {
|
||||||
|
|
||||||
private String endpoint;
|
private String endpoint;
|
||||||
private String accessKeyId;
|
private String accessKeyId;
|
||||||
|
|
@ -23,13 +26,13 @@ public class AliyunOSSClient {
|
||||||
|
|
||||||
private OSSClient ossClient;
|
private OSSClient ossClient;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
public AliyunOSSClient() {
|
public AliyunOSSClient() {
|
||||||
// this.endpoint = configService.getKey("ali.oss.endpoint");
|
// this.endpoint = configService.selectConfigByKey( "ali.oss.endpoint");
|
||||||
// this.accessKeyId = configService.getKey("ali.oss.accessKeyId");
|
// this.accessKeyId = configService.selectConfigByKey("ali.oss.accessKeyId");
|
||||||
// this.accessKeySecret = configService.getKey("ali.oss.accessKeySecret");
|
// this.accessKeySecret = configService.selectConfigByKey("ali.oss.accessKeySecret");
|
||||||
// this.bucket = configService.getKey("ali.oss.bucket");
|
// this.bucket = configService.selectConfigByKey("ali.oss.bucket");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
Loading…
Reference in New Issue