package activity

import (
	"context"

	"bindbox-game/internal/repository/mysql/model"
)

func (s *service) ListIssueRewards(ctx context.Context, issueID int64) (items []*model.ActivityRewardSettings, err error) {
	items, err = s.readDB.ActivityRewardSettings.WithContext(ctx).Where(s.readDB.ActivityRewardSettings.IssueID.Eq(issueID)).Order(s.readDB.ActivityRewardSettings.Sort.Asc()).Find()
	if err != nil {
		return nil, err
	}
	return items, nil
}
