diff --git a/app/operate/models/org_season.go b/app/operate/models/org_season.go index a764cd9df0a9f849f8a23e8ddedec4ae3abdb762..543f1f019aa13788916c25dbe0561adbcdd5c25a 100755 --- a/app/operate/models/org_season.go +++ b/app/operate/models/org_season.go @@ -1,27 +1,28 @@ package models import ( - // "gorm.io/gorm" + // "gorm.io/gorm" "go-admin/common/models" + "time" ) type OrgSeason struct { - models.Model - - LeagueId string `json:"leagueId" gorm:"type:bigint(20);comment:org_league琛╥d"` - DivisionId string `json:"divisionId" gorm:"type:bigint(20);comment:org_division琛╥d"` - 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:璧涘缁撴潫鏃堕棿"` - Status string `json:"status" gorm:"type:tinyint(1);comment:璧涘寮€鍚姸鎬� 1 鏄� 0 鍚�"` - models.ModelTime - models.ControlBy + models.Model + + LeagueId string `json:"leagueId" gorm:"type:bigint(20);comment:org_league琛╥d"` + DivisionId string `json:"divisionId" gorm:"type:bigint(20);comment:org_division琛╥d"` + SeasonName string `json:"seasonName" gorm:"type:varchar(255);comment:璧涘鍚嶇О"` + TotalRounds string `json:"totalRounds" gorm:"type:varchar(60);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 } func (OrgSeason) TableName() string { - return "org_season" + return "org_season" } func (e *OrgSeason) Generate() models.ActiveRecord { @@ -31,4 +32,4 @@ func (e *OrgSeason) Generate() models.ActiveRecord { func (e *OrgSeason) GetId() interface{} { return e.Id -} \ No newline at end of file +} diff --git a/app/operate/service/dto/org_ad.go b/app/operate/service/dto/org_ad.go index 26b65ea0a0bd9179f4ca42dc6726e011b0c0c57c..9d321f30a25d9167f8968471e5183acc00626943 100755 --- a/app/operate/service/dto/org_ad.go +++ b/app/operate/service/dto/org_ad.go @@ -4,6 +4,7 @@ import ( "go-admin/app/operate/models" "go-admin/common/dto" common "go-admin/common/models" + "go-admin/common/utils" "time" ) @@ -37,15 +38,15 @@ func (m *OrgAdGetPageReq) GetNeedSearch() interface{} { } type OrgAdInsertReq struct { - Id int `json:"-" comment:""` // - UserId string `json:"userId" comment:"sys_user琛╥d"` - AdName string `json:"adName" comment:"骞垮憡鍚嶇О"` - AdType string `json:"adType" comment:"绫诲瀷"` - 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:"骞垮憡鏈夋晥鏈� 缁撴潫鏃堕棿"` + Id int `json:"-" comment:""` // + UserId string `json:"userId" comment:"sys_user琛╥d"` + AdName string `json:"adName" comment:"骞垮憡鍚嶇О"` + AdType string `json:"adType" comment:"绫诲瀷"` + AdImg string `json:"adImg" comment:"骞垮憡鍥�"` + AdUrl string `json:"adUrl" comment:"閾炬帴鍦板潃"` + Status string `json:"status" comment:"骞垮憡鐘舵€� 1 寮€鍚� 0鍏抽棴"` + 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{} { @@ -68,15 +69,15 @@ func (s *OrgAdInsertReq) GetId() interface{} { } type OrgAdUpdateReq struct { - Id int `uri:"id" comment:""` // - UserId string `json:"userId" comment:"sys_user琛╥d"` - AdName string `json:"adName" comment:"骞垮憡鍚嶇О"` - AdType string `json:"adType" comment:"绫诲瀷"` - 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:"骞垮憡鏈夋晥鏈� 缁撴潫鏃堕棿"` + Id int `uri:"id" comment:""` // + UserId string `json:"userId" comment:"sys_user琛╥d"` + AdName string `json:"adName" comment:"骞垮憡鍚嶇О"` + AdType string `json:"adType" comment:"绫诲瀷"` + AdImg string `json:"adImg" comment:"骞垮憡鍥�"` + AdUrl string `json:"adUrl" comment:"閾炬帴鍦板潃"` + Status string `json:"status" comment:"骞垮憡鐘舵€� 1 寮€鍚� 0鍏抽棴"` + 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{} { diff --git a/app/operate/service/dto/org_season.go b/app/operate/service/dto/org_season.go index 88e882d3c57013b5817dd8fa6009294e64c5f69b..06748bf14df9218dde69f55975d4a3eaf90384dc 100755 --- a/app/operate/service/dto/org_season.go +++ b/app/operate/service/dto/org_season.go @@ -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 } diff --git a/common/utils/common.go b/common/utils/common.go index 6070888a97149a32c6a228f5250317950b71fa77..c2d16e2a7c6caac29a254f12db573dda2541fda8 100755 --- a/common/utils/common.go +++ b/common/utils/common.go @@ -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) {