feat: Add texture rendering endpoints and service methods
- Introduced new API endpoints for rendering textures, avatars, capes, and previews, enhancing the texture handling capabilities. - Implemented corresponding service methods in the TextureHandler to process rendering requests and return appropriate responses. - Updated the TextureRenderService interface to include methods for rendering textures, avatars, and capes, along with their respective parameters. - Enhanced error handling for invalid texture IDs and added support for different rendering types and formats. - Updated go.mod to include the webp library for image processing.
This commit is contained in:
@@ -108,6 +108,10 @@ func registerTextureRoutes(v1 *gin.RouterGroup, h *TextureHandler, jwtService *a
|
||||
// 公开路由(无需认证)
|
||||
textureGroup.GET("", h.Search)
|
||||
textureGroup.GET("/:id", h.Get)
|
||||
textureGroup.GET("/:id/render", h.RenderTexture) // type/front/back/full/head/isometric
|
||||
textureGroup.GET("/:id/avatar", h.RenderAvatar) // mode=2d/3d
|
||||
textureGroup.GET("/:id/cape", h.RenderCape)
|
||||
textureGroup.GET("/:id/preview", h.RenderPreview) // 自动根据类型预览
|
||||
|
||||
// 需要认证的路由
|
||||
textureAuth := textureGroup.Group("")
|
||||
|
||||
Reference in New Issue
Block a user