123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- // Code generated by goctl. DO NOT EDIT.
- package handler
- import (
- "net/http"
- Contact "wechat-api/internal/handler/Contact"
- WechatServer "wechat-api/internal/handler/WechatServer"
- Wx "wechat-api/internal/handler/Wx"
- Wxhook "wechat-api/internal/handler/Wxhook"
- base "wechat-api/internal/handler/base"
- "wechat-api/internal/svc"
- "github.com/zeromicro/go-zero/rest"
- )
- func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
- server.AddRoutes(
- []rest.Route{
- {
- Method: http.MethodGet,
- Path: "/init/database",
- Handler: base.InitDatabaseHandler(serverCtx),
- },
- },
- )
- server.AddRoutes(
- rest.WithMiddlewares(
- []rest.Middleware{serverCtx.Authority},
- []rest.Route{
- {
- Method: http.MethodPost,
- Path: "/server/create",
- Handler: WechatServer.CreateServerHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/server/update",
- Handler: WechatServer.UpdateServerHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/server/delete",
- Handler: WechatServer.DeleteServerHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/server/list",
- Handler: WechatServer.GetServerListHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/server",
- Handler: WechatServer.GetServerByIdHandler(serverCtx),
- },
- }...,
- ),
- rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
- )
- server.AddRoutes(
- rest.WithMiddlewares(
- []rest.Middleware{serverCtx.Authority},
- []rest.Route{
- {
- Method: http.MethodPost,
- Path: "/wx/create",
- Handler: Wx.CreateWxHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/wx/update",
- Handler: Wx.UpdateWxHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/wx/delete",
- Handler: Wx.DeleteWxHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/wx/list",
- Handler: Wx.GetWxListHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/wx",
- Handler: Wx.GetWxByIdHandler(serverCtx),
- },
- }...,
- ),
- rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
- )
- server.AddRoutes(
- rest.WithMiddlewares(
- []rest.Middleware{serverCtx.Authority},
- []rest.Route{
- {
- Method: http.MethodPost,
- Path: "/wxhook/refreshLoginQR",
- Handler: Wxhook.RefreshLoginQRHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/wxhook/logout",
- Handler: Wxhook.LogoutHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/wxhook/getFriendsAndGroups",
- Handler: Wxhook.GetFriendsAndGroupsHandler(serverCtx),
- },
- }...,
- ),
- rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
- )
- server.AddRoutes(
- rest.WithMiddlewares(
- []rest.Middleware{serverCtx.Authority},
- []rest.Route{
- {
- Method: http.MethodPost,
- Path: "/contact/create",
- Handler: Contact.CreateContactHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/contact/update",
- Handler: Contact.UpdateContactHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/contact/delete",
- Handler: Contact.DeleteContactHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/contact/list",
- Handler: Contact.GetContactListHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/contact",
- Handler: Contact.GetContactByIdHandler(serverCtx),
- },
- }...,
- ),
- rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
- )
- }
|