oss/README.md
2023-08-21 09:49:41 +08:00

45 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# oss 对象存储服务
## 介绍
- 项目介绍说明地址https://showdoc.axzo.cn/web/#/102?page_id=987
- 项目接入说明地址https://showdoc.axzo.cn/web/#/102?page_id=908
- 项目API说明地址https://yapi.axzo.cn/project/950/interface/api
## 业务支持场景
### 业务服务新接入进行sql语句配置
以前端app有文件上传需求进行接入oss服务进行sql语句配置为例appCode=app
```mysql
INSERT INTO `app_channel_bucket` (`app_channel_bucket_no`, `app_code`, `channel_code`, `bucket_name`, `access_control`, `remark`, `extension`, `create_at`, `update_at`, `create_by`, `update_by`, `is_delete`) VALUES ('app:aliyun:app', 'app', 'aliyun', 'axzo-public', '', NULL, NULL, now(), now(), '', '', 0);
INSERT INTO `file_app` (`app_code`, `app_name`, `status`, `remark`, `extension`, `create_at`, `update_at`, `create_by`, `update_by`, `is_delete`) VALUES ('app', 'app', 1, 'app', NULL, now(), now(), '', '', 0);
INSERT INTO `file_business_scene` (`app_channel_bucket_no`, `app_code`, `channel_code`, `bucket_name`, `business_scene`, `directory`, `create_at`, `update_at`, `create_by`, `update_by`, `is_delete`) VALUES ('app:aliyun:app', 'app', 'aliyun', 'axzo-public', 'app', 'app/app', now(), now(), NULL, NULL, 0);
INSERT INTO `file_upload_config` (`app_channel_bucket_no`, `app_code`, `channel_code`, `bucket_name`, `directory`, `storage_unit`, `storage_size`, `file_format`, `create_at`, `update_at`, `create_by`, `update_by`, `is_delete`) VALUES ('app:aliyun:app', 'app', 'aliyun', 'axzo-public', 'app/app', 'MB', 100, 'png,jpg,xls,xlsx,docx,pdf,zip,dwg,doc,jpeg', now(), now(), NULL, NULL, 0);
```
### 已接入业务服务支持文件格式配置
例如appCode=cms需要支持rar格式文件上传, 支持处理的方式为:
修改file_upload_config表对字段file_format进行调整执行以下语句即可
```mysql
update `file_upload_config` SET `file_format` = 'png,jpg,zip,jpeg,pdf,gif,xls,doc,docx,xlsx,bmp,rar' WHERE `app_code` = 'cms'
```
## 当前提供的能力
- 文件上传功能
- 上传功能对接操作日志记录服务。
- 对接用户授权获取用户信息。
- 根据fileKey获取文件流返回。
- 获取文件url兼容处理传输的为url直接返回。
- 支持app端历史数据不存在进行新增处理。
- 获取文件Url支持返回原文件名。
- 支持图片处理尺寸样式。
- 文件流下载。
- 分片上传。
## 未来可扩展
- oss服务业务支持场景手动配置sql语句可切换为管理界面处理效率提高可追溯。方案
- oss封装提供给表的curd api接口。
- 基础技术管理后台对接调用 oss提供的api接口进行业务接入或者已接入业务服务调整文件格式配置。
- oss服务重构简化流程
- 多子模块架构,调用链路太长,新功能支持开发较繁琐。