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

Method GetById

internal/repository/interactive.go:101–112  ·  view source on GitHub ↗

GetById 批量获取互动信息

(ctx context.Context, postIds []uint)

Source from the content-addressed store, hash-verified

99
100// GetById 批量获取互动信息
101func (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 检查是否存在
115func (i *InteractiveRepositoryImpl) checkExistence(err error, logMsg string) (bool, error) {

Callers

nothing calls this directly

Calls 2

toDomainFunction · 0.85
GetByIdsMethod · 0.65

Tested by

no test coverage detected