57 lines
2.3 KiB
Go
57 lines
2.3 KiB
Go
package api
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Image struct {
|
|
ID int `json:"id" db:"id"`
|
|
Width int `json:"width" db:"width"`
|
|
Height int `json:"height" db:"height"`
|
|
Content string `json:"content" db:"content"`
|
|
Remark string `json:"remark" db:"remark"`
|
|
Description string `json:"description" db:"description"`
|
|
Tags string `json:"tags" db:"tags"`
|
|
Rank string `json:"rank" db:"rank"`
|
|
Text string `json:"text" db:"text"`
|
|
CommentNum int `json:"comment_num" db:"comment_num"`
|
|
ArticleCategoryTopId int `json:"article_category_top_id" db:"article_category_top_id"`
|
|
PraiseCount int `json:"praise_count" db:"praise_count"`
|
|
CollectCount int `json:"collect_count" db:"collect_count"`
|
|
ArticleID int `json:"article_id" db:"article_id"`
|
|
UserID int `json:"user_id" db:"user_id"`
|
|
User User `json:"user" db:"-"`
|
|
Article Article `json:"article" db:"-"`
|
|
CreateTime time.Time `json:"create_time" db:"create_time"`
|
|
UpdateTime time.Time `json:"update_time" db:"update_time"`
|
|
}
|
|
|
|
type User struct {
|
|
ID int `json:"id" db:"id"`
|
|
UserName *string `json:"user_name" db:"user_name"`
|
|
Avatar *string `json:"avatar" db:"avatar"`
|
|
Rank *string `json:"rank" db:"rank"`
|
|
CreateTime time.Time `json:"create_time" db:"create_time"`
|
|
UpdateTime time.Time `json:"update_time" db:"update_time"`
|
|
}
|
|
|
|
type Article struct {
|
|
ID int `json:"id" db:"id"`
|
|
Title string `json:"title" db:"title"`
|
|
Tags string `json:"tags" db:"tags"`
|
|
CreateTime time.Time `json:"create_time" db:"create_time"`
|
|
UpdateTime time.Time `json:"update_time" db:"update_time"`
|
|
}
|
|
|
|
// 输入配置
|
|
type ConfigMysql struct {
|
|
Host string
|
|
Port int
|
|
Database string
|
|
UserName string
|
|
Password string
|
|
}
|
|
type Config struct {
|
|
Mysql ConfigMysql
|
|
}
|