chore: update id type to int32

This commit is contained in:
Steven
2023-08-02 08:41:56 +08:00
parent c26834e9cd
commit d6dccb1f95
14 changed files with 61 additions and 50 deletions

View File

@ -48,8 +48,8 @@ func (l ActivityLevel) String() string {
}
type Activity struct {
ID int
CreatorID int
ID int32
CreatorID int32
CreatedTs int64
Type ActivityType
Level ActivityLevel

View File

@ -2,6 +2,6 @@ package store
import "fmt"
func getUserSettingCacheKey(userID int, key string) string {
func getUserSettingCacheKey(userID int32, key string) string {
return fmt.Sprintf("%d-%s", userID, key)
}

View File

@ -39,10 +39,10 @@ type OpenGraphMetadata struct {
}
type Shortcut struct {
ID int
ID int32
// Standard fields
CreatorID int
CreatorID int32
CreatedTs int64
UpdatedTs int64
RowStatus RowStatus
@ -58,7 +58,7 @@ type Shortcut struct {
}
type UpdateShortcut struct {
ID int
ID int32
RowStatus *RowStatus
Name *string
@ -71,8 +71,8 @@ type UpdateShortcut struct {
}
type FindShortcut struct {
ID *int
CreatorID *int
ID *int32
CreatorID *int32
RowStatus *RowStatus
Name *string
VisibilityList []Visibility
@ -80,7 +80,7 @@ type FindShortcut struct {
}
type DeleteShortcut struct {
ID int
ID int32
}
func (s *Store) CreateShortcut(ctx context.Context, create *Shortcut) (*Shortcut, error) {

View File

@ -17,7 +17,7 @@ const (
)
type User struct {
ID int
ID int32
// Standard fields
CreatedTs int64
@ -32,7 +32,7 @@ type User struct {
}
type UpdateUser struct {
ID int
ID int32
RowStatus *RowStatus
Email *string
@ -42,7 +42,7 @@ type UpdateUser struct {
}
type FindUser struct {
ID *int
ID *int32
RowStatus *RowStatus
Email *string
Nickname *string
@ -50,7 +50,7 @@ type FindUser struct {
}
type DeleteUser struct {
ID int
ID int32
}
func (s *Store) CreateUser(ctx context.Context, create *User) (*User, error) {

View File

@ -7,13 +7,13 @@ import (
)
type UserSetting struct {
UserID int
UserID int32
Key string
Value string
}
type FindUserSetting struct {
UserID *int
UserID *int32
Key string
}