Impl swag and auth switch

This commit is contained in:
若海
2023-12-29 21:28:18 +08:00
parent 21f63ee545
commit 524faae9cf
12 changed files with 148 additions and 54 deletions
+9 -4
View File
@@ -9,8 +9,8 @@ import (
)
// @title Wechat Rest API
// @version v0.4.2
// @description 基于 WeChatFerry RPC 实现的电脑版微信 REST-API,使用 Go 语言编写,无第三方运行时依赖。基于 HTTP 提供操作接口,轻松对接任意编程语言。
// @version v0.4.6
// @description 基于 WeChatFerry RPC 实现的电脑版微信 REST API,使用 Go 语言编写,无第三方运行时依赖。基于 HTTP 提供操作接口,轻松对接任意编程语言。
// @contact.name WeChatRest
// @contact.url https://github.com/opentdp/wechat-rest
// @license.name Apache 2.0
@@ -20,13 +20,18 @@ import (
func Server() {
httpd.Engine(args.Debug)
httpd.Use(midware.OutputHandle)
// Api 守卫
api := httpd.Group("/api")
api.Use(midware.OutputHandle, midware.AuthGuard)
api.Use(midware.ApiGuard)
// 注册 WCF
// Wcf 路由
wcfrest.Route(api)
// Swagger 守卫
httpd.Use(midware.SwagGuard)
// 前端文件路由
httpd.StaticEmbed("/", "public", args.Efs)