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.
25 lines
554 B
25 lines
554 B
package shows
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/errors/gcode"
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
"practice_Go/api/v1/shows"
|
|
"practice_Go/internal/service"
|
|
)
|
|
|
|
type cShows struct{}
|
|
|
|
var Shows = cShows{}
|
|
|
|
func (c *cShows) GetShowList(r *ghttp.Request) {
|
|
var req *shows.ShowReq
|
|
if err := r.Parse(&req); err != nil {
|
|
r.Response.WriteJsonExit(gcode.New(400, "参数错误", nil))
|
|
}
|
|
|
|
res, err := service.Shows().GetShowsList(r.Context(), req)
|
|
if err != nil {
|
|
r.Response.WriteJsonExit(gcode.New(500, err.Error(), nil))
|
|
}
|
|
r.Response.WriteJson(res)
|
|
}
|