Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoyanbin
nbya
Commits
a2bb9799
Commit
a2bb9799
authored
Jan 18, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Time
parent
c16cde2b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
40 deletions
+48
-40
org_season.go
app/operate/models/org_season.go
+15
-14
org_ad.go
app/operate/service/dto/org_ad.go
+23
-22
org_season.go
app/operate/service/dto/org_season.go
+5
-4
common.go
common/utils/common.go
+5
-0
No files found.
app/operate/models/org_season.go
View file @
a2bb9799
...
...
@@ -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
...
...
app/operate/service/dto/org_ad.go
View file @
a2bb9799
...
...
@@ -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
{}
{
...
...
app/operate/service/dto/org_season.go
View file @
a2bb9799
...
...
@@ -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
}
...
...
common/utils/common.go
View file @
a2bb9799
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment