Commit c0d63ae5 authored by Quxl's avatar Quxl

x

parent 916efed5
......@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -16,6 +17,7 @@ import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.OtherUploadService;
import com.egolm.film.bean.Fc_film_upload;
import com.egolm.film.util.FilmContrants;
import com.egolm.film.util.OSSUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -180,4 +182,30 @@ public class FilmUploadController {
otherUploadService.updateFail(film_no, number, errorMessage);
return Rjx.jsonOk();
}
@Value("${aliyun.sts.accessKeyId}")
private String accessKeyId;
@Value("${aliyun.sts.accessKeySecret}")
private String accessKeySecret;
@Value("${aliyun.oss.endpoint}")
private String endpoint;
@Value("${aliyun.oss.bucket}")
private String bucket;
@ResponseBody
@Transactional
@PostMapping("getOssMvPath")
@ApiOperation("获取OSS图片访问路径")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="film_no", value="影片NO"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="number", value="集数"),
@ApiImplicitParam(paramType="query", dataType="String", required=false, name="errorMessage", value="失败原因"),
})
public Object getOssMvPath(String tv_poster){
OSSUtils ossUtil = new OSSUtils(endpoint, accessKeyId, accessKeySecret);
String ossPicPath = ossUtil.urlSign(bucket, tv_poster, 60*24);
ossUtil.closeOssClient();
return Rjx.jsonOk().setData(ossPicPath);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment