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
258160c3
Commit
258160c3
authored
May 31, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d8eab572
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
33 additions
and
15 deletions
+33
-15
UserInfo.cs
EduSpider.Model/CacheModel/UserInfo.cs
+7
-2
RB_Account.cs
EduSpider.Model/Entity/RB_Account.cs
+6
-1
AccountRepository.cs
EduSpider.Repository/AccountRepository.cs
+2
-2
ExamService.cs
EduSpider.Services/ExamService.cs
+1
-1
StuController.cs
EduSpider.WebApi/Controllers/Student/StuController.cs
+2
-1
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+2
-1
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+3
-0
ClassInFlow.cs
EduSpider/Spiders/ClassInRule/ClassInFlow.cs
+7
-6
StudentManager.cs
EduSpider/Spiders/ClassInRule/StudentManager.cs
+2
-1
TeacherManager.cs
EduSpider/Spiders/ClassInRule/TeacherManager.cs
+1
-0
No files found.
EduSpider.Model/CacheModel/UserInfo.cs
View file @
258160c3
...
...
@@ -9,7 +9,12 @@ namespace EduSpider.Model.Cache
public
class
UserInfo
{
/// <summary>
/// 账号编号
/// 唯一Key
/// </summary>
public
int
UniqueId
{
get
;
set
;
}
/// <summary>
/// 对应 teacherId / stuId
/// </summary>
public
int
Id
{
get
;
set
;
}
...
...
@@ -29,7 +34,7 @@ namespace EduSpider.Model.Cache
public
AccountTypeEnum
AccountType
{
get
;
set
;
}
/// <summary>
/// 对应
的账户i
d
/// 对应
老师/学生 UI
d
/// </summary>
public
int
AccountId
{
get
;
set
;
}
...
...
EduSpider.Model/Entity/RB_Account.cs
View file @
258160c3
...
...
@@ -13,7 +13,12 @@ namespace EduSpider.Model.Entity
public
class
RB_Account
{
/// <summary>
/// 对应id
/// 唯一key
/// </summary>
public
int
UniqueId
{
get
;
set
;
}
/// <summary>
/// 对应 teacherId / stuId
/// </summary>
public
int
Id
{
get
;
set
;
}
...
...
EduSpider.Repository/AccountRepository.cs
View file @
258160c3
...
...
@@ -59,10 +59,10 @@ namespace EduSpider.Repository
string
sql
=
$@"
select * from(
SELECT a.Id,a.Account,a.`Password`,a.AccountType,a.AccountId,t.TeacherName AS AccountName,t.Logo as UserIcon,a.Status FROM rb_account a
SELECT a.
UniqueId,a.
Id,a.Account,a.`Password`,a.AccountType,a.AccountId,t.TeacherName AS AccountName,t.Logo as UserIcon,a.Status FROM rb_account a
INNER JOIN rb_teacher t on a.Id =t.TeacherId and a.AccountType =1
UNION
SELECT a.Id,a.Account,a.`Password`,a.AccountType,a.AccountId,s.StudentName AS AccountName,'' as UserIcon,a.Status FROM rb_account a
SELECT a.
UniqueId,a.
Id,a.Account,a.`Password`,a.AccountType,a.AccountId,s.StudentName AS AccountName,'' as UserIcon,a.Status FROM rb_account a
INNER JOIN rb_student s on a.Id =s.StudId and a.AccountType =2
) t where
{
where
}
"
;
...
...
EduSpider.Services/ExamService.cs
View file @
258160c3
...
...
@@ -176,7 +176,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
string
ImportExcelForStuExamScore
(
string
path_server
,
int
courseId
,
string
examName
,
int
userId
)
{
var
umodel
=
AccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
var
umodel
=
AccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account_Extend
()
{
Id
=
userId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
}).
FirstOrDefault
();
if
(
umodel
==
null
||
umodel
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
||
umodel
.
AccountType
!=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
return
"没有权限操作"
;
}
var
EQlist
=
StuExamScoreHelper
.
GetStuExamScoreData
(
path_server
,
out
List
<
StuScoreModel
>
StuList
);
if
(
EQlist
.
Any
())
...
...
EduSpider.WebApi/Controllers/Student/StuController.cs
View file @
258160c3
...
...
@@ -29,9 +29,10 @@ namespace EduSpider.WebApi.Controllers
[
HttpGet
]
public
ApiResult
GetStuCourse
()
{
var
userInfo
=
base
.
UserInfo
;
var
query
=
new
Model
.
Query
.
CourseQuery
()
{
StuIds
=
base
.
BaseUser
Id
.
ToString
()
StuIds
=
userInfo
.
Id
.
ToString
()
};
List
<
object
>
result
=
new
();
var
list
=
CourseService
.
GetStuCourseList
(
query
);
...
...
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
258160c3
...
...
@@ -368,7 +368,8 @@ namespace EduSpider.WebApi.Controllers
{
var
query
=
new
CourseQuery
()
{
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
)
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
CommentTimes
=
base
.
ReqParameters
.
GetInt
(
"CommentTimes"
)
};
var
list
=
CourseService
.
GetStuCommentList
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
...
...
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
258160c3
...
...
@@ -84,6 +84,7 @@ namespace EduSpider.WebApi.Controllers
Model
.
Cache
.
UserInfo
obj
=
new
()
{
UniqueId
=
model
.
UniqueId
,
Id
=
model
.
Id
,
AccountType
=
model
.
AccountType
,
AccountName
=
model
.
AccountName
,
...
...
@@ -157,6 +158,7 @@ namespace EduSpider.WebApi.Controllers
Model
.
Cache
.
UserInfo
obj
=
new
()
{
UniqueId
=
model
.
UniqueId
,
Id
=
model
.
Id
,
AccountType
=
model
.
AccountType
,
AccountName
=
model
.
AccountName
,
...
...
@@ -336,6 +338,7 @@ namespace EduSpider.WebApi.Controllers
Model
.
Cache
.
UserInfo
obj
=
new
()
{
UniqueId
=
model
.
UniqueId
,
Id
=
model
.
Id
,
AccountType
=
model
.
AccountType
,
AccountName
=
model
.
AccountName
,
...
...
EduSpider/Spiders/ClassInRule/ClassInFlow.cs
View file @
258160c3
...
...
@@ -15,18 +15,19 @@ namespace TicketSpider.Spiders.ClassInRule
public
class
ClassInFlow
{
public
async
void
StartAsync
()
public
void
StartAsync
()
{
Console
.
WriteLine
(
"开始模拟登录信息......."
);
string
loginCookies
=
""
;
//
loginCookies= ClassInAccountManager.GetInstance();
loginCookies
=
"_eeos_uid=12780052; _eeos_useraccount=18140082327; _eeos_userlogo=%2Fupload%2Fimages%2F20200126%2F709df9532bee722f2268_70.jpg; _eeos_domain=.eeo.cn; _eeos_remember=1; _eeos_sid=12780052; _eeos_nsid=kspGu2gfMu%2BU2EFgLpSGyg%3D%3D; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2212780052%22%2C%22first_id%22%3A%22180f59907abbed-081e4952c5b26f-12333272-2073600-180f59907acbc8%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22%24device_id%22%3A%22180f59907abbed-081e4952c5b26f-12333272-2073600-180f59907acbc8%22%7D; _eeos_traffic=EqlIOFq4S2hz5FTTtHzNUViBYcWCixrJYMCF6Y5yJuD8eq8ZwPvVSHMvUkLFA5lzNoaTrDBpGhFOuRmo3R6CQ5GeSsJx1IEakyt2K%2B3ifco%3D; PHPSESSID=3etqs18ka2s425omq6uqsus8s2; __tk_id=7a20b97a04709afc3137ec211e756d5f"
;
loginCookies
=
ClassInAccountManager
.
GetInstance
();
//
loginCookies = "_eeos_uid=12780052; _eeos_useraccount=18140082327; _eeos_userlogo=%2Fupload%2Fimages%2F20200126%2F709df9532bee722f2268_70.jpg; _eeos_domain=.eeo.cn; _eeos_remember=1; _eeos_sid=12780052; _eeos_nsid=kspGu2gfMu%2BU2EFgLpSGyg%3D%3D; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2212780052%22%2C%22first_id%22%3A%22180f59907abbed-081e4952c5b26f-12333272-2073600-180f59907acbc8%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22%24device_id%22%3A%22180f59907abbed-081e4952c5b26f-12333272-2073600-180f59907acbc8%22%7D; _eeos_traffic=EqlIOFq4S2hz5FTTtHzNUViBYcWCixrJYMCF6Y5yJuD8eq8ZwPvVSHMvUkLFA5lzNoaTrDBpGhFOuRmo3R6CQ5GeSsJx1IEakyt2K%2B3ifco%3D; PHPSESSID=3etqs18ka2s425omq6uqsus8s2; __tk_id=7a20b97a04709afc3137ec211e756d5f";
Console
.
WriteLine
(
"开始获取学员信息"
);
Console
.
WriteLine
(
"cookies:"
+
loginCookies
);
Console
.
WriteLine
(
"开始获取老师信息"
);
new
TeacherManager
().
RunTeacher
(
loginCookies
);
Console
.
WriteLine
(
"老师信息更新结束"
);
//new StudentManager().RunAsync(loginCookies);
//new CourseManager().RunCourse(loginCookies);
//new TeacherManager().RunTeacher(loginCookies);
//new HomeWorkManager().RunHomeWork(loginCookies);
}
}
...
...
EduSpider/Spiders/ClassInRule/StudentManager.cs
View file @
258160c3
...
...
@@ -84,6 +84,7 @@ namespace EduSpider.Spiders.ClassInRule
{
accountList
.
Add
(
new
RB_Account
()
{
UniqueId
=
0
,
Id
=
item
.
StudId
,
Account
=
item
.
StudentAccount
,
AccountId
=
item
.
StudentUid
,
...
...
EduSpider/Spiders/ClassInRule/TeacherManager.cs
View file @
258160c3
...
...
@@ -83,6 +83,7 @@ namespace EduSpider.Spiders.ClassInRule
{
accountList
.
Add
(
new
RB_Account
()
{
UniqueId
=
0
,
Id
=
item
.
TeacherId
,
Account
=
item
.
TeacherAccount
,
AccountId
=
item
.
TeacherUid
,
...
...
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