fix:分享
This commit is contained in:
@@ -108,6 +108,22 @@ func (d *OutfitDao) OutfitGetByID(ctx context.Context, id int64) (*mysqlmodel.Ou
|
||||
return &outfit, nil
|
||||
}
|
||||
|
||||
// OutfitGetByIDs 按主键 ID 批量查询穿搭
|
||||
func (d *OutfitDao) OutfitGetByIDs(ctx context.Context, ids []int64) ([]mysqlmodel.Outfit, error) {
|
||||
ctx, span := global.Tracer.Start(ctx, "mysqldao.OutfitGetByIDs")
|
||||
defer span.End()
|
||||
|
||||
var list []mysqlmodel.Outfit
|
||||
if len(ids) == 0 {
|
||||
return list, nil
|
||||
}
|
||||
if err := d.db.WithContext(ctx).Where("id IN ?", ids).Find(&list).Error; err != nil {
|
||||
span.RecordError(err)
|
||||
return nil, err
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// OutfitGetByUUIDs 按 UUID 批量查询穿搭
|
||||
func (d *OutfitDao) OutfitGetByUUIDs(ctx context.Context, uuids []string) ([]mysqlmodel.Outfit, error) {
|
||||
ctx, span := global.Tracer.Start(ctx, "mysqldao.OutfitGetByUUIDs")
|
||||
|
||||
Reference in New Issue
Block a user