You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by ro...@apache.org on 2024/08/21 07:13:31 UTC

(incubator-answer) 30/49: feat(badge): change badge_award check

This is an automated email from the ASF dual-hosted git repository.

robin0716 pushed a commit to branch develop/robin
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 62e5bf21870e276231ce0408a854c7bccde583df
Author: kumfo <ku...@sifou.com>
AuthorDate: Thu Aug 8 18:17:41 2024 +0800

    feat(badge): change badge_award check
---
 internal/repo/badge_award/badge_award_repo.go       | 4 ++--
 internal/service/badge_award/badge_award_service.go | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/internal/repo/badge_award/badge_award_repo.go b/internal/repo/badge_award/badge_award_repo.go
index 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.go
index 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) bool
 
 	CountByUserIdAndBadgeLevel(ctx context.Context, userID string, badgeLevel entity.BadgeLevel) (awardCount int64)
 	CountByUserId(ctx context.Context, userID string) (awardCount int64)