This repository has been archived on 2025-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
boilerplate/internal/models/models.go
2025-03-08 20:06:06 +07:00

23 lines
621 B
Go

package models
var Entities = []any{
&Post{}, &Author{},
}
type Post struct {
Id uint `gorm:"primaryKey" ui:"hidden"`
Text string `displayName:"Текст" ui:"label=Текст"`
Deadline int64 `ui:"label=Дедлайн"`
CreatedAt int64 `gorm:"autoCreateTime" ui:"hidden"`
AuthorId uint
Author Author `ui:"label=Автор, data=Author, field=[Name]"`
}
type Author struct {
Id uint `gorm:"primaryKey" ui:"hidden"`
Name string `ui:"label=Имя"`
Posts []Post `ui:"label=Посты, data=Post, field=[Text]"`
}
// TODO: correct processing the semicolon (get attention to quotes)