This commit is contained in:
aozhiwei 2024-06-23 14:09:18 +08:00
parent d5c012c201
commit 86e96732a7
4 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package mt
import (
"f5"
"mtb"
)
type Mail struct {
mtb.Mail
}
type MailTable struct {
f5.NameMetaTable[Mail]
}

View File

@ -12,6 +12,7 @@ type table struct {
Config *ConfigTable
Item *ItemTable
Language *LanguageTable
Mail *MailTable
RankSeason *RankSeasonTable
HashRateCommon *HashRateCommonTable
Contract *ContractTable
@ -48,6 +49,11 @@ var Table = f5.New(func(this *table) {
this.PrimKey = "id"
})
this.Mail = f5.New(func(this *MailTable) {
this.FileName = "../config/mail.json"
this.PrimKey = "name"
})
this.Language = f5.New(func(this *LanguageTable) {
this.FileName = "../res/language@language.json"
this.PrimKey = "info"

View File

@ -72,6 +72,15 @@ type Language struct {
_flags2_ uint64
}
type Mail struct {
name string
subject string
content string
_flags1_ uint64
_flags2_ uint64
}
type RankSeason struct {
id int32
name string
@ -300,6 +309,30 @@ func (this *Language) HasEn() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *Mail) GetName() string {
return this.name
}
func (this *Mail) HasName() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0
}
func (this *Mail) GetSubject() string {
return this.subject
}
func (this *Mail) HasSubject() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *Mail) GetContent() string {
return this.content
}
func (this *Mail) HasContent() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *RankSeason) GetId() int32 {
return this.id
}
@ -412,6 +445,12 @@ func (this *Language) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.en, "en", &this._flags1_, 2, kv)
}
func (this *Mail) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.name, "name", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.subject, "subject", &this._flags1_, 2, kv)
f5.ReadMetaTableField(&this.content, "content", &this._flags1_, 3, kv)
}
func (this *RankSeason) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.id, "id", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.name, "name", &this._flags1_, 2, kv)

View File

@ -56,6 +56,13 @@ message Language
optional string en = 2;
}
message Mail
{
optional string name = 1;
optional string subject = 2;
optional string content = 3;
}
message RankSeason
{
optional int32 id = 1;