Commit 7e6b74e3 authored by hezhen's avatar hezhen

Merge branch 'master-chw' of http://113.105.137.151:22280/youjj/cloud-platform into master-chw

parents 888b4690 9ec7ac2b
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 String 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;
/**
* 类型,1: 订单商品,2: 活动,3: 达人秀
*/
@Column(name = "comment_type")
@ApiModelProperty(value = "类型,1: 订单商品,2: 活动,3: 达人秀")
private Integer commentType;
}
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
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> {
}
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.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;
@RestController
@RequestMapping("app/reportComment")
@Api(tags = {"评论举报"})
public class AppReportCommentController extends BaseController<ReportCommentBiz, ReportComment> {
@PostMapping("/app/unauth/saveReport")
@ApiModelProperty("评论举报")
@IgnoreUserToken
public ObjectRestResponse saveReport(@RequestBody ReportComment reportComment) {
reportComment.setUserId(getCurrentUserIdInt());
return baseBiz.saveReport(reportComment);
}
}
\ No newline at end of file
<?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
...@@ -12,7 +12,7 @@ spring: ...@@ -12,7 +12,7 @@ spring:
driverClassName: com.mysql.jdbc.Driver driverClassName: com.mysql.jdbc.Driver
#url: jdbc:mysql://10.5.52.3:3306/xxfc_vehicle?useUnicode=true&characterEncoding=UTF-8 #url: jdbc:mysql://10.5.52.3:3306/xxfc_vehicle?useUnicode=true&characterEncoding=UTF-8
#url: jdbc:mysql://10.5.52.3:3306/tiande_order?useUnicode=true&characterEncoding=UTF-8 #url: jdbc:mysql://10.5.52.3:3306/tiande_order?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://10.5.52.4:3307/chw_order?useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://10.5.52.4:3307/chw_admin_v1?useUnicode=true&characterEncoding=UTF-8
username: root username: root
password: sslcloud123*() password: sslcloud123*()
jackson: jackson:
......
#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F #\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
#\u5305\u540D #\u5305\u540D
package=com.xxfc.platform.order #package=com.xxfc.platform.order
package=com.github.wxiaoqi.security.admin
#\u4F5C\u8005 #\u4F5C\u8005
author=libin author=xiaoshaolin
#Email #Email
email=18178966185@163.com email=18178966185@163.com
#\u8868\u524D\u9519\u8BEF\u7684Unicode\u5B57\u7B26\u4E32! #\u8868\u524D\u9519\u8BEF\u7684Unicode\u5B57\u7B26\u4E32!
......
...@@ -29,5 +29,6 @@ public class ActivityDTO extends PageParam { ...@@ -29,5 +29,6 @@ public class ActivityDTO extends PageParam {
private Integer activityId; private Integer activityId;
@ApiModelProperty(value = "时间戳") @ApiModelProperty(value = "时间戳")
private Long time; private Long time;
private Integer isSee;
} }
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
<if test="type != null"> <if test="type != null">
and a.`type`=#{type} and a.`type`=#{type}
</if> </if>
<if test="isSee != null">
and a.`is_see`=#{isSee}
</if>
<if test="userId != null and userId > 0"> <if test="userId != null and userId > 0">
and a.`user_id`=#{userId} and a.`user_id`=#{userId}
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment