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.

29 lines
721 B

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. package cmd
  2. import (
  3. "CouponBackendGo/internal/controller/coupon"
  4. "context"
  5. "github.com/gogf/gf/v2/frame/g"
  6. "github.com/gogf/gf/v2/net/ghttp"
  7. "github.com/gogf/gf/v2/os/gcmd"
  8. )
  9. var (
  10. Main = gcmd.Command{
  11. Name: "main",
  12. Usage: "main",
  13. Brief: "start http server",
  14. Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
  15. s := g.Server()
  16. s.Group("/api/coupon_backend", func(group *ghttp.RouterGroup) {
  17. group.POST("/get-coupon-list", coupon.Coupon().GetCouponList)
  18. group.POST("/get-coupon", coupon.Coupon().GetCoupon)
  19. group.POST("/delete-coupon", coupon.Coupon().DeleteCoupon)
  20. group.POST("/insert-coupon", coupon.Coupon().InsertCoupon)
  21. })
  22. s.Run()
  23. return nil
  24. },
  25. }
  26. )