Files
servicebase/pkg/req/app_user_moment.go
2025-11-18 17:48:20 +08:00

37 lines
1.2 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"`
}