Skip to content

Commit

Permalink
Merge pull request #13 from fsy2001/main
Browse files Browse the repository at this point in the history
Change maximum length of push tokens to 256
  • Loading branch information
JingYiJun authored May 4, 2024
2 parents b4f11f8 + a6a5b4b commit 0af2e69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis/token/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package token
type CreateTokenRequest struct {
DeviceID string `json:"device_id" validate:"max=64"`
Service string `json:"service" validate:"required,oneof=apns fcm mipush"`
Token string `json:"token" validate:"max=64"`
Token string `json:"token" validate:"max=256"`
PackageName string `json:"package_name"`
}
2 changes: 1 addition & 1 deletion models/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type PushToken struct {
UserID int `json:"user_id" gorm:"primaryKey;not null"` // not required
Service PushService `json:"service" gorm:"not null" swaggertype:"string" validate:"required,oneof=apns fcm mipush"`
DeviceID string `json:"device_id" gorm:"uniqueIndex:,length:10;not null;size:64" validate:"required,max=64"`
Token string `json:"token" gorm:"primaryKey;not null;size:64;index:,length:10" validate:"required,max=64"`
Token string `json:"token" gorm:"primaryKey;not null;size:256;index:,length:10" validate:"required,max=256"`
PackageName string `json:"package_name"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
Expand Down

0 comments on commit 0af2e69

Please sign in to comment.