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
15da3cc3
Commit
15da3cc3
authored
Jun 01, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/eduspider
parents
7e0ec86f
f5a4f448
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
10 deletions
+108
-10
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
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+6
-6
No files found.
EduSpider.IRepository/IStuCommentRepository.cs
View file @
15da3cc3
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 @
15da3cc3
...
...
@@ -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 @
15da3cc3
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 @
15da3cc3
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 @
15da3cc3
...
...
@@ -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 @
15da3cc3
...
...
@@ -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
);
}
...
...
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
15da3cc3
...
...
@@ -78,7 +78,7 @@ namespace EduSpider.WebApi.Controllers
}
#
region
获取进阶思维小程序端
token
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
Id
};
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
Unique
Id
};
string
token
=
JwtHelper
.
CreateToken
(
UserInfo
,
Config
.
JwtSecretKey
,
Config
.
JwtExpirTime
);
#
endregion
...
...
@@ -94,7 +94,7 @@ namespace EduSpider.WebApi.Controllers
UserMobile
=
model
.
Account
,
UserIcon
=
model
.
UserIcon
,
};
Cache
.
User
.
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Config
.
JwtExpirTime
);
Cache
.
User
.
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Unique
Id
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
data
:
obj
);
}
}
...
...
@@ -152,7 +152,7 @@ namespace EduSpider.WebApi.Controllers
}
#
region
获取进阶思维小程序端
token
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
Id
};
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
Unique
Id
};
string
token
=
JwtHelper
.
CreateToken
(
UserInfo
,
Config
.
JwtSecretKey
,
Config
.
JwtExpirTime
);
#
endregion
...
...
@@ -168,7 +168,7 @@ namespace EduSpider.WebApi.Controllers
UserMobile
=
model
.
Account
,
UserIcon
=
model
.
UserIcon
,
};
Cache
.
User
.
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Config
.
JwtExpirTime
);
Cache
.
User
.
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Unique
Id
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
data
:
obj
);
}
}
...
...
@@ -332,7 +332,7 @@ namespace EduSpider.WebApi.Controllers
}
#
region
获取进阶思维小程序端
token
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
Id
};
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
Unique
Id
};
string
token
=
JwtHelper
.
CreateToken
(
UserInfo
,
Config
.
JwtSecretKey
,
Config
.
JwtExpirTime
);
#
endregion
...
...
@@ -348,7 +348,7 @@ namespace EduSpider.WebApi.Controllers
UserMobile
=
model
.
Account
,
UserIcon
=
model
.
UserIcon
,
};
Cache
.
User
.
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Config
.
JwtExpirTime
);
Cache
.
User
.
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Unique
Id
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
data
:
obj
);
}
}
...
...
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