Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
hujiebin
hilo-common
Commits
e6605d24
Commit
e6605d24
authored
Apr 15, 2024
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:导出数据
parent
85a4d65a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
44 deletions
+56
-44
promotion_data.go
script/promotion_data.go
+3
-3
svip_user_charge.go
script/svip_user_charge.go
+53
-41
No files found.
script/promotion_data.go
View file @
e6605d24
...
...
@@ -43,7 +43,7 @@ func main() {
pageIndex
:=
1
pageSize
:=
1000
for
{
url
:=
fmt
.
Sprintf
(
"https://apiv2.faceline.live/v1/mgr/promotion/invite/data?lang=zh-cn&pageIndex=%d&pageSize=%d&startTime=2023-
09-01&endTime=2023-11-30
&teamName=&agentCode=&inviteeCode=&platform=All"
,
url
:=
fmt
.
Sprintf
(
"https://apiv2.faceline.live/v1/mgr/promotion/invite/data?lang=zh-cn&pageIndex=%d&pageSize=%d&startTime=2023-
12-01&endTime=2024-03-31
&teamName=&agentCode=&inviteeCode=&platform=All"
,
pageIndex
,
pageSize
)
method
:=
"GET"
...
...
@@ -55,7 +55,7 @@ func main() {
return
}
req
.
Header
.
Add
(
"nonce"
,
"hilo"
)
req
.
Header
.
Add
(
"token"
,
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTc
wNTIxODE0MH0.Xb7DU89AUYBahJfV4MDcr-pBbsLJcf1VM0WgnCNb-ig
"
)
req
.
Header
.
Add
(
"token"
,
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTc
xNDcxNjcyOH0.Mt_gpOenB25vRXDFM4u-oReTNMBYgS7ZvzQumQHOuvU
"
)
res
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
...
...
@@ -80,7 +80,7 @@ func main() {
data
=
append
(
data
,
resp
.
Data
.
Items
...
)
pageIndex
++
}
excelFileName
:=
fmt
.
Sprintf
(
"./推广员数据
0901-1130
.xlsx"
)
excelFileName
:=
fmt
.
Sprintf
(
"./推广员数据
12月1日-3月31日
.xlsx"
)
xlFile
:=
xlsx
.
NewFile
()
sheet
,
err
:=
xlFile
.
AddSheet
(
"promotion"
)
if
err
!=
nil
{
...
...
script/svip_user_charge.go
View file @
e6605d24
...
...
@@ -12,23 +12,25 @@ type AutoGenerated34 struct {
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
struct
{
Total
int
`json:"total"`
Data
[]
struct
{
UserID
int
`json:"userId"`
Date
string
`json:"date"`
Country
string
`json:"country"`
UserCode
string
`json:"userCode"`
UserName
string
`json:"userName"`
ChargeMoney
string
`json:"chargeMoney"`
HaveFirst
int
`json:"haveFirst"`
RegisterAt
string
`json:"registerAt"`
SvipLevel
int
`json:"svipLevel"`
MaxDollar
int
`json:"maxDollar"`
// 历史最高单笔
MaxDollarDuration
int
`json:"maxDollarDuration"`
// 时段最高单笔
}
`json:"data"`
Total
int
`json:"total"`
Data
[]
AutoGenerated34Data
`json:"data"`
}
`json:"data"`
}
type
AutoGenerated34Data
struct
{
UserID
int
`json:"userId"`
Date
string
`json:"date"`
Country
string
`json:"country"`
UserCode
string
`json:"userCode"`
UserName
string
`json:"userName"`
ChargeMoney
string
`json:"chargeMoney"`
HaveFirst
int
`json:"haveFirst"`
RegisterAt
string
`json:"registerAt"`
SvipLevel
int
`json:"svipLevel"`
MaxDollar
int
`json:"maxDollar"`
// 历史最高单笔
MaxDollarDuration
int
`json:"maxDollarDuration"`
// 时段最高单笔
}
func
ats34
(
a
interface
{})
string
{
return
fmt
.
Sprintf
(
"%v"
,
a
)
}
...
...
@@ -36,43 +38,53 @@ func ats34(a interface{}) string {
func
main
()
{
//url := "https://apiv2.faceline.live/v1/stats/charge/user?lang=zh-cn&diamondType=2&beginDate=2023-10-01&endDate=2023-10-31&pageIndex=1&pageSize=10000&country=All&code=&area=1&timezone=1"
//url := "https://apiv2.faceline.live/v1/stats/charge/user?lang=zh-cn&diamondType=1&beginDate=2022-06-01&endDate=2023-12-13&pageIndex=1&pageSize=4805&country=All&code=&area=1&timezone=0"
url
:=
"https://apiv2.faceline.live/v1/stats/charge/user?lang=zh-cn&diamondType=1&beginDate=2023-12-01&endDate=2023-12-31&pageIndex=2&pageSize=2500&country=All&code=&area=2&timezone=0"
method
:=
"GET"
var
data
[]
AutoGenerated34Data
pageIndex
:=
1
pageSize
:=
1000
for
{
url
:=
fmt
.
Sprintf
(
"https://apiv2.faceline.live/v1/stats/charge/user?lang=zh-cn&diamondType=1&beginDate=2024-03-01&endDate=2024-03-31&pageIndex=%d&pageSize=%d&country=All&code=&area=2&timezone=0"
,
pageIndex
,
pageSize
)
method
:=
"GET"
client
:=
&
http
.
Client
{}
req
,
err
:=
http
.
NewRequest
(
method
,
url
,
nil
)
client
:=
&
http
.
Client
{}
req
,
err
:=
http
.
NewRequest
(
method
,
url
,
nil
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
req
.
Header
.
Add
(
"nonce"
,
"hilo"
)
req
.
Header
.
Add
(
"token"
,
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTcwNTIxODE0MH0.Xb7DU89AUYBahJfV4MDcr-pBbsLJcf1VM0WgnCNb-ig
"
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
req
.
Header
.
Add
(
"nonce"
,
"hilo"
)
req
.
Header
.
Add
(
"token"
,
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTcxNDcxNjcyOH0.Mt_gpOenB25vRXDFM4u-oReTNMBYgS7ZvzQumQHOuvU
"
)
res
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
defer
res
.
Body
.
Close
()
res
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
body
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
panic
(
err
)
}
println
(
string
(
body
))
var
response
=
new
(
AutoGenerated34
)
err
=
json
.
Unmarshal
(
body
,
&
response
)
if
err
!=
nil
{
panic
(
err
)
body
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
panic
(
err
)
}
println
(
string
(
body
))
var
response
=
new
(
AutoGenerated34
)
err
=
json
.
Unmarshal
(
body
,
&
response
)
if
err
!=
nil
{
panic
(
err
)
}
if
len
(
response
.
Data
.
Data
)
<=
0
{
break
}
data
=
append
(
data
,
response
.
Data
.
Data
...
)
pageIndex
++
}
excelFileName
:=
fmt
.
Sprintf
(
"./非阿语区黄钻充值202
312月2
.xlsx"
)
excelFileName
:=
fmt
.
Sprintf
(
"./非阿语区黄钻充值202
43月
.xlsx"
)
xlFile
:=
xlsx
.
NewFile
()
sheet
,
_
:=
xlFile
.
AddSheet
(
"charge"
)
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
,
c10
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c1
.
Value
,
c2
.
Value
,
c3
.
Value
,
c4
.
Value
,
c5
.
Value
,
c6
.
Value
,
c7
.
Value
,
c8
.
Value
,
c9
.
Value
,
c10
.
Value
=
"日期"
,
"国家"
,
"用户ID"
,
"用户昵称"
,
"充值金额"
,
"注册时间"
,
"是否举办首场活动"
,
"svip等级"
,
"时段最高单笔"
,
"历史最高单笔"
for
_
,
d
:=
range
response
.
Data
.
D
ata
{
for
_
,
d
:=
range
d
ata
{
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
,
c10
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c1
.
Value
,
c2
.
Value
,
c3
.
Value
,
c4
.
Value
,
c5
.
Value
,
c6
.
Value
=
ats34
(
d
.
Date
),
ats34
(
d
.
Country
),
ats34
(
d
.
UserCode
),
ats34
(
d
.
UserName
),
ats34
(
d
.
ChargeMoney
),
ats34
(
d
.
RegisterAt
)
...
...
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