A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat(badge): change badge_award check
kumfo122ac657f14f
diff --git a/internal/repo/badge_award/badge_award_repo.go b/internal/repo/badge_award/badge_award_repo.goindex 0a460347..85d3ceac 100644--- a/internal/repo/badge_award/badge_award_repo.go+++ b/internal/repo/badge_award/badge_award_repo.go@@ -43,10 +43,10 @@ func NewBadgeAwardRepo(data *data.Data, uniqueIDRepo unique.UniqueIDRepo) badge_}}-func (r *badgeAwardRepo) Award(ctx context.Context, badgeID string, userID string, objectID string, force bool, createdAt time.Time) {+func (r *badgeAwardRepo) Award(ctx context.Context, badgeID string, userID string, awardKey string, force bool, createdAt time.Time) {return}-func (r *badgeAwardRepo) CheckIsAward(ctx context.Context, badgeID string, userID string, objectID string) (isAward bool) {+func (r *badgeAwardRepo) CheckIsAward(ctx context.Context, badgeID string, userID string, awardKey string) (isAward bool) {return}func (r *badgeAwardRepo) CountByUserIdAndBadgeLevel(ctx context.Context, userID string, badgeLevel entity.BadgeLevel) (awardCount int64) {diff --git a/internal/service/badge_award/badge_award_service.go b/internal/service/badge_award/badge_award_service.goindex 7eb218fd..d94258b4 100644--- a/internal/service/badge_award/badge_award_service.go+++ b/internal/service/badge_award/badge_award_service.go@@ -33,8 +33,8 @@ import ()type BadgeAwardRepo interface {- Award(ctx context.Context, badgeID string, userID string, objectID string, force bool, createdAt time.Time)- CheckIsAward(ctx context.Context, badgeID string, userID string, objectID string) bool+ Award(ctx context.Context, badgeID string, userID string, awardKey string, force bool, createdAt time.Time)+ CheckIsAward(ctx context.Context, badgeID string, userID string, awardKey string) boolCountByUserIdAndBadgeLevel(ctx context.Context, userID string, badgeLevel entity.BadgeLevel) (awardCount int64)CountByUserId(ctx context.Context, userID string) (awardCount int64)