Skip to content

Commit 3039960

Browse files
committed
update: update xutxitong log show
1 parent 02e0c25 commit 3039960

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
1515
)
1616

17-
require github.com/yatori-dev/yatori-go-core v1.2.0
17+
require github.com/yatori-dev/yatori-go-core v1.2.1
1818

1919
require (
2020
github.com/PuerkitoBio/goquery v1.10.0 // indirect

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
120120
github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
121121
github.com/yalue/onnxruntime_go v1.12.1 h1:joCCmBnNjHy04jK9EMP/UV6oPPqySXlRgf3gcUcnI/g=
122122
github.com/yalue/onnxruntime_go v1.12.1/go.mod h1:b4X26A8pekNb1ACJ58wAXgNKeUCGEAQ9dmACut9Sm/4=
123-
github.com/yatori-dev/yatori-go-core v1.2.0 h1:NqkiV4gQf4ZvKVXL9cHR4jt0yNwGIhSnTvsnGbLEy5A=
124-
github.com/yatori-dev/yatori-go-core v1.2.0/go.mod h1:M32eb5ULwWC5We8QD1653UpdWldfv7wNdMB8UgdDVdw=
123+
github.com/yatori-dev/yatori-go-core v1.2.1 h1:v5fc7mBeliiPKtzMJoK5pUbHO1UbmMlOTh80JGTa8SA=
124+
github.com/yatori-dev/yatori-go-core v1.2.1/go.mod h1:M32eb5ULwWC5We8QD1653UpdWldfv7wNdMB8UgdDVdw=
125125
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
126126
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
127127
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=

logic/xuexitong/XueXiTongPart.go

+17-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"github.com/thedevsaddam/gojsonq"
66
xuexitong "github.com/yatori-dev/yatori-go-core/aggregation/xuexitong"
7-
"github.com/yatori-dev/yatori-go-core/aggregation/xuexitong/point"
87
"github.com/yatori-dev/yatori-go-core/api/entity"
98
xuexitongApi "github.com/yatori-dev/yatori-go-core/api/xuexitong"
109
lg "github.com/yatori-dev/yatori-go-core/utils/log"
@@ -153,10 +152,8 @@ func nodeListStudy(setting config.Setting, user *config.Users, userCache *xuexit
153152
log.Fatal(err)
154153
}
155154
documentDTO.AttachmentsDetection(card)
156-
point.ExecuteDocument(userCache, &documentDTO)
157-
if err != nil {
158-
log.Fatal(err)
159-
}
155+
//point.ExecuteDocument(userCache, &documentDTO)
156+
ExecuteDocument(userCache, &documentDTO)
160157
time.Sleep(5 * time.Second)
161158
}
162159
}
@@ -165,13 +162,13 @@ func nodeListStudy(setting config.Setting, user *config.Users, userCache *xuexit
165162
videosLock.Done()
166163
}
167164

168-
// 常规刷视屏逻辑
165+
// 常规刷视频逻辑
169166
func ExecuteVideo(cache *xuexitongApi.XueXiTUserCache, p *entity.PointVideoDto) {
170167
if state, _ := xuexitong.VideoDtoFetchAction(cache, p); state {
171168
var playingTime = p.PlayTime
172169
for {
173170
if p.Duration-playingTime >= 58 {
174-
playReport, err := cache.VideoDtoPlayReport(p, playingTime, 0)
171+
playReport, err := cache.VideoDtoPlayReport(p, playingTime, 0, 8, nil)
175172
if gojsonq.New().JSONString(playReport).Find("isPassed") == nil || err != nil {
176173
lg.Print(lg.INFO, `[`, cache.Name, `] `, lg.BoldRed, "提交学时接口访问异常,返回信息:", playReport, err.Error())
177174
}
@@ -183,7 +180,7 @@ func ExecuteVideo(cache *xuexitongApi.XueXiTUserCache, p *entity.PointVideoDto)
183180
playingTime = playingTime + 58
184181
time.Sleep(58 * time.Second)
185182
} else if p.Duration-playingTime < 58 {
186-
playReport, err := cache.VideoDtoPlayReport(p, p.Duration, 2)
183+
playReport, err := cache.VideoDtoPlayReport(p, p.Duration, 2, 8, nil)
187184
if gojsonq.New().JSONString(playReport).Find("isPassed") == nil || err != nil {
188185
lg.Print(lg.INFO, `[`, cache.Name, `] `, lg.BoldRed, "提交学时接口访问异常,返回信息:", playReport, err.Error())
189186
}
@@ -199,3 +196,15 @@ func ExecuteVideo(cache *xuexitongApi.XueXiTUserCache, p *entity.PointVideoDto)
199196
log.Fatal("视频解析失败")
200197
}
201198
}
199+
200+
// 常规刷文档逻辑
201+
func ExecuteDocument(cache *xuexitongApi.XueXiTUserCache, p *entity.PointDocumentDto) {
202+
report, err := cache.DocumentDtoReadingReport(p)
203+
if gojsonq.New().JSONString(report).Find("status") == nil || err != nil {
204+
lg.Print(lg.INFO, `[`, cache.Name, `] `, lg.BoldRed, "提交学时接口访问异常,返回信息:", report, err.Error())
205+
log.Fatalln(err)
206+
}
207+
if gojsonq.New().JSONString(report).Find("status").(bool) {
208+
lg.Print(lg.INFO, "[", lg.Green, cache.Name, lg.Default, "] ", " 【", p.Title, "】 >>> ", "文档阅览状态:", lg.Green, lg.Green, strconv.FormatBool(gojsonq.New().JSONString(report).Find("status").(bool)), lg.Default, " ")
209+
}
210+
}

0 commit comments

Comments
 (0)