diff --git a/artalk-go.example.yml b/artalk-go.example.yml index 6d68bde..a19f3e2 100644 --- a/artalk-go.example.yml +++ b/artalk-go.example.yml @@ -30,7 +30,7 @@ db: # 数据库地址 host: "localhost" # 数据库端口 - port: "3306" + port: 3306 # 数据库账户 user: "root" # 数据库密码 diff --git a/model/comment.go b/model/comment.go index 15f89c0..cccc967 100644 --- a/model/comment.go +++ b/model/comment.go @@ -160,6 +160,7 @@ type CookedCommentForEmail struct { ContentRaw string `json:"content_raw"` Nick string `json:"nick"` Email string `json:"email"` + IP string `json:"ip"` Datetime string `json:"datetime"` Date string `json:"date"` Time string `json:"time"` @@ -181,6 +182,7 @@ func (c *Comment) ToCookedForEmail() CookedCommentForEmail { ContentRaw: c.Content, Nick: user.Name, Email: user.Email, + IP: c.IP, Datetime: c.CreatedAt.Local().Format("2006-01-02 15:04:05"), Date: c.CreatedAt.Local().Format("2006-01-02"), Time: c.CreatedAt.Local().Format("15:04:05"),