bba6dc6b4f
- Replaced common upload handler and service with Qiniu-specific implementations in main.go and route registration. - Deleted outdated upload_handler.go and qiniu_service.go files to streamline the codebase. - Updated route definitions to utilize the new Qiniu upload handler for improved file upload management.
17 lines
449 B
Go
17 lines
449 B
Go
package routes
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
|
|
qiniuhandler "wx_service/internal/common/qiniu/handler"
|
|
)
|
|
|
|
func registerCommonRoutes(protected *gin.RouterGroup, uploadHandler *qiniuhandler.UploadHandler) {
|
|
// 公共接口(所有小程序共用)
|
|
common := protected.Group("/common")
|
|
{
|
|
// 七牛直传凭证:前端先拿 token,再直传文件到七牛 upload_url
|
|
common.POST("/upload/qiniu/token", uploadHandler.QiniuToken)
|
|
}
|
|
}
|