45 lines
2.0 KiB
Go
45 lines
2.0 KiB
Go
package model
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
// Contact 联系我们模型
|
||
type Contact struct {
|
||
Id int `json:"id" dc:"主键"`
|
||
Name string `json:"name" dc:"姓名"`
|
||
Email string `json:"email" dc:"邮箱"`
|
||
Phone string `json:"phone" dc:"电话"`
|
||
Company string `json:"company" dc:"公司"`
|
||
Subject string `json:"subject" dc:"主题"`
|
||
Message string `json:"message" dc:"留言内容"`
|
||
Ip string `json:"ip" dc:"IP地址"`
|
||
UserAgent string `json:"user_agent" dc:"用户代理"`
|
||
Status int `json:"status" dc:"状态 0:未处理 1:已处理 2:已回复"`
|
||
Reply string `json:"reply" dc:"回复内容"`
|
||
RepliedAt *gtime.Time `json:"replied_at" dc:"回复时间"`
|
||
RepliedBy int `json:"replied_by" dc:"回复人ID"`
|
||
CreatedAt *gtime.Time `json:"created_at" dc:"创建时间"`
|
||
UpdatedAt *gtime.Time `json:"updated_at" dc:"更新时间"`
|
||
}
|
||
|
||
// CreateContactRequest 创建联系信息请求
|
||
type CreateContactRequest struct {
|
||
Name string `json:"name" v:"required|length:1,50#姓名不能为空|姓名长度不能超过50字符" dc:"姓名"`
|
||
Email string `json:"email" v:"required|email#邮箱不能为空|邮箱格式不正确" dc:"邮箱"`
|
||
Phone string `json:"phone" dc:"电话"`
|
||
Company string `json:"company" dc:"公司"`
|
||
Subject string `json:"subject" v:"required|length:1,200#主题不能为空|主题长度不能超过200字符" dc:"主题"`
|
||
Message string `json:"message" v:"required|length:1,2000#留言内容不能为空|留言内容长度不能超过2000字符" dc:"留言内容"`
|
||
}
|
||
|
||
// ReplyContactRequest 回复联系信息请求
|
||
type ReplyContactRequest struct {
|
||
Reply string `json:"reply" v:"required|length:1,2000#回复内容不能为空|回复内容长度不能超过2000字符" dc:"回复内容"`
|
||
}
|
||
|
||
// ContactTrend 联系信息趋势数据
|
||
type ContactTrend struct {
|
||
Date string `json:"date" dc:"日期"`
|
||
Count int `json:"count" dc:"数量"`
|
||
} |