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
1e8f4292
Commit
1e8f4292
authored
Oct 11, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
粉钻充值10月
parent
cc2b3b73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
svip_user_charge.go
script/svip_user_charge.go
+77
-0
No files found.
script/svip_user_charge.go
0 → 100644
View file @
1e8f4292
package
main
import
(
"encoding/json"
"fmt"
"github.com/tealeg/xlsx"
"io/ioutil"
"net/http"
)
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"`
}
`json:"data"`
}
`json:"data"`
}
func
ats34
(
a
interface
{})
string
{
return
fmt
.
Sprintf
(
"%v"
,
a
)
}
func
main
()
{
url
:=
"https://apiv2.faceline.live/v1/stats/charge/user?lang=zh-cn&diamondType=2&beginDate=2023-10-01&endDate=2023-10-30&pageIndex=1&pageSize=100000&country=All&code=&area=0&timezone=0"
method
:=
"GET"
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.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTY5ODM5MjYzNH0.2zOdawVOI8G_4U1xeQJib_s9-JqUORgcTEx7EACj8Wo"
)
res
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
defer
res
.
Body
.
Close
()
body
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
panic
(
err
)
}
var
response
=
new
(
AutoGenerated34
)
err
=
json
.
Unmarshal
(
body
,
&
response
)
if
err
!=
nil
{
panic
(
err
)
}
excelFileName
:=
fmt
.
Sprintf
(
"./粉钻充值10月.xlsx"
)
xlFile
:=
xlsx
.
NewFile
()
sheet
,
_
:=
xlFile
.
AddSheet
(
"charge"
)
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
:=
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
=
"日期"
,
"国家"
,
"用户ID"
,
"用户昵称"
,
"充值金额"
,
"注册时间"
,
"是否举办首场活动"
,
"svip等级"
for
_
,
d
:=
range
response
.
Data
.
Data
{
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
:=
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
)
c7
.
Value
,
c8
.
Value
=
ats34
(
d
.
HaveFirst
),
ats34
(
d
.
SvipLevel
)
}
_
=
xlFile
.
Save
(
excelFileName
)
}
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