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.

16 lines
431 B

7 months ago
  1. package channel
  2. import (
  3. "context"
  4. "practice_Go/api/channel/v1"
  5. "practice_Go/internal/dao"
  6. "practice_Go/internal/model/entity"
  7. )
  8. func (c *ControllerV1) GetChannel(ctx context.Context, req *v1.GetChannelReq) (res *v1.GetChannelRes, err error) {
  9. err = dao.GoChannels.Ctx(ctx).WherePri(req.Id).Scan(&res.GoChannels)
  10. err = dao.GoShows.Ctx(ctx).With(entity.GoUsers{}).Where("channel_id =?", req.Id).Scan(&res.List)
  11. return
  12. }