diff --git a/app/controllers/Content/focus.go b/app/controllers/Content/focus.go index 56f02df..c4a8854 100644 --- a/app/controllers/Content/focus.go +++ b/app/controllers/Content/focus.go @@ -158,7 +158,7 @@ func (c Focus) Add(focus *models.Focus) revel.Result { rand_num := rand.Intn(99999) //原图 - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //保存文件 old_img := save_path + new_file_name @@ -171,7 +171,7 @@ func (c Focus) Add(focus *models.Focus) revel.Result { return c.Redirect("/Message/") } - thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename) + thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename) //内容显示图片 web_url_img := web_save_path + thumb_name @@ -378,7 +378,7 @@ func (c Focus) Edit(focus *models.Focus) revel.Result { rand_num := rand.Intn(99999) //原图 - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //保存文件 old_img := save_path + new_file_name @@ -391,7 +391,7 @@ func (c Focus) Edit(focus *models.Focus) revel.Result { return c.Redirect("/Message/") } - thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename) + thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename) //内容显示图片 web_url_img := web_save_path + thumb_name diff --git a/app/controllers/Extend/copyfrom.go b/app/controllers/Extend/copyfrom.go index 1f7fe47..9da42a6 100644 --- a/app/controllers/Extend/copyfrom.go +++ b/app/controllers/Extend/copyfrom.go @@ -127,7 +127,7 @@ func (c Copyfrom) Add(copyfrom *models.Copyfrom) revel.Result { //新文件名 rand.Seed(time.Now().UnixNano()) rand_num := rand.Intn(99999) - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //创建目录 error := os.MkdirAll(save_path, os.ModePerm) @@ -287,7 +287,7 @@ func (c Copyfrom) Edit(copyfrom *models.Copyfrom) revel.Result { //新文件名 rand.Seed(time.Now().UnixNano()) rand_num := rand.Intn(99999) - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //创建目录 error := os.MkdirAll(save_path, os.ModePerm) diff --git a/app/controllers/Public/kindeditor.go b/app/controllers/Public/kindeditor.go index 14655a7..741afe7 100644 --- a/app/controllers/Public/kindeditor.go +++ b/app/controllers/Public/kindeditor.go @@ -164,7 +164,7 @@ func (c *Kindeditor) TitleImage(upload *models.Upload) revel.Result { rand_num := rand.Intn(99999) //原图 - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //保存文件 old_img := save_path + new_file_name @@ -181,7 +181,7 @@ func (c *Kindeditor) TitleImage(upload *models.Upload) revel.Result { //*******************图片处理**************** //缩略图400 - thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_100" + path.Ext(header.Filename) + thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_100" + path.Ext(header.Filename) //内容显示图片 web_url := web_save_path + thumb_name @@ -275,7 +275,7 @@ func (c *Kindeditor) Upload(upload *models.Upload) revel.Result { rand_num := rand.Intn(99999) //原图 - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //保存文件 old_img := save_path + new_file_name @@ -292,7 +292,7 @@ func (c *Kindeditor) Upload(upload *models.Upload) revel.Result { //*******************图片处理**************** //缩略图400 - new_img_thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename) + new_img_thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename) //内容显示图片 web_url := web_save_path + new_img_thumb_name @@ -302,17 +302,17 @@ func (c *Kindeditor) Upload(upload *models.Upload) revel.Result { utils.Resize(old_img, new_img_400, "400", "center", "white") //圆角图片生成 - new_img_thumb_0x4 := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_0x4" + path.Ext(header.Filename) + new_img_thumb_0x4 := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_0x4" + path.Ext(header.Filename) new_img_0x4 := save_path + new_img_thumb_0x4 utils.Vignette(new_img_400, new_img_0x4, "0x4") //图片反色处理 - new_img_thumb_negate := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_negate" + path.Ext(header.Filename) + new_img_thumb_negate := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_negate" + path.Ext(header.Filename) new_img_negate := save_path + new_img_thumb_negate utils.Negate(new_img_400, new_img_negate) //图片加水印之文字水印处理 - new_img_watermark := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_watermark" + path.Ext(header.Filename) + new_img_watermark := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_watermark" + path.Ext(header.Filename) new_img_watermark_file := save_path + new_img_watermark utils.WatermarkText(new_img_400, new_img_watermark_file) @@ -401,7 +401,7 @@ func (c *Kindeditor) AnnounceImage(upload *models.Upload) revel.Result { rand_num := rand.Intn(99999) //原图 - new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename) + new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename) //保存文件 old_img := save_path + new_file_name @@ -418,7 +418,7 @@ func (c *Kindeditor) AnnounceImage(upload *models.Upload) revel.Result { //*******************图片处理**************** //缩略图400 - thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename) + thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename) //内容显示图片 web_url := web_save_path + thumb_name diff --git a/app/controllers/User/user.go b/app/controllers/User/user.go index 9dcec9d..0239665 100644 --- a/app/controllers/User/user.go +++ b/app/controllers/User/user.go @@ -199,7 +199,7 @@ func (c *User) Add(user *models.User) revel.Result { } else { user.Vip = 0 - user.Overduedate = time.Now().Format("2006-01-02 15:04:04") + user.Overduedate = time.Now().Format("2006-01-02 15:04:05") } if ip := c.Request.Header.Get("X-Forwarded-For"); ip != "" { diff --git a/app/models/admin.go b/app/models/admin.go index 23ecf8a..7abf1d8 100644 --- a/app/models/admin.go +++ b/app/models/admin.go @@ -243,7 +243,7 @@ func (a *Admin) Save() bool { admin.Lang = a.Lang admin.Lastlogintime = "0000-00-00 00:00:00" admin.Status = a.Status - admin.Createtime = time.Now().Format("2006-01-02 15:04:04") + admin.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(admin) if err != nil { @@ -259,7 +259,7 @@ func (a *Admin) UpdateLoginTime(Id int64) bool { admin := new(Admin) admin.Lastloginip = a.Lastloginip - admin.Lastlogintime = time.Now().Format("2006-01-02 15:04:04") + admin.Lastlogintime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Id(Id).Cols("lastloginip", "lastlogintime").Update(admin) if err != nil { diff --git a/app/models/admin_panel.go b/app/models/admin_panel.go index 09dfb6b..503502b 100644 --- a/app/models/admin_panel.go +++ b/app/models/admin_panel.go @@ -116,7 +116,7 @@ func (a *Admin_Panel) AddPanel(Mid int64, Admin_Info *Admin) bool { admin_panel.Name = menu_info.Name admin_panel.Url = menu_info.Url - admin_panel.Createtime = time.Now().Format("2006-01-02 15:04:04") + admin_panel.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Table("admin_panel").Insert(admin_panel) if err != nil { diff --git a/app/models/announce.go b/app/models/announce.go index 0296d2c..8c38411 100644 --- a/app/models/announce.go +++ b/app/models/announce.go @@ -76,7 +76,7 @@ func (a *Announce) Save() bool { announce.Endtime = a.Endtime announce.Hits = 0 announce.Status = a.Status - announce.Createtime = time.Now().Format("2006-01-02 15:04:04") + announce.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(announce) if err != nil { diff --git a/app/models/article.go b/app/models/article.go index 3892a98..0b38f29 100644 --- a/app/models/article.go +++ b/app/models/article.go @@ -308,7 +308,7 @@ func (a *Article) Save() bool { article.Status = a.Status article.Hits = 0 article.Iscomment = a.Iscomment - article.Createtime = time.Now().Format("2006-01-02 15:04:04") + article.Createtime = time.Now().Format("2006-01-02 15:04:05") article.Updatetime = "0000-00-00 00:00:00" has, err := DB_Write.Insert(article) @@ -339,7 +339,7 @@ func (a *Article) Edit(Id int64) bool { article.Istop = a.Istop article.Status = a.Status article.Iscomment = a.Iscomment - article.Updatetime = time.Now().Format("2006-01-02 15:04:04") + article.Updatetime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Id(Id).Cols("title", "color", "font", "thumb", "content", "copyfrom", "keywords", "description", "relation", "pagetype", "Maxcharperpage", "istop", "status", "iscomment", "updatetime").Update(article) if err != nil { diff --git a/app/models/comment.go b/app/models/comment.go index 77f4640..4d6efa2 100644 --- a/app/models/comment.go +++ b/app/models/comment.go @@ -111,7 +111,7 @@ func (c *Comment) Save() bool { comment.Agree = 0 comment.Against = 0 comment.Ip = c.Ip - comment.Createtime = time.Now().Format("2006-01-02 15:04:04") + comment.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Table("comment").Insert(comment) if err != nil { diff --git a/app/models/copyfrom.go b/app/models/copyfrom.go index 4c46940..4afce48 100644 --- a/app/models/copyfrom.go +++ b/app/models/copyfrom.go @@ -77,7 +77,7 @@ func (c *Copyfrom) Save() bool { copyfrom.Sitename = c.Sitename copyfrom.Siteurl = c.Siteurl copyfrom.Thumb = c.Thumb - copyfrom.Createtime = time.Now().Format("2006-01-02 15:04:04") + copyfrom.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(copyfrom) if err != nil { diff --git a/app/models/cron.go b/app/models/cron.go index 639fe6e..451497b 100644 --- a/app/models/cron.go +++ b/app/models/cron.go @@ -30,7 +30,7 @@ type FiveMinutes struct { } func (c FiveMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } //每三十分钟执行 @@ -38,7 +38,7 @@ type ThirtyMinutes struct { } func (c ThirtyMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } //每小时执行 @@ -46,7 +46,7 @@ type HourlyMinutes struct { } func (c HourlyMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } //每天执行 @@ -55,7 +55,7 @@ type DailyMinutes struct { } func (c DailyMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } //每周执行 @@ -64,7 +64,7 @@ type WeeklyMinutes struct { } func (c WeeklyMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } //每月执行 @@ -73,7 +73,7 @@ type MonthlyMinutes struct { } func (c MonthlyMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } //每年执行 @@ -82,5 +82,5 @@ type YearlyMinutes struct { } func (c YearlyMinutes) Run() { - revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04")) + revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05")) } diff --git a/app/models/focus.go b/app/models/focus.go index 0810d38..e06477b 100644 --- a/app/models/focus.go +++ b/app/models/focus.go @@ -169,7 +169,7 @@ func (c *Focus) Save() bool { focus.Clicks = 0 focus.Order = c.Order focus.Status = 1 - focus.Createtime = time.Now().Format("2006-01-02 15:04:04") + focus.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(focus) if err != nil { @@ -191,7 +191,7 @@ func (c *Focus) Edit(Id int64) bool { focus.Content = c.Content focus.Order = c.Order focus.Status = 1 - focus.Updatetime = time.Now().Format("2006-01-02 15:04:04") + focus.Updatetime = time.Now().Format("2006-01-02 15:04:05") if len(c.Img) > 0 { has, err := DB_Write.Id(Id).Cols("cid", "title", "url", "img", "content", "order", "updatetime").Update(focus) diff --git a/app/models/focuscate.go b/app/models/focuscate.go index 4994fe1..8ca1d85 100644 --- a/app/models/focuscate.go +++ b/app/models/focuscate.go @@ -77,7 +77,7 @@ func (c *FocusCate) Save() bool { focuscate.Name = c.Name focuscate.Width = c.Width focuscate.Height = c.Height - focuscate.Createtime = time.Now().Format("2006-01-02 15:04:04") + focuscate.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(focuscate) if err != nil { diff --git a/app/models/logs.go b/app/models/logs.go index 88b464d..34d47c9 100644 --- a/app/models/logs.go +++ b/app/models/logs.go @@ -61,7 +61,7 @@ func (L *Logs) Save(Admin_Info *Admin, c *revel.Controller, Desc string) bool { } logs.Desc = Desc - logs.Createtime = time.Now().Format("2006-01-02 15:04:04") + logs.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(logs) if err != nil { diff --git a/app/models/role.go b/app/models/role.go index 6b7367b..4ac60d6 100644 --- a/app/models/role.go +++ b/app/models/role.go @@ -79,7 +79,7 @@ func (r *Role) Save() bool { role.Desc = r.Desc role.Data = r.Data role.Status = r.Status - role.Createtime = time.Now().Format("2006-01-02 15:04:04") + role.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(role) if err != nil { diff --git a/app/models/template.go b/app/models/template.go index a076d1c..ce600f7 100644 --- a/app/models/template.go +++ b/app/models/template.go @@ -61,7 +61,7 @@ func (t *Template) Save() bool { template.Author = t.Author template.Version = t.Version template.Status = t.Status - template.Createtime = time.Now().Format("2006-01-02 15:04:04") + template.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Table("template").Insert(template) if err != nil { diff --git a/app/models/test.go b/app/models/test.go index 1801d3d..7cc264d 100644 --- a/app/models/test.go +++ b/app/models/test.go @@ -24,7 +24,7 @@ func (c *Test) Save() bool { test := new(Test) test.Content = "测试" - test.Createtime = time.Now().Format("2006-01-02 15:04:04") + test.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Insert(test) if err != nil { diff --git a/app/models/user.go b/app/models/user.go index 793b9c0..776542f 100644 --- a/app/models/user.go +++ b/app/models/user.go @@ -189,8 +189,8 @@ func (u *User) Save() bool { user.Mobile = u.Mobile user.Birthday = u.Birthday user.Regip = u.Regip - user.Regdate = time.Now().Format("2006-01-02 15:04:04") - user.Lastdate = time.Now().Format("2006-01-02 15:04:04") + user.Regdate = time.Now().Format("2006-01-02 15:04:05") + user.Lastdate = time.Now().Format("2006-01-02 15:04:05") user.Lastip = u.Lastip user.Loginnum = 0 user.Groupid = u.Groupid @@ -202,7 +202,7 @@ func (u *User) Save() bool { user.Vip = u.Vip user.Overduedate = u.Overduedate user.Status = u.Status - user.Createtime = time.Now().Format("2006-01-02 15:04:04") + user.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Table("user").Insert(user) if err != nil { diff --git a/app/models/user_group.go b/app/models/user_group.go index 1c61821..b77fb24 100644 --- a/app/models/user_group.go +++ b/app/models/user_group.go @@ -98,7 +98,7 @@ func (u *User_Group) Save() bool { user_group.Usernamecolor = u.Usernamecolor user_group.Desc = u.Desc user_group.Status = u.Status - user_group.Createtime = time.Now().Format("2006-01-02 15:04:04") + user_group.Createtime = time.Now().Format("2006-01-02 15:04:05") has, err := DB_Write.Table("user_group").Insert(user_group) if err != nil { diff --git a/tests/apptest.go b/tests/apptest.go index 3edd5f6..94e6230 100644 --- a/tests/apptest.go +++ b/tests/apptest.go @@ -8,7 +8,7 @@ type AppTest struct { } func (t *AppTest) Before() { - println("Start time:" + time.Now().Format("2006-01-02 15:04:04")) + println("Start time:" + time.Now().Format("2006-01-02 15:04:05")) } func (t AppTest) TestThatIndexPageWorks() { @@ -18,5 +18,5 @@ func (t AppTest) TestThatIndexPageWorks() { } func (t *AppTest) After() { - println("End time:" + time.Now().Format("2006-01-02 15:04:04")) + println("End time:" + time.Now().Format("2006-01-02 15:04:05")) }