Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
viitto
EduSpider
Commits
47041ac9
Commit
47041ac9
authored
Sep 19, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
9f4200ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
CourseStudentRepository.cs
EduSpider.Repository/CourseStudentRepository.cs
+3
-1
ClassInAccountManager.cs
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
+11
-2
CourseManager.cs
EduSpider/Spiders/ClassInRule/CourseManager.cs
+18
-1
No files found.
EduSpider.Repository/CourseStudentRepository.cs
View file @
47041ac9
...
...
@@ -34,7 +34,9 @@ namespace EduSpider.Repository
/// <returns></returns>
public
bool
BatchDeleteCourseStudentRepository
(
List
<
RB_Course_Student
>
courses
)
{
string
sql
=
string
.
Format
(
"DELETE FROM RB_Course_Student WHERE courseId IN({0}) "
,
string
.
Join
(
","
,
courses
.
Select
(
qitem
=>
qitem
.
courseId
)));
string
courseId
=
string
.
Join
(
","
,
courses
.
Select
(
qitem
=>
qitem
.
courseId
));
string
uid
=
string
.
Join
(
","
,
courses
.
Select
(
qitem
=>
qitem
.
uid
));
string
sql
=
string
.
Format
(
" DELETE FROM RB_Course_Student WHERE courseId IN({0}) AND uid IN({1}) "
,
courseId
,
uid
);
return
base
.
Execute
(
sql
)
>
0
;
}
...
...
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
View file @
47041ac9
...
...
@@ -41,9 +41,13 @@ namespace TicketSpider.Spiders.ClassInRule
_loginCookies
=
string
.
Empty
;
var
cnt
=
0
;
Random
r
=
new
Random
();
while
(
cnt
<
4
)
{
cnt
++;
int
num
=
r
.
Next
(
1
,
10
);
Thread
.
Sleep
(
1000
*
num
);
var
result
=
RunAsync
();
if
(
result
&&
!
_openHeartTimer
)
{
...
...
@@ -122,14 +126,19 @@ namespace TicketSpider.Spiders.ClassInRule
{
inputEle
.
SendKeys
(
"18140082327"
);
pwdEle
.
SendKeys
(
"ls123456"
);
var
buttonEle
=
driver
.
FindElement
(
By
.
CssSelector
(
".submit-btn"
));
Thread
.
Sleep
(
1000
);
//开始登录
buttonEle
.
Click
();
//开始模拟登录
for
(
var
loginCount
=
0
;
loginCount
<=
3
;
loginCount
++)
Random
r
=
new
Random
();
for
(
var
loginCount
=
1
;
loginCount
<=
3
;
loginCount
++)
{
if
(
loginCount
>
1
)
{
int
num
=
r
.
Next
(
1
,
10
);
Thread
.
Sleep
(
1000
*
num
);
}
InfoHelper
.
WriteLine
(
$"正在进行第
{
loginCount
}
次模拟登录..."
);
VTX
.
FW
.
Helper
.
LogHelper
.
WriteInfo
(
"RunAsync"
,
$"正在进行第
{
loginCount
}
次模拟登录..."
);
var
login
=
FireFoxBeginSliderLoginHandler
(
driver
);
...
...
EduSpider/Spiders/ClassInRule/CourseManager.cs
View file @
47041ac9
...
...
@@ -174,6 +174,7 @@ namespace EduSpider.Spiders.ClassInRule
var
response
=
await
request
.
PostAsync
(
url
,
content
);
var
sutResult
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
List
<
RB_Course_Student
>
list
=
new
();
List
<
RB_Course_Student
>
deleteList
=
new
List
<
RB_Course_Student
>();
if
(!
string
.
IsNullOrWhiteSpace
(
sutResult
))
{
JObject
stuRootObj
=
JObject
.
Parse
(
sutResult
);
...
...
@@ -198,15 +199,31 @@ namespace EduSpider.Spiders.ClassInRule
courseId
=
courseId
});
}
else
{
deleteList
.
Add
(
new
RB_Course_Student
()
{
id
=
courseStuObj
.
GetInt
(
"id"
),
uid
=
courseStuObj
.
GetInt
(
"uid"
),
name
=
courseStuObj
.
GetString
(
"name"
),
account
=
courseStuObj
.
GetString
(
"account"
),
logo
=
courseStuObj
.
GetString
(
"logo"
),
courseId
=
courseId
});
}
}
}
}
}
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
courseStudentRepository
.
BatchDeleteCourseStudentRepository
(
list
);
courseStudentRepository
.
BatchSetCourseStudentRepository
(
list
);
}
if
(
deleteList
!=
null
&&
deleteList
.
Count
>
0
)
{
courseStudentRepository
.
BatchDeleteCourseStudentRepository
(
deleteList
);
}
}
/// <summary>
...
...
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