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
2f542726
Commit
2f542726
authored
Jan 22, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload
parent
033bc81b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
43 deletions
+126
-43
org_player.go
app/mobile/apis/org_player.go
+41
-15
org_player_rank.go
app/mobile/apis/org_player_rank.go
+38
-1
org_player.go
app/mobile/service/dto/org_player.go
+18
-15
org_player.go
app/mobile/service/org_player.go
+25
-9
org_player_rank.go
app/mobile/service/org_player_rank.go
+2
-2
common.go
common/utils/common.go
+2
-1
No files found.
app/mobile/apis/org_player.go
View file @
2f542726
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"go-admin/app/mobile/service"
"go-admin/app/mobile/service"
"go-admin/app/mobile/service/dto"
"go-admin/app/mobile/service/dto"
"go-admin/common/actions"
"go-admin/common/actions"
cDto
"go-admin/common/dto"
"strconv"
"strconv"
)
)
...
@@ -28,9 +29,10 @@ type OrgPlayer struct {
...
@@ -28,9 +29,10 @@ type OrgPlayer struct {
func
(
e
OrgPlayer
)
GetPage
(
c
*
gin
.
Context
)
{
func
(
e
OrgPlayer
)
GetPage
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetPageReq
{}
req
:=
dto
.
OrgPlayerGetPageReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
OrgPlayer
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
c
.
Bind
(
&
req
)
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
MakeService
(
&
s
.
Service
)
.
Errors
Errors
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -66,9 +68,9 @@ func (e OrgPlayer) GetPage(c *gin.Context) {
...
@@ -66,9 +68,9 @@ func (e OrgPlayer) GetPage(c *gin.Context) {
func
(
e
OrgPlayer
)
Get
(
c
*
gin
.
Context
)
{
func
(
e
OrgPlayer
)
Get
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetReq
{}
req
:=
dto
.
OrgPlayerGetReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
OrgPlayer
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
c
.
Bind
(
&
req
)
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
MakeService
(
&
s
.
Service
)
.
Errors
Errors
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -136,9 +138,9 @@ func (e OrgPlayer) Get(c *gin.Context) {
...
@@ -136,9 +138,9 @@ func (e OrgPlayer) Get(c *gin.Context) {
func
(
e
OrgPlayer
)
GetInfo
(
c
*
gin
.
Context
)
{
func
(
e
OrgPlayer
)
GetInfo
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetReq
{}
req
:=
dto
.
OrgPlayerGetReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
OrgPlayer
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
c
.
Bind
(
&
req
)
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
MakeService
(
&
s
.
Service
)
.
Errors
Errors
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -193,9 +195,9 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
...
@@ -193,9 +195,9 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
func
(
e
OrgPlayer
)
GetOrgMatchSeason
(
c
*
gin
.
Context
)
{
func
(
e
OrgPlayer
)
GetOrgMatchSeason
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetReq
{}
req
:=
dto
.
OrgPlayerGetReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
OrgPlayer
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
c
.
Bind
(
&
req
)
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
MakeService
(
&
s
.
Service
)
.
Errors
Errors
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -230,9 +232,9 @@ func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) {
...
@@ -230,9 +232,9 @@ func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) {
func
(
e
OrgPlayer
)
GetOrgMatchEvaluate
(
c
*
gin
.
Context
)
{
func
(
e
OrgPlayer
)
GetOrgMatchEvaluate
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetOrgMatchEvaluateReq
{}
req
:=
dto
.
OrgPlayerGetOrgMatchEvaluateReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
OrgPlayer
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
c
.
Bind
(
&
req
)
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
MakeService
(
&
s
.
Service
)
.
Errors
Errors
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -241,7 +243,7 @@ func (e OrgPlayer) GetOrgMatchEvaluate(c *gin.Context) {
...
@@ -241,7 +243,7 @@ func (e OrgPlayer) GetOrgMatchEvaluate(c *gin.Context) {
return
return
}
}
list
:=
make
([]
dto
.
OrgMatchEvaluate
,
0
)
list
:=
make
([]
dto
.
OrgMatchEvaluate
List
,
0
)
var
count
int64
var
count
int64
//p := actions.GetPermissionFromContext(c)
//p := actions.GetPermissionFromContext(c)
...
@@ -251,7 +253,31 @@ func (e OrgPlayer) GetOrgMatchEvaluate(c *gin.Context) {
...
@@ -251,7 +253,31 @@ func (e OrgPlayer) GetOrgMatchEvaluate(c *gin.Context) {
return
return
}
}
e
.
OK
(
list
,
"查询成功"
)
reply
:=
make
([]
dto
.
OrgMatchEvaluate
,
0
)
for
_
,
v
:=
range
list
{
replyV
:=
dto
.
OrgMatchEvaluate
{}
imgList
:=
make
([]
cDto
.
Wonderful
,
0
)
err
=
s
.
GetPageWonderful
(
v
.
Id
,
&
imgList
,
1
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
replyV
.
MatchImg
=
imgList
mvList
:=
make
([]
cDto
.
Wonderful
,
0
)
err
=
s
.
GetPageWonderful
(
v
.
Id
,
&
imgList
,
2
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
replyV
.
MatchMv
=
mvList
replyV
.
Id
=
v
.
Id
replyV
.
Content
=
v
.
Content
reply
=
append
(
reply
,
replyV
)
}
e
.
OK
(
reply
,
"查询成功"
)
}
}
// Get <手机端>获取球员精彩时刻
// Get <手机端>获取球员精彩时刻
...
@@ -264,14 +290,14 @@ func (e OrgPlayer) GetOrgMatchEvaluate(c *gin.Context) {
...
@@ -264,14 +290,14 @@ func (e OrgPlayer) GetOrgMatchEvaluate(c *gin.Context) {
// @Param rounds path string false "rounds"
// @Param rounds path string false "rounds"
// @Param playerId path string false "playerId"
// @Param playerId path string false "playerId"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/
evaluate
[get]
// @Router /mobile/v1/org-player/
get-rounds
[get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgPlayer
)
GetOrgRounds
(
c
*
gin
.
Context
)
{
func
(
e
OrgPlayer
)
GetOrgRounds
(
c
*
gin
.
Context
)
{
req
:=
dto
.
GetRoundsReq
{}
req
:=
dto
.
GetRoundsReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
OrgPlayer
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
c
.
Bind
(
&
req
)
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
MakeService
(
&
s
.
Service
)
.
Errors
Errors
if
err
!=
nil
{
if
err
!=
nil
{
...
...
app/mobile/apis/org_player_rank.go
View file @
2f542726
...
@@ -22,7 +22,7 @@ type OrgPlayerRank struct {
...
@@ -22,7 +22,7 @@ type OrgPlayerRank struct {
// @Tags <手机端>比赛排名
// @Tags <手机端>比赛排名
// @Param pageSize query int false "页条数"
// @Param pageSize query int false "页条数"
// @Param pageIndex query int false "页码"
// @Param pageIndex query int false "页码"
// @Param data body dto.Org
TeamPlayer
GetPageReq true "data"
// @Param data body dto.Org
PlayerRank
GetPageReq true "data"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player-rank [get]
// @Router /mobile/v1/org-player-rank [get]
// @Security Bearer
// @Security Bearer
...
@@ -52,3 +52,40 @@ func (e OrgPlayerRank) GetPage(c *gin.Context) {
...
@@ -52,3 +52,40 @@ func (e OrgPlayerRank) GetPage(c *gin.Context) {
e
.
PageOK
(
list
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
(),
"查询成功"
)
e
.
PageOK
(
list
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
(),
"查询成功"
)
}
}
// GetPage <手机端>获取球队排名
// @Summary <手机端>获取球队排名
// @Description <手机端>获取球队排名
// @Tags <手机端>比赛排名
// @Param pageSize query int false "页条数"
// @Param pageIndex query int false "页码"
// @Param data body dto.OrgPlayerRankGetPageReq true "data"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player-rank/team [get]
// @Security Bearer
func
(
e
OrgPlayerRank
)
GetPageTeam
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerRankGetPageReq
{}
s
:=
service
.
OrgPlayerRank
{}
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
Errors
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
dto
.
OrgPlayerRankGetPageReply
,
0
)
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球队 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
e
.
PageOK
(
list
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
(),
"查询成功"
)
}
app/mobile/service/dto/org_player.go
View file @
2f542726
...
@@ -58,9 +58,9 @@ func (m *OrgPlayerGetPageReq) GetNeedSearch() interface{} {
...
@@ -58,9 +58,9 @@ func (m *OrgPlayerGetPageReq) GetNeedSearch() interface{} {
}
}
type
OrgPlayerDataGetReq
struct
{
type
OrgPlayerDataGetReq
struct
{
PlayerId
string
`json:"playerId"`
PlayerId
string
`
form:"playerId"
json:"playerId"`
SeasonId
string
`json:"seasonId"`
SeasonId
string
`
form:"seasonId"
json:"seasonId"`
Match
string
`json:"match"`
Match
string
`
form:"match"
json:"match"`
}
}
type
OrgPlayerDataGetReply
struct
{
type
OrgPlayerDataGetReply
struct
{
...
@@ -100,7 +100,7 @@ type OrgPlayerRoundsScoring struct {
...
@@ -100,7 +100,7 @@ type OrgPlayerRoundsScoring struct {
}
}
type
GetRoundsReq
struct
{
type
GetRoundsReq
struct
{
PlayerId
string
`json:"playerId"`
PlayerId
string
`
form:"playerId"
json:"playerId"`
}
}
type
GetRoundsReply
struct
{
type
GetRoundsReply
struct
{
Id
string
`json:"id"`
Id
string
`json:"id"`
...
@@ -114,11 +114,11 @@ type GetRoundsReply struct {
...
@@ -114,11 +114,11 @@ type GetRoundsReply struct {
}
}
type
OrgPlayerGetOrgMatchEvaluateReq
struct
{
type
OrgPlayerGetOrgMatchEvaluateReq
struct
{
LeagueId
string
`json:"leagueId"`
LeagueId
string
`
form:"leagueId"
json:"leagueId"`
SeasonId
string
`json:"seasonId"`
SeasonId
string
`
form:"seasonId"
json:"seasonId"`
MatchId
string
`json:"matchId"`
MatchId
string
`
form:"matchId"
json:"matchId"`
Rounds
string
`json:"rounds"`
Rounds
string
`
form:"rounds"
json:"rounds"`
PlayerId
string
`json:"playerId"`
PlayerId
string
`
form:"playerId"
json:"playerId"`
}
}
type
OrgPlayerGetOrgMatchEvaluateReply
struct
{
type
OrgPlayerGetOrgMatchEvaluateReply
struct
{
...
@@ -128,10 +128,13 @@ type OrgPlayerGetOrgMatchEvaluateReply struct {
...
@@ -128,10 +128,13 @@ type OrgPlayerGetOrgMatchEvaluateReply struct {
type
OrgMatchEvaluate
struct
{
type
OrgMatchEvaluate
struct
{
Id
string
`json:"id"`
Id
string
`json:"id"`
Content
string
`json:"content"`
Content
string
`json:"content"`
WonderfulMomentImg
string
`json:"wonderfulMomentImg"`
MatchImg
[]
dto
.
Wonderful
`json:"matchImg"`
WonderfulMomentImgTitle
string
`json:"wonderfulMomentImgTitle"`
MatchMv
[]
dto
.
Wonderful
`json:"matchMv"`
WonderfulMomentMv
string
`json:"wonderfulMomentMv"`
}
WonderfulMomentMvTitle
string
`json:"wonderfulMomentMvTitle"`
type
OrgMatchEvaluateList
struct
{
Id
string
`json:"id"`
Content
string
`json:"content"`
}
}
// OrgPlayerGetReq 功能获取请求参数
// OrgPlayerGetReq 功能获取请求参数
...
...
app/mobile/service/org_player.go
View file @
2f542726
...
@@ -318,22 +318,20 @@ func (e *OrgPlayer) GetOrgRounds(c *dto.GetRoundsReq, list *[]dto.GetRoundsReply
...
@@ -318,22 +318,20 @@ func (e *OrgPlayer) GetOrgRounds(c *dto.GetRoundsReq, list *[]dto.GetRoundsReply
}
}
return
nil
return
nil
}
}
func
(
e
*
OrgPlayer
)
GetOrgMatchEvaluate
(
c
*
dto
.
OrgPlayerGetOrgMatchEvaluateReq
,
list
*
[]
dto
.
OrgMatchEvaluate
,
count
*
int64
)
error
{
func
(
e
*
OrgPlayer
)
GetOrgMatchEvaluate
(
c
*
dto
.
OrgPlayerGetOrgMatchEvaluateReq
,
list
*
[]
dto
.
OrgMatchEvaluate
List
,
count
*
int64
)
error
{
var
err
error
var
err
error
err
=
e
.
Orm
.
Table
(
"org_match_evaluate as ome"
)
.
err
=
e
.
Orm
.
Table
(
"org_match_evaluate as ome"
)
.
Select
(
"ome.id, ome.content,"
+
Select
(
"ome.id, ome.content"
)
.
"ome.wonderful_moment_img, ome.wonderful_moment_mv,ome.wonderful_moment_img_title,"
+
"ome.wonderful_moment_mv_title"
)
.
Joins
(
"left join org_match as om on om.id = ome.match_id"
)
.
Joins
(
"left join org_match as om on om.id = ome.match_id"
)
.
Scopes
(
Scopes
(
cDto
.
PassDel
(
"ome"
),
cDto
.
PassDel
(
"ome"
),
cDto
.
SetWhere
(
"om"
,
"league_id"
,
c
.
LeagueId
),
cDto
.
SetWhere
(
"om"
,
"season_id"
,
c
.
SeasonId
),
cDto
.
SetWhere
(
"ome"
,
"match_id"
,
c
.
MatchId
),
cDto
.
SetWhere
(
"ome"
,
"rounds"
,
c
.
Rounds
),
)
.
)
.
Where
(
"om.league_id = ?"
,
c
.
LeagueId
)
.
Where
(
"ome.player_id=?"
,
c
.
PlayerId
)
.
Where
(
"om.season_id = ?"
,
c
.
SeasonId
)
.
Where
(
"ome.match_id = ?"
,
c
.
MatchId
)
.
Where
(
"ome.rounds = ?"
,
c
.
Rounds
)
.
Where
(
"ome.player_id = ?"
,
c
.
PlayerId
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Count
(
count
)
.
Error
Count
(
count
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -571,3 +569,21 @@ func (e *OrgPlayer) rankingForGetPage(replyGetPlayerRank []models.OrgMatchTeamPl
...
@@ -571,3 +569,21 @@ func (e *OrgPlayer) rankingForGetPage(replyGetPlayerRank []models.OrgMatchTeamPl
}
}
return
"0"
return
"0"
}
}
func
(
e
*
OrgPlayer
)
GetPageWonderful
(
evaluateId
string
,
list
*
[]
cDto
.
Wonderful
,
wType
int
)
error
{
var
err
error
err
=
e
.
Orm
.
Table
(
"org_match_evaluate_wonderful as omew"
)
.
Select
(
"omew.id, omew.wonderful_url, omew.wonderful_title"
)
.
Scopes
(
cDto
.
PassDel
(
"omew"
),
)
.
Where
(
"match_evaluate_id=?"
,
evaluateId
)
.
Where
(
"type=?"
,
wType
)
.
Find
(
list
)
.
Error
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchService GetPage error:%s
\r\n
"
,
err
)
return
err
}
return
nil
}
app/mobile/service/org_player_rank.go
View file @
2f542726
...
@@ -20,7 +20,7 @@ func (e *OrgPlayerRank) GetPage(c *dto.OrgPlayerRankGetPageReq, p *actions.DataP
...
@@ -20,7 +20,7 @@ func (e *OrgPlayerRank) GetPage(c *dto.OrgPlayerRankGetPageReq, p *actions.DataP
var
err
error
var
err
error
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
Select
(
"o
l.league_name, omtp.player_name, omtp.player_id as id
, omtp.player_number,"
+
Select
(
"o
mtp.player_id as id, ol.league_name, omtp.player_name
, omtp.player_number,"
+
"sum(omtp.scoring)as scoring,"
+
"sum(omtp.scoring)as scoring,"
+
"sum(omtp.rebound)as rebound,"
+
"sum(omtp.rebound)as rebound,"
+
"sum(omtp.assist)as assist,"
+
"sum(omtp.assist)as assist,"
+
...
@@ -39,7 +39,7 @@ func (e *OrgPlayerRank) GetPage(c *dto.OrgPlayerRankGetPageReq, p *actions.DataP
...
@@ -39,7 +39,7 @@ func (e *OrgPlayerRank) GetPage(c *dto.OrgPlayerRankGetPageReq, p *actions.DataP
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
"omtp"
,
p
),
actions
.
Permission
(
"omtp"
,
p
),
cDto
.
PassDel
(
"omtp"
),
cDto
.
PassDel
(
"omtp"
),
cDto
.
SetWhere
(
"om
tp
"
,
"league_id"
,
c
.
LeagueId
),
cDto
.
SetWhere
(
"om"
,
"league_id"
,
c
.
LeagueId
),
)
.
)
.
Group
(
"omtp.player_id"
)
.
Group
(
"omtp.player_id"
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
...
...
common/utils/common.go
View file @
2f542726
...
@@ -57,7 +57,8 @@ func UploadFile(f multipart.File, h *multipart.FileHeader) (string, error) {
...
@@ -57,7 +57,8 @@ func UploadFile(f multipart.File, h *multipart.FileHeader) (string, error) {
yunfiletmp
:=
fmt
.
Sprintf
(
"%s/%s"
,
extConfig
.
ExtConfig
.
Upload
.
Dir
,
GetDate
())
yunfiletmp
:=
fmt
.
Sprintf
(
"%s/%s"
,
extConfig
.
ExtConfig
.
Upload
.
Dir
,
GetDate
())
fullFileName
=
fmt
.
Sprintf
(
"%s/%s%s"
,
yunfiletmp
,
guid
,
filepath
.
Ext
(
h
.
Filename
))
fullFileName
=
fmt
.
Sprintf
(
"%s/%s%s"
,
yunfiletmp
,
guid
,
filepath
.
Ext
(
h
.
Filename
))
//fmt.Println(fullFileName)
//fmt.Println(fullFileName)
if
err
=
bucket
.
PutObject
(
fullFileName
,
buf
);
err
!=
nil
{
option
:=
oss
.
ContentType
(
"image/jpg"
)
if
err
=
bucket
.
PutObject
(
fullFileName
,
buf
,
option
);
err
!=
nil
{
return
fullFileName
,
err
return
fullFileName
,
err
}
}
return
fullFileName
,
nil
return
fullFileName
,
nil
...
...
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