2022-12-11 20:48:18 +08:00
|
|
|
// ================================================================================
|
2022-11-24 23:37:34 +08:00
|
|
|
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
2022-12-11 20:48:18 +08:00
|
|
|
// You can delete these comments if you wish manually maintain this interface file.
|
|
|
|
// ================================================================================
|
2022-11-24 23:37:34 +08:00
|
|
|
|
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2023-01-18 16:23:39 +08:00
|
|
|
"hotgo/internal/model"
|
2023-05-10 23:54:50 +08:00
|
|
|
"hotgo/internal/model/input/commonin"
|
2022-11-24 23:37:34 +08:00
|
|
|
"hotgo/internal/model/input/sysin"
|
|
|
|
|
|
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
|
|
)
|
|
|
|
|
2022-12-11 20:48:18 +08:00
|
|
|
type (
|
|
|
|
ICommonUpload interface {
|
2023-01-18 16:23:39 +08:00
|
|
|
UploadFile(ctx context.Context, file *ghttp.UploadFile) (result *sysin.AttachmentListModel, err error)
|
2022-12-11 20:48:18 +08:00
|
|
|
UploadImage(ctx context.Context, file *ghttp.UploadFile) (result *sysin.AttachmentListModel, err error)
|
2023-01-18 16:23:39 +08:00
|
|
|
UploadLocal(ctx context.Context, conf *model.UploadConfig, file *ghttp.UploadFile, meta *sysin.UploadFileMeta) (result *sysin.AttachmentListModel, err error)
|
|
|
|
UploadUCloud(ctx context.Context, conf *model.UploadConfig, file *ghttp.UploadFile, meta *sysin.UploadFileMeta) (result *sysin.AttachmentListModel, err error)
|
2023-05-10 23:54:50 +08:00
|
|
|
UploadCOS(ctx context.Context, conf *model.UploadConfig, file *ghttp.UploadFile, meta *sysin.UploadFileMeta) (result *sysin.AttachmentListModel, err error)
|
|
|
|
UploadOSS(ctx context.Context, conf *model.UploadConfig, file *ghttp.UploadFile, meta *sysin.UploadFileMeta) (result *sysin.AttachmentListModel, err error)
|
|
|
|
UploadQiNiu(ctx context.Context, conf *model.UploadConfig, file *ghttp.UploadFile, meta *sysin.UploadFileMeta) (result *sysin.AttachmentListModel, err error)
|
2023-01-18 16:23:39 +08:00
|
|
|
LastUrl(ctx context.Context, conf *model.UploadConfig, fullPath, drive string) string
|
2023-05-10 23:54:50 +08:00
|
|
|
HasFile(ctx context.Context, md5 string) (res *sysin.AttachmentListModel, err error)
|
|
|
|
}
|
|
|
|
ICommonWechat interface {
|
|
|
|
Authorize(ctx context.Context, in commonin.WechatAuthorizeInp) (res *commonin.WechatAuthorizeModel, err error)
|
|
|
|
AuthorizeCall(ctx context.Context, in commonin.WechatAuthorizeCallInp) (res *commonin.WechatAuthorizeCallModel, err error)
|
|
|
|
GetOpenId(ctx context.Context) (openId string, err error)
|
|
|
|
GetCacheKey(typ, ak string) string
|
|
|
|
CleanTempMap(ctx context.Context)
|
2022-12-11 20:48:18 +08:00
|
|
|
}
|
|
|
|
)
|
2022-11-24 23:37:34 +08:00
|
|
|
|
2022-12-11 20:48:18 +08:00
|
|
|
var (
|
|
|
|
localCommonUpload ICommonUpload
|
2023-05-10 23:54:50 +08:00
|
|
|
localCommonWechat ICommonWechat
|
2022-12-11 20:48:18 +08:00
|
|
|
)
|
2022-11-24 23:37:34 +08:00
|
|
|
|
|
|
|
func CommonUpload() ICommonUpload {
|
|
|
|
if localCommonUpload == nil {
|
|
|
|
panic("implement not found for interface ICommonUpload, forgot register?")
|
|
|
|
}
|
|
|
|
return localCommonUpload
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterCommonUpload(i ICommonUpload) {
|
|
|
|
localCommonUpload = i
|
|
|
|
}
|
2023-05-10 23:54:50 +08:00
|
|
|
|
|
|
|
func CommonWechat() ICommonWechat {
|
|
|
|
if localCommonWechat == nil {
|
|
|
|
panic("implement not found for interface ICommonWechat, forgot register?")
|
|
|
|
}
|
|
|
|
return localCommonWechat
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterCommonWechat(i ICommonWechat) {
|
|
|
|
localCommonWechat = i
|
|
|
|
}
|