接口对接

This commit is contained in:
2026-04-21 13:31:10 +08:00
parent adb6da1d70
commit 33cb945846
8 changed files with 119 additions and 47 deletions

View File

@@ -68,22 +68,26 @@ func (s *scheduleService) List(ctx context.Context, req *dto.ListScheduleReq) (r
for _, item := range scheduleList {
// 获取主播信息
anchorName := ""
anchor, _ := dao.Anchor.GetOne(ctx, &dto.GetAnchorReq{Id: int64(item.AnchorId)})
if anchor != nil {
anchorName = anchor.Name
if item.AnchorId > 0 {
anchor, _ := dao.Anchor.GetOne(ctx, &dto.GetAnchorReq{Id: int64(item.AnchorId)})
if anchor != nil {
anchorName = anchor.Name
}
}
// 获取账号信息
accountName := ""
platform := ""
account, _ := dao.LiveAccount.GetOne(ctx, &dto.GetLiveAccountReq{Id: int64(item.AccountId)})
if account != nil {
accountName = account.AccountName
platform = account.Platform
if item.AccountId > 0 {
account, _ := dao.LiveAccount.GetOne(ctx, &dto.GetLiveAccountReq{Id: int64(item.AccountId)})
if account != nil {
accountName = account.AccountName
platform = account.Platform
}
}
list = append(list, dto.ScheduleItem{
Id: item.Id,
Id: int64(item.Id),
AnchorId: item.AnchorId,
AnchorName: anchorName,
AccountId: item.AccountId,