|
@@ -7,6 +7,7 @@ import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -19,6 +20,9 @@ import java.util.List;
|
|
@RequestMapping(value = "/oss/file")
|
|
@RequestMapping(value = "/oss/file")
|
|
public class OssFileController {
|
|
public class OssFileController {
|
|
|
|
|
|
|
|
+ @Value("${config.accessory.aliyun.aliyunUrl}")
|
|
|
|
+ private String aliyunUrl;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private OssService ossService;
|
|
private OssService ossService;
|
|
|
|
|
|
@@ -34,6 +38,19 @@ public class OssFileController {
|
|
ossService.deleteMsgByFileName(url);
|
|
ossService.deleteMsgByFileName(url);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/deleteMsgById")
|
|
|
|
+ @ApiOperation(value = "根据id删除数据")
|
|
|
|
+ public void deleteMsgById(@RequestParam String id) {
|
|
|
|
+ ossService.deleteMsgById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/getTemporaryUrl")
|
|
|
|
+ @ApiOperation(value = "根据url获取临时文件地址")
|
|
|
|
+ public ResponseEntity<String> getTemporaryUrl(@RequestParam String url) {
|
|
|
|
+ String temporaryLookUrl = ossService.getFileTemporaryLookUrl(aliyunUrl + url);
|
|
|
|
+ return ResponseEntity.ok(temporaryLookUrl);
|
|
|
|
+ }
|
|
|
|
+
|
|
@GetMapping("/findFileList")
|
|
@GetMapping("/findFileList")
|
|
@ApiOperation(value = "查询数据")
|
|
@ApiOperation(value = "查询数据")
|
|
public ResponseEntity<List<WorkAttachment>> findFileList(@RequestParam("attachmentId") String attachmentId) {
|
|
public ResponseEntity<List<WorkAttachment>> findFileList(@RequestParam("attachmentId") String attachmentId) {
|