Replace Hard-coded HTTP Verbs with Constants (#27219)

* Replace hard-coded HTTP verbs with constants in `net/http`
Этот коммит содержится в:
enzowritescode
2024-07-15 08:52:03 -06:00
коммит произвёл GitHub
родитель e364c2a265
Коммит d44c3d5d45
72 изменённых файлов: 638 добавлений и 622 удалений

Просмотреть файл

@@ -3,13 +3,15 @@
package api4
func (api *API) InitBotLocal() {
api.BaseRoutes.Bot.Handle("", api.APILocal(getBot)).Methods("GET")
api.BaseRoutes.Bot.Handle("", api.APILocal(patchBot)).Methods("PUT")
api.BaseRoutes.Bot.Handle("/disable", api.APILocal(disableBot)).Methods("POST")
api.BaseRoutes.Bot.Handle("/enable", api.APILocal(enableBot)).Methods("POST")
api.BaseRoutes.Bot.Handle("/convert_to_user", api.APILocal(convertBotToUser)).Methods("POST")
api.BaseRoutes.Bot.Handle("/assign/{user_id:[A-Za-z0-9]+}", api.APILocal(assignBot)).Methods("POST")
import "net/http"
api.BaseRoutes.Bots.Handle("", api.APILocal(getBots)).Methods("GET")
func (api *API) InitBotLocal() {
api.BaseRoutes.Bot.Handle("", api.APILocal(getBot)).Methods(http.MethodGet)
api.BaseRoutes.Bot.Handle("", api.APILocal(patchBot)).Methods(http.MethodPut)
api.BaseRoutes.Bot.Handle("/disable", api.APILocal(disableBot)).Methods(http.MethodPost)
api.BaseRoutes.Bot.Handle("/enable", api.APILocal(enableBot)).Methods(http.MethodPost)
api.BaseRoutes.Bot.Handle("/convert_to_user", api.APILocal(convertBotToUser)).Methods(http.MethodPost)
api.BaseRoutes.Bot.Handle("/assign/{user_id:[A-Za-z0-9]+}", api.APILocal(assignBot)).Methods(http.MethodPost)
api.BaseRoutes.Bots.Handle("", api.APILocal(getBots)).Methods(http.MethodGet)
}