|
|
|
@ -7,17 +7,20 @@ import cn.hutool.json.JSONUtil;
@@ -7,17 +7,20 @@ import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
|
import com.cloud.kicc.common.core.constant.StringPool; |
|
|
|
|
import com.cloud.kicc.common.security.annotation.Inner; |
|
|
|
|
import com.cloud.kicc.system.api.bigscreen.dto.VisualProxyDto; |
|
|
|
|
import com.cloud.kicc.system.api.entity.OssFile; |
|
|
|
|
import com.cloud.kicc.system.bigscreen.util.RequestUtil; |
|
|
|
|
import com.cloud.kicc.system.service.FileService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
import springfox.documentation.annotations.ApiIgnore; |
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -29,13 +32,15 @@ import java.util.Map;
@@ -29,13 +32,15 @@ import java.util.Map;
|
|
|
|
|
* @since: 2023/7/3 |
|
|
|
|
*/ |
|
|
|
|
@Slf4j |
|
|
|
|
@ApiIgnore |
|
|
|
|
@RestController |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@RequestMapping(AppConstants.APP_BIGSCREEN + "/visual") |
|
|
|
|
@ApiIgnore |
|
|
|
|
@Api(value = "接口代理", tags = "接口代理") |
|
|
|
|
public class VisualProxyController { |
|
|
|
|
|
|
|
|
|
private final FileService fileService; |
|
|
|
|
|
|
|
|
|
@RequestMapping("/proxy") |
|
|
|
|
@ApiOperation(value = "接口代理", notes = "接口代理") |
|
|
|
|
public R proxy(@RequestBody VisualProxyDto proxy) { |
|
|
|
@ -67,4 +72,18 @@ public class VisualProxyController {
@@ -67,4 +72,18 @@ public class VisualProxyController {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Inner(false) |
|
|
|
|
@PostMapping("/put-file") |
|
|
|
|
public R upload(@RequestPart("file") MultipartFile file) {; |
|
|
|
|
OssFile ossFile = fileService.uploadFile(file, null); |
|
|
|
|
ossFile.setAvailablePath(String.format("/visual/getFile/%s/%s", ossFile.getBucketName(), ossFile.getFileName())); |
|
|
|
|
return R.ok(ossFile); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Inner(false) |
|
|
|
|
@GetMapping("/getFile/{bucket}/{fileName}") |
|
|
|
|
public void getById(@PathVariable String bucket, @PathVariable String fileName, HttpServletResponse response) { |
|
|
|
|
fileService.getFile(bucket, fileName, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|