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): update entity
kumfob70229492031
diff --git a/internal/entity/badge.go b/internal/entity/badge.goindex d310ef79..0b296f61 100644--- a/internal/entity/badge.go+++ b/internal/entity/badge.go@@ -21,20 +21,25 @@ package entityimport "time"+const (+ BadgeStatusAvailable = 1+ BadgeStatusDeleted = 10+)+// Badge badgetype Badge struct {ID string `json:"id" xorm:"id"`- CreatedAt time.Time `json:"created_at" xorm:"created_at"`- UpdatedAt time.Time `json:"updated_at" xorm:"updated_at"`- Name string `json:"name" xorm:"name"`- AwardTotal int64 `json:"award_total" xorm:"award_total"`- Description string `json:"description" xorm:"description"`- Status int8 `json:"status" xorm:"status"`- BadgeGroupId int64 `json:"badge_group_id" xorm:"badge_group_id"`- Single int8 `json:"single" xorm:"single"`- Collect string `json:"collect" xorm:"collect"`- Handler string `json:"handler" xorm:"handler"`- Param string `json:"param" xorm:"param"`+ CreatedAt time.Time `json:"created_at" xorm:"created not null default CURRENT_TIMESTAMP TIMESTAMP created_at"`+ UpdatedAt time.Time `json:"updated_at" xorm:"updated not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"`+ Name string `json:"name" xorm:"not null default '' VARCHAR(256) name"`+ AwardCount int64 `json:"award_count" xorm:"not null default 0 INT(11) award_count"`+ Description string `json:"description" xorm:"not null default '' MEDIUMTEXT description"`+ Status int8 `json:"status" xorm:"not null default 1 INT(11) status"`+ BadgeGroupId int64 `json:"badge_group_id" xorm:"not null default 0 BIGINT(20) badge_group_id"`+ Single int8 `json:"single" xorm:"not null default 1 TINYINT(4) single"`+ Collect string `json:"collect" xorm:"not null default '' VARCHAR(64) collect"`+ Handler string `json:"handler" xorm:"not null default '' VARCHAR(64) handler"`+ Param string `json:"param" xorm:"not null default '' VARCHAR(128) param"`}// TableName badge table namediff --git a/internal/entity/badge_award.go b/internal/entity/badge_award.goindex fe1dab96..01100b1f 100644--- a/internal/entity/badge_award.go+++ b/internal/entity/badge_award.go@@ -24,13 +24,13 @@ import "time"// BadgeAward badge_awardtype BadgeAward struct {ID string `json:"id" xorm:"id"`- CreatedAt time.Time `json:"created_at" xorm:"created_at"`- UpdatedAt time.Time `json:"updated_at" xorm:"updated_at"`- UserId int64 `json:"user_id" xorm:"user_id"`- BadgeId int64 `json:"badge_id" xorm:"badge_id"`- ObjectId int64 `json:"object_id" xorm:"object_id"`- BadgeGroupId int8 `json:"badge_group_id" xorm:"badge_group_id"`- IsBadgeDeleted int8 `json:"is_badge_deleted" xorm:"is_badge_deleted"`+ CreatedAt time.Time `json:"created_at" xorm:"created not null default CURRENT_TIMESTAMP TIMESTAMP created_at"`+ UpdatedAt time.Time `json:"updated_at" xorm:"updated not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"`+ UserId int64 `json:"user_id" xorm:"not null index BIGINT(20) user_id"`+ BadgeId int64 `json:"badge_id" xorm:"not null index BIGINT(20) badge_id"`+ ObjectId int64 `json:"object_id" xorm:"not null index BIGINT(20) object_id"`+ BadgeGroupId int8 `json:"badge_group_id" xorm:"not null index BIGINT(20) badge_group_id"`+ IsBadgeDeleted int8 `json:"is_badge_deleted" xorm:"not null index TINYINT(1) s_badge_deleted"`}// TableName badge_award table namediff --git a/internal/entity/badge_group.go b/internal/entity/badge_group.goindex 14535299..9953d067 100644--- a/internal/entity/badge_group.go+++ b/internal/entity/badge_group.go@@ -23,10 +23,10 @@ import "time"// BadgeGroup badge_grouptype BadgeGroup struct {- ID string `json:"id" xorm:"id"`- Name string `json:"name" xorm:"name"`- CreatedAt time.Time `json:"created_at" xorm:"created_at"`- UpdatedAt time.Time `json:"updated_at" xorm:"updated_at"`+ ID string `json:"id" xorm:"not null pk autoincr BIGINT(20) id"`+ Name string `json:"name" xorm:"not null default '' VARCHAR(256) name"`+ CreatedAt time.Time `json:"created_at" xorm:"created not null default CURRENT_TIMESTAMP TIMESTAMP created_at"`+ UpdatedAt time.Time `json:"updated_at" xorm:"updated not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"`}// TableName badge_group table name