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.

23 lines
498 B

1 month ago
  1. package live_streams
  2. import (
  3. "github.com/gogf/gf/v2/net/ghttp"
  4. "practice_Go/api/v1/live_streams"
  5. live "practice_Go/internal/service"
  6. )
  7. type cLive struct{}
  8. var Live = cLive{}
  9. func (c *cLive) GetLiveList(r *ghttp.Request) {
  10. var req *live_streams.GetLiveListReq
  11. if err := r.Parse(&req); err != nil {
  12. r.Response.WriteJsonExit(err.Error())
  13. }
  14. res, err := live.Live().GetLiveList(r.Context(), req)
  15. if err != nil {
  16. r.Response.WriteJsonExit(err.Error())
  17. }
  18. r.Response.WriteJsonExit(res)
  19. }