4
4
"fmt"
5
5
"github.com/thedevsaddam/gojsonq"
6
6
xuexitong "github.com/yatori-dev/yatori-go-core/aggregation/xuexitong"
7
- "github.com/yatori-dev/yatori-go-core/aggregation/xuexitong/point"
8
7
"github.com/yatori-dev/yatori-go-core/api/entity"
9
8
xuexitongApi "github.com/yatori-dev/yatori-go-core/api/xuexitong"
10
9
lg "github.com/yatori-dev/yatori-go-core/utils/log"
@@ -153,10 +152,8 @@ func nodeListStudy(setting config.Setting, user *config.Users, userCache *xuexit
153
152
log .Fatal (err )
154
153
}
155
154
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 )
160
157
time .Sleep (5 * time .Second )
161
158
}
162
159
}
@@ -165,13 +162,13 @@ func nodeListStudy(setting config.Setting, user *config.Users, userCache *xuexit
165
162
videosLock .Done ()
166
163
}
167
164
168
- // 常规刷视屏逻辑
165
+ // 常规刷视频逻辑
169
166
func ExecuteVideo (cache * xuexitongApi.XueXiTUserCache , p * entity.PointVideoDto ) {
170
167
if state , _ := xuexitong .VideoDtoFetchAction (cache , p ); state {
171
168
var playingTime = p .PlayTime
172
169
for {
173
170
if p .Duration - playingTime >= 58 {
174
- playReport , err := cache .VideoDtoPlayReport (p , playingTime , 0 )
171
+ playReport , err := cache .VideoDtoPlayReport (p , playingTime , 0 , 8 , nil )
175
172
if gojsonq .New ().JSONString (playReport ).Find ("isPassed" ) == nil || err != nil {
176
173
lg .Print (lg .INFO , `[` , cache .Name , `] ` , lg .BoldRed , "提交学时接口访问异常,返回信息:" , playReport , err .Error ())
177
174
}
@@ -183,7 +180,7 @@ func ExecuteVideo(cache *xuexitongApi.XueXiTUserCache, p *entity.PointVideoDto)
183
180
playingTime = playingTime + 58
184
181
time .Sleep (58 * time .Second )
185
182
} 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 )
187
184
if gojsonq .New ().JSONString (playReport ).Find ("isPassed" ) == nil || err != nil {
188
185
lg .Print (lg .INFO , `[` , cache .Name , `] ` , lg .BoldRed , "提交学时接口访问异常,返回信息:" , playReport , err .Error ())
189
186
}
@@ -199,3 +196,15 @@ func ExecuteVideo(cache *xuexitongApi.XueXiTUserCache, p *entity.PointVideoDto)
199
196
log .Fatal ("视频解析失败" )
200
197
}
201
198
}
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