MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / GetByIds

Method GetByIds

internal/service/interactive.go:99–115  ·  view source on GitHub ↗

GetByIds 批量获取互动信息

(ctx context.Context, postIds []uint)

Source from the content-addressed store, hash-verified

97
98// GetByIds 批量获取互动信息
99func (i *interactiveService) GetByIds(ctx context.Context, postIds []uint) (map[uint]domain.Interactive, error) {
100 if len(postIds) == 0 {
101 return nil, errors.New("invalid parameters")
102 }
103
104 interactions, err := i.repo.GetById(ctx, postIds)
105 if err != nil {
106 return nil, err
107 }
108
109 result := make(map[uint]domain.Interactive, len(interactions))
110 for _, interaction := range interactions {
111 result[interaction.BizID] = interaction
112 }
113
114 return result, nil
115}

Callers

nothing calls this directly

Calls 1

GetByIdMethod · 0.65

Tested by

no test coverage detected