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.
36 lines
1.0 KiB
36 lines
1.0 KiB
package cmd
|
|
|
|
import (
|
|
"MangheGo/internal/controller/prize"
|
|
"MangheGo/internal/controller/record"
|
|
"MangheGo/internal/logic/middleware"
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
"github.com/gogf/gf/v2/os/gcmd"
|
|
)
|
|
|
|
var (
|
|
Main = gcmd.Command{
|
|
Name: "main",
|
|
Usage: "main",
|
|
Brief: "start http server",
|
|
Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
|
|
s := g.Server()
|
|
s.Group("/api/prize_activity", func(group *ghttp.RouterGroup) {
|
|
group.Middleware(middleware.MiddlewareCORS)
|
|
group.POST("/get-prize-list", prize.Prize().GetPrizeList)
|
|
group.POST("/get-records-by-jwcode", record.Record().GetRecordsByJwcode)
|
|
group.POST("/get-top-prize-records", record.Record().GetTopPrizeRecords)
|
|
})
|
|
s.Group("/api/prize_backend", func(group *ghttp.RouterGroup) {
|
|
group.Middleware(middleware.MiddlewareCORS)
|
|
group.POST("/edit-prize", prize.Prize().EditPrize)
|
|
group.POST("/delete-prize", prize.Prize().DeletePrize)
|
|
})
|
|
s.Run()
|
|
return nil
|
|
},
|
|
}
|
|
)
|