1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| func (a *App) UnAuthPost(path string, f func(w http.ResponseWriter, r *http.Request)) { a.Router.HandleFunc(path, f).Methods("POST") }
func (a *App) Get(muxRouter *mux.Router, path string, f func(w http.ResponseWriter, r *http.Request)) { muxRouter.Path(path).HandlerFunc(f).Methods("GET") }
func (a *App) Post(muxRouter *mux.Router, path string, f func(w http.ResponseWriter, r *http.Request)) { muxRouter.Path(path).HandlerFunc(f).Methods("POST") }
func (a *App) Patch(muxRouter *mux.Router, path string, f func(w http.ResponseWriter, r *http.Request)) { muxRouter.Path(path).HandlerFunc(f).Methods("PATCH") }
func (a *App) Delete(muxRouter *mux.Router, path string, f func(w http.ResponseWriter, r *http.Request)) { muxRouter.Path(path).HandlerFunc(f).Methods("DELETE") }
func (a *App) Register(w http.ResponseWriter, r *http.Request) { controller.Register(a.db, w, r) }
func (a *App) Login(w http.ResponseWriter, r *http.Request) { controller.Login(a.db, w, r) }
func (a *App) Logout(w http.ResponseWriter, r *http.Request) { controller.Logout(a.db, w, r) }
func (a *App) GetProducts(w http.ResponseWriter, r *http.Request) { controller.GetProducts(a.db, w, r) }
func (a *App) PostProduct(w http.ResponseWriter, r *http.Request) { controller.PostProduct(a.db, w, r) }
func (a *App) GetProduct(w http.ResponseWriter, r *http.Request) { controller.GetProduct(a.db, w, r) }
func (a *App) UpdateProduct(w http.ResponseWriter, r *http.Request) { controller.UpdateProduct(a.db, w, r) }
func (a *App) GetTags(w http.ResponseWriter, r *http.Request) { controller.GetTags(a.db, w, r) }
func (a *App) GetDeletedProducts(w http.ResponseWriter, r *http.Request) { controller.GetDeletedProducts(a.db, w, r) }
func (a *App) DeleteProduct(w http.ResponseWriter, r *http.Request) { controller.DeleteProduct(a.db, w, r) }
|