Skip to content

为对接 UCloud 提供快速 API 能力,包括UFile、USms 等

Notifications You must be signed in to change notification settings

developer-weapons/ucloud-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ucloud-spring-boot-starter

快速接入 UCloud Starter,如 usms,ufile等

Usage

  1. pom.xml 里面添加公开仓库
<repositories>
    <repository>
        <id>developer-weapons-repository</id>
        <url>https://raw.githubusercontent.com/developer-weapons/repository/master</url>
    </repository>
</repositories>
  1. 引入对应的包版本
<dependency>
    <groupId>com.github.developer.weapons</groupId>
    <artifactId>ucloud-spring-boot-starter</artifactId>
    <version>1.0.0</version>
</dependency>
  1. 配置必备属性
spring.usms.publicKey=pk
spring.usms.privateKey=pk
spring.usms.projectId=id
spring.usms.signContent=id
  1. 引入操作
@Autowired
private USMSService usmsService;

USMSMessage message = new USMSMessage();
message.setPhoneNumbers(Lists.newArrayList("PHONE"));
message.setTemplateId("ID");
message.setTemplateParams(Lists.newArrayList("PARAM"));
usmsService.send(message);

5 操作文件

@Autowired
private UFileService uFileService;
uFileService.upload("image url");
uFileService.upload(new FileInputStream(new File("")),"mimeType","fileName");

About

为对接 UCloud 提供快速 API 能力,包括UFile、USms 等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published