Integrate WeChat Official Account support and update configuration
- Added WeChat Official Account configuration options to .env.example and config.go for OAuth2 integration. - Updated main.go to initialize WeChat OAuth handler and register routes for handling OAuth requests. - Enhanced documentation to include references for WeChat Official Account functionality. - Updated route registration to accommodate the new OAuth handler for improved API structure.
This commit is contained in:
+6
-1
@@ -10,6 +10,8 @@ import (
|
||||
authservice "wx_service/internal/common/auth/service"
|
||||
qiniuhandler "wx_service/internal/common/qiniu/handler"
|
||||
qiniuservice "wx_service/internal/common/qiniu/service"
|
||||
oahandler "wx_service/internal/common/wechat_official/handler"
|
||||
oaservice "wx_service/internal/common/wechat_official/service"
|
||||
"wx_service/internal/database"
|
||||
"wx_service/internal/model"
|
||||
rmhandler "wx_service/internal/remove_watermark/handler"
|
||||
@@ -60,8 +62,11 @@ func main() {
|
||||
qiniuService := qiniuservice.NewQiniuService(config.AppConfig.Qiniu)
|
||||
uploadHandler := qiniuhandler.NewUploadHandler(qiniuService)
|
||||
|
||||
oaService := oaservice.NewWeChatOAService(config.AppConfig.WeChatOA)
|
||||
oaOAuthHandler := oahandler.NewOAuthHandler(oaService)
|
||||
|
||||
// 6) 注册路由:把 URL 映射到 handler
|
||||
routes.Register(router, database.DB, authHandler, videoHandler, smokeHandler, uploadHandler)
|
||||
routes.Register(router, database.DB, authHandler, videoHandler, smokeHandler, uploadHandler, oaOAuthHandler)
|
||||
|
||||
// 7) 启动监听端口
|
||||
addr := ":" + config.AppConfig.Server.Port
|
||||
|
||||
Reference in New Issue
Block a user