mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 02:33:42 +08:00
feat: add invitation and promotion functions
This commit is contained in:
12
api/store/model/invite_code.go
Normal file
12
api/store/model/invite_code.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type InviteCode struct {
|
||||
Id uint `gorm:"primarykey;column:id"`
|
||||
UserId uint
|
||||
Code string
|
||||
Hits int // 点击次数
|
||||
RegNum int // 注册人数
|
||||
CreatedAt time.Time
|
||||
}
|
||||
15
api/store/model/invite_log.go
Normal file
15
api/store/model/invite_log.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type InviteLog struct {
|
||||
Id uint `gorm:"primarykey;column:id"`
|
||||
InviterId uint
|
||||
UserId uint
|
||||
Username string
|
||||
InviteCode string
|
||||
Reward string `gorm:"column:reward_json"` // 邀请奖励
|
||||
CreatedAt time.Time
|
||||
}
|
||||
10
api/store/vo/invite_code.go
Normal file
10
api/store/vo/invite_code.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package vo
|
||||
|
||||
type InviteCode struct {
|
||||
Id uint `json:"id"`
|
||||
UserId uint `json:"user_id"`
|
||||
Code string `json:"code"`
|
||||
Hits int `json:"hits"`
|
||||
RegNum int `json:"reg_num"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
15
api/store/vo/invite_log.go
Normal file
15
api/store/vo/invite_log.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package vo
|
||||
|
||||
import (
|
||||
"chatplus/core/types"
|
||||
)
|
||||
|
||||
type InviteLog struct {
|
||||
Id uint `json:"id"`
|
||||
InviterId uint `json:"inviter_id"`
|
||||
UserId uint `json:"user_id"`
|
||||
Username string `json:"username"`
|
||||
InviteCode string `json:"invite_code"`
|
||||
Reward types.InviteReward `json:"reward"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user