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
900aff4d
Commit
900aff4d
authored
Jun 01, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/eduspider
parents
52e0f11c
42fffb76
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
226 additions
and
117 deletions
+226
-117
IStuHomeWorkRepository.cs
EduSpider.IRepository/IStuHomeWorkRepository.cs
+9
-4
ICourseService.cs
EduSpider.IServices/ICourseService.cs
+7
-0
ExamWorkResult.cs
EduSpider.Model/Extend/ExamWorkResult.cs
+1
-1
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+178
-106
CourseService.cs
EduSpider.Services/CourseService.cs
+10
-0
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+13
-0
ClassInFlow.cs
EduSpider/Spiders/ClassInRule/ClassInFlow.cs
+3
-3
HomeWorkManager.cs
EduSpider/Spiders/ClassInRule/HomeWorkManager.cs
+5
-3
No files found.
EduSpider.IRepository/IStuHomeWorkRepository.cs
View file @
900aff4d
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
System.Collections.Generic
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
using
System.Text
;
using
System.Linq
;
using
EduSpider.Model.Query
;
using
EduSpider.Model.Extend
;
namespace
EduSpider.IRepository
{
...
...
@@ -21,6 +19,13 @@ namespace EduSpider.IRepository
/// <returns></returns>
public
bool
BatchSetStuHomeWorkRepository
(
List
<
RB_Stu_HomeWork
>
homeWorks
);
/// <summary>
/// 创建课程作业评论
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <returns></returns>
public
List
<
ExamWorkResult
>
CreateHomeWorkCommentRepository
(
int
CourseId
);
/// <summary>
/// 获取学生作业列表
/// </summary>
...
...
EduSpider.IServices/ICourseService.cs
View file @
900aff4d
...
...
@@ -130,5 +130,12 @@ namespace EduSpider.IServices
/// </summary>
/// <returns></returns>
public
List
<
RB_Comment
>
GetSysComment
();
/// <summary>
/// 创建课程作业评论
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <returns></returns>
public
void
CreateHomeWorkComment
(
int
CourseId
);
}
}
EduSpider.Model/Extend/ExamWorkResult.cs
View file @
900aff4d
...
...
@@ -115,7 +115,7 @@ namespace EduSpider.Model.Extend
string
str
=
""
;
switch
(
this
.
HomeWorkStatus
)
{
case
0
:
str
=
"未
交作业
"
;
break
;
case
0
:
str
=
"未
提交
"
;
break
;
case
1
:
str
=
"未批阅"
;
break
;
case
2
:
str
=
"已批阅"
;
break
;
}
...
...
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
900aff4d
This diff is collapsed.
Click to expand it.
EduSpider.Services/CourseService.cs
View file @
900aff4d
...
...
@@ -436,6 +436,16 @@ namespace EduSpider.Services
var
list
=
CommentRepository
.
GetCommentListRepository
();
return
list
;
}
/// <summary>
/// 创建课程作业评论
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <returns></returns>
public
void
CreateHomeWorkComment
(
int
CourseId
)
{
StuHomeWorkRepository
.
CreateHomeWorkCommentRepository
(
CourseId
);
}
}
}
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
900aff4d
...
...
@@ -427,5 +427,18 @@ namespace EduSpider.WebApi.Controllers
var
list
=
CourseService
.
RemoveStuComment
(
Ids
);
return
ApiResult
.
Success
(
data
:
list
);
}
[
HttpPost
]
[
HttpGet
]
/// <summary>
/// 生成课程评论
/// </summary>
/// <returns></returns>
public
ApiResult
CreateCourseComment
()
{
int
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
);
CourseService
.
CreateHomeWorkComment
(
CourseId
);
return
ApiResult
.
Success
();
}
}
}
EduSpider/Spiders/ClassInRule/ClassInFlow.cs
View file @
900aff4d
...
...
@@ -26,9 +26,9 @@ namespace TicketSpider.Spiders.ClassInRule
Console
.
WriteLine
(
"开始获取老师信息"
);
new
TeacherManager
().
RunTeacher
(
loginCookies
);
Console
.
WriteLine
(
"老师信息更新结束"
);
//
new StudentManager().RunAsync(loginCookies);
//new CourseManager()
.RunCourse(loginCookies);
//new HomeWorkManager()
.RunHomeWork(loginCookies);
new
StudentManager
().
RunAsync
(
loginCookies
);
CourseManager
.
RunCourse
(
loginCookies
);
HomeWorkManager
.
RunHomeWork
(
loginCookies
);
}
}
}
EduSpider/Spiders/ClassInRule/HomeWorkManager.cs
View file @
900aff4d
...
...
@@ -30,6 +30,7 @@ namespace EduSpider.Spiders.ClassInRule
string
paramStr
=
string
.
Format
(
queryStr
,
pageCount
,
perpage
);
var
content
=
new
StringContent
(
paramStr
,
System
.
Text
.
Encoding
.
UTF8
,
"application/x-www-form-urlencoded"
);
IHomeWorkRepository
homeWorkRepository
=
new
HomeWorkRepository
();
IStuHomeWorkRepository
stuHomeWorkRepository
=
new
StuHomeWorkRepository
();
int
totalCount
=
0
;
Console
.
WriteLine
(
string
.
Format
(
"开始第{0}次获取家庭作业"
,
pageCount
));
...
...
@@ -90,6 +91,10 @@ namespace EduSpider.Spiders.ClassInRule
{
RunStuHomeWork
(
cookie
,
sItem
.
Homework_id
,
sItem
.
Course_id
);
}
if
(
i
==
totalCount
)
{
stuHomeWorkRepository
.
CreateHomeWorkCommentRepository
(
0
);
}
}
}
}
...
...
@@ -97,7 +102,6 @@ namespace EduSpider.Spiders.ClassInRule
}
}
}
}
/// <summary>
...
...
@@ -255,7 +259,5 @@ namespace EduSpider.Spiders.ClassInRule
stuHomeWorkRepository
.
BatchSetStuHomeWorkRepository
(
list
);
}
}
}
}
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