v1.0.82 #94
@@ -4,7 +4,6 @@ import com.imyeyu.api.annotation.RequireCorePermission;
|
||||
import com.imyeyu.api.bean.CorePermissionCode;
|
||||
import com.imyeyu.api.modules.system.service.FileContentService;
|
||||
import com.imyeyu.spring.annotation.IgnoreGlobalReturn;
|
||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -21,6 +20,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
/**
|
||||
* 文件内容接口
|
||||
*
|
||||
* <p>读取、下载与预览均输出二进制内容,浏览器会按 Range 对同一文件分多次请求,
|
||||
* 请求次数取决于播放和下载行为,因此不使用 {@code @RequestRateLimit} 按请求次数限流。
|
||||
*
|
||||
* @author 夜雨
|
||||
* @version 2026-11-24
|
||||
*/
|
||||
@@ -33,7 +35,6 @@ public class FileContentController {
|
||||
private final FileContentService contentService;
|
||||
|
||||
@Operation(summary = "读取文件", description = "以内联方式输出文件内容,支持 Range 与条件请求。")
|
||||
@RequestRateLimit
|
||||
@RequireCorePermission(CorePermissionCode.FILE_READ)
|
||||
@IgnoreGlobalReturn
|
||||
@GetMapping("/read/{*path}")
|
||||
@@ -45,7 +46,6 @@ public class FileContentController {
|
||||
}
|
||||
|
||||
@Operation(summary = "下载文件", description = "以附件方式输出文件内容,支持 Range 与 HEAD 请求。")
|
||||
@RequestRateLimit
|
||||
@RequireCorePermission(CorePermissionCode.FILE_READ)
|
||||
@IgnoreGlobalReturn
|
||||
@RequestMapping(value = "/download/{*path}", method = {RequestMethod.GET, RequestMethod.HEAD})
|
||||
|
||||
Reference in New Issue
Block a user