first commit

This commit is contained in:
Yangtao
2025-11-18 17:48:20 +08:00
commit 6e56cab848
196 changed files with 65809 additions and 0 deletions

View File

@ -0,0 +1,36 @@
package req
import (
"errors"
)
type AppMomentCreate struct {
ClanID string `gorm:"column:clan_id;type:char(32);not null;comment:家" json:"clan_id"`
Title string `gorm:"column:title;type:varchar(64);not null;comment:标题" json:"title"`
TextContent string `gorm:"column:text_content;type:varchar(2048);not null;comment:内容" json:"text_content"`
Items []AppMomentCreateItem `json:"items"`
}
func (req *AppMomentCreate) Check() (err error) {
return nil
}
type AppMomentUpdate struct {
IDBody
Nickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"nickname"`
Sign string `gorm:"column:sign;type:varchar(255);not null;comment:签名" json:"sign"`
Avatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"avatar"`
}
func (req *AppMomentUpdate) Check() (err error) {
if len(req.Nickname) == 0 {
err = errors.New("名称不能为空")
return
}
return nil
}
type AppMomentCreateItem struct {
Type string `gorm:"column:type;type:varchar(64);not null;comment:类型PIC=图片" json:"type"`
Content string `gorm:"column:content;type:varchar(255);not null;comment:内容、如图片id" json:"content"`
}