|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- # file_transfer
-
-
-
- ## 项目信息结构
-
- | 名称 | 说明 | 例如 |
- |:-:|:-:|:-:|
- | name | 项目名 | 乳山 |
- | token | 项目唯一标识. 前端上传文件必须携带 | rushan |
- | remote_host | 远程项目地址. 前端或后端, 如果不能跨域则使用前端地址 | 如果使用后端地址: http://127.0.0.1:8080; 如果使用前端地址: http://127.0.0.1/api |
- | disk_path | 文件存储路径. application.yml中的nsgk.profile值, 路径分隔符必须使用正斜杠 | D:/NsgkSoft/files/nsgk/uploadPath |
- | disabled | 是否禁用. 1 或 0 | 1 则禁止上传 |
-
- ----------------------------------------------------------------------------------
- ## 通用接口
-
- * POST请求
- * 单文件字段是file
-
- > 仅上传
- >> `/open/file/upload/{项目唯一标识}/{存储目录}`
-
- > 上传并重定向
- >> `/open/file/uploadForward/{项目唯一标识}/{存储目录}`
- > * 必须参数: redirectUri 重定向地址, 必须是可以GET请求
- > * 其他参数: 将拼接到地址中
-
- > 上传并转发
- >> `/open/file/uploadForward/{项目唯一标识}/{存储目录}`
- > * 必须参数: requestUri 请求地址
- > * 必须参数: method 请求方法 默认get
- > * 必须参数: contentType 请求类型 get自动设为application/x-www-form-urlencoded, post默认application/json
- > * 必须参数: responseContentType 响应类型 默认application/json
- > * 其他参数: data 请求数据 String
-
- ----------------------------------------------------------------------------------
- ## 财务项目专用接口
-
- * POST请求
- * 单文件字段是file
-
- > 通用上传
- >> `/open/ruralCollectiveAssets/common/upload`
- > * 必须参数: token 项目唯一标识
- > * 必须参数: bizPath 存储目录, 默认upload
- > * 重定向到: `{remote_host}`/file/common/upload, 对应`{remote_host}`/common/upload
-
- > 附件上传
- >> `/open/ruralCollectiveAssets/common/attach`
- > * 必须参数: token 项目唯一标识
- > * 必须参数: bizPath 存储目录
- > * 必须参数: tableName 表名
- > * 必须参数: tableId 表ID
- > * 可选参数: fileType 额外类型
- > * 重定向到: `{remote_host}`/file/common/attach, 对应`{remote_host}`/common/attach
-
-
- > 客户服务器nginx配置代理
- ```
- location /file_server {
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- rewrite ^/file_server/(.*)$ /$1 break;
- proxy_pass http://localhost:8077;
- }
- ```
|