🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

oss-service

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oss-service

oss服务插件

latest
npmnpm
Version
0.0.7
Version published
Weekly downloads
16
220%
Maintainers
1
Weekly downloads
 
Created
Source

oss-service

介绍

云存储插件

软件架构

功能点

  • 支持配置灵活切换静态资源存储类型
  • 上传文件,返回文件信息,包含文件id、访问路径等
  • 删除文件,内部定时任务根据微服务模块划分,自动执行异步文件资源清理(标记过期时间,定时清理已过期资源
  • 支持2类查询文件方式
  • 提供文件业务属性(bizType)、文件业务数据编码(bizCode) 查询文件列表(内置微服务模块查询条件serviceModule)
  • 提供文件id集合(ids=1,2,3) 查询文件列表

安装教程

  • 服务端下载依赖
npm i oss-service
  • 在服务端启动文件补充配置-读取配置代码块
OssAppConf.init(config.appConf);
  • 在服务端启动文件补充配置-路由绑定
await this.bindRoutes(app, '/oss', () => import('oss-service/routes/OssFileRoutes'))
  • 在服务端启动文件补充配置-bean注册
ossRegisterDAOBeans(beans);
ossRegisterServiceBeans(beans, this.appConf.get('oss').type);
  • 配置文件中添加oss配置项
oss:
  # oss类型,可选值:local、ali、tencent
  type: ali
  # 微服务模块名称
  serviceModule: xxxx
  endpoint: xxxxxx
  accessKey: xxxxxaccessKey
  secretKey: xxxxxsecretKey
  bucket: xxxxxx
  region: xxxxx
  staticDomain:

Keywords

oss-service

FAQs

Package last updated on 07 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts