26 lines
797 B
Go
26 lines
797 B
Go
package model
|
|
|
|
// User 用户模型
|
|
type Invite struct {
|
|
Model
|
|
UserId int32 `gorm:"column:user_id;comment:邀请人账号id"`
|
|
UserInfo *User `gorm:"foreignKey:id;reference:UserId"`
|
|
InvitedId int32 `gorm:"column:invited_id;default:0;comment:受邀请画家宝用户id"`
|
|
InviteCode string `gorm:"column:invite_code;type:varchar(191);comment:邀请人的邀请码"`
|
|
InvitedCode string `gorm:"column:invited_code;type:varchar(191);comment:受邀请人的邀请码"`
|
|
}
|
|
|
|
func (i Invite) TableName() string {
|
|
return "invite"
|
|
}
|
|
|
|
type InvitedCodeService struct {
|
|
InvitedCode string `form:"invitedCode" json:"invitedCode"`
|
|
}
|
|
|
|
type InviteService struct {
|
|
Id int32 `json:"id"`
|
|
UserId int32 `form:"userId" json:"userId"`
|
|
InvitedId int32 `form:"invitedId" json:"invitedId"`
|
|
}
|