You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
poetize/poetize-server/src/main/java/com/ld/poetry/controller/QiniuController.java

35 lines
1.0 KiB

package com.ld.poetry.controller;
import com.ld.poetry.config.LoginCheck;
import com.ld.poetry.config.PoetryResult;
import com.ld.poetry.config.SaveCheck;
import com.ld.poetry.utils.storage.QiniuUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 七牛云
*/
@RestController
@RequestMapping("/qiniu")
@ConditionalOnBean(QiniuUtil.class)
public class QiniuController {
@Autowired
private QiniuUtil qiniuUtil;
/**
* 获取覆盖凭证,用于七牛云
*/
@GetMapping("/getUpToken")
@LoginCheck
@SaveCheck
public PoetryResult<String> getUpToken(@RequestParam(value = "key") String key) {
return PoetryResult.success(qiniuUtil.getToken(key));
}
}