feat: add callback

This commit is contained in:
yanghao05
2025-04-14 21:15:24 +08:00
parent ea867f7261
commit 6e822e1a1b
7 changed files with 95 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import (
// @provider contracts.HttpRoute atom.GroupRoutes
type Routes struct {
log *log.Entry `inject:"false"`
pays *pays
posts *posts
}
@@ -27,8 +28,13 @@ func (r *Routes) Name() string {
}
func (r *Routes) Register(router fiber.Router) {
// 注册路由组: pays
router.Get("/pay/callback", Func0(
r.pays.Callback,
))
// 注册路由组: posts
router.Get("/", DataFunc2(
router.Get("/posts", DataFunc2(
r.posts.List,
Query[requests.Pagination]("pagination"),
Query[ListQuery]("query"),
@@ -45,4 +51,9 @@ func (r *Routes) Register(router fiber.Router) {
Query[ListQuery]("query"),
))
router.Get("/buy/:id", DataFunc1(
r.posts.Buy,
PathParam[int64]("id"),
))
}