Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
0df3ddba
Commit
0df3ddba
authored
Dec 13, 2020
by
xiaosl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
举报
parent
c1d6cd03
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
176 additions
and
0 deletions
+176
-0
ReportComment.java
...m/github/wxiaoqi/security/admin/entity/ReportComment.java
+73
-0
ReportCommentBiz.java
...m/github/wxiaoqi/security/admin/biz/ReportCommentBiz.java
+39
-0
ReportCommentMapper.java
...ub/wxiaoqi/security/admin/mapper/ReportCommentMapper.java
+15
-0
AppReportCommentController.java
...iaoqi/security/admin/rest/AppReportCommentController.java
+32
-0
ReportCommentMapper.xml
...e-admin/src/main/resources/mapper/ReportCommentMapper.xml
+17
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/ReportComment.java
0 → 100644
View file @
0df3ddba
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
*
* 评论举报记录
* @author xiaoshaolin
* @email 18178966185@163.com
* @date 2020-12-13 21:20:35
*/
@Data
@Table
(
name
=
"report_comment"
)
public
class
ReportComment
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
""
)
private
Long
id
;
/**
*
*/
@Column
(
name
=
"comment_id"
)
@ApiModelProperty
(
value
=
""
)
private
Long
commentId
;
/**
*
*/
@Column
(
name
=
"remarks"
)
@ApiModelProperty
(
value
=
""
)
private
String
remarks
;
/**
*
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
""
,
hidden
=
true
)
private
Long
crtTime
;
/**
*
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
""
)
private
Integer
userId
;
/**
*
*/
@Column
(
name
=
"pic_url"
)
@ApiModelProperty
(
value
=
""
)
private
String
picUrl
;
/**
* 状态,1未处理,2已处理
*/
@Column
(
name
=
"status"
)
@ApiModelProperty
(
value
=
"状态,1未处理,2已处理"
)
private
Integer
status
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/ReportCommentBiz.java
0 → 100644
View file @
0df3ddba
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.stereotype.Service
;
import
com.github.wxiaoqi.security.admin.entity.ReportComment
;
import
com.github.wxiaoqi.security.admin.mapper.ReportCommentMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.List
;
/**
*
*
* @author xiaoshaolin
* @email 18178966185@163.com
* @date 2020-12-13 21:20:35
*/
@Service
public
class
ReportCommentBiz
extends
BaseBiz
<
ReportCommentMapper
,
ReportComment
>
{
public
ObjectRestResponse
saveReport
(
ReportComment
reportComment
)
{
if
(
reportComment
.
getUserId
()
!=
null
&&
reportComment
.
getUserId
()
!=
0
)
{
ReportComment
query
=
new
ReportComment
();
query
.
setCommentId
(
reportComment
.
getCommentId
());
query
.
setUserId
(
reportComment
.
getUserId
());
List
<
ReportComment
>
reportCommentList
=
selectList
(
query
);
if
(
reportCommentList
!=
null
&&
reportCommentList
.
size
()
>
0
)
{
return
ObjectRestResponse
.
succ
(
"已举报过,我们会及时处理,无需重复提交"
);
}
}
reportComment
.
setCrtTime
(
System
.
currentTimeMillis
());
reportComment
.
setStatus
(
1
);
mapper
.
insertSelective
(
reportComment
);
return
ObjectRestResponse
.
succ
(
"感谢你的反馈,我们会进行核实,并对违规进行下架处理"
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/ReportCommentMapper.java
0 → 100644
View file @
0df3ddba
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.ReportComment
;
import
tk.mybatis.mapper.common.Mapper
;
/**
*
*
* @author xiaoshaolin
* @email 18178966185@163.com
* @date 2020-12-13 21:20:35
*/
public
interface
ReportCommentMapper
extends
Mapper
<
ReportComment
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppReportCommentController.java
0 → 100644
View file @
0df3ddba
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.entity.UserComment
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.admin.biz.ReportCommentBiz
;
import
com.github.wxiaoqi.security.admin.entity.ReportComment
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"app/reportComment"
)
@Api
(
tags
=
{
"评论举报"
})
public
class
AppReportCommentController
extends
BaseController
<
ReportCommentBiz
,
ReportComment
>
{
@PostMapping
(
"saveReport"
)
@ApiModelProperty
(
"评论举报"
)
@IgnoreUserToken
public
ObjectRestResponse
saveReport
(
@RequestBody
ReportComment
reportComment
)
{
reportComment
.
setUserId
(
getCurrentUserIdInt
());
baseBiz
.
saveReport
(
reportComment
);
return
ObjectRestResponse
.
succ
();
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/resources/mapper/ReportCommentMapper.xml
0 → 100644
View file @
0df3ddba
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.ReportCommentMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.github.wxiaoqi.security.admin.entity.ReportComment"
id=
"reportCommentMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"commentId"
column=
"comment_id"
/>
<result
property=
"remarks"
column=
"remarks"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"picUrl"
column=
"pic_url"
/>
<result
property=
"status"
column=
"status"
/>
</resultMap>
</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