60 lines
1.1 KiB
Go
60 lines
1.1 KiB
Go
// Code generated by the atomctl ; DO NOT EDIT.
|
|
|
|
package http
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v3"
|
|
log "github.com/sirupsen/logrus"
|
|
_ "go.ipao.vip/atom"
|
|
_ "go.ipao.vip/atom/contracts"
|
|
. "go.ipao.vip/atom/fen"
|
|
"quyun/app/requests"
|
|
)
|
|
|
|
// @provider contracts.HttpRoute atom.GroupRoutes
|
|
type Routes struct {
|
|
log *log.Entry `inject:"false"`
|
|
pays *pays
|
|
posts *posts
|
|
}
|
|
|
|
func (r *Routes) Prepare() error {
|
|
r.log = log.WithField("module", "routes.http")
|
|
return nil
|
|
}
|
|
|
|
func (r *Routes) Name() string {
|
|
return "http"
|
|
}
|
|
|
|
func (r *Routes) Register(router fiber.Router) {
|
|
// 注册路由组: pays
|
|
router.Get("/pay/callback", Func0(
|
|
r.pays.Callback,
|
|
))
|
|
|
|
// 注册路由组: posts
|
|
router.Get("/posts", DataFunc2(
|
|
r.posts.List,
|
|
Query[requests.Pagination]("pagination"),
|
|
Query[ListQuery]("query"),
|
|
))
|
|
|
|
router.Get("/show/:id", DataFunc1(
|
|
r.posts.Show,
|
|
PathParam[int64]("id"),
|
|
))
|
|
|
|
router.Get("/mine", DataFunc2(
|
|
r.posts.Mine,
|
|
Query[requests.Pagination]("pagination"),
|
|
Query[ListQuery]("query"),
|
|
))
|
|
|
|
router.Get("/buy/:id", DataFunc1(
|
|
r.posts.Buy,
|
|
PathParam[int64]("id"),
|
|
))
|
|
|
|
}
|