实现商户注册、管理员审核商户申请接口

This commit is contained in:
2025-06-04 15:10:56 +08:00
parent 00b889cfcc
commit caf3d42fe5
63 changed files with 1195 additions and 294 deletions

26
utility/oss/oss.go Normal file
View File

@ -0,0 +1,26 @@
package oss
import (
"context"
"server/internal/model"
)
// OssClient 是所有云存储平台要实现的统一接口
type OssClient interface {
UploadFile(ctx context.Context, in *model.OssUploadFileInput) (out *model.OssOutput, err error)
GetFileURL(ctx context.Context, in *model.OssGetFileInput) (out *model.OssOutput, err error)
}
// registry 存储各个平台的实现
var clients = make(map[string]OssClient)
// Register 用于注册平台实现
func Register(name string, client OssClient) {
clients[name] = client
}
// GetClient 获取指定平台的实现
func GetClient(name string) (OssClient, bool) {
client, ok := clients[name]
return client, ok
}