统一文件上传方式为直接上传,更新环境变量示例
This commit is contained in:
@@ -27,6 +27,9 @@ type UserService interface {
|
||||
ResetPassword(ctx context.Context, email, newPassword string) error
|
||||
ChangeEmail(ctx context.Context, userID int64, newEmail string) error
|
||||
|
||||
// 头像上传
|
||||
UploadAvatar(ctx context.Context, userID int64, fileData []byte, fileName string) (string, error)
|
||||
|
||||
// URL验证
|
||||
ValidateAvatarURL(ctx context.Context, avatarURL string) error
|
||||
|
||||
@@ -55,8 +58,7 @@ type ProfileService interface {
|
||||
// TextureService 材质服务接口
|
||||
type TextureService interface {
|
||||
// 材质CRUD
|
||||
Create(ctx context.Context, uploaderID int64, name, description, textureType, url, hash string, size int, isPublic, isSlim bool) (*model.Texture, error)
|
||||
UploadTexture(ctx context.Context, uploaderID int64, name, description, textureType string, fileData []byte, fileName string, isPublic, isSlim bool) (*model.Texture, error) // 直接上传材质文件
|
||||
UploadTexture(ctx context.Context, uploaderID int64, name, description, textureType string, fileData []byte, fileName string, isPublic, isSlim bool) (*model.Texture, error)
|
||||
GetByID(ctx context.Context, id int64) (*model.Texture, error)
|
||||
GetByHash(ctx context.Context, hash string) (*model.Texture, error)
|
||||
GetByUserID(ctx context.Context, uploaderID int64, page, pageSize int) ([]*model.Texture, int64, error)
|
||||
@@ -98,12 +100,6 @@ type CaptchaService interface {
|
||||
Verify(ctx context.Context, dx int, captchaID string) (bool, error)
|
||||
}
|
||||
|
||||
// UploadService 上传服务接口
|
||||
type UploadService interface {
|
||||
GenerateAvatarUploadURL(ctx context.Context, userID int64, fileName string) (*storage.PresignedPostPolicyResult, error)
|
||||
GenerateTextureUploadURL(ctx context.Context, userID int64, fileName, textureType string) (*storage.PresignedPostPolicyResult, error)
|
||||
}
|
||||
|
||||
// YggdrasilService Yggdrasil服务接口
|
||||
type YggdrasilService interface {
|
||||
// 用户认证
|
||||
@@ -211,7 +207,6 @@ type Services struct {
|
||||
Token TokenService
|
||||
Verification VerificationService
|
||||
Captcha CaptchaService
|
||||
Upload UploadService
|
||||
Yggdrasil YggdrasilService
|
||||
Security SecurityService
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user