This commit is contained in:
@@ -13,7 +13,7 @@ const (
|
||||
type SignIn struct {
|
||||
*BaseConfig
|
||||
SignType uint32 `gorm:"not null;default:1;uniqueIndex:idx_sign_type_stage;comment:'签到类别(1-累计 2-连续)'" json:"sign_type"`
|
||||
StageDays uint32 `gorm:"not null;default:1;uniqueIndex:idx_sign_type_stage;comment:'签到阶段天数(1/3/7/14/30)'" json:"stage_days"`
|
||||
StageDays uint32 `gorm:"not null;default:1;uniqueIndex:idx_sign_type_stage;comment:'签到阶段天数(0/1/3/7/14/30)'" json:"stage_days"`
|
||||
CdkID uint32 `gorm:"not null;uniqueIndex;comment:'绑定的CDK配置ID'" json:"cdk_id"`
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
var signStageDays = map[uint32]struct{}{
|
||||
0: {},
|
||||
1: {},
|
||||
3: {},
|
||||
7: {},
|
||||
@@ -50,7 +51,7 @@ func (s *SignInService) ModifyBefore(ctx context.Context, method string, param g
|
||||
|
||||
stageDays := gconv.Uint32(param["stage_days"])
|
||||
if _, ok := signStageDays[stageDays]; !ok {
|
||||
return fmt.Errorf("签到阶段仅支持1、3、7、14、30天")
|
||||
return fmt.Errorf("签到阶段仅支持0、1、3、7、14、30天")
|
||||
}
|
||||
|
||||
cdkID := gconv.Uint32(param["cdk_id"])
|
||||
|
||||
Reference in New Issue
Block a user