Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
wangming
/
kzy-oss
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 563bf52e
authored
Mar 14, 2020
by
wangming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangming' into '105'
banner See merge request
!10
2 parents
a0cc495d
aac8ef8b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
173 additions
and
4 deletions
src/main/java/com/server/web/controller/CommentController.java
src/main/java/com/server/web/controller/CourseController.java
src/main/java/com/server/web/controller/InformationController.java
src/main/resources/mybatis/mapping/queryModel.xml
src/main/java/com/server/web/controller/CommentController.java
0 → 100644
View file @
563bf52
package
com
.
server
.
web
.
controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.server.shiro.persistent.bean.SysUser
;
import
com.server.utils.DateUtils
;
import
com.server.web.common.mapper.TBaseSecondClassMapper
;
import
com.server.web.common.mapper.TKzyCommentMapper
;
import
com.server.web.common.mapper.TKzyCourseMapper
;
import
com.server.web.common.model.PageModel
;
import
com.server.web.common.model.TBaseSecondClass
;
import
com.server.web.common.model.TKzyComment
;
import
com.server.web.common.model.TKzyCourse
;
import
com.server.web.common.service.CourseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 评论管理
*/
@RestController
@RequestMapping
(
BaseController
.
OSS_NAMESPACE
+
"/comment"
)
public
class
CommentController
extends
BaseController
{
@Autowired
private
TKzyCommentMapper
commentMapper
;
/**
* 课程评论列表
* @param pageNo
* @param pageSize
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/commentCourseList"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
commentList
(
Long
id
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageSize
)
{
try
{
Map
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
PageHelper
.
startPage
(
pageNo
,
pageSize
,
true
,
false
);
List
list
=
openSqlRingsService
.
selectList_Rings
(
"com.mapping.queryModel.commentCourseList"
,
paramMap
);
PageInfo
pageInfo
=
new
PageInfo
(
list
);
PageModel
model
=
new
PageModel
();
model
.
setTotal
(
pageInfo
.
getTotal
());
model
.
setList
(
list
);
return
success
(
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
/**
* 资讯评论列表
* @param id
* @param pageNo
* @param pageSize
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/commentInformationList"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
commentInformationList
(
Long
id
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageSize
)
{
try
{
Map
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
PageHelper
.
startPage
(
pageNo
,
pageSize
,
true
,
false
);
List
list
=
openSqlRingsService
.
selectList_Rings
(
"com.mapping.queryModel.commentInformationList"
,
paramMap
);
PageInfo
pageInfo
=
new
PageInfo
(
list
);
PageModel
model
=
new
PageModel
();
model
.
setTotal
(
pageInfo
.
getTotal
());
model
.
setList
(
list
);
return
success
(
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
/**
* 删除评论
* @param id
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/deleteComment"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
deleteComment
(
@RequestParam
long
id
)
{
try
{
TKzyComment
comment
=
new
TKzyComment
();
comment
.
setId
(
id
);
comment
.
setIsDelete
(
1
);
commentMapper
.
updateByPrimaryKeySelective
(
comment
);
return
success
(
"操作成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
/**
* 审核评论
* @param id
* @param status
* @return
*/
@ResponseBody
@RequestMapping
(
path
=
"/authComment"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
authComment
(
@RequestParam
long
id
,
Integer
status
)
{
try
{
TKzyComment
comment
=
commentMapper
.
selectByPrimaryKey
(
id
);
if
(
comment
.
getAuthStatus
()!=
1
){
return
error
(
"0"
,
"评论已审核"
,
"评论已审核"
);
}
comment
.
setId
(
id
);
comment
.
setAuthDt
(
new
Date
());
comment
.
setAuthStatus
(
status
);
commentMapper
.
updateByPrimaryKeySelective
(
comment
);
return
success
(
"操作成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
"0"
,
"系统异常"
,
null
);
}
}
}
src/main/java/com/server/web/controller/CourseController.java
View file @
563bf52
...
@@ -219,7 +219,8 @@ public class CourseController extends BaseController {
...
@@ -219,7 +219,8 @@ public class CourseController extends BaseController {
@ResponseBody
@ResponseBody
@RequestMapping
(
path
=
"/saveLbCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
@RequestMapping
(
path
=
"/saveLbCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
saveLbCourse
(
@RequestParam
(
defaultValue
=
"-1"
)
long
id
,
@RequestParam
String
courseName
,
public
Map
saveLbCourse
(
@RequestParam
(
defaultValue
=
"-1"
)
long
id
,
@RequestParam
String
courseName
,
@RequestParam
String
picUrl
,
@RequestParam
String
courseIntroduce
,
@RequestParam
(
defaultValue
=
""
)
String
liveUrl
,
@RequestParam
(
defaultValue
=
""
)
String
classIds
)
{
@RequestParam
String
picUrl
,
@RequestParam
String
courseIntroduce
,
@RequestParam
(
defaultValue
=
""
)
String
liveUrl
,
@RequestParam
(
defaultValue
=
""
)
String
classIds
,
@RequestParam
Integer
weight
)
{
try
{
try
{
String
[]
ids
=
classIds
.
split
(
","
);
String
[]
ids
=
classIds
.
split
(
","
);
boolean
flag
=
true
;
boolean
flag
=
true
;
...
@@ -241,6 +242,7 @@ public class CourseController extends BaseController {
...
@@ -241,6 +242,7 @@ public class CourseController extends BaseController {
if
(!(
""
).
equals
(
liveUrl
))
{
if
(!(
""
).
equals
(
liveUrl
))
{
course
.
setLiveUrl
(
liveUrl
);
course
.
setLiveUrl
(
liveUrl
);
}
}
course
.
setWeight
(
weight
);
course
.
setEditorId
(
user
.
getId
());
course
.
setEditorId
(
user
.
getId
());
course
.
setEditorName
(
user
.
getRealname
());
course
.
setEditorName
(
user
.
getRealname
());
if
(
id
!=
-
1
){
//修改
if
(
id
!=
-
1
){
//修改
...
...
src/main/java/com/server/web/controller/InformationController.java
View file @
563bf52
...
@@ -45,8 +45,8 @@ public class InformationController extends BaseController {
...
@@ -45,8 +45,8 @@ public class InformationController extends BaseController {
* @return
* @return
*/
*/
@ResponseBody
@ResponseBody
@RequestMapping
(
path
=
"/
zb
List"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
@RequestMapping
(
path
=
"/
information
List"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
zb
List
(
@RequestParam
(
defaultValue
=
""
)
String
title
public
Map
information
List
(
@RequestParam
(
defaultValue
=
""
)
String
title
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageSize
)
{
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageSize
)
{
try
{
try
{
Map
paramMap
=
new
HashMap
<>();
Map
paramMap
=
new
HashMap
<>();
...
...
src/main/resources/mybatis/mapping/queryModel.xml
View file @
563bf52
...
@@ -223,7 +223,6 @@
...
@@ -223,7 +223,6 @@
ORDER BY c.create_dt DESC
ORDER BY c.create_dt DESC
</select>
</select>
<select
id=
"queryInformationInfo"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
<select
id=
"queryInformationInfo"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
SELECT
SELECT
c.id,
c.id,
...
@@ -237,4 +236,40 @@
...
@@ -237,4 +236,40 @@
WHERE c.id = #{id,jdbcType=BIGINT}
WHERE c.id = #{id,jdbcType=BIGINT}
</select>
</select>
<select
id=
"commentCourseList"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
SELECT
c.id,
c.reply_content as replyContent,
c1.course_name as replyName,
u.full_name as fullName,
u.phone,
c.auth_status as authStatus,
date_format(c.auth_dt,'%Y-%m-%d %H:%i:%S') authDt,
date_format(c.create_dt,'%Y-%m-%d %H:%i:%S') createDt
FROM
t_kzy_comment c
LEFT JOIN t_kzy_course c1 ON c.relation_id =c1.id
LEFT JOIN t_kzy_user u ON c.user_id=u.id
WHERE c.is_delete=0 AND
c.type=2 AND c.relation_id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"commentInformationList"
resultType=
"java.util.HashMap"
parameterType=
"java.util.HashMap"
>
SELECT
c.id,
c.reply_content as replyContent,
c1.title as replyName,
u.full_name as fullName,
u.phone,
c.auth_status as authStatus,
date_format(c.auth_dt,'%Y-%m-%d %H:%i:%S') authDt,
date_format(c.create_dt,'%Y-%m-%d %H:%i:%S') createDt
FROM
t_kzy_comment c
LEFT JOIN t_kzy_information c1 ON c.relation_id =c1.id
LEFT JOIN t_kzy_user u ON c.user_id=u.id
WHERE c.is_delete=0 AND
c.type=1 AND c.relation_id = #{id,jdbcType=BIGINT}
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment