Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
3970e648
Commit
3970e648
authored
Jul 13, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
52da1db0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
0 deletions
+179
-0
RB_Class_Time_UnKnowUser.cs
Edu.Model/Entity/Course/RB_Class_Time_UnKnowUser.cs
+45
-0
RB_Class_Time_UnKnowUser_ViewModel.cs
...el/ViewModel/Course/RB_Class_Time_UnKnowUser_ViewModel.cs
+20
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+46
-0
RB_Class_Time_UnKnowRepository.cs
Edu.Repository/Course/RB_Class_Time_UnKnowRepository.cs
+25
-0
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+43
-0
No files found.
Edu.Model/Entity/Course/RB_Class_Time_UnKnowUser.cs
0 → 100644
View file @
3970e648
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 未知的用户信息
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Class_Time_UnKnowUser
{
/// <summary>
/// 编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 上课计划ID
/// </summary>
public
int
ClassTimeId
{
get
;
set
;
}
/// <summary>
/// 用户头像
/// </summary>
public
string
UserAvatar
{
get
;
set
;
}
/// <summary>
/// 发生的FaceID
/// </summary>
public
int
FaceId
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateDate
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Class_Time_UnKnowUser_ViewModel.cs
0 → 100644
View file @
3970e648
using
Edu.Model.Entity.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Course
{
public
class
RB_Class_Time_UnKnowUser_ViewModel
:
RB_Class_Time_UnKnowUser
{
/// <summary>
/// 创建时间字符串
/// </summary>
public
string
CreateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
CreateDate
);
}
}
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
}
}
Edu.Module.Course/CourseModule.cs
View file @
3970e648
...
...
@@ -105,6 +105,11 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_Class_ConfigRepository
class_ConfigRepository
=
new
RB_Class_ConfigRepository
();
/// <summary>
/// 非法用户信息
/// </summary>
private
readonly
RB_Class_Time_UnKnowRepository
unKnowRepository
=
new
RB_Class_Time_UnKnowRepository
();
#
region
课程管理
public
List
<
RB_Course_ViewModel
>
GetAllCourseChapterCountModule
(
int
groupId
,
int
courseId
)
...
...
@@ -1493,5 +1498,46 @@ namespace Edu.Module.Course
}
#
endregion
#
region
非法访问用户
/// <summary>
/// 保存非法访问用信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetUnKnownUserModule
(
RB_Class_Time_UnKnowUser_ViewModel
model
)
{
bool
flag
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Time_UnKnowUser_ViewModel
.
ClassTimeId
)
,
model
.
ClassTimeId
},
{
nameof
(
RB_Class_Time_UnKnowUser_ViewModel
.
UserAvatar
)
,
model
.
UserAvatar
}
};
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Class_Time_UnKnowUser_ViewModel
.
Id
),
model
.
Id
));
}
else
{
var
newId
=
unKnowRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 查询指定课程的非法访问用户数据
/// </summary>
/// <returns></returns>
public
List
<
RB_Class_Time_UnKnowUser_ViewModel
>
GetUnKnowUserByClassTimeModule
(
int
classId
)
{
var
list
=
unKnowRepository
.
GetUnKnowUsersByClassIdRepository
(
classId
);
return
list
;
}
#
endregion
}
}
\ No newline at end of file
Edu.Repository/Course/RB_Class_Time_UnKnowRepository.cs
0 → 100644
View file @
3970e648
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Edu.Repository.Course
{
public
class
RB_Class_Time_UnKnowRepository
:
BaseRepository
<
RB_Class_Time_UnKnowUser
>
{
/// <summary>
/// 跟进课时编号查询非法用户
/// </summary>
/// <param name="classId"></param>
/// <returns></returns>
public
List
<
RB_Class_Time_UnKnowUser_ViewModel
>
GetUnKnowUsersByClassIdRepository
(
int
classId
)
{
StringBuilder
sql
=
new
StringBuilder
();
sql
.
Append
(
"select * from RB_Class_Time_UnKnowUser where "
);
sql
.
AppendFormat
(
"{0}={1}"
,
nameof
(
RB_Class_Time_UnKnowUser_ViewModel
.
ClassTimeId
),
classId
);
return
Get
<
RB_Class_Time_UnKnowUser_ViewModel
>(
sql
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
3970e648
...
...
@@ -1131,5 +1131,48 @@ namespace Edu.WebApi.Controllers.Course
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
#
region
非法用户管理
/// <summary>
/// 保存非法用户信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetUnKnowUser
()
{
RB_Class_Time_UnKnowUser_ViewModel
model
=
JsonHelper
.
DeserializeObject
<
RB_Class_Time_UnKnowUser_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
model
.
CreateDate
=
DateTime
.
Now
;
var
flag
=
courseModule
.
SetUnKnownUserModule
(
model
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 跟进课程编号查询非法用户
/// </summary>
/// <returns></returns>
public
ApiResult
GetUnKnowUserByClassId
()
{
int
classId
=
ParmJObj
.
GetInt
(
"classId"
,
0
);
var
list
=
courseModule
.
GetUnKnowUserByClassTimeModule
(
classId
);
var
result
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
UserAvatar
,
x
.
CreateTimeStr
,
x
.
FaceId
});
return
ApiResult
.
Success
(
data
:
result
);
}
#
endregion
}
}
\ 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