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
4f17f4f5
Commit
4f17f4f5
authored
Sep 25, 2019
by
王淑君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加评论相关接口
parent
6cc7dd99
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
110 additions
and
18 deletions
+110
-18
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+2
-3
BChapterService.java
...rg/rcisoft/business/bchapter/service/BChapterService.java
+2
-1
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+5
-2
BDiscussController.java
...soft/business/bdiscuss/controller/BDiscussController.java
+16
-9
BDiscussRepository.java
...org/rcisoft/business/bdiscuss/dao/BDiscussRepository.java
+21
-0
BDiscussDto.java
...n/java/org/rcisoft/business/bdiscuss/dto/BDiscussDto.java
+24
-0
BDiscuss.java
...n/java/org/rcisoft/business/bdiscuss/entity/BDiscuss.java
+2
-1
BDiscussService.java
...rg/rcisoft/business/bdiscuss/service/BDiscussService.java
+3
-0
BDiscussServiceImpl.java
...t/business/bdiscuss/service/impl/BDiscussServiceImpl.java
+11
-0
SysRoleController.java
...va/org/rcisoft/sys/role/controller/SysRoleController.java
+7
-2
BDiscussMapper.xml
...ources/mapper/business/bdiscuss/mapper/BDiscussMapper.xml
+17
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
4f17f4f5
...
@@ -113,15 +113,14 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -113,15 +113,14 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
map
);
map
);
}
}
@ApiOperation
(
value
=
"查询章节带进度"
,
notes
=
"根据lessonId查询章节带进度"
)
@ApiOperation
(
value
=
"
205
查询章节带进度"
,
notes
=
"根据lessonId查询章节带进度"
)
@GetMapping
(
value
=
"/queryBChaptersWithProgress"
)
@GetMapping
(
value
=
"/queryBChaptersWithProgress"
)
public
Result
queryBChaptersWithProgress
(
CurUser
curUser
,
@Valid
QueryChapterListDTO
param
,
BindingResult
br
)
{
public
Result
queryBChaptersWithProgress
(
CurUser
curUser
,
@Valid
QueryChapterListDTO
param
,
BindingResult
br
)
{
Map
<
String
,
Object
>
map
=
new
HashedMap
();
Map
<
String
,
Object
>
map
=
new
HashedMap
();
map
.
put
(
"chapterList"
,
bChapterService
.
queryBChaptersWithProgress
(
param
));
return
Result
.
builder
(
new
PersistModel
(
1
),
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
map
);
bChapterService
.
queryBChaptersWithProgress
(
param
)
);
}
}
//
//
// @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态")
// @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态")
...
...
src/main/java/org/rcisoft/business/bchapter/service/BChapterService.java
View file @
4f17f4f5
...
@@ -8,6 +8,7 @@ import org.rcisoft.core.aop.PageUtil;
...
@@ -8,6 +8,7 @@ import org.rcisoft.core.aop.PageUtil;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Created by gwf on 2017-7-21 15:08:47.
* Created by gwf on 2017-7-21 15:08:47.
...
@@ -47,7 +48,7 @@ public interface BChapterService{
...
@@ -47,7 +48,7 @@ public interface BChapterService{
* @param model
* @param model
* @return
* @return
*/
*/
List
<
QueryChapterListResDTO
>
queryBChaptersWithProgress
(
QueryChapterListDTO
model
);
Map
queryBChaptersWithProgress
(
QueryChapterListDTO
model
);
/**
/**
* 插入
* 插入
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
4f17f4f5
...
@@ -84,7 +84,7 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -84,7 +84,7 @@ public class BChapterServiceImpl implements BChapterService {
return
queryChapterListResDTO
(
model
);
return
queryChapterListResDTO
(
model
);
}
}
@Override
@Override
public
List
<
QueryChapterListResDTO
>
queryBChaptersWithProgress
(
QueryChapterListDTO
model
)
{
public
Map
queryBChaptersWithProgress
(
QueryChapterListDTO
model
)
{
List
<
QueryChapterListResDTO
>
queryChapterListResDTOS
=
queryChapterListResDTO
(
model
);
List
<
QueryChapterListResDTO
>
queryChapterListResDTOS
=
queryChapterListResDTO
(
model
);
queryChapterListResDTOS
.
stream
().
forEach
(
queryChapterListResDTO
->
{
queryChapterListResDTOS
.
stream
().
forEach
(
queryChapterListResDTO
->
{
queryChapterListResDTO
.
getChildList
().
stream
().
forEach
(
childList
->
{
queryChapterListResDTO
.
getChildList
().
stream
().
forEach
(
childList
->
{
...
@@ -94,7 +94,10 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -94,7 +94,10 @@ public class BChapterServiceImpl implements BChapterService {
}
}
});
});
});
});
return
queryChapterListResDTOS
;
Map
map
=
new
HashMap
();
map
.
put
(
"chapterList"
,
queryChapterListResDTOS
);
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
model
.
getLessonId
()));
return
map
;
}
}
/**
/**
...
...
src/main/java/org/rcisoft/business/bdiscuss/controller/BDiscussController.java
View file @
4f17f4f5
...
@@ -36,8 +36,12 @@ public class BDiscussController extends PaginationController<BDiscuss> {
...
@@ -36,8 +36,12 @@ public class BDiscussController extends PaginationController<BDiscuss> {
private
BDiscussService
bDiscussServiceImpl
;
private
BDiscussService
bDiscussServiceImpl
;
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
@ApiOperation
(
value
=
"801 添加"
,
notes
=
"添加"
)
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"课程id 修改章节时传入"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonId"
,
value
=
"课程ID"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"content"
,
value
=
"评论内容"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"上一级(评论别人的评论需要)"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"studentId"
,
value
=
"评论人id"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
BDiscuss
bDiscuss
,
BindingResult
bindingResult
)
{
public
Result
add
(
@Valid
BDiscuss
bDiscuss
,
BindingResult
bindingResult
)
{
// bDiscuss.setToken(getToken());
// bDiscuss.setToken(getToken());
...
@@ -48,6 +52,15 @@ public class BDiscussController extends PaginationController<BDiscuss> {
...
@@ -48,6 +52,15 @@ public class BDiscussController extends PaginationController<BDiscuss> {
bDiscuss
);
bDiscuss
);
}
}
@ApiOperation
(
value
=
"802 根据课程id查询评论集合"
,
notes
=
"根据课程id查询评论"
)
@GetMapping
(
"{lessonId:\\w+}"
)
public
Result
getDiscussByLessonId
(
@PathVariable
String
lessonId
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bDiscussServiceImpl
.
getDiscussByLessonId
(
lessonId
));
}
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"逻辑删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"id"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"id"
,
required
=
false
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/delete/{id:\\w+}"
)
@DeleteMapping
(
"/delete/{id:\\w+}"
)
...
@@ -83,11 +96,5 @@ public class BDiscussController extends PaginationController<BDiscuss> {
...
@@ -83,11 +96,5 @@ public class BDiscussController extends PaginationController<BDiscuss> {
bDiscussServiceImpl
.
findById
(
id
));
bDiscussServiceImpl
.
findById
(
id
));
}
}
@ApiOperation
(
value
=
"查看 集合"
,
notes
=
"查看 集合"
)
@GetMapping
(
value
=
"/queryBDiscussByPagination"
)
public
GridModel
listByPagination
(
BDiscuss
bDiscuss
)
{
// bDiscuss.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
bDiscussServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
bDiscuss
);
return
getGridModelResponse
();
}
}
}
src/main/java/org/rcisoft/business/bdiscuss/dao/BDiscussRepository.java
View file @
4f17f4f5
package
org
.
rcisoft
.
business
.
bdiscuss
.
dao
;
package
org
.
rcisoft
.
business
.
bdiscuss
.
dao
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.bdiscuss.dto.BDiscussDto
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.bdiscuss.entity.BDiscuss
;
import
org.rcisoft.business.bdiscuss.entity.BDiscuss
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.ResultMap
;
...
@@ -25,5 +27,24 @@ public interface BDiscussRepository extends BaseMapper<BDiscuss> {
...
@@ -25,5 +27,24 @@ public interface BDiscussRepository extends BaseMapper<BDiscuss> {
+
"</script>"
)
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BDiscuss
>
queryBDiscusss
(
BDiscuss
bDiscuss
);
List
<
BDiscuss
>
queryBDiscusss
(
BDiscuss
bDiscuss
);
@Select
(
"<script> SELECT "
+
" bd.*, "
+
" su.NAME AS studentName "
+
"FROM "
+
" b_discuss bd "
+
" LEFT JOIN s_user su ON su.business_id = bd.student_id "
+
"WHERE "
+
" 1 = 1 "
+
" AND bd.del_flag = '0' "
+
" AND bd.flag = '1' "
+
"<if test=\"lessonId !=null and lessonId != '' \">and bd.lesson_id = #{lessonId} </if> "
+
"<if test=\"pid !=null and pid != '' \">and bd.pid = #{pid} </if> "
+
"<if test=\"pid ==null or pid == '' \">and bd.pid = '-1' </if> "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMapDto"
)
List
<
BDiscussDto
>
getDiscussByLessonId
(
@Param
(
"lessonId"
)
String
lessonId
,
@Param
(
"pid"
)
String
pid
);
}
}
src/main/java/org/rcisoft/business/bdiscuss/dto/BDiscussDto.java
0 → 100644
View file @
4f17f4f5
package
org
.
rcisoft
.
business
.
bdiscuss
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.rcisoft.business.bdiscuss.entity.BDiscuss
;
import
org.rcisoft.core.entity.IdEntity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
java.util.List
;
/**
* Created with on 2019-9-25 9:03:08.
*/
@Data
public
class
BDiscussDto
extends
BDiscuss
{
private
List
<
BDiscussDto
>
bDiscussChildList
;
private
String
studentName
;
}
src/main/java/org/rcisoft/business/bdiscuss/entity/BDiscuss.java
View file @
4f17f4f5
...
@@ -21,7 +21,6 @@ import java.util.List;
...
@@ -21,7 +21,6 @@ import java.util.List;
public
class
BDiscuss
extends
IdEntity
<
BDiscuss
>
{
public
class
BDiscuss
extends
IdEntity
<
BDiscuss
>
{
private
String
lessonId
;
private
String
lessonId
;
private
String
pid
;
private
String
pid
;
...
@@ -30,6 +29,8 @@ public class BDiscuss extends IdEntity<BDiscuss> {
...
@@ -30,6 +29,8 @@ public class BDiscuss extends IdEntity<BDiscuss> {
private
String
level
;
private
String
level
;
private
String
studentId
;
}
}
src/main/java/org/rcisoft/business/bdiscuss/service/BDiscussService.java
View file @
4f17f4f5
package
org
.
rcisoft
.
business
.
bdiscuss
.
service
;
package
org
.
rcisoft
.
business
.
bdiscuss
.
service
;
import
org.rcisoft.business.bdiscuss.dto.BDiscussDto
;
import
org.rcisoft.business.bdiscuss.entity.BDiscuss
;
import
org.rcisoft.business.bdiscuss.entity.BDiscuss
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
...
@@ -48,6 +49,8 @@ public interface BDiscussService {
...
@@ -48,6 +49,8 @@ public interface BDiscussService {
BDiscuss
bDiscuss
);
BDiscuss
bDiscuss
);
List
<
BDiscussDto
>
getDiscussByLessonId
(
String
lessonId
);
}
}
src/main/java/org/rcisoft/business/bdiscuss/service/impl/BDiscussServiceImpl.java
View file @
4f17f4f5
package
org
.
rcisoft
.
business
.
bdiscuss
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
bdiscuss
.
service
.
impl
;
import
org.rcisoft.business.bdiscuss.dto.BDiscussDto
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
...
@@ -46,6 +47,7 @@ public class BDiscussServiceImpl implements BDiscussService {
...
@@ -46,6 +47,7 @@ public class BDiscussServiceImpl implements BDiscussService {
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
/**
/**
* 逻辑删除
* 逻辑删除
* @param bDiscuss
* @param bDiscuss
...
@@ -98,4 +100,13 @@ public class BDiscussServiceImpl implements BDiscussService {
...
@@ -98,4 +100,13 @@ public class BDiscussServiceImpl implements BDiscussService {
return
bDiscussRepository
.
queryBDiscusss
(
bDiscuss
);
return
bDiscussRepository
.
queryBDiscusss
(
bDiscuss
);
}
}
@Override
public
List
<
BDiscussDto
>
getDiscussByLessonId
(
String
lessonId
)
{
List
<
BDiscussDto
>
bDiscussList
=
bDiscussRepository
.
getDiscussByLessonId
(
lessonId
,
""
);
bDiscussList
.
stream
().
forEach
(
bDiscuss
->
{
bDiscuss
.
setBDiscussChildList
(
bDiscussRepository
.
getDiscussByLessonId
(
lessonId
,
bDiscuss
.
getBusinessId
()));
});
return
bDiscussList
;
}
}
}
src/main/java/org/rcisoft/sys/role/controller/SysRoleController.java
View file @
4f17f4f5
...
@@ -42,10 +42,15 @@ public class SysRoleController extends PaginationController<SysRole> {
...
@@ -42,10 +42,15 @@ public class SysRoleController extends PaginationController<SysRole> {
@ApiOperation
(
value
=
"查询全部角色"
,
notes
=
"查询全部角色"
)
@ApiOperation
(
value
=
"查询全部角色"
,
notes
=
"查询全部角色"
)
@GetMapping
(
value
=
"/queryRolesAll"
)
@GetMapping
(
value
=
"/queryRolesAll"
)
public
GridModel
queryRolesAll
(
CurUser
curUser
,
@Valid
FindRolePaginDTO
findRolePaginDTO
,
BindingResult
bindingResult
){
public
Result
queryRolesAll
(
CurUser
curUser
,
@Valid
FindRolePaginDTO
findRolePaginDTO
,
BindingResult
bindingResult
){
sysRoleServiceImpl
.
queryRolesAll
(
findRolePaginDTO
);
sysRoleServiceImpl
.
queryRolesAll
(
findRolePaginDTO
);
GridModel
gridModel
=
getGridModelResponse
();
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
// return gridModel;
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
sysRoleServiceImpl
.
queryRolesAll
(
findRolePaginDTO
));
}
}
@ApiOperation
(
value
=
"增加/修改角色"
,
notes
=
"增加/修改角色"
)
@ApiOperation
(
value
=
"增加/修改角色"
,
notes
=
"增加/修改角色"
)
...
...
src/main/resources/mapper/business/bdiscuss/mapper/BDiscussMapper.xml
View file @
4f17f4f5
...
@@ -14,7 +14,24 @@
...
@@ -14,7 +14,24 @@
<result
column=
"pid"
jdbcType=
"VARCHAR"
property=
"pid"
/>
<result
column=
"pid"
jdbcType=
"VARCHAR"
property=
"pid"
/>
<result
column=
"content"
jdbcType=
"LONGVARCHAR"
property=
"content"
/>
<result
column=
"content"
jdbcType=
"LONGVARCHAR"
property=
"content"
/>
<result
column=
"level"
jdbcType=
"VARCHAR"
property=
"level"
/>
<result
column=
"level"
jdbcType=
"VARCHAR"
property=
"level"
/>
<result
column=
"student_id"
jdbcType=
"VARCHAR"
property=
"studentId"
/>
</resultMap>
</resultMap>
<resultMap
id=
"BaseResultMapDto"
type=
"org.rcisoft.business.bdiscuss.dto.BDiscussDto"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"lesson_id"
jdbcType=
"VARCHAR"
property=
"lessonId"
/>
<result
column=
"pid"
jdbcType=
"VARCHAR"
property=
"pid"
/>
<result
column=
"content"
jdbcType=
"LONGVARCHAR"
property=
"content"
/>
<result
column=
"level"
jdbcType=
"VARCHAR"
property=
"level"
/>
<result
column=
"student_id"
jdbcType=
"VARCHAR"
property=
"studentId"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
</mapper>
\ 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