feat: complete

This commit is contained in:
Rogee
2024-12-13 21:28:43 +08:00
parent 13ebc91220
commit 7aebb161f6
13 changed files with 219 additions and 161 deletions

View File

@@ -6,6 +6,7 @@ import (
"backend/modules/medias"
"backend/modules/middlewares"
"backend/modules/users"
wechatModule "backend/modules/wechat"
"backend/providers/app"
"backend/providers/hashids"
"backend/providers/http"
@@ -46,6 +47,7 @@ func Command() atom.Option {
middlewares.Provide,
users.Provide,
medias.Provide,
wechatModule.Provide,
)),
)
}
@@ -55,6 +57,7 @@ type Http struct {
App *app.Config
Storage *storage.Config
Wechat *wechatModule.Controller
Service *http.Service
Initials []contracts.Initial `group:"initials"`
Routes []contracts.HttpRoute `group:"routes"`
@@ -73,7 +76,7 @@ func Serve(cmd *cobra.Command, args []string) error {
engine.Use(mid.ProcessResponse)
engine.Use(mid.WeChatVerify)
engine.Use("/t+", mid.WeChatAuthUserInfo, mid.WeChatSilentAuth)
engine.Use([]string{"/t/:tenant", "/t/:tenant/*"}, mid.WeChatAuth, http.Wechat.Render)
http.Service.Engine.Use(favicon.New(favicon.Config{
Data: []byte{},