finished router spec

This commit is contained in:
a 2022-02-22 23:44:57 +00:00
parent edd0e5c018
commit 9a860c2ad1
2 changed files with 50 additions and 41 deletions

View File

@ -309,59 +309,68 @@ func NewChiRouter() {
r.Get("/block/create/submit", ConvertExtraRoute(routes.RelationsBlockCreateSubmit))
r.Get("/block/remove", ConvertHeaderExtraRoute(routes.RelationsBlockRemove))
r.Get("/block/remove/submit", ConvertExtraRoute(routes.RelationsBlockRemoveSubmit))
r.Get("/{user}", ConvertExtraRoute(routes))
r.Get("/{user}", ConvertHeaderRoute(routes.ViewProfile))
})
r.Route("/users", func(r chi.Router) {
r.Get("/ban/submit", ConvertExtraRoute(routes))
r.Get("/unban", ConvertExtraRoute(routes))
r.Get("/activate", ConvertExtraRoute(routes))
r.Get("/ips", ConvertExtraRoute(routes))
r.Get("/delete-posts/submit", ConvertExtraRoute(routes))
r.Use(NoSessionMismatchMiddleware)
r.Get("/ban/submit", ConvertExtraRoute(routes.BanUserSubmit))
r.Get("/unban", ConvertExtraRoute(routes.UnbanUser))
r.Get("/activate", ConvertExtraRoute(routes.ActivateUser))
r.Get("/ips", ConvertHeaderRoute(routes.IPSearch))
r.Get("/delete-posts/submit", ConvertExtraRoute(routes.DeletePostsSubmit))
})
r.Route("/topic", func(r chi.Router) {
r.Get("/create/submit", ConvertExtraRoute(routes))
r.Get("/edit/submit", ConvertExtraRoute(routes))
r.Get("/delete/submit", ConvertExtraRoute(routes))
r.Get("/stick/submit", ConvertExtraRoute(routes))
r.Get("/unstick/submit", ConvertExtraRoute(routes))
r.Get("/lock/submit", ConvertExtraRoute(routes))
r.Get("/unlock/submit", ConvertExtraRoute(routes))
r.Get("/move/submit", ConvertExtraRoute(routes))
r.Get("/like/submit", ConvertExtraRoute(routes))
r.Get("/unlike/submit", ConvertExtraRoute(routes))
r.Get("/attach/add/submit", ConvertExtraRoute(routes))
r.Get("/attach/remove/submit", ConvertExtraRoute(routes))
r.Use(MemberOnlyMiddleware)
r.Use(NoSessionMismatchMiddleware)
r.Get("/create/submit", ConvertUserRoute(routes.CreateTopicSubmit))
r.Get("/edit/submit", ConvertExtraRoute(routes.EditTopicSubmit))
r.Get("/delete/submit", ConvertUserRoute(routes.DeleteTopicSubmit))
r.Get("/stick/submit", ConvertExtraRoute(routes.StickTopicSubmit))
r.Get("/unstick/submit", ConvertExtraRoute(routes.UnstickTopicSubmit))
r.Get("/lock/submit", ConvertUserRoute(routes.LockTopicSubmit))
r.Get("/unlock/submit", ConvertExtraRoute(routes.UnlockTopicSubmit))
r.Get("/move/submit", ConvertExtraRoute(routes.MoveTopicSubmit))
r.Get("/like/submit", ConvertExtraRoute(routes.LikeTopicSubmit))
r.Get("/unlike/submit", ConvertExtraRoute(routes.UnlikeTopicSubmit))
r.Get("/attach/add/submit", ConvertExtraRoute(routes.AddAttachToTopicSubmit))
r.Get("/attach/remove/submit", ConvertExtraRoute(routes.RemoveAttachFromTopicSubmit))
})
r.Route("/reply", func(r chi.Router) {
r.Get("/create", ConvertExtraRoute(routes))
r.Get("/edit/submit", ConvertExtraRoute(routes))
r.Get("/delete/submit", ConvertExtraRoute(routes))
r.Get("/like/submit", ConvertExtraRoute(routes))
r.Get("/unlike/submit", ConvertExtraRoute(routes))
r.Get("/attach/add/submit", ConvertExtraRoute(routes))
r.Get("/attach/remove/submit", ConvertExtraRoute(routes))
r.Use(MemberOnlyMiddleware)
r.Get("/create", ConvertUserRoute(routes.ProfileReplyCreateSubmit))
r.Get("/edit/submit", ConvertExtraRoute(routes.ReplyEditSubmit))
r.Get("/delete/submit", ConvertExtraRoute(routes.ReplyDeleteSubmit))
r.Get("/like/submit", ConvertExtraRoute(routes.ReplyLikeSubmit))
r.Get("/unlike/submit", ConvertExtraRoute(routes.ReplyUnlikeSubmit))
r.Get("/attach/add/submit", ConvertExtraRoute(routes.AddAttachToReplySubmit))
r.Get("/attach/remove/submit", ConvertExtraRoute(routes.RemoveAttachFromReplySubmit))
})
r.Route("/profile", func(r chi.Router) {
r.Get("/reply/create", ConvertExtraRoute(routes))
r.Get("/reply/edit/submit", ConvertExtraRoute(routes))
r.Get("/reply/edit/delete/submit", ConvertExtraRoute(routes))
r.Use(MemberOnlyMiddleware)
r.Use(NoSessionMismatchMiddleware)
r.Get("/reply/create", ConvertUserRoute(routes.ProfileReplyCreateSubmit))
r.Get("/reply/edit/submit", ConvertExtraRoute(routes.ProfileReplyEditSubmit))
r.Get("/reply/edit/delete/submit", ConvertExtraRoute(routes.ProfileReplyDeleteSubmit))
})
r.Route("/poll", func(r chi.Router) {
r.Get("/poll/vote", ConvertExtraRoute(routes))
r.Get("/poll/results", ConvertExtraRoute(routes))
r.Use(MemberOnlyMiddleware)
r.Use(NoSessionMismatchMiddleware)
r.Get("/poll/vote", ConvertExtraRoute(routes.PollVote))
r.Get("/poll/results", ConvertExtraRoute(routes.PollResults))
})
r.Route("/accounts", func(r chi.Router) {
r.Get("/login", ConvertExtraRoute(routes))
r.Get("/create", ConvertExtraRoute(routes))
r.Get("/logout", ConvertExtraRoute(routes))
r.Get("/login/submit", ConvertExtraRoute(routes))
r.Get("/mfa_verify", ConvertExtraRoute(routes))
r.Get("/mfa_verify/submit", ConvertExtraRoute(routes))
r.Get("/create/submit", ConvertExtraRoute(routes))
r.Get("/password-reset", ConvertExtraRoute(routes))
r.Get("/password-reset/submit", ConvertExtraRoute(routes))
r.Get("/password-reset/token", ConvertExtraRoute(routes))
r.Get("/password-reset/token/submit", ConvertExtraRoute(routes))
r.Get("/login", ConvertHeaderRoute(routes.AccountLogin))
r.Get("/create", ConvertHeaderRoute(routes.AccountRegister))
r.Get("/logout", ConvertUserRoute(routes.AccountLogout))
r.Get("/login/submit", ConvertUserRoute(routes.AccountLoginSubmit))
r.Get("/mfa_verify", ConvertHeaderRoute(routes.AccountLoginMFAVerify))
r.Get("/mfa_verify/submit", ConvertUserRoute(routes.AccountLoginMFAVerifySubmit))
r.Get("/create/submit", ConvertUserRoute(routes.AccountRegisterSubmit))
r.Get("/password-reset", ConvertHeaderRoute(routes.AccountPasswordReset))
r.Get("/password-reset/submit", ConvertUserRoute(routes.AccountPasswordResetSubmit))
r.Get("/password-reset/token", ConvertHeaderRoute(routes.AccountPasswordResetToken))
r.Get("/password-reset/token/submit", ConvertUserRoute(routes.AccountPasswordResetTokenSubmit))
})
r.Route("/static", func(r chi.Router) {})
r.Route("/uploads", func(r chi.Router) {})