Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
online-edu
online-edu-backend
Commits
891b645d
Commit
891b645d
authored
Jun 24, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug
parent
14ae81d6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
13 deletions
+8
-13
CourseConsumeRecordService.java
...ta/biz/management/service/CourseConsumeRecordService.java
+5
-10
UserCenterController.java
...a/com/qkdata/biz/web/controller/UserCenterController.java
+2
-3
course_consume_recordMapper.xml
...ources/mappers/management/course_consume_recordMapper.xml
+1
-0
No files found.
src/main/java/com/qkdata/biz/management/service/CourseConsumeRecordService.java
View file @
891b645d
...
@@ -52,18 +52,13 @@ public class CourseConsumeRecordService extends ServiceImpl<CourseConsumeRecordM
...
@@ -52,18 +52,13 @@ public class CourseConsumeRecordService extends ServiceImpl<CourseConsumeRecordM
/**
/**
* 批量删除观看记录
* 批量删除观看记录
* @param ids
* @param userId
* @param courseIds
*/
*/
public
void
removeBatch
(
List
<
Long
>
ids
)
{
public
void
removeByCourseIds
(
Long
userId
,
List
<
Long
>
courseIds
)
{
for
(
Long
id
:
ids
){
CourseConsumeRecordPO
po
=
getById
(
id
);
if
(
po
!=
null
){
remove
(
Wrappers
.<
CourseConsumeRecordPO
>
lambdaQuery
()
remove
(
Wrappers
.<
CourseConsumeRecordPO
>
lambdaQuery
()
.
eq
(
CourseConsumeRecordPO:
:
getUserId
,
po
.
getUserId
())
.
eq
(
CourseConsumeRecordPO:
:
getUserId
,
userId
)
.
eq
(
CourseConsumeRecordPO:
:
getCourseId
,
po
.
getCourseId
())
.
in
(
CourseConsumeRecordPO:
:
getCourseId
,
courseIds
));
.
eq
(
CourseConsumeRecordPO:
:
getChapterId
,
po
.
getChapterId
()));
}
}
}
}
/**
/**
...
...
src/main/java/com/qkdata/biz/web/controller/UserCenterController.java
View file @
891b645d
...
@@ -16,7 +16,6 @@ import com.qkdata.common.base.exception.BusinessException;
...
@@ -16,7 +16,6 @@ import com.qkdata.common.base.exception.BusinessException;
import
com.qkdata.common.base.model.PageResult
;
import
com.qkdata.common.base.model.PageResult
;
import
com.qkdata.common.base.model.Result
;
import
com.qkdata.common.base.model.Result
;
import
com.qkdata.common.util.UserContext
;
import
com.qkdata.common.util.UserContext
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.Logical
;
...
@@ -136,8 +135,8 @@ public class UserCenterController {
...
@@ -136,8 +135,8 @@ public class UserCenterController {
@PostMapping
(
"/consumeRecord/delete"
)
@PostMapping
(
"/consumeRecord/delete"
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_USER
,
BizConstants
.
ROLE_ENTERPRISE_ADMIN
},
logical
=
Logical
.
OR
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_USER
,
BizConstants
.
ROLE_ENTERPRISE_ADMIN
},
logical
=
Logical
.
OR
)
@SysLog
(
"删除观看记录列表"
)
@SysLog
(
"删除观看记录列表"
)
public
Result
<
String
>
consumeRecordList
(
@RequestBody
List
<
Long
>
i
ds
){
public
Result
<
String
>
consumeRecordList
(
@RequestBody
List
<
Long
>
courseI
ds
){
courseConsumeRecordService
.
removeB
atch
(
i
ds
);
courseConsumeRecordService
.
removeB
yCourseIds
(
UserContext
.
getUserId
(),
courseI
ds
);
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
}
}
@ApiOperation
(
"用户观看某课程的记录"
)
@ApiOperation
(
"用户观看某课程的记录"
)
...
...
src/main/resources/mappers/management/course_consume_recordMapper.xml
View file @
891b645d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qkdata.biz.management.mapper.CourseConsumeRecordMapper"
>
<mapper
namespace=
"com.qkdata.biz.management.mapper.CourseConsumeRecordMapper"
>
<select
id=
"queryUserCourseRecordLast"
resultType=
"com.qkdata.biz.web.vo.CourseConsumeRecordModel"
>
<select
id=
"queryUserCourseRecordLast"
resultType=
"com.qkdata.biz.web.vo.CourseConsumeRecordModel"
>
SELECT r.id,
SELECT r.id,
r.user_id,
r.user_id,
...
...
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