feat: 互动处理

This commit is contained in:
Blizzard
2026-03-05 16:54:25 +08:00
parent 74b252550b
commit 2583b5f302
30 changed files with 412 additions and 119 deletions
+1
View File
@@ -15,5 +15,6 @@ type Order struct {
Amount int `json:"amount" gorm:"column:amount;comment:金额分"`
Status int `json:"status" gorm:"column:status;comment:订单状态"` // 0:待支付 1:已支付 2:已关闭
PayStatus string `json:"payStatus" gorm:"column:pay_status;comment:支付状态"`
Type int `json:"type" gorm:"column:type;default:1;comment:支付类型"` // 1.订阅支付(包含包月包季包年) 2:vip支付
User *system.User `json:"user" gorm:"foreignKey:UserId"`
}
-29
View File
@@ -1,29 +0,0 @@
package radio
import (
"sundynix-go/global"
"sundynix-go/model/system"
)
// RadioUser 小程序用户信息表
type RadioUser struct {
global.BaseModel
UserId string `gorm:"size:50;uniqueIndex" json:"userId"` // 关联system用户ID
OpenId string `gorm:"size:80;uniqueIndex" json:"openId"` // 微信openid
UnionId string `gorm:"size:80" json:"unionId"` // 微信unionid
SessionKey string `gorm:"size:200" json:"sessionKey"` // 会话密钥
NickName string `gorm:"size:50" json:"nickName"` // 昵称
AvatarId string `gorm:"size:50" json:"avatarId"` // 头像OSS ID
Avatar *system.Oss `gorm:"foreignKey:AvatarId" json:"avatar"` // 头像OSS
Gender int `gorm:"default:0" json:"gender"` // 性别 0:未知 1:男 2:女
Country string `gorm:"size:50" json:"country"` // 国家
Province string `gorm:"size:50" json:"province"` // 省份
City string `gorm:"size:50" json:"city"` // 城市
Language string `gorm:"size:20" json:"language"` // 语言
IsVip int `gorm:"default:0" json:"isVip"` // 是否VIP 0:否 1:是
VipExpireAt *int64 `gorm:"type:bigint" json:"vipExpireAt"` // VIP过期时间
}
func (RadioUser) TableName() string {
return "sundynix_radio_user"
}
+18
View File
@@ -0,0 +1,18 @@
package radio
import (
"sundynix-go/global"
"time"
)
type Vip struct {
global.BaseModel
Price int `gorm:"default:0;comment:价格,单位,分 " json:"price"` //vip价格 单位:分
DiscountedPrice int `gorm:"default:0;comment:优惠价格,单位,分 " json:"discountedPrice"` // 优惠价格 单位:分
ExpiredAt time.Time `gorm:"index;column:expired_at" json:"expiredAt"` //过期时间
Remark string `gorm:"column:remark" json:"remark"` //备注
}
func (Vip) TableName() string {
return "sundynix_radio_vip_config"
}
+8
View File
@@ -0,0 +1,8 @@
package request
type UpdateVipConfig struct {
Id string `json:"id" binding:"required"`
Price int `json:"price" binding:"required"`
DiscountedPrice int `json:"discountedPrice"`
Remark string `json:"remark"`
}
+20 -13
View File
@@ -2,6 +2,7 @@ package system
import (
"sundynix-go/global"
"time"
)
type Login interface {
@@ -11,19 +12,25 @@ type Login interface {
}
type User struct {
global.BaseModel
TenantId string `gorm:"size:20;" json:"tenantId" form:"tenantId"`
ClientId string `gorm:"size:20;" json:"clientId"`
Name string `gorm:"size:20" json:"name" form:"name"`
Account string `gorm:"size:11;" json:"account" form:"account"`
Password string `gorm:"size:100;" json:"-" form:"password"`
NickName string `gorm:"size:20;column:nick_name" json:"nickName" form:"nickName"`
Phone string `gorm:"size:20;column:phone" json:"phone" form:"phone"`
SessionKey string `gorm:"size:80;column:session_key" json:"sessionKey" form:"sessionKey"`
UnionId string `gorm:"size:80;column:union_id" json:"unionId"`
MiniOpenId string `gorm:"size:80;column:mini_open_id" json:"miniOpenId" form:"miniOpenId"`
SaOpenId string `gorm:"size:80;column:sa_open_id" json:"saOpenId"`
AvatarId string `gorm:"size:50;column:avatar_id" json:"avatarId"`
Avatar *Oss `gorm:"foreignKey:AvatarId" json:"avatar"`
TenantId string `gorm:"size:20;" json:"tenantId" form:"tenantId"`
ClientId string `gorm:"size:20;" json:"clientId"`
Name string `gorm:"size:20" json:"name" form:"name"`
Account string `gorm:"size:11;" json:"account" form:"account"`
Password string `gorm:"size:100;" json:"-" form:"password"`
NickName string `gorm:"size:20;column:nick_name" json:"nickName" form:"nickName"`
Phone string `gorm:"size:20;column:phone" json:"phone" form:"phone"`
SessionKey string `gorm:"size:80;column:session_key" json:"sessionKey" form:"sessionKey"`
UnionId string `gorm:"size:80;column:union_id" json:"unionId"`
OpenId string `gorm:"size:80;column:open_id" json:"openId" form:"openId"`
AvatarId string `gorm:"size:50;column:avatar_id" json:"avatarId"`
Avatar *Oss `gorm:"foreignKey:AvatarId" json:"avatar"`
Gender int `gorm:"default:0" json:"gender"` // 性别 0:未知 1:男 2:女
Country string `gorm:"size:50" json:"country"` // 国家
Province string `gorm:"size:50" json:"province"` // 省份
City string `gorm:"size:50" json:"city"` // 城市
Language string `gorm:"size:20" json:"language"` // 语言
IsVip int `gorm:"default:0" json:"isVip"` // 是否VIP 0:否 1:是
VipExpireAt *time.Time `gorm:"column:vip_expire_at" json:"vipExpireAt"` // VIP过期时间
}
func (u *User) GetAccount() string {