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
724d18d5
Commit
724d18d5
authored
Jul 12, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:加两个
parent
861e6880
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
156 additions
and
0 deletions
+156
-0
fruit_day_stake.go
script/fruit_day_stake.go
+76
-0
fruit_day_stat.go
script/fruit_day_stat.go
+80
-0
No files found.
script/fruit_day_stake.go
0 → 100644
View file @
724d18d5
package
main
import
(
"encoding/json"
"fmt"
"github.com/tealeg/xlsx"
"io/ioutil"
"net/http"
)
type
AutoGenerated2
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
struct
{
Total
int
`json:"total"`
Data
[]
struct
{
Rank
int
`json:"rank"`
UserCode
string
`json:"userCode"`
Country
string
`json:"country"`
Stake
int
`json:"stake"`
Award
int
`json:"award"`
ProfitLoss
int
`json:"profitLoss"`
ChargeMoney
float64
`json:"chargeMoney"`
}
`json:"data"`
}
`json:"data"`
}
func
ats29
(
a
interface
{})
string
{
return
fmt
.
Sprintf
(
"%v"
,
a
)
}
func
main
()
{
url
:=
"https://apiv2.faceline.live/v1/fruitMachine/rank/stake?lang=zh-cn&pageIndex=4&pageSize=5000&beginDate=2023-06-01&endDate=2023-06-30&userCode=&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.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTY5MDYwOTY4NX0.dVsFGjc1wLPxqhAMloXICs-xQcVxM5FkweLvFta3ncA"
)
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
(
AutoGenerated2
)
err
=
json
.
Unmarshal
(
body
,
&
response
)
if
err
!=
nil
{
panic
(
err
)
}
excelFileName
:=
fmt
.
Sprintf
(
"./水果机投注榜单前15000-20000.xlsx"
)
xlFile
:=
xlsx
.
NewFile
()
sheet
,
_
:=
xlFile
.
AddSheet
(
"charge"
)
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
:=
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
=
"排名"
,
"用户ID"
,
"国家"
,
"投注钻石数"
,
"中奖钻石数"
,
"盈亏(中奖-投注)"
,
"充值金额 $"
for
_
,
d
:=
range
response
.
Data
.
Data
{
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
:=
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
=
ats29
(
d
.
Rank
),
ats29
(
d
.
UserCode
),
ats29
(
d
.
Country
),
ats29
(
d
.
Stake
),
ats29
(
d
.
Award
),
ats29
(
d
.
ProfitLoss
)
c7
.
Value
=
ats29
(
d
.
ChargeMoney
)
}
_
=
xlFile
.
Save
(
excelFileName
)
}
script/fruit_day_stat.go
0 → 100644
View file @
724d18d5
package
main
import
(
"encoding/json"
"fmt"
"github.com/tealeg/xlsx"
"io/ioutil"
"net/http"
)
type
AutoGenerated
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
struct
{
Total
int
`json:"total"`
Data
[]
struct
{
Date
string
`json:"Date"`
Pool
int
`json:"Pool"`
RoundNum
int
`json:"RoundNum"`
UserNum
int
`json:"UserNum"`
AwardNum
int
`json:"AwardNum"`
Stake
int
`json:"Stake"`
Award
int
`json:"Award"`
Recycle
int
`json:"Recycle"`
TopConsumer
string
`json:"TopConsumer"`
TopConsumerDiamond
int
`json:"TopConsumerDiamond"`
TopWinner
string
`json:"TopWinner"`
TopWinnerDiamond
int
`json:"TopWinnerDiamond"`
LeftOver
int
`json:"LeftOver"`
}
`json:"data"`
}
`json:"data"`
}
func
ats28
(
a
interface
{})
string
{
return
fmt
.
Sprintf
(
"%v"
,
a
)
}
func
main
()
{
url
:=
"https://apiv2.faceline.live/v1/fruitMachine/day/stats?lang=zh-cn&pageIndex=1&pageSize=100000&beginDate=2023-04-01&endDate=2023-06-31"
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.eyJVc2VySWQiOjI1MSwiRXh0ZXJuYWxJZCI6IiIsImV4cCI6MTY5MDYwOTY4NX0.dVsFGjc1wLPxqhAMloXICs-xQcVxM5FkweLvFta3ncA"
)
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
{
fmt
.
Println
(
err
)
return
}
var
response
=
new
(
AutoGenerated
)
json
.
Unmarshal
(
body
,
&
response
)
excelFileName
:=
fmt
.
Sprintf
(
"./水果机每日统计.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
=
"日期"
,
"参与人数"
,
"中奖人数"
,
"投注钻石数"
,
"中奖钻石数"
,
"系统回收"
,
"今日盈余"
,
"奖池盈余"
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
=
d
.
Date
,
ats28
(
d
.
UserNum
),
ats28
(
d
.
AwardNum
),
ats28
(
d
.
Stake
),
ats28
(
d
.
Award
),
ats28
(
d
.
Recycle
)
c7
.
Value
,
c8
.
Value
=
ats28
(
d
.
LeftOver
),
ats28
(
d
.
Pool
)
}
_
=
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