mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-21 01:10:39 +08:00
添加腾讯云COS生成预授权URL功能
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user