🎨 新增讲师关注功能

This commit is contained in:
2025-09-06 21:47:31 +08:00
parent 90bd42d488
commit 7bcc2370bd
7 changed files with 230 additions and 1 deletions

13
model/app/follow.go Normal file
View File

@@ -0,0 +1,13 @@
package app
import "git.echol.cn/loser/lckt/global"
type Follow struct {
global.GVA_MODEL
UserId uint `json:"userId" gorm:"comment:用户ID;uniqueIndex:idx_user_teacher"`
TeacherId uint `json:"teacherId" gorm:"comment:讲师ID;uniqueIndex:idx_user_teacher"`
}
func (Follow) TableName() string {
return "app_follow"
}

View File

@@ -21,4 +21,5 @@ type TeacherInfo struct {
NickName string `json:"nick_name" form:"nick_name"`
Avatar string `json:"avatar" form:"avatar"`
Des string `json:"des" form:"des"`
Follow int64 `json:"follow" form:"follow"` // 粉丝数
}

View File

@@ -20,6 +20,8 @@ type User struct {
UserType int8 `gorm:"column:user_type;default:1;NOT NULL;comment:'用户类型 1 用户 2 讲师'" json:"user_type" form:"user_type" `
IsVip int8 `gorm:"column:is_vip;default:0;NOT NULL;comment:'是否是VIP 0 否 1 是'" json:"is_vip" form:"is_vip"`
VipExpireTime string `json:"vip_expire_time" form:"vip_expire_time" gorm:"comment:VIP过期时间"`
//权重
Weight int `json:"weight" form:"weight" gorm:"comment:用户权重"`
}
func (User) TableName() string {