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
6eba9fa4
Commit
6eba9fa4
authored
May 25, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/eduspider
parents
c2eae54e
a7ecb561
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
363 additions
and
39 deletions
+363
-39
IHomeWorkRepository.cs
EduSpider.IRepository/IHomeWorkRepository.cs
+25
-0
RB_Course.cs
EduSpider.Model/Entity/RB_Course.cs
+15
-0
RB_Course_Teacher.cs
EduSpider.Model/Entity/RB_Course_Teacher.cs
+5
-0
RB_HomeWork.cs
EduSpider.Model/Entity/RB_HomeWork.cs
+144
-0
CourseRepository.cs
EduSpider.Repository/CourseRepository.cs
+2
-2
HomeWorkRepository.cs
EduSpider.Repository/HomeWorkRepository.cs
+25
-0
ClassInAccountManager.cs
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
+12
-20
CourseManager.cs
EduSpider/Spiders/ClassInRule/CourseManager.cs
+135
-16
StudentManager.cs
EduSpider/Spiders/ClassInRule/StudentManager.cs
+0
-1
No files found.
EduSpider.IRepository/IHomeWorkRepository.cs
0 → 100644
View file @
6eba9fa4
using
EduSpider.Model.Entity
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
namespace
EduSpider.IRepository
{
/// <summary>
/// 作业仓储层接口
/// </summary>
public
interface
IHomeWorkRepository
:
IDBRepository
<
RB_HomeWork
>,
IDependency
{
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
/// <param name="homeWorks"></param>
/// <returns></returns>
public
bool
BatchSetHomeWorkRepository
(
List
<
RB_HomeWork
>
homeWorks
);
}
}
EduSpider.Model/Entity/RB_Course.cs
View file @
6eba9fa4
...
...
@@ -110,5 +110,20 @@ namespace EduSpider.Model.Entity
/// 课程类型(1-标准课,公开课)
/// </summary>
public
CourseTypeEnum
courseType
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
addTime
{
get
;
set
;
}
/// <summary>
/// 课程图片
/// </summary>
public
string
courseWare
{
get
;
set
;
}
/// <summary>
/// 封面图
/// </summary>
public
string
coverImg
{
get
;
set
;
}
}
}
EduSpider.Model/Entity/RB_Course_Teacher.cs
View file @
6eba9fa4
...
...
@@ -39,5 +39,10 @@ namespace EduSpider.Model.Entity
/// 课程编号
/// </summary>
public
int
courseId
{
get
;
set
;
}
/// <summary>
/// 课程教师编号
/// </summary>
public
int
courseTeacherId
{
get
;
set
;
}
}
}
EduSpider.Model/Entity/RB_HomeWork.cs
0 → 100644
View file @
6eba9fa4
using
System
;
using
VTX.FW.Attr
;
namespace
EduSpider.Model.Entity
{
/// <summary>
/// 作业实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_HomeWork
{
/// <summary>
/// 作业编号
/// </summary>
public
int
homework_id
{
get
;
set
;
}
/// <summary>
/// 作业标题
/// </summary>
public
string
homework_title
{
get
;
set
;
}
/// <summary>
/// 作业分享Key
/// </summary>
public
string
homework_share_key
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
?
course_id
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
course_name
{
get
;
set
;
}
/// <summary>
/// 作业开始时间
/// </summary>
public
DateTime
?
start_time
{
get
;
set
;
}
/// <summary>
/// 作业结束时间
/// </summary>
public
DateTime
?
end_time
{
get
;
set
;
}
/// <summary>
/// 作业状态(0-未开始,1-进行中,2-已结束)
/// </summary>
public
int
?
status
{
get
;
set
;
}
/// <summary>
/// 显示状态(0-客户端显示,1-客户端隐藏)
/// </summary>
public
int
?
is_del
{
get
;
set
;
}
/// <summary>
/// 是否公开作业(1-公开作业,2-不公开,3-公开优秀)
/// </summary>
public
string
is_open
{
get
;
set
;
}
/// <summary>
/// 公开方式(1-结束后)
/// </summary>
public
string
open_type
{
get
;
set
;
}
/// <summary>
/// 是否允许补交(1-否,2-是)
/// </summary>
public
string
is_revise
{
get
;
set
;
}
/// <summary>
/// 学生数
/// </summary>
public
int
?
num
{
get
;
set
;
}
/// <summary>
/// 优秀人数
/// </summary>
public
int
?
cream_num
{
get
;
set
;
}
/// <summary>
/// revised_num
/// </summary>
public
int
?
revised_num
{
get
;
set
;
}
/// <summary>
/// 已批阅
/// </summary>
public
int
?
rnum
{
get
;
set
;
}
/// <summary>
/// 已提交
/// </summary>
public
int
?
cnum
{
get
;
set
;
}
/// <summary>
/// 学校编号
/// </summary>
public
int
?
school_uid
{
get
;
set
;
}
/// <summary>
/// 评分机制(5-自定义,4-不评分,3-等第制,2-十分制,1-百分制)
/// </summary>
public
int
?
score_type
{
get
;
set
;
}
/// <summary>
/// 自定义分数
/// </summary>
public
decimal
?
score_value
{
get
;
set
;
}
/// <summary>
/// 教师账号
/// </summary>
public
string
teacher_account
{
get
;
set
;
}
/// <summary>
/// 教师姓名
/// </summary>
public
string
teacher_name
{
get
;
set
;
}
/// <summary>
/// 教师编号
/// </summary>
public
int
?
teacher_uid
{
get
;
set
;
}
/// <summary>
/// th_cancel
/// </summary>
public
string
th_cancel
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
add_time
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
DateTime
update_time
{
get
;
set
;
}
}
}
EduSpider.Repository/CourseRepository.cs
View file @
6eba9fa4
...
...
@@ -33,7 +33,7 @@ namespace EduSpider.Repository
public
List
<
RB_Course
>
GetCourseListRepository
(
CourseQuery
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Course AS A
...
...
@@ -65,7 +65,7 @@ WHERE 1=1
public
List
<
RB_Course
>
GetCoursePageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Course AS A
...
...
EduSpider.Repository/HomeWorkRepository.cs
0 → 100644
View file @
6eba9fa4
using
EduSpider.IRepository
;
using
EduSpider.Model.Entity
;
using
EduSpider.Repository.Base
;
using
System.Collections.Generic
;
namespace
EduSpider.Repository
{
/// <summary>
/// 作业仓储层实现
/// </summary>
public
class
HomeWorkRepository
:
BaseRepository
<
RB_HomeWork
>,
IHomeWorkRepository
{
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
/// <param name="homeWorks"></param>
/// <returns></returns>
public
bool
BatchSetHomeWorkRepository
(
List
<
RB_HomeWork
>
homeWorks
)
{
bool
flag
;
flag
=
base
.
BatchInsert
(
homeWorks
,
isReplace
:
true
);
return
flag
;
}
}
}
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
View file @
6eba9fa4
using
Newtonsoft.Json.Linq
;
using
OpenCvSharp
;
using
OpenCvSharp
;
using
OpenQA.Selenium
;
using
OpenQA.Selenium.Chrome
;
using
OpenQA.Selenium.Interactions
;
using
OpenQA.Selenium.Remote
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.Linq
;
using
System.Net
;
using
System.Net.Http
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
...
...
@@ -68,8 +60,8 @@ namespace TicketSpider.Spiders.ClassInRule
public
static
bool
RunAsync
()
{
var
flag
=
false
;
IWebElement
inputEle
=
null
;
IWebElement
pwdEle
=
null
;
IWebElement
inputEle
;
IWebElement
pwdEle
;
var
option
=
new
ChromeOptions
();
option
.
AddArgument
(
"--incognito"
);
option
.
AddArgument
(
"headless"
);
...
...
@@ -240,9 +232,8 @@ namespace TicketSpider.Spiders.ClassInRule
var
res
=
new
Mat
();
Cv2
.
MatchTemplate
(
bgPic
,
tpPic
,
res
,
TemplateMatchModes
.
CCoeffNormed
);
double
minVal
=
0
,
maxVal
=
0
;
OpenCvSharp
.
Point
minLoc
=
new
OpenCvSharp
.
Point
(),
maxLoc
=
new
OpenCvSharp
.
Point
();
Cv2
.
MinMaxLoc
(
res
,
out
minVal
,
out
maxVal
,
out
minLoc
,
out
maxLoc
);
Cv2
.
MinMaxLoc
(
res
,
out
double
minVal
,
out
double
maxVal
,
out
minLoc
,
out
maxLoc
);
var
bt
=
new
OpenCvSharp
.
Point
(
maxLoc
.
X
+
tpPic
.
Width
,
maxLoc
.
Y
+
tpPic
.
Height
);
Cv2
.
Rectangle
(
bgImg
,
maxLoc
,
bt
,
Scalar
.
Red
,
2
);
...
...
@@ -256,16 +247,17 @@ namespace TicketSpider.Spiders.ClassInRule
{
while
(
_openHeartTimer
)
{
var
handler
=
new
HttpClientHandler
();
handler
.
AllowAutoRedirect
=
false
;
handler
.
UseCookies
=
true
;
handler
.
CookieContainer
=
CreateCookie
();
handler
.
AutomaticDecompression
=
DecompressionMethods
.
GZip
;
handler
.
ClientCertificateOptions
=
ClientCertificateOption
.
Automatic
;
var
handler
=
new
HttpClientHandler
{
AllowAutoRedirect
=
false
,
UseCookies
=
true
,
CookieContainer
=
CreateCookie
(),
AutomaticDecompression
=
DecompressionMethods
.
GZip
,
ClientCertificateOptions
=
ClientCertificateOption
.
Automatic
};
var
http
=
new
HttpClient
(
handler
);
http
.
GetAsync
(
"https://console.eeo.cn/saas/school/index.html#/fullPage/Index?lang=zh-CN"
);
//TODO:检查是否需要重新登录
Thread
.
Sleep
(
60
*
1000
);
}
}
...
...
EduSpider/Spiders/ClassInRule/CourseManager.cs
View file @
6eba9fa4
This diff is collapsed.
Click to expand it.
EduSpider/Spiders/ClassInRule/StudentManager.cs
View file @
6eba9fa4
...
...
@@ -2,7 +2,6 @@
using
EduSpider.Model.Entity
;
using
EduSpider.Repository
;
using
EduSpider.Utility
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
...
...
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