Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
加钱居士.
foot
提交
72ecb590
F
foot
项目概览
加钱居士.
/
foot
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
foot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
72ecb590
编写于
12月 30, 2019
作者:
M
monomania
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.增加主推模型胜率统计
上级
762ec344
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
112 addition
and
26 deletion
+112
-26
FOOT000TestApplication.go
FOOT000TestApplication.go
+7
-0
assets/wechat/html/month.html
assets/wechat/html/month.html
+2
-1
assets/wechat/html/today.html
assets/wechat/html/today.html
+3
-3
assets/wechat/html/today_detail.html
assets/wechat/html/today_detail.html
+4
-4
assets/wechat/html/today_tbs.html
assets/wechat/html/today_tbs.html
+7
-7
assets/wechat/html/week.html
assets/wechat/html/week.html
+2
-1
conf/app.ini
conf/app.ini
+3
-1
conf/app_prod.ini
conf/app_prod.ini
+2
-1
foot-api/module/suggest/vo/MonthVO.go
foot-api/module/suggest/vo/MonthVO.go
+7
-0
foot-api/module/suggest/vo/WeekVO.go
foot-api/module/suggest/vo/WeekVO.go
+9
-0
foot-core/module/suggest/service/SuggestService.go
foot-core/module/suggest/service/SuggestService.go
+1
-1
foot-core/module/wechat/service/SuggestMonthService.go
foot-core/module/wechat/service/SuggestMonthService.go
+22
-2
foot-core/module/wechat/service/SuggestTodayService.go
foot-core/module/wechat/service/SuggestTodayService.go
+21
-2
foot-core/module/wechat/service/SuggestWeekService.go
foot-core/module/wechat/service/SuggestWeekService.go
+22
-3
未找到文件。
FOOT000TestApplication.go
浏览文件 @
72ecb590
...
...
@@ -53,6 +53,13 @@ func getFuncMap() map[string]interface{} {
}
func
main
()
{
var
mainRedCount
,
mainBlackCount
int64
mainRedCount
=
27
mainBlackCount
=
22
value
:=
float64
(
mainRedCount
)
/
(
float64
(
mainRedCount
)
+
float64
(
mainBlackCount
))
*
100
value
,
_
=
strconv
.
ParseFloat
(
fmt
.
Sprintf
(
"%.2f"
,
value
),
64
)
fmt
.
Println
(
strconv
.
FormatFloat
(
value
,
'f'
,
-
1
,
64
)
+
"%"
)
//测试
suggestService
:=
new
(
service3
.
SuggestService
)
i
:=
vo
.
SuggestVO
{}
...
...
assets/wechat/html/month.html
浏览文件 @
72ecb590
...
...
@@ -7,6 +7,7 @@
<li><span
style=
"color: gray; "
><strong>
黑(错误):{{.BlackCount}}
</strong></span></li>
<li><span
style=
"color: red; "
><strong>
最长连红:{{.LinkRedCount}}
</strong></span></li>
<li><span
style=
"color: gray; "
><strong>
最长连黑:{{.LinkBlackCount}}
</strong></span></li>
<li
style=
"font-size: 12px;font-weight: bold"
><strong>
E2模型统计,红(正确):{{.MainRedCount}} 黑(错误):{{.MainBlackCount}},胜率:{{.MainRedCount}}/({{.MainRedCount}}+{{.MainBlackCount}})={{.MainVal}}
</strong></li>
</ul>
<hr/>
<h1
style=
"margin-top: 5px"
>
...
...
@@ -40,7 +41,7 @@
style=
"background-color: orange"
{{
end
}}
>
{{preResultStr .PreResult}}
({{alFlagStr .AlFlag}})
{{preResultStr .PreResult}}
<span
style=
"color: {{color .AlFlag}}"
>
({{alFlagStr .AlFlag}})
</span>
</td>
</tr>
...
...
assets/wechat/html/today.html
浏览文件 @
72ecb590
...
...
@@ -5,7 +5,7 @@
<li><strong>
3.推荐的场次为当前时间"往前推12个小时"至"往后推24小时"的比赛.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)4.推荐的场次会随指数的变化而变化,如再次进入不见上次推荐的比赛,请查看"待选池比赛".
</strong></li>
<li><strong>
5.推荐选项跟着的字母,如A1 A2 E1 E2,为算法模型标识,仅是为了方便观察不同模型的表现.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.
建议多关注支持模型E2的比赛
.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.
公众号主推模型为E2,敬请关注
.
</strong></li>
</ul>
<hr/>
<ul
style=
"font-size: 12px;font-weight: lighter"
>
...
...
@@ -21,7 +21,7 @@
<span
style=
"color: orangered"
>
A2
</span>
<span
style=
"color: blue"
>
E1
</span>
<span
style=
"color: darkblue"
>
E2
</span>
<span
style=
"color:
blue
"
>
Q1
</span>
<span
style=
"color:
olivedrab
"
>
Q1
</span>
</div>
</h1>
<table
style=
"font-size: 12px;font-weight: bold"
>
...
...
@@ -53,7 +53,7 @@
style=
"background-color: orange"
{{
end
}}
>
{{preResultStr .PreResult}}({{alFlagStr .AlFlag}})
{{preResultStr .PreResult}}
<span
style=
"color: {{color .AlFlag}}"
>
({{alFlagStr .AlFlag}})
</span>
</td>
</tr>
...
...
assets/wechat/html/today_detail.html
浏览文件 @
72ecb590
...
...
@@ -5,7 +5,7 @@
<li><strong>
3.推荐的场次为当前时间"往前推12个小时"至"往后推24小时"的比赛.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)4.推荐的场次会随指数的变化而变化,如再次进入不见上次推荐的比赛,请查看"待选池比赛".
</strong></li>
<li><strong>
5.推荐选项跟着的字母,如A1 A2 E1 E2,为算法模型标识,仅是为了方便观察不同模型的表现.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.
建议多关注支持模型E2的比赛
.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.
公众号主推模型为E2,敬请关注
.
</strong></li>
</ul>
<hr/>
<ul
style=
"font-size: 12px;font-weight: lighter"
>
...
...
@@ -20,9 +20,9 @@
<li>
比赛时间:{{.MatchDateStr}}
</li>
<li>
联 赛:{{.LeagueName}}
</li>
<li>
对阵双方:{{.MainTeam}}({{.LetBall}}){{.GuestTeam}}
</li>
<li>
算法模型:
<span
style=
"color:
red;font-weight: bold;"
>
{{alFlagStr .AlFlag}}
</span></li>
<li>
球探指数:
<span
style=
"color: red;font-weight: bold;"
>
{{.HitCount}}
(指数越大,越稳定)
</span></li>
<li>
推荐选项:
<span
style=
"color: red;font-weight: bold;"
>
{{preResultStr .PreResult}}
</span>
</li>
<li>
算法模型:
<span
style=
"color:
{{color .AlFlag}}"
>
({{alFlagStr .AlFlag}})
</span></li>
<li>
球探指数:
{{.HitCount}}
<span
style=
"color: red;font-weight: bold;"
>
(指数越大,越稳定)
</span></li>
<li>
推荐选项:
{{preResultStr .PreResult}}
</li>
<li>
说 明:
<span
style=
"color: red;font-weight: bold;"
>
程序只分析预测胜负,平局仅作为次防选项.历史统计以亚指为依据.
</span></li>
</ul>
<hr/>
...
...
assets/wechat/html/today_tbs.html
浏览文件 @
72ecb590
...
...
@@ -5,7 +5,7 @@
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)3.获取最新推荐请发送"今日推荐"给公众号.
</strong></li>
<li><strong>
4.待选的场次为当前时间"往前推48小时"至"往后推24小时"的比赛.
</strong></li>
<li><strong>
5.待选的场次会随指数的变化而变化,如再次进入不见上次待选的比赛,请查看"今日推荐".
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.
建议多关注支持模型E2的比赛
.
</strong></li>
<li
style=
"text-shadow: 0 0 7px blue"
><strong>
(重要)6.
公众号主推模型为E2,敬请关注
.
</strong></li>
</ul>
<hr/>
<ul
style=
"font-size: 12px;font-weight: lighter"
>
...
...
@@ -17,11 +17,11 @@
<div
style=
"float: left;width: 40%"
><strong>
赛事列表
</strong></div>
<div
style=
"float: right;width: 40%;font-weight: bold;font-size: 12px"
>
模型:
<span
style=
"color: orange"
>
A1
</span>
<span
style=
"color: orangered"
>
A2
</span>
<span
style=
"color: blue"
>
E1
</span>
<span
style=
"color: darkblue"
>
E2
</span>
<span
style=
"color: blue
"
>
Q1
</span>
<span
style=
"color: orange"
>
A1
</span>
<span
style=
"color: orangered"
>
A2
</span>
<span
style=
"color: blue"
>
E1
</span>
<span
style=
"color: darkblue"
>
E2
</span>
<span
style=
"color: olivedrab
"
>
Q1
</span>
</div>
</h1>
<table
style=
"font-size: 12px;font-weight: bold"
>
...
...
@@ -44,7 +44,7 @@
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td>
{{preResultStr .PreResult}}
({{alFlagStr .AlFlag}})
{{preResultStr .PreResult}}
<span
style=
"color: {{color .AlFlag}}"
>
({{alFlagStr .AlFlag}})
</span>
</td>
<td
style=
"color: red"
>
<strong>
{{.HitCount}}
</strong>
...
...
assets/wechat/html/week.html
浏览文件 @
72ecb590
...
...
@@ -7,6 +7,7 @@
<li><span
style=
"color: gray; "
><strong>
黑(错误):{{.BlackCount}}
</strong></span></li>
<li><span
style=
"color: red; "
><strong>
最长连红:{{.LinkRedCount}}
</strong></span></li>
<li><span
style=
"color: gray; "
><strong>
最长连黑:{{.LinkBlackCount}}
</strong></span></li>
<li
style=
"font-size: 12px;font-weight: bold"
><strong>
E2模型统计,红(正确):{{.MainRedCount}} 黑(错误):{{.MainBlackCount}},胜率:{{.MainRedCount}}/({{.MainRedCount}}+{{.MainBlackCount}})={{.MainVal}}
</strong></li>
</ul>
<hr/>
<h1
style=
"margin-top: 5px"
>
...
...
@@ -40,7 +41,7 @@
style=
"background-color: orange"
{{
end
}}
>
{{preResultStr .PreResult}}
({{alFlagStr .AlFlag}})
{{preResultStr .PreResult}}
<span
style=
"color: {{color .AlFlag}}"
>
({{alFlagStr .AlFlag}})
</span>
</td>
</tr>
...
...
conf/app.ini
浏览文件 @
72ecb590
[mysql]
url
=
root:Meta.123@tcp(localhost:3306)/foot?charset=utf8
#url=root:awe.FOG5188@tcp(39.108.212.245:3306)/foot?charset=utf8
maxIdle
=
10
maxConn
=
50
[cookies]
...
...
@@ -52,7 +53,8 @@ content_tpl="本次推荐为程序全自动处理,全程无人为参与干预.
price_strategy
=
0
[wechat]
###推荐使用的算法
#al_flag=Euro20191212Service
al_flag
=
'Asia20191206Service','Euro20191206Service','Euro20191212Service'
main_al_flag
=
'','Euro20191212Service'
OriId
=
gh_a8328f3c25d2
AppID
=
wx76e3dd0445aa0055
AppSecret
=
4257a40eb6f59e50777fdcc2b47b31a4
...
...
conf/app_prod.ini
浏览文件 @
72ecb590
...
...
@@ -52,7 +52,8 @@ content_tpl="本次推荐为程序全自动处理,全程无人为参与干预.
price_strategy
=
0
[wechat]
###推荐使用的算法
#al_flag=Euro20191212Service
al_flag
=
'Asia20191206Service','Euro20191206Service','Euro20191212Service'
main_al_flag
=
'','Euro20191212Service'
OriId
=
gh_a8328f3c25d2
AppID
=
wx76e3dd0445aa0055
AppSecret
=
4257a40eb6f59e50777fdcc2b47b31a4
...
...
foot-api/module/suggest/vo/MonthVO.go
浏览文件 @
72ecb590
...
...
@@ -19,5 +19,12 @@ type MonthVO struct {
//最长连黑
LinkBlackCount
int64
//红
MainRedCount
int64
//黑
MainBlackCount
int64
//胜率
MainVal
string
DataList
[]
SuggestVO
}
foot-api/module/suggest/vo/WeekVO.go
浏览文件 @
72ecb590
...
...
@@ -19,5 +19,14 @@ type WeekVO struct {
//最长连黑
LinkBlackCount
int64
//红
MainRedCount
int64
//黑
MainBlackCount
int64
//胜率
MainVal
string
DataList
[]
SuggestVO
}
foot-core/module/suggest/service/SuggestService.go
浏览文件 @
72ecb590
...
...
@@ -81,7 +81,7 @@ WHERE mh.LeagueId = l.Id
}
if
len
(
param
.
AlFlag
)
>
0
{
sql
+=
" AND ar.AlFlag
= '"
+
param
.
AlFlag
+
"'
"
sql
+=
" AND ar.AlFlag
in ("
+
param
.
AlFlag
+
")
"
}
if
len
(
param
.
BeginDateStr
)
>
0
{
sql
+=
" AND mh.`MatchDate` >= '"
+
param
.
BeginDateStr
+
"' "
...
...
foot-core/module/wechat/service/SuggestMonthService.go
浏览文件 @
72ecb590
...
...
@@ -6,6 +6,7 @@ import (
"github.com/chanxuehong/wechat/mp/core"
"github.com/chanxuehong/wechat/mp/material"
"html/template"
"strconv"
"strings"
"tesou.io/platform/foot-parent/foot-api/common/base"
"tesou.io/platform/foot-parent/foot-api/module/suggest/vo"
...
...
@@ -62,7 +63,7 @@ func (this *SuggestMonthService) ModifyMonth(wcClient *core.Client) {
first
.
Digest
=
fmt
.
Sprintf
(
"%v-%v"
,
beginDate
.
Format
(
"2006年01月02日"
),
now
.
Format
(
"2006年01月02日"
))
first
.
ThumbMediaId
=
month_thumbMediaId
first
.
ContentSourceURL
=
contentSourceURL
first
.
Author
=
utils
.
GetVal
(
"wechat"
,
"author"
)
first
.
Author
=
utils
.
GetVal
(
"wechat"
,
"author"
)
temp
:=
vo
.
WeekVO
{}
temp
.
BeginDateStr
=
param
.
BeginDateStr
...
...
@@ -100,6 +101,25 @@ func (this *SuggestMonthService) ModifyMonth(wcClient *core.Client) {
temp
.
LinkRedCount
=
linkRedCount
temp
.
LinkBlackCount
=
linkBlackCount
//计算主要模型胜率
param
.
AlFlag
=
getMainAlFlag
()
mainTempList
:=
this
.
SuggestService
.
Query
(
param
)
var
mainRedCount
,
mainBlackCount
int64
for
_
,
e
:=
range
mainTempList
{
if
e
.
PreResult
==
3
&&
e
.
MainTeamGoal
>=
e
.
GuestTeamGoal
{
mainRedCount
++
}
else
if
e
.
PreResult
==
0
&&
e
.
MainTeamGoal
<=
e
.
GuestTeamGoal
{
mainRedCount
++
}
else
{
mainBlackCount
++
}
}
temp
.
MainRedCount
=
mainRedCount
temp
.
MainBlackCount
=
mainBlackCount
value
:=
float64
(
mainRedCount
)
/
(
float64
(
mainRedCount
)
+
float64
(
mainBlackCount
))
*
100
value
,
_
=
strconv
.
ParseFloat
(
fmt
.
Sprintf
(
"%.2f"
,
value
),
64
)
temp
.
MainVal
=
strconv
.
FormatFloat
(
value
,
'f'
,
-
1
,
64
)
+
"%"
var
buf
bytes
.
Buffer
tpl
,
err
:=
template
.
New
(
"month.html"
)
.
Funcs
(
getFuncMap
())
.
ParseFiles
(
"assets/wechat/html/month.html"
)
if
err
!=
nil
{
...
...
@@ -114,4 +134,4 @@ func (this *SuggestMonthService) ModifyMonth(wcClient *core.Client) {
if
err
!=
nil
{
base
.
Log
.
Error
(
err
)
}
}
\ No newline at end of file
}
foot-core/module/wechat/service/SuggestTodayService.go
浏览文件 @
72ecb590
...
...
@@ -45,10 +45,24 @@ func alFlagStr(str string) string {
return
"XX"
}
func
color
(
str
string
)
string
{
if
"Asia20191206Service"
==
str
{
return
"orange"
}
else
if
"Euro20191206Service"
==
str
{
return
"blue"
}
else
if
"Euro20191212Service"
==
str
{
return
"darkblue"
}
else
if
"Euro20191226Service"
==
str
{
return
"olivedrab"
}
return
"XX"
}
func
getFuncMap
()
map
[
string
]
interface
{}
{
funcMap
:=
template
.
FuncMap
{
"preResultStr"
:
preResultStr
,
"alFlagStr"
:
alFlagStr
,
"color"
:
color
,
}
return
funcMap
}
...
...
@@ -58,6 +72,11 @@ func getAlFlag() string{
return
al_flag
;
}
func
getMainAlFlag
()
string
{
al_flag
:=
utils
.
GetVal
(
"wechat"
,
"main_al_flag"
)
return
al_flag
;
}
const
contentSourceURL
=
"https://gitee.com/aoe5188/foot"
const
today_thumbMediaId
=
"chP-LBQxy9SVbAFjwZ4QEuxc8rI6Dy-bm5n3yZbsuJA"
const
today_detail_thumbMediaId
=
"chP-LBQxy9SVbAFjwZ4QEgIU_dXnFnXHvYzocwCpkM4"
...
...
@@ -197,8 +216,8 @@ func (this *SuggestTodayService) ModifyTodayTbs(wcClient *core.Client) {
h12
,
_
=
time
.
ParseDuration
(
"24h"
)
endDate
:=
now
.
Add
(
h12
)
param
.
EndDateStr
=
endDate
.
Format
(
"2006-01-02 15:04:05"
)
//
今日推荐
param
.
AlFlag
=
getAlFlag
()
//
待选池释放Q1
param
.
AlFlag
=
""
tempList
:=
this
.
SuggestService
.
QueryTbs
(
param
)
//更新推送
first
:=
material
.
Article
{}
...
...
foot-core/module/wechat/service/SuggestWeekService.go
浏览文件 @
72ecb590
...
...
@@ -6,6 +6,7 @@ import (
"github.com/chanxuehong/wechat/mp/core"
"github.com/chanxuehong/wechat/mp/material"
"html/template"
"strconv"
"strings"
"tesou.io/platform/foot-parent/foot-api/common/base"
"tesou.io/platform/foot-parent/foot-api/module/suggest/vo"
...
...
@@ -25,7 +26,6 @@ type SuggestWeekService struct {
const
week_thumbMediaId
=
"chP-LBQxy9SVbAFjwZ4QEo81I0bHaY3YDYRwVGmf7o8"
const
week_mediaId
=
"chP-LBQxy9SVbAFjwZ4QEgcfOu5CZ67hiBgn5qnZ-Ac"
func
(
this
*
SuggestWeekService
)
Week
(
wcClient
*
core
.
Client
)
string
{
articles
:=
make
([]
material
.
Article
,
1
)
first
:=
material
.
Article
{}
...
...
@@ -64,7 +64,7 @@ func (this *SuggestWeekService) ModifyWeek(wcClient *core.Client) {
first
.
ThumbMediaId
=
week_thumbMediaId
first
.
ContentSourceURL
=
contentSourceURL
first
.
ShowCoverPic
=
0
first
.
Author
=
utils
.
GetVal
(
"wechat"
,
"author"
)
first
.
Author
=
utils
.
GetVal
(
"wechat"
,
"author"
)
temp
:=
vo
.
WeekVO
{}
temp
.
BeginDateStr
=
param
.
BeginDateStr
temp
.
EndDateStr
=
param
.
EndDateStr
...
...
@@ -101,6 +101,25 @@ func (this *SuggestWeekService) ModifyWeek(wcClient *core.Client) {
temp
.
LinkRedCount
=
linkRedCount
temp
.
LinkBlackCount
=
linkBlackCount
//计算主要模型胜率
param
.
AlFlag
=
getMainAlFlag
()
mainTempList
:=
this
.
SuggestService
.
Query
(
param
)
var
mainRedCount
,
mainBlackCount
int64
for
_
,
e
:=
range
mainTempList
{
if
e
.
PreResult
==
3
&&
e
.
MainTeamGoal
>=
e
.
GuestTeamGoal
{
mainRedCount
++
}
else
if
e
.
PreResult
==
0
&&
e
.
MainTeamGoal
<=
e
.
GuestTeamGoal
{
mainRedCount
++
}
else
{
mainBlackCount
++
}
}
temp
.
MainRedCount
=
mainRedCount
temp
.
MainBlackCount
=
mainBlackCount
value
:=
float64
(
mainRedCount
)
/
(
float64
(
mainRedCount
)
+
float64
(
mainBlackCount
))
*
100
value
,
_
=
strconv
.
ParseFloat
(
fmt
.
Sprintf
(
"%.2f"
,
value
),
64
)
temp
.
MainVal
=
strconv
.
FormatFloat
(
value
,
'f'
,
-
1
,
64
)
+
"%"
var
buf
bytes
.
Buffer
tpl
,
err
:=
template
.
New
(
"week.html"
)
.
Funcs
(
getFuncMap
())
.
ParseFiles
(
"assets/wechat/html/week.html"
)
if
err
!=
nil
{
...
...
@@ -115,4 +134,4 @@ func (this *SuggestWeekService) ModifyWeek(wcClient *core.Client) {
if
err
!=
nil
{
base
.
Log
.
Error
(
err
)
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录