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
Hide 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
package
models
package
models
import
(
import
(
// "gorm.io/gorm"
// "gorm.io/gorm"
"go-admin/common/models"
"go-admin/common/models"
"time"
)
)
type
OrgSeason
struct
{
type
OrgSeason
struct
{
models
.
Model
models
.
Model
LeagueId
string
`json:"leagueId" gorm:"type:bigint(20);comment:org_league表id"`
LeagueId
string
`json:"leagueId" gorm:"type:bigint(20);comment:org_league表id"`
DivisionId
string
`json:"divisionId" gorm:"type:bigint(20);comment:org_division表id"`
DivisionId
string
`json:"divisionId" gorm:"type:bigint(20);comment:org_division表id"`
SeasonName
string
`json:"seasonName" gorm:"type:varchar(255);comment:赛季名称"`
SeasonName
string
`json:"seasonName" gorm:"type:varchar(255);comment:赛季名称"`
TotalRounds
string
`json:"totalRounds" gorm:"type:varchar(60);comment:总轮次"`
TotalRounds
string
`json:"totalRounds" gorm:"type:varchar(60);comment:总轮次"`
StartTime
string
`json:"startTime" gorm:"type:date;comment:赛季开始时间"`
StartTime
time
.
Time
`json:"startTime" gorm:"type:date;comment:赛季开始时间"`
EndTime
string
`json:"endTime" gorm:"type:date;comment:赛季结束时间"`
EndTime
time
.
Time
`json:"endTime" gorm:"type:date;comment:赛季结束时间"`
Status
string
`json:"status" gorm:"type:tinyint(1);comment:赛季开启状态 1 是 0 否"`
Status
string
`json:"status" gorm:"type:tinyint(1);comment:赛季开启状态 1 是 0 否"`
models
.
ModelTime
models
.
ModelTime
models
.
ControlBy
models
.
ControlBy
}
}
func
(
OrgSeason
)
TableName
()
string
{
func
(
OrgSeason
)
TableName
()
string
{
return
"org_season"
return
"org_season"
}
}
func
(
e
*
OrgSeason
)
Generate
()
models
.
ActiveRecord
{
func
(
e
*
OrgSeason
)
Generate
()
models
.
ActiveRecord
{
...
@@ -31,4 +32,4 @@ func (e *OrgSeason) Generate() models.ActiveRecord {
...
@@ -31,4 +32,4 @@ func (e *OrgSeason) Generate() models.ActiveRecord {
func
(
e
*
OrgSeason
)
GetId
()
interface
{}
{
func
(
e
*
OrgSeason
)
GetId
()
interface
{}
{
return
e
.
Id
return
e
.
Id
}
}
\ No newline at end of file
app/operate/service/dto/org_ad.go
View file @
a2bb9799
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"go-admin/app/operate/models"
"go-admin/app/operate/models"
"go-admin/common/dto"
"go-admin/common/dto"
common
"go-admin/common/models"
common
"go-admin/common/models"
"go-admin/common/utils"
"time"
"time"
)
)
...
@@ -37,15 +38,15 @@ func (m *OrgAdGetPageReq) GetNeedSearch() interface{} {
...
@@ -37,15 +38,15 @@ func (m *OrgAdGetPageReq) GetNeedSearch() interface{} {
}
}
type
OrgAdInsertReq
struct
{
type
OrgAdInsertReq
struct
{
Id
int
`json:"-" comment:""`
//
Id
int
`json:"-" comment:""`
//
UserId
string
`json:"userId" comment:"sys_user表id"`
UserId
string
`json:"userId" comment:"sys_user表id"`
AdName
string
`json:"adName" comment:"广告名称"`
AdName
string
`json:"adName" comment:"广告名称"`
AdType
string
`json:"adType" comment:"类型"`
AdType
string
`json:"adType" comment:"类型"`
AdImg
string
`json:"adImg" comment:"广告图"`
AdImg
string
`json:"adImg" comment:"广告图"`
AdUrl
string
`json:"adUrl" comment:"链接地址"`
AdUrl
string
`json:"adUrl" comment:"链接地址"`
Status
string
`json:"status" comment:"广告状态 1 开启 0关闭"`
Status
string
`json:"status" comment:"广告状态 1 开启 0关闭"`
StartTime
time
.
Time
`json:"startTime" comment:"广告有效期 开始时间"`
StartTime
string
`json:"startTime" comment:"广告有效期 开始时间"`
EndTime
time
.
Time
`json:"endTime" comment:"广告有效期 结束时间"`
EndTime
string
`json:"endTime" comment:"广告有效期 结束时间"`
common
.
ControlBy
common
.
ControlBy
}
}
...
@@ -59,8 +60,8 @@ func (s *OrgAdInsertReq) Generate(model *models.OrgAd) {
...
@@ -59,8 +60,8 @@ func (s *OrgAdInsertReq) Generate(model *models.OrgAd) {
model
.
AdImg
=
s
.
AdImg
model
.
AdImg
=
s
.
AdImg
model
.
AdUrl
=
s
.
AdUrl
model
.
AdUrl
=
s
.
AdUrl
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
model
.
StartTime
=
s
.
StartTime
model
.
StartTime
=
utils
.
StringToTime
(
s
.
StartTime
)
model
.
EndTime
=
s
.
EndTime
model
.
EndTime
=
utils
.
StringToTime
(
s
.
EndTime
)
}
}
func
(
s
*
OrgAdInsertReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgAdInsertReq
)
GetId
()
interface
{}
{
...
@@ -68,15 +69,15 @@ func (s *OrgAdInsertReq) GetId() interface{} {
...
@@ -68,15 +69,15 @@ func (s *OrgAdInsertReq) GetId() interface{} {
}
}
type
OrgAdUpdateReq
struct
{
type
OrgAdUpdateReq
struct
{
Id
int
`uri:"id" comment:""`
//
Id
int
`uri:"id" comment:""`
//
UserId
string
`json:"userId" comment:"sys_user表id"`
UserId
string
`json:"userId" comment:"sys_user表id"`
AdName
string
`json:"adName" comment:"广告名称"`
AdName
string
`json:"adName" comment:"广告名称"`
AdType
string
`json:"adType" comment:"类型"`
AdType
string
`json:"adType" comment:"类型"`
AdImg
string
`json:"adImg" comment:"广告图"`
AdImg
string
`json:"adImg" comment:"广告图"`
AdUrl
string
`json:"adUrl" comment:"链接地址"`
AdUrl
string
`json:"adUrl" comment:"链接地址"`
Status
string
`json:"status" comment:"广告状态 1 开启 0关闭"`
Status
string
`json:"status" comment:"广告状态 1 开启 0关闭"`
StartTime
time
.
Time
`json:"startTime" comment:"广告有效期 开始时间"`
StartTime
string
`json:"startTime" comment:"广告有效期 开始时间"`
EndTime
time
.
Time
`json:"endTime" comment:"广告有效期 结束时间"`
EndTime
string
`json:"endTime" comment:"广告有效期 结束时间"`
common
.
ControlBy
common
.
ControlBy
}
}
...
@@ -90,8 +91,8 @@ func (s *OrgAdUpdateReq) Generate(model *models.OrgAd) {
...
@@ -90,8 +91,8 @@ func (s *OrgAdUpdateReq) Generate(model *models.OrgAd) {
model
.
AdImg
=
s
.
AdImg
model
.
AdImg
=
s
.
AdImg
model
.
AdUrl
=
s
.
AdUrl
model
.
AdUrl
=
s
.
AdUrl
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
model
.
StartTime
=
s
.
StartTime
model
.
StartTime
=
utils
.
StringToTime
(
s
.
StartTime
)
model
.
EndTime
=
s
.
EndTime
model
.
EndTime
=
utils
.
StringToTime
(
s
.
EndTime
)
}
}
func
(
s
*
OrgAdUpdateReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgAdUpdateReq
)
GetId
()
interface
{}
{
...
...
app/operate/service/dto/org_season.go
View file @
a2bb9799
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"go-admin/app/operate/models"
"go-admin/app/operate/models"
"go-admin/common/dto"
"go-admin/common/dto"
common
"go-admin/common/models"
common
"go-admin/common/models"
"go-admin/common/utils"
"time"
"time"
)
)
...
@@ -72,8 +73,8 @@ func (s *OrgSeasonInsertReq) Generate(model *models.OrgSeason) {
...
@@ -72,8 +73,8 @@ func (s *OrgSeasonInsertReq) Generate(model *models.OrgSeason) {
model
.
DivisionId
=
s
.
DivisionId
model
.
DivisionId
=
s
.
DivisionId
model
.
SeasonName
=
s
.
SeasonName
model
.
SeasonName
=
s
.
SeasonName
model
.
TotalRounds
=
s
.
TotalRounds
model
.
TotalRounds
=
s
.
TotalRounds
model
.
StartTime
=
s
.
StartTime
model
.
StartTime
=
utils
.
StringToTime
(
s
.
StartTime
)
model
.
EndTime
=
s
.
EndTime
model
.
EndTime
=
utils
.
StringToTime
(
s
.
EndTime
)
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
}
}
...
@@ -101,8 +102,8 @@ func (s *OrgSeasonUpdateReq) Generate(model *models.OrgSeason) {
...
@@ -101,8 +102,8 @@ func (s *OrgSeasonUpdateReq) Generate(model *models.OrgSeason) {
model
.
DivisionId
=
s
.
DivisionId
model
.
DivisionId
=
s
.
DivisionId
model
.
SeasonName
=
s
.
SeasonName
model
.
SeasonName
=
s
.
SeasonName
model
.
TotalRounds
=
s
.
TotalRounds
model
.
TotalRounds
=
s
.
TotalRounds
model
.
StartTime
=
s
.
StartTime
model
.
StartTime
=
utils
.
StringToTime
(
s
.
StartTime
)
model
.
EndTime
=
s
.
EndTime
model
.
EndTime
=
utils
.
StringToTime
(
s
.
EndTime
)
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
}
}
...
...
common/utils/common.go
View file @
a2bb9799
...
@@ -29,6 +29,11 @@ func StringToFloat(data string) float64 {
...
@@ -29,6 +29,11 @@ func StringToFloat(data string) float64 {
return
reply
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
)
{
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