fix: issues
This commit is contained in:
@@ -14,11 +14,10 @@ import (
|
||||
|
||||
// @provider contracts.HttpRoute atom.GroupRoutes
|
||||
type Routes struct {
|
||||
log *log.Entry `inject:"false"`
|
||||
auth *auth
|
||||
pays *pays
|
||||
posts *posts
|
||||
weChat *weChat
|
||||
log *log.Entry `inject:"false"`
|
||||
auth *auth
|
||||
pays *pays
|
||||
posts *posts
|
||||
}
|
||||
|
||||
func (r *Routes) Prepare() error {
|
||||
@@ -51,41 +50,35 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
))
|
||||
|
||||
// 注册路由组: posts
|
||||
router.Get("/api/posts", DataFunc3(
|
||||
router.Get("/posts", DataFunc3(
|
||||
r.posts.List,
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[ListQuery]("query"),
|
||||
Local[*model.Users]("user"),
|
||||
))
|
||||
|
||||
router.Get("/api/posts/:id", DataFunc2(
|
||||
router.Get("/posts/:id", DataFunc2(
|
||||
r.posts.Show,
|
||||
PathParam[int64]("id"),
|
||||
Local[*model.Users]("user"),
|
||||
))
|
||||
|
||||
router.Get("/api/posts/:id/play", DataFunc2(
|
||||
router.Get("/posts/:id/play", DataFunc2(
|
||||
r.posts.Play,
|
||||
PathParam[int64]("id"),
|
||||
Local[*model.Users]("user"),
|
||||
))
|
||||
|
||||
router.Get("/api/posts/mine", DataFunc2(
|
||||
router.Get("/posts/mine", DataFunc2(
|
||||
r.posts.Mine,
|
||||
Query[requests.Pagination]("pagination"),
|
||||
Query[ListQuery]("query"),
|
||||
))
|
||||
|
||||
router.Get("/api/posts/:id/buy", DataFunc2(
|
||||
router.Get("/posts/:id/buy", DataFunc2(
|
||||
r.posts.Buy,
|
||||
PathParam[int64]("id"),
|
||||
Local[*model.Users]("user"),
|
||||
))
|
||||
|
||||
// 注册路由组: weChat
|
||||
router.Get("/MP_verify_:code.txt", Func1(
|
||||
r.weChat.Verify,
|
||||
PathParam[string]("code"),
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user