1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-21 01:10:39 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

添加腾讯云COS生成预授权URL功能

This commit is contained in:
2022-03-13 00:00:38 +08:00
parent 5f5c318da7
commit 1b78102d61
5 changed files with 154 additions and 0 deletions

View File

@@ -1,10 +1,13 @@
package plus.bookshelf;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import plus.bookshelf.Common.Enum.plus.bookshelf.TencentCloud.COS.CosProperties;
import plus.bookshelf.Common.TencentCloud.COS.GeneratePresignatureUrl;
/**
* Hello world!
@@ -25,4 +28,13 @@ public class App {
public String Home() {
return "首页";
}
@Autowired
CosProperties cosProperties;
@RequestMapping("/cos")
public String cos() {
GeneratePresignatureUrl generatePresignatureUrl = new GeneratePresignatureUrl(cosProperties);
return generatePresignatureUrl.getUrl("mydemo.jpg", 1);
}
}