2022-11-24 23:37:34 +08:00
|
|
|
// Package router
|
|
|
|
// @Link https://github.com/bufanyun/hotgo
|
2023-02-23 17:53:04 +08:00
|
|
|
// @Copyright Copyright (c) 2023 HotGo CLI
|
2022-11-24 23:37:34 +08:00
|
|
|
// @Author Ms <133814250@qq.com>
|
|
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
2023-06-12 17:49:29 +08:00
|
|
|
"hotgo/internal/consts"
|
2022-11-24 23:37:34 +08:00
|
|
|
"hotgo/internal/controller/api/member"
|
2023-05-10 23:54:50 +08:00
|
|
|
"hotgo/internal/controller/api/pay"
|
2022-11-24 23:37:34 +08:00
|
|
|
"hotgo/internal/service"
|
2023-06-12 17:49:29 +08:00
|
|
|
"hotgo/utility/simple"
|
2022-11-24 23:37:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// Api 前台路由
|
|
|
|
func Api(ctx context.Context, group *ghttp.RouterGroup) {
|
2023-06-12 17:49:29 +08:00
|
|
|
group.Group(simple.RouterPrefix(ctx, consts.AppApi), func(group *ghttp.RouterGroup) {
|
2022-11-24 23:37:34 +08:00
|
|
|
group.Bind(
|
2023-05-10 23:54:50 +08:00
|
|
|
pay.Notify, // 支付异步通知
|
2023-02-23 17:53:04 +08:00
|
|
|
)
|
|
|
|
group.Middleware(service.Middleware().ApiAuth)
|
|
|
|
group.Bind(
|
2022-11-24 23:37:34 +08:00
|
|
|
member.Member, // 管理员
|
|
|
|
)
|
|
|
|
})
|
|
|
|
}
|