培训课件
This commit is contained in:
parent
c887bc5e9c
commit
5b220e323e
2
pom.xml
2
pom.xml
|
|
@ -49,7 +49,7 @@
|
||||||
<module>ruoyi-exam</module>
|
<module>ruoyi-exam</module>
|
||||||
<module>ruoyi-vip</module>
|
<module>ruoyi-vip</module>
|
||||||
<module>ruoyi-train</module>
|
<module>ruoyi-train</module>
|
||||||
<module>tuoyi-test</module>
|
<!--<module>tuoyi-test</module>-->
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,17 +58,17 @@
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 培训系统-->
|
<!-- 培训系统-->
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>com.ruoyi</groupId>-->
|
|
||||||
<!--<artifactId>ruoyi-train</artifactId>-->
|
|
||||||
<!--<version>${ruoyi.version}</version>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<!-- 测试生成的代码-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>tuoyi-test</artifactId>
|
<artifactId>ruoyi-train</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 测试生成的代码-->
|
||||||
|
<!--<dependency>-->
|
||||||
|
<!--<groupId>com.ruoyi</groupId>-->
|
||||||
|
<!--<artifactId>tuoyi-test</artifactId>-->
|
||||||
|
<!--<version>${ruoyi.version}</version>-->
|
||||||
|
<!--</dependency>-->
|
||||||
<!-- 定时任务
|
<!-- 定时任务
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.ruoyi.web.controller.tool;
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
import com.ruoyi.framework.web.service.AliyunOSSClient;
|
import com.ruoyi.framework.web.service.AliyunOSSClient;
|
||||||
import net.sf.json.JSONObject;
|
|
||||||
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.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
@ -12,11 +12,12 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequestMapping("aliyun/oss")
|
@RequestMapping("aliyun/oss")
|
||||||
public class AliyunOSSRest {
|
public class AliyunOSSRest {
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private AliyunOSSClient aliyunOSSClient ;
|
// private AliyunOSSClient aliyunOSSClient ;
|
||||||
@GetMapping("policy.json")
|
@GetMapping("policy.json")
|
||||||
public JSONObject getPolicy() {
|
public JSONObject getPolicy() {
|
||||||
String dir = String.valueOf(System.currentTimeMillis());
|
String dir = String.valueOf(System.currentTimeMillis());
|
||||||
return aliyunOSSClient .getPostObjectPolicy(dir);
|
// return aliyunOSSClient .getPostObjectPolicy(dir);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.ruoyi.framework.web.service;
|
package com.ruoyi.framework.web.service;
|
||||||
|
|
||||||
|
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 net.sf.json.JSONObject;
|
|
||||||
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;
|
||||||
|
|
@ -26,17 +26,17 @@ public class AliyunOSSClient {
|
||||||
private ConfigService configService;
|
private ConfigService configService;
|
||||||
|
|
||||||
public AliyunOSSClient() {
|
public AliyunOSSClient() {
|
||||||
this.endpoint = configService.getKey("ali.oss.endpoint");
|
// this.endpoint = configService.getKey("ali.oss.endpoint");
|
||||||
this.accessKeyId = configService.getKey("ali.oss.accessKeyId");
|
// this.accessKeyId = configService.getKey("ali.oss.accessKeyId");
|
||||||
this.accessKeySecret = configService.getKey("ali.oss.accessKeySecret");
|
// this.accessKeySecret = configService.getKey("ali.oss.accessKeySecret");
|
||||||
this.bucket = configService.getKey("ali.oss.bucket");
|
// this.bucket = configService.getKey("ali.oss.bucket");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
void init() {
|
void init() {
|
||||||
if (this.ossClient == null) {
|
// if (this.ossClient == null) {
|
||||||
this.ossClient = new OSSClient(this.endpoint, this.accessKeyId, this.accessKeySecret);
|
// this.ossClient = new OSSClient(this.endpoint, this.accessKeyId, this.accessKeySecret);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue