parent
163567897e
commit
f4622f09ba
@ -1,44 +1,78 @@
|
||||
package com.dsideal.resource.Res.Controller;
|
||||
|
||||
import com.dsideal.resource.Interceptor.EmptyInterface;
|
||||
import com.dsideal.resource.Interceptor.JwtCheckInterface;
|
||||
import com.dsideal.resource.Util.MinioUtils;
|
||||
import com.dsideal.resource.Util.RetKit;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.ext.interceptor.GET;
|
||||
import io.minio.errors.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class ResourceController extends Controller {
|
||||
|
||||
/**
|
||||
* 获取Minio的上传签名
|
||||
*
|
||||
* @param extension 上传的扩展名
|
||||
*/
|
||||
@Before(GET.class)
|
||||
@JwtCheckInterface({})
|
||||
@EmptyInterface({"objectName"})
|
||||
public void getSignature(String extension) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
|
||||
if (!extension.equals(extension.toLowerCase())) {
|
||||
renderJson(RetKit.renderFail("扩展名必须为小写"));
|
||||
return;
|
||||
}
|
||||
//生成一个guid+扩展名的key
|
||||
String objectName = java.util.UUID.randomUUID() + "." + extension;
|
||||
String signature = MinioUtils.getSignature(objectName);
|
||||
renderJson(RetKit.renderSuccess(signature));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增资源
|
||||
*/
|
||||
public void addResource(){
|
||||
public void addResource() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源
|
||||
*
|
||||
* @param resource_id_int 资源id
|
||||
*/
|
||||
public void deleteResource(int resource_id_int){
|
||||
public void deleteResource(int resource_id_int) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资源
|
||||
*
|
||||
* @param resource_id_int 资源id
|
||||
*/
|
||||
public void updateResource(int resource_id_int){
|
||||
public void updateResource(int resource_id_int) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资源
|
||||
*
|
||||
* @param resource_id_int 资源id
|
||||
*/
|
||||
public void queryResource(int resource_id_int){
|
||||
public void queryResource(int resource_id_int) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有资源
|
||||
*/
|
||||
public void queryAllResource(){
|
||||
public void queryAllResource() {
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue