fix(ai): 修复产品点模块文件列表接口路径错误
- 修正add.html中fileList接口路径为productPoint/fileList/parent
- 修正info.html中fileList接口路径为productPoint/fileList/parent
- 优化文件上传控制器中初始片段大小计算逻辑
- 初始片段大小改为文件大小的10分之一与15MB中的较小值
- 添加详细的日志记录以跟踪初始片段返回情况
| | |
| | | } else { |
| | | log.debug("收到完整文件请求,返回初始片段"); |
| | | |
| | | // 没有Range头,返回初始片段(约30秒内容) |
| | | long actualEnd = Math.min(MAX_INITIAL_SEGMENT, fileSize - 1); |
| | | // 没有Range头,返回文件大小的10分之一和15MB中较小的那个 |
| | | long oneTenthSize = fileSize / 10; |
| | | // 计算10分之一和15MB的较小值 |
| | | long maxInitialSize = Math.min(oneTenthSize, MAX_INITIAL_SEGMENT); |
| | | // 确保至少返回1字节,且不超过文件大小 |
| | | long actualEnd = Math.min(Math.max(maxInitialSize, 1), fileSize - 1); |
| | | log.debug("返回初始片段: {} bytes (10分之一大小: {} bytes, 15MB限制: {} bytes, 文件总大小: {} bytes)", |
| | | actualEnd + 1, oneTenthSize, MAX_INITIAL_SEGMENT, fileSize); |
| | | |
| | | // 设置响应状态和头部信息 |
| | | response.setStatus(HttpStatus.PARTIAL_CONTENT.value()); // 使用206状态码,因为只返回部分内容 |
| | |
| | | }); |
| | | |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/fileList/parent', function (data) { |
| | | $.get(ctx + 'admin/productPoint/fileList/parent', function (data) { |
| | | for (var k in data) |
| | | { |
| | | $(".video-add-productCategory").append("<option value='" + data[k].fileName + "'>" + data[k].fileName + "</option>"); |
| | |
| | | }); |
| | | |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/fileList/parent', function (data) { |
| | | $.get(ctx + 'admin/productPoint/fileList/parent', function (data) { |
| | | for (var k in data) |
| | | { |
| | | $(".video-add-productCategory").append("<option value='" + data[k].fileName + "'>" + data[k].fileName + "</option>"); |