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
fd4f06d2
Commit
fd4f06d2
authored
Jun 17, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
fa09a4b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
CourseTeacherRepository.cs
EduSpider.Repository/CourseTeacherRepository.cs
+2
-2
CourseManager.cs
EduSpider/Spiders/ClassInRule/CourseManager.cs
+21
-1
No files found.
EduSpider.Repository/CourseTeacherRepository.cs
View file @
fd4f06d2
...
...
@@ -44,11 +44,11 @@ WHERE 1=1
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_
Student
.
courseId
),
query
.
CourseId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_
Teacher_Extend
.
courseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
TeacherIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_
Student
.
uid
),
query
.
TeacherIds
);
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_
Teacher_Extend
.
uid
),
query
.
TeacherIds
);
}
if
(
query
.
QCourseState
>
0
)
{
...
...
EduSpider/Spiders/ClassInRule/CourseManager.cs
View file @
fd4f06d2
...
...
@@ -265,13 +265,14 @@ namespace EduSpider.Spiders.ClassInRule
string
paramStr
=
string
.
Format
(
queryStr
,
courseId
);
var
content
=
new
StringContent
(
paramStr
,
System
.
Text
.
Encoding
.
UTF8
,
"application/x-www-form-urlencoded"
);
ICourseRepository
courseRepository
=
new
CourseRepository
();
ICourseTeacherRepository
courseTeacherRepository
=
new
CourseTeacherRepository
();
Console
.
WriteLine
(
string
.
Format
(
"开始获取{0}课程详情数据"
,
courseId
));
string
url
=
"https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseInfo"
;
var
response
=
await
request
.
PostAsync
(
url
,
content
);
var
courseInfoResult
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
List
<
rb_course_hk
>
list
=
new
();
List
<
RB_Course_Teacher
>
teacherList
=
new
();
if
(!
string
.
IsNullOrWhiteSpace
(
courseInfoResult
))
{
JObject
courseRootObj
=
JObject
.
Parse
(
courseInfoResult
);
...
...
@@ -316,12 +317,31 @@ namespace EduSpider.Spiders.ClassInRule
}
courseModel
.
CoverImg
=
coverImg
;
list
.
Add
(
courseModel
);
var
cTeacherModel
=
courseTeacherRepository
.
GetTeacherCourseListRepository
(
new
Model
.
Query
.
CourseQuery
()
{
CourseId
=
courseModel
.
CourseId
,
TeacherIds
=
courseModel
.
TeacherUid
.
ToString
()
}).
FirstOrDefault
();
teacherList
.
Add
(
new
RB_Course_Teacher
()
{
id
=
cTeacherModel
?.
id
??
0
,
uid
=
Convert
.
ToInt32
(
courseModel
.
TeacherUid
),
phone
=
courseModel
.
TeacherAccount
,
logo
=
courseModel
.
TeacherLogo
,
name
=
courseModel
.
TeacherName
,
courseId
=
courseId
,
courseTeacherId
=
courseModel
.
TeacherId
});
}
}
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
courseRepository
.
BatchSetCourseOtherRepository
(
list
);
}
if
(
teacherList
!=
null
&&
teacherList
.
Count
>
0
)
{
courseTeacherRepository
.
BatchSetCourseTeacherRepository
(
teacherList
);
}
}
}
}
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