优化启动报错

This commit is contained in:
zhujunjieit 2018-12-20 21:29:16 +08:00
parent 5b220e323e
commit b098007a13
3 changed files with 30 additions and 10 deletions

View File

@ -1,9 +1,6 @@
package com.ruoyi.web.controller.tool;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@ -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);
}

View File

@ -1,10 +1,13 @@
package com.ruoyi.framework.web.service;
package com.ruoyi.system.service.impl;
import cn.hutool.json.JSONObject;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.model.MatchMode;
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.Value;
import org.springframework.stereotype.Service;
@ -14,7 +17,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
@Service
public class AliyunOSSClient {
public class AliyunOSSClient implements AliyunOssClientService {
private String endpoint;
private String accessKeyId;
@ -23,13 +26,13 @@ public class AliyunOSSClient {
private OSSClient ossClient;
@Autowired
private ConfigService configService;
private ISysConfigService configService;
public AliyunOSSClient() {
// this.endpoint = configService.getKey("ali.oss.endpoint");
// this.accessKeyId = configService.getKey("ali.oss.accessKeyId");
// this.accessKeySecret = configService.getKey("ali.oss.accessKeySecret");
// this.bucket = configService.getKey("ali.oss.bucket");
// this.endpoint = configService.selectConfigByKey( "ali.oss.endpoint");
// this.accessKeyId = configService.selectConfigByKey("ali.oss.accessKeyId");
// this.accessKeySecret = configService.selectConfigByKey("ali.oss.accessKeySecret");
// this.bucket = configService.selectConfigByKey("ali.oss.bucket");
}
@PostConstruct