RIceWqy 2 years ago
parent c95d5088b4
commit e818c6a652

@ -0,0 +1,31 @@
package comment
import "time"
func (Comment) TableName() string {
return "comment"
}
// Comment 用户评论结构体
type Comment struct {
ID int `json:"id"` // 评论ID
GoodsID int `json:"goods_id"` // 商品ID
OrderID int `json:"order_id"` // 订单ID
OrderItemID int `json:"order_item_id"` // 订单项ID
UserID int `json:"user_id"` // 用户ID
Level int `json:"level"` // 评级
Content string `json:"content"` // 评论内容
Images []string `json:"images"` // 评论图片列表
Status string `json:"status"` // 评论状态
AdminID int `json:"admin_id"` // 管理员ID
ReplyContent string `json:"reply_content"` // 回复内容
ReplyTime time.Time `json:"replytime"` // 回复时间
CreateTime int64 `json:"createtime"` // 创建时间
UpdateTime int64 `json:"updatetime"` // 更新时间
DeleteTime int64 `json:"deletetime"` // 删除时间
User struct {
ID int `json:"id"` // 用户ID
Nickname string `json:"nickname"` // 用户昵称
Avatar string `json:"avatar"` // 用户头像
} `json:"user" xorm:"-"` // 用户信息
}

@ -0,0 +1,12 @@
package comment
import (
"github.com/towgo/towgo/dao/ormDriver/xormDriver"
"github.com/towgo/towgo/towgo"
)
func init() {
xormDriver.Sync2(new(Comment))
towgo.NewCRUDJsonrpcAPI("/comment", Comment{}, []Comment{}).RegAPI()
}
Loading…
Cancel
Save