统一文件上传方式为直接上传,更新环境变量示例
This commit is contained in:
@@ -95,8 +95,8 @@ func registerUserRoutes(v1 *gin.RouterGroup, h *UserHandler, jwtService *auth.JW
|
||||
userGroup.PUT("/profile", h.UpdateProfile)
|
||||
|
||||
// 头像相关
|
||||
userGroup.POST("/avatar/upload-url", h.GenerateAvatarUploadURL)
|
||||
userGroup.PUT("/avatar", h.UpdateAvatar)
|
||||
userGroup.POST("/avatar/upload", h.UploadAvatar) // 直接上传头像文件
|
||||
userGroup.PUT("/avatar", h.UpdateAvatar) // 更新头像URL(外部URL)
|
||||
|
||||
// 更换邮箱
|
||||
userGroup.POST("/change-email", h.ChangeEmail)
|
||||
@@ -122,9 +122,7 @@ func registerTextureRoutes(v1 *gin.RouterGroup, h *TextureHandler, jwtService *a
|
||||
textureAuth := textureGroup.Group("")
|
||||
textureAuth.Use(middleware.AuthMiddleware(jwtService))
|
||||
{
|
||||
textureAuth.POST("/upload", h.Upload) // 直接上传文件
|
||||
textureAuth.POST("/upload-url", h.GenerateUploadURL) // 生成预签名URL(保留兼容性)
|
||||
textureAuth.POST("", h.Create) // 创建材质记录(配合预签名URL使用)
|
||||
textureAuth.POST("/upload", h.Upload) // 直接上传文件
|
||||
textureAuth.PUT("/:id", h.Update)
|
||||
textureAuth.DELETE("/:id", h.Delete)
|
||||
textureAuth.POST("/:id/favorite", h.ToggleFavorite)
|
||||
|
||||
Reference in New Issue
Block a user