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
8cd52c83
Commit
8cd52c83
authored
Jun 08, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增关键词匹配规则
parent
37235d67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
CourseQuery.cs
EduSpider.Model/Query/CourseQuery.cs
+6
-1
CommentRepository.cs
EduSpider.Repository/CommentRepository.cs
+14
-1
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+7
-2
FolderProfile.pubxml
...er.WebApi/Properties/PublishProfiles/FolderProfile.pubxml
+20
-0
No files found.
EduSpider.Model/Query/CourseQuery.cs
View file @
8cd52c83
...
@@ -39,7 +39,12 @@
...
@@ -39,7 +39,12 @@
/// 关键词
/// 关键词
/// </summary>
/// </summary>
public
string
KeyWords
{
get
;
set
;}
public
string
KeyWords
{
get
;
set
;}
/// <summary>
/// 是否强制匹配关键词
/// </summary>
public
int
IsMatchKeyWords
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 作业编号
/// 作业编号
/// </summary>
/// </summary>
...
...
EduSpider.Repository/CommentRepository.cs
View file @
8cd52c83
...
@@ -66,7 +66,20 @@ WHERE 1=1
...
@@ -66,7 +66,20 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Comment_Extend
.
Id
),
query
.
DefaultCommentId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Comment_Extend
.
Id
),
query
.
DefaultCommentId
);
}
}
var
list
=
base
.
Get
<
RB_Comment_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
var
list
=
new
List
<
RB_Comment_Extend
>();
//强制匹配关键词
if
(
query
.
IsMatchKeyWords
==
1
)
{
if
(
parameters
!=
null
&&
parameters
.
ParameterNames
.
Count
()>
0
)
{
list
=
base
.
Get
<
RB_Comment_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
else
{
list
=
base
.
Get
<
RB_Comment_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
Id
));
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
Id
));
...
...
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
8cd52c83
...
@@ -166,7 +166,12 @@ namespace EduSpider.WebApi.Controllers
...
@@ -166,7 +166,12 @@ namespace EduSpider.WebApi.Controllers
}
}
else
else
{
{
var
sysModel
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
}).
FirstOrDefault
();
var
sysModel
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
,
IsMatchKeyWords
=
1
}).
FirstOrDefault
();
if
(
sysModel
!=
null
)
if
(
sysModel
!=
null
)
{
{
result
=
new
result
=
new
...
@@ -207,7 +212,7 @@ namespace EduSpider.WebApi.Controllers
...
@@ -207,7 +212,7 @@ namespace EduSpider.WebApi.Controllers
CourseName
=
base
.
ReqParameters
.
GetString
(
"CourseName"
),
CourseName
=
base
.
ReqParameters
.
GetString
(
"CourseName"
),
};
};
var
courseRuleList
=
CourseService
.
GetCourseCommentList
(
query
).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
var
courseRuleList
=
CourseService
.
GetCourseCommentList
(
query
).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
var
sysCommentList
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
}).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
var
sysCommentList
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
,
IsMatchKeyWords
=
1
}).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
List
<
object
>
result
=
new
();
List
<
object
>
result
=
new
();
for
(
var
i
=
1
;
i
<=
3
;
i
++)
for
(
var
i
=
1
;
i
<=
3
;
i
++)
...
...
EduSpider.WebApi/Properties/PublishProfiles/FolderProfile.pubxml
0 → 100644
View file @
8cd52c83
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<DeleteExistingFiles>
False
</DeleteExistingFiles>
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<LaunchSiteAfterPublish>
True
</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedPlatform>
Any CPU
</LastUsedPlatform>
<PublishProvider>
FileSystem
</PublishProvider>
<PublishUrl>
G:\Publish\jinjie_publish
</PublishUrl>
<WebPublishMethod>
FileSystem
</WebPublishMethod>
<SiteUrlToLaunchAfterPublish
/>
<TargetFramework>
net5.0
</TargetFramework>
<ProjectGuid>
f0a5853b-7aa9-43bf-8e81-98b65f44a269
</ProjectGuid>
<SelfContained>
false
</SelfContained>
</PropertyGroup>
</Project>
\ No newline at end of file
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