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
59875dfd
Commit
59875dfd
authored
Jun 01, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
2e99da22
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
4 deletions
+102
-4
IStuCommentRepository.cs
EduSpider.IRepository/IStuCommentRepository.cs
+8
-0
ICourseService.cs
EduSpider.IServices/ICourseService.cs
+1
-1
RB_Stu_Comment_Extend.cs
EduSpider.Model/Extend/RB_Stu_Comment_Extend.cs
+17
-0
StuCommentRepository.cs
EduSpider.Repository/StuCommentRepository.cs
+38
-0
CourseService.cs
EduSpider.Services/CourseService.cs
+2
-2
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+36
-1
No files found.
EduSpider.IRepository/IStuCommentRepository.cs
View file @
59875dfd
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
System.Collections.Generic
;
using
VTX.FW.Config
;
...
...
@@ -55,5 +56,12 @@ namespace EduSpider.IRepository
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetCourseCommentTimesListRepository
(
CourseQuery
query
);
/// <summary>
/// 获取评论列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment_Extend
>
GetStuCommentList
(
CourseQuery
query
);
}
}
EduSpider.IServices/ICourseService.cs
View file @
59875dfd
...
...
@@ -92,7 +92,7 @@ namespace EduSpider.IServices
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetStuCommentList
(
CourseQuery
query
);
public
List
<
RB_Stu_Comment
_Extend
>
GetStuCommentList
(
CourseQuery
query
);
/// <summary>
/// 修改学员评论状态
...
...
EduSpider.Model/Extend/RB_Stu_Comment_Extend.cs
0 → 100644
View file @
59875dfd
using
EduSpider.Model.Entity
;
using
System
;
using
VTX.FW.Attr
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 学生评价扩展
/// </summary>
public
class
RB_Stu_Comment_Extend
:
RB_Stu_Comment
{
/// <summary>
/// 学生姓名
/// </summary>
public
string
StuName
{
get
;
set
;
}
}
}
EduSpider.Repository/StuCommentRepository.cs
View file @
59875dfd
using
EduSpider.IRepository
;
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
EduSpider.Repository.Base
;
using
System
;
...
...
@@ -151,5 +152,42 @@ WHERE 1=1
return
Get
<
RB_Stu_Comment
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取评论列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment_Extend
>
GetStuCommentList
(
CourseQuery
query
)
{
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*,s.StudentName as StuName
FROM RB_Stu_Comment AS A
left join rb_student s on A.StuUid = s.StudentUid
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}=0 "
,
nameof
(
RB_Stu_Comment
.
Status
));
if
(
query
!=
null
)
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Stu_Comment
.
CourseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StuIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_Comment
.
StuUid
),
query
.
StuIds
);
}
if
(
query
.
HomeWorkId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Stu_Comment
.
HomeWorkId
),
query
.
HomeWorkId
);
}
if
(
query
.
CommentTimes
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_Comment
.
Times
),
query
.
CommentTimes
);
}
}
return
Get
<
RB_Stu_Comment_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
EduSpider.Services/CourseService.cs
View file @
59875dfd
...
...
@@ -351,9 +351,9 @@ namespace EduSpider.Services
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetStuCommentList
(
CourseQuery
query
)
public
List
<
RB_Stu_Comment
_Extend
>
GetStuCommentList
(
CourseQuery
query
)
{
var
list
=
StuCommentRepository
.
GetStuCommentList
Repository
(
query
);
var
list
=
StuCommentRepository
.
GetStuCommentList
(
query
);
return
list
;
}
...
...
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
59875dfd
...
...
@@ -371,8 +371,43 @@ namespace EduSpider.WebApi.Controllers
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
CommentTimes
=
base
.
ReqParameters
.
GetInt
(
"CommentTimes"
)
};
List
<
object
>
result
=
new
();
var
list
=
CourseService
.
GetStuCommentList
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
if
(
list
.
Any
())
{
foreach
(
var
item
in
list
)
{
string
ShowTypeStr
=
""
;
if
(
item
.
ShowType
==
1
)
{
ShowTypeStr
=
"全部可见"
;
}
else
if
(
item
.
ShowType
==
2
)
{
ShowTypeStr
=
"部分可见"
;
}
else
if
(
item
.
ShowType
==
3
)
{
ShowTypeStr
=
"不可见"
;
}
result
.
Add
(
new
{
item
.
Id
,
item
.
HomeWorkId
,
item
.
StuUid
,
item
.
StuName
,
item
.
CourseId
,
item
.
Times
,
item
.
Info
,
item
.
CreateType
,
CreateTypeStr
=
item
.
CreateType
==
1
?
"系统创建"
:
"老师创建"
,
item
.
ShowType
,
ShowTypeStr
,
CreateTime
=
VTX
.
FW
.
Helper
.
ConvertHelper
.
FormatDate
(
item
.
CreateTime
)
});
}
}
return
ApiResult
.
Success
(
data
:
result
);
}
...
...
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