Skip to content

Latest commit

 

History

History
47 lines (44 loc) · 1.12 KB

README.md

File metadata and controls

47 lines (44 loc) · 1.12 KB

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");