feat(friend): 添加好友系统功能实现 完善好友管理功能,包括添加好友、回复好友请求、删除好友等操作, 同时优化了相关数据结构和接口定义。 BREAKING CHANGE: 调整了黑名单数据结构,将BlackInfo从结构体改为uint32数组 ```
40 lines
858 B
Go
40 lines
858 B
Go
package model
|
|
|
|
import (
|
|
"blazing/cool"
|
|
)
|
|
|
|
// 表名常量
|
|
const TableNamePlayerTitle = "player_title"
|
|
|
|
// PlayerTitle 对应数据库表 <player_title>
|
|
type Title struct {
|
|
Base
|
|
PlayerID uint64 `gorm:"not null;index:idx_player_title_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
|
//TitleID uint32 `gorm:"not null;comment:'称号ID'" json:"title_id"`
|
|
//可用称号
|
|
AvailableTitle []uint32 `gorm:"type:jsonb; comment:'可用称号'" json:"available_title"`
|
|
}
|
|
|
|
// TableName 返回表名
|
|
func (*Title) TableName() string {
|
|
return TableNamePlayerTitle
|
|
}
|
|
|
|
// GroupName 返回表组名
|
|
func (*Title) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
// NewPlayerTitle 创建一个新的称号记录
|
|
func NewPlayerTitle() *Title {
|
|
return &Title{
|
|
Base: *NewBase(),
|
|
}
|
|
}
|
|
|
|
// init 程序启动时自动创建表
|
|
func init() {
|
|
cool.CreateTable(&Title{})
|
|
}
|