商品价格计划
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pricing/main.go

25 lines
560 B

package main
import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"hupeh.vip/pricing/app"
"log"
"net/http"
)
func main() {
app.ConfigLogger("debug.log", app.LogWhenMinute)
app.ConfigGormDB()
r := chi.NewRouter()
r.Use(middleware.Logger)
r.Get("/goods", app.Handler(app.GetGoodsList))
r.Post("/goods", app.Handler(app.CreateGoods))
r.Get("/goods/:id/prices", app.Handler(app.GetGoodsPrices))
r.Post("/goods/:id", app.Handler(app.UpdateGoods))
if err := http.ListenAndServe(":3000", r); err != nil {
log.Fatalln(err)
}
}