Commit a2bb9799 authored by haoyanbin's avatar haoyanbin

Time

parent c16cde2b
......@@ -4,6 +4,7 @@ import (
// "gorm.io/gorm"
"go-admin/common/models"
"time"
)
type OrgSeason struct {
......@@ -13,8 +14,8 @@ type OrgSeason struct {
DivisionId string `json:"divisionId" gorm:"type:bigint(20);comment:org_division表id"`
SeasonName string `json:"seasonName" gorm:"type:varchar(255);comment:赛季名称"`
TotalRounds string `json:"totalRounds" gorm:"type:varchar(60);comment:总轮次"`
StartTime string `json:"startTime" gorm:"type:date;comment:赛季开始时间"`
EndTime string `json:"endTime" gorm:"type:date;comment:赛季结束时间"`
StartTime time.Time `json:"startTime" gorm:"type:date;comment:赛季开始时间"`
EndTime time.Time `json:"endTime" gorm:"type:date;comment:赛季结束时间"`
Status string `json:"status" gorm:"type:tinyint(1);comment:赛季开启状态 1 是 0 否"`
models.ModelTime
models.ControlBy
......
......@@ -4,6 +4,7 @@ import (
"go-admin/app/operate/models"
"go-admin/common/dto"
common "go-admin/common/models"
"go-admin/common/utils"
"time"
)
......@@ -44,8 +45,8 @@ type OrgAdInsertReq struct {
AdImg string `json:"adImg" comment:"广告图"`
AdUrl string `json:"adUrl" comment:"链接地址"`
Status string `json:"status" comment:"广告状态 1 开启 0关闭"`
StartTime time.Time `json:"startTime" comment:"广告有效期 开始时间"`
EndTime time.Time `json:"endTime" comment:"广告有效期 结束时间"`
StartTime string `json:"startTime" comment:"广告有效期 开始时间"`
EndTime string `json:"endTime" comment:"广告有效期 结束时间"`
common.ControlBy
}
......@@ -59,8 +60,8 @@ func (s *OrgAdInsertReq) Generate(model *models.OrgAd) {
model.AdImg = s.AdImg
model.AdUrl = s.AdUrl
model.Status = s.Status
model.StartTime = s.StartTime
model.EndTime = s.EndTime
model.StartTime = utils.StringToTime(s.StartTime)
model.EndTime = utils.StringToTime(s.EndTime)
}
func (s *OrgAdInsertReq) GetId() interface{} {
......@@ -75,8 +76,8 @@ type OrgAdUpdateReq struct {
AdImg string `json:"adImg" comment:"广告图"`
AdUrl string `json:"adUrl" comment:"链接地址"`
Status string `json:"status" comment:"广告状态 1 开启 0关闭"`
StartTime time.Time `json:"startTime" comment:"广告有效期 开始时间"`
EndTime time.Time `json:"endTime" comment:"广告有效期 结束时间"`
StartTime string `json:"startTime" comment:"广告有效期 开始时间"`
EndTime string `json:"endTime" comment:"广告有效期 结束时间"`
common.ControlBy
}
......@@ -90,8 +91,8 @@ func (s *OrgAdUpdateReq) Generate(model *models.OrgAd) {
model.AdImg = s.AdImg
model.AdUrl = s.AdUrl
model.Status = s.Status
model.StartTime = s.StartTime
model.EndTime = s.EndTime
model.StartTime = utils.StringToTime(s.StartTime)
model.EndTime = utils.StringToTime(s.EndTime)
}
func (s *OrgAdUpdateReq) GetId() interface{} {
......
......@@ -4,6 +4,7 @@ import (
"go-admin/app/operate/models"
"go-admin/common/dto"
common "go-admin/common/models"
"go-admin/common/utils"
"time"
)
......@@ -72,8 +73,8 @@ func (s *OrgSeasonInsertReq) Generate(model *models.OrgSeason) {
model.DivisionId = s.DivisionId
model.SeasonName = s.SeasonName
model.TotalRounds = s.TotalRounds
model.StartTime = s.StartTime
model.EndTime = s.EndTime
model.StartTime = utils.StringToTime(s.StartTime)
model.EndTime = utils.StringToTime(s.EndTime)
model.Status = s.Status
}
......@@ -101,8 +102,8 @@ func (s *OrgSeasonUpdateReq) Generate(model *models.OrgSeason) {
model.DivisionId = s.DivisionId
model.SeasonName = s.SeasonName
model.TotalRounds = s.TotalRounds
model.StartTime = s.StartTime
model.EndTime = s.EndTime
model.StartTime = utils.StringToTime(s.StartTime)
model.EndTime = utils.StringToTime(s.EndTime)
model.Status = s.Status
}
......
......@@ -29,6 +29,11 @@ func StringToFloat(data string) float64 {
return reply
}
func StringToTime(data string) time.Time {
timeData, _ := time.Parse("2006-01-02 15:04:05", data)
return timeData
}
//上传文件
func UploadFile(f multipart.File, h *multipart.FileHeader) (string, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment