Browse Source

修bug

pindao-mj
majun 7 months ago
parent
commit
b77b029b12
  1. 1
      api/channel/v1/channel.go
  2. 1
      internal/controller/channel/channel_v1_get_channel.go
  3. BIN
      main.exe~

1
api/channel/v1/channel.go

@ -15,5 +15,4 @@ type GetChannelReq struct {
type GetChannelRes struct { type GetChannelRes struct {
*entity.GoChannels `json:"channel" dc:"单个频道"` *entity.GoChannels `json:"channel" dc:"单个频道"`
List []*entity.GoShows `json:"shows" dc:"频道下的所有节目和对应创作人"` List []*entity.GoShows `json:"shows" dc:"频道下的所有节目和对应创作人"`
// `json:"status" dc:"频道是否订阅"`
} }

1
internal/controller/channel/channel_v1_get_channel.go

@ -11,6 +11,5 @@ import (
func (c *ControllerV1) GetChannel(ctx context.Context, req *v1.GetChannelReq) (res *v1.GetChannelRes, err error) { func (c *ControllerV1) GetChannel(ctx context.Context, req *v1.GetChannelReq) (res *v1.GetChannelRes, err error) {
err = dao.GoChannels.Ctx(ctx).WherePri(req.Id).Scan(&res.GoChannels) err = dao.GoChannels.Ctx(ctx).WherePri(req.Id).Scan(&res.GoChannels)
err = dao.GoShows.Ctx(ctx).With(entity.GoUsers{}).Where("channel_id =?", req.Id).Scan(&res.List) err = dao.GoShows.Ctx(ctx).With(entity.GoUsers{}).Where("channel_id =?", req.Id).Scan(&res.List)
return return
} }

BIN
main.exe~

Loading…
Cancel
Save