GetById 批量获取互动信息
(ctx context.Context, postIds []uint)
| 99 | |
| 100 | // GetById 批量获取互动信息 |
| 101 | func (i *InteractiveRepositoryImpl) GetById(ctx context.Context, postIds []uint) ([]domain.Interactive, error) { |
| 102 | ics, err := i.dao.GetByIds(ctx, postIds) |
| 103 | if err != nil { |
| 104 | return make([]domain.Interactive, 0), err |
| 105 | } |
| 106 | |
| 107 | result := make([]domain.Interactive, len(ics)) |
| 108 | for idx, ic := range ics { |
| 109 | result[idx] = toDomain(ic) |
| 110 | } |
| 111 | return result, nil |
| 112 | } |
| 113 | |
| 114 | // checkExistence 检查是否存在 |
| 115 | func (i *InteractiveRepositoryImpl) checkExistence(err error, logMsg string) (bool, error) { |