Commit 5f34f277 authored by shiyu's avatar shiyu

安全识别

parent c0676efd
...@@ -67,20 +67,50 @@ public class QdWxAppletApi { ...@@ -67,20 +67,50 @@ public class QdWxAppletApi {
public String checkMedia(WxCheckMediaRequestDto dto) { public String checkMedia(WxCheckMediaRequestDto dto) {
String accessToken = qdWxLoginManager.getAccessToken(); try {
String url = String.format(MEDIA_CHECK_URL, accessToken); String accessToken = qdWxLoginManager.getAccessToken();
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url); String url = String.format(MEDIA_CHECK_URL, accessToken);
Map<String, Object> map = new HashMap<>(); OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url);
map.put("media_url", dto.getMediaUrl()); Map<String, Object> map = new HashMap<>();
map.put("media_type", dto.getMediaType()); map.put("media_url", dto.getMediaUrl());
map.put("version", 2); map.put("media_type", dto.getMediaType());
map.put("scene", 4); map.put("version", 2);
map.put("openid", dto.getWxOpenId()); map.put("scene", 4);
okHttpUtil.addParams(map); map.put("openid", dto.getWxOpenId());
okHttpUtil.post(true); okHttpUtil.addParams(map);
String responseStr = okHttpUtil.async(); okHttpUtil.post(true);
logger.info("[checkMedia] response :{}", responseStr); String responseStr = okHttpUtil.async();
return responseStr; logger.info("[checkMedia] response :{}", responseStr);
String traceId = JsonUtils.getValueByPath(responseStr, "trace_id");
return traceId;
} catch (Exception e) {
logger.error("checkMedia error : {}", e);
}
return null;
}
public String checkAudio(WxCheckMediaRequestDto dto) {
try {
String accessToken = qdWxLoginManager.getAccessToken();
String url = String.format(MEDIA_CHECK_URL, accessToken);
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url);
Map<String, Object> map = new HashMap<>();
map.put("media_url", dto.getMediaUrl());
map.put("media_type", dto.getMediaType());
map.put("version", 2);
map.put("scene", 4);
map.put("openid", dto.getWxOpenId());
okHttpUtil.addParams(map);
okHttpUtil.post(true);
String responseStr = okHttpUtil.async();
logger.info("[checkAudio] response :{}", responseStr);
String traceId = JsonUtils.getValueByPath(responseStr, "trace_id");
return traceId;
} catch (Exception e) {
logger.error("checkAudio error : {}", e);
}
return null;
} }
......
...@@ -54,6 +54,11 @@ public interface CommConsts { ...@@ -54,6 +54,11 @@ public interface CommConsts {
*/ */
public static final String AUCTION_LOCK_KEY_PRE = "AUCTION:OFFER:"; public static final String AUCTION_LOCK_KEY_PRE = "AUCTION:OFFER:";
/**
* 微信内容安全检测结果缓存
*/
public static final String QIANDAO_CHECK_RESULT_KEY = "qiandao:check:result:key:";
/** /**
* 拍卖保证金额度更新的锁 * 拍卖保证金额度更新的锁
*/ */
......
package com.wwdz.ch.core.consts.qiandao;
public class WxCheckEnum {
/**
* 检测类型
*/
public enum TypeEnum {
SIGN_IN_IMAGE(1, "签到笔记图片"),
SIGN_IN_AUDIO(2, "签到笔记音频"),
USER_AVATAR(3, "用户头像"),
USER_TASK(4, "用户创建的任务"),
;
private int code;
private String des;
TypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (SignInTaskEnum.TypeEnum typeEnum : SignInTaskEnum.TypeEnum.values()) {
if (code == typeEnum.getCode()) {
return typeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
...@@ -7,7 +7,7 @@ import java.util.List; ...@@ -7,7 +7,7 @@ import java.util.List;
public interface QdUserSignInNoteDao { public interface QdUserSignInNoteDao {
boolean insert(QdUserSignInNote qdUserSignInNote); long insert(QdUserSignInNote qdUserSignInNote);
List<QdUserSignInNote> findByPage(QdUserSignInNoteRequestDto dto); List<QdUserSignInNote> findByPage(QdUserSignInNoteRequestDto dto);
......
...@@ -21,4 +21,6 @@ public interface SignInTaskDao { ...@@ -21,4 +21,6 @@ public interface SignInTaskDao {
SignInTask findById(long taskId); SignInTask findById(long taskId);
boolean updateByPrimaryKey(SignInTask signInTask); boolean updateByPrimaryKey(SignInTask signInTask);
boolean delete(long taskId);
} }
package com.wwdz.ch.db.dao.qiandao;
import com.wwdz.ch.db.domain.qiandao.SignInTask;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecord;
public interface WxCheckRecordDao {
boolean insert(WxCheckRecord wxCheckRecord);
WxCheckRecord findByTraceId(String traceId);
boolean update(WxCheckRecord wxCheckRecord);
boolean updateByPrimaryKey(WxCheckRecord wxCheckRecord);
}
package com.wwdz.ch.db.domain.qiandao;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2025/01/22
*/
@Data
public class WxCheckRecord implements Entity {
private Long id;
/**
* 任务id
*/
private String traceId;
/**
* 资源id
*/
private Long sourceId;
/**
* 用户id
*/
private Long userId;
/**
* openid
*/
private String openId;
/**
* 类型
*/
private Integer type;
/**
* 检查结果
*/
private String suggest;
/**
* 创建时间
*/
private Date createTime;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", traceId=").append(traceId);
sb.append(", sourceId=").append(sourceId);
sb.append(", userId=").append(userId);
sb.append(", openId=").append(openId);
sb.append(", type=").append(type);
sb.append(", suggest=").append(suggest);
sb.append(", createTime=").append(createTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
WxCheckRecord other = (WxCheckRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getTraceId() == null ? other.getTraceId() == null : this.getTraceId().equals(other.getTraceId()))
&& (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getSuggest() == null ? other.getSuggest() == null : this.getSuggest().equals(other.getSuggest()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getTraceId() == null) ? 0 : getTraceId().hashCode());
result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getSuggest() == null) ? 0 : getSuggest().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "BIGINT", false),
traceId("trace_id", "traceId", "VARCHAR", false),
sourceId("source_id", "sourceId", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false),
openId("open_Id", "openId", "VARCHAR", false),
type("type", "type", "INTEGER", true),
suggest("suggest", "suggest", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain.qiandao;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class WxCheckRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public WxCheckRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public WxCheckRecordExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public WxCheckRecordExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
WxCheckRecordExample example = new WxCheckRecordExample();
return example.createCriteria();
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTraceIdIsNull() {
addCriterion("trace_id is null");
return (Criteria) this;
}
public Criteria andTraceIdIsNotNull() {
addCriterion("trace_id is not null");
return (Criteria) this;
}
public Criteria andTraceIdEqualTo(String value) {
addCriterion("trace_id =", value, "traceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTraceIdEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("trace_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTraceIdNotEqualTo(String value) {
addCriterion("trace_id <>", value, "traceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTraceIdNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("trace_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTraceIdGreaterThan(String value) {
addCriterion("trace_id >", value, "traceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTraceIdGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("trace_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTraceIdGreaterThanOrEqualTo(String value) {
addCriterion("trace_id >=", value, "traceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTraceIdGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("trace_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTraceIdLessThan(String value) {
addCriterion("trace_id <", value, "traceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTraceIdLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("trace_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTraceIdLessThanOrEqualTo(String value) {
addCriterion("trace_id <=", value, "traceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTraceIdLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("trace_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTraceIdLike(String value) {
addCriterion("trace_id like", value, "traceId");
return (Criteria) this;
}
public Criteria andTraceIdNotLike(String value) {
addCriterion("trace_id not like", value, "traceId");
return (Criteria) this;
}
public Criteria andTraceIdIn(List<String> values) {
addCriterion("trace_id in", values, "traceId");
return (Criteria) this;
}
public Criteria andTraceIdNotIn(List<String> values) {
addCriterion("trace_id not in", values, "traceId");
return (Criteria) this;
}
public Criteria andTraceIdBetween(String value1, String value2) {
addCriterion("trace_id between", value1, value2, "traceId");
return (Criteria) this;
}
public Criteria andTraceIdNotBetween(String value1, String value2) {
addCriterion("trace_id not between", value1, value2, "traceId");
return (Criteria) this;
}
public Criteria andSourceIdIsNull() {
addCriterion("source_id is null");
return (Criteria) this;
}
public Criteria andSourceIdIsNotNull() {
addCriterion("source_id is not null");
return (Criteria) this;
}
public Criteria andSourceIdEqualTo(Long value) {
addCriterion("source_id =", value, "sourceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceIdEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("source_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceIdNotEqualTo(Long value) {
addCriterion("source_id <>", value, "sourceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceIdNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("source_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceIdGreaterThan(Long value) {
addCriterion("source_id >", value, "sourceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceIdGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("source_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceIdGreaterThanOrEqualTo(Long value) {
addCriterion("source_id >=", value, "sourceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceIdGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("source_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceIdLessThan(Long value) {
addCriterion("source_id <", value, "sourceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceIdLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("source_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceIdLessThanOrEqualTo(Long value) {
addCriterion("source_id <=", value, "sourceId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceIdLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("source_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceIdIn(List<Long> values) {
addCriterion("source_id in", values, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdNotIn(List<Long> values) {
addCriterion("source_id not in", values, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdBetween(Long value1, Long value2) {
addCriterion("source_id between", value1, value2, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdNotBetween(Long value1, Long value2) {
addCriterion("source_id not between", value1, value2, "sourceId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andOpenIdIsNull() {
addCriterion("open_Id is null");
return (Criteria) this;
}
public Criteria andOpenIdIsNotNull() {
addCriterion("open_Id is not null");
return (Criteria) this;
}
public Criteria andOpenIdEqualTo(String value) {
addCriterion("open_Id =", value, "openId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenIdEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("open_Id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenIdNotEqualTo(String value) {
addCriterion("open_Id <>", value, "openId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenIdNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("open_Id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenIdGreaterThan(String value) {
addCriterion("open_Id >", value, "openId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenIdGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("open_Id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenIdGreaterThanOrEqualTo(String value) {
addCriterion("open_Id >=", value, "openId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenIdGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("open_Id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenIdLessThan(String value) {
addCriterion("open_Id <", value, "openId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenIdLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("open_Id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenIdLessThanOrEqualTo(String value) {
addCriterion("open_Id <=", value, "openId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenIdLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("open_Id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenIdLike(String value) {
addCriterion("open_Id like", value, "openId");
return (Criteria) this;
}
public Criteria andOpenIdNotLike(String value) {
addCriterion("open_Id not like", value, "openId");
return (Criteria) this;
}
public Criteria andOpenIdIn(List<String> values) {
addCriterion("open_Id in", values, "openId");
return (Criteria) this;
}
public Criteria andOpenIdNotIn(List<String> values) {
addCriterion("open_Id not in", values, "openId");
return (Criteria) this;
}
public Criteria andOpenIdBetween(String value1, String value2) {
addCriterion("open_Id between", value1, value2, "openId");
return (Criteria) this;
}
public Criteria andOpenIdNotBetween(String value1, String value2) {
addCriterion("open_Id not between", value1, value2, "openId");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("`type` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("`type` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("`type` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("`type` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("`type` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("`type` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andSuggestIsNull() {
addCriterion("suggest is null");
return (Criteria) this;
}
public Criteria andSuggestIsNotNull() {
addCriterion("suggest is not null");
return (Criteria) this;
}
public Criteria andSuggestEqualTo(String value) {
addCriterion("suggest =", value, "suggest");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuggestEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("suggest = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuggestNotEqualTo(String value) {
addCriterion("suggest <>", value, "suggest");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuggestNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("suggest <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuggestGreaterThan(String value) {
addCriterion("suggest >", value, "suggest");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuggestGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("suggest > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuggestGreaterThanOrEqualTo(String value) {
addCriterion("suggest >=", value, "suggest");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuggestGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("suggest >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuggestLessThan(String value) {
addCriterion("suggest <", value, "suggest");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuggestLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("suggest < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuggestLessThanOrEqualTo(String value) {
addCriterion("suggest <=", value, "suggest");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSuggestLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("suggest <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSuggestLike(String value) {
addCriterion("suggest like", value, "suggest");
return (Criteria) this;
}
public Criteria andSuggestNotLike(String value) {
addCriterion("suggest not like", value, "suggest");
return (Criteria) this;
}
public Criteria andSuggestIn(List<String> values) {
addCriterion("suggest in", values, "suggest");
return (Criteria) this;
}
public Criteria andSuggestNotIn(List<String> values) {
addCriterion("suggest not in", values, "suggest");
return (Criteria) this;
}
public Criteria andSuggestBetween(String value1, String value2) {
addCriterion("suggest between", value1, value2, "suggest");
return (Criteria) this;
}
public Criteria andSuggestNotBetween(String value1, String value2) {
addCriterion("suggest not between", value1, value2, "suggest");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(WxCheckRecord.Column column) {
addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private WxCheckRecordExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(WxCheckRecordExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public WxCheckRecordExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
...@@ -22,8 +22,9 @@ public class QdUserSignInNoteDaoImpl implements QdUserSignInNoteDao { ...@@ -22,8 +22,9 @@ public class QdUserSignInNoteDaoImpl implements QdUserSignInNoteDao {
QdUserSignInNoteMapper qdUserSignInNoteMapper; QdUserSignInNoteMapper qdUserSignInNoteMapper;
@Override @Override
public boolean insert(QdUserSignInNote qdUserSignInNote) { public long insert(QdUserSignInNote qdUserSignInNote) {
return qdUserSignInNoteMapper.insert(qdUserSignInNote) > 0; qdUserSignInNoteMapper.insert(qdUserSignInNote);
return qdUserSignInNote.getId();
} }
@Override @Override
......
...@@ -73,4 +73,10 @@ public class SignInTaskDaoImpl implements SignInTaskDao { ...@@ -73,4 +73,10 @@ public class SignInTaskDaoImpl implements SignInTaskDao {
public boolean updateByPrimaryKey(SignInTask signInTask) { public boolean updateByPrimaryKey(SignInTask signInTask) {
return signInTaskMapper.updateByPrimaryKeySelective(signInTask) > 0; return signInTaskMapper.updateByPrimaryKeySelective(signInTask) > 0;
} }
@Override
public boolean delete(long taskId) {
return signInTaskMapper.deleteByPrimaryKey(taskId) > 0;
}
} }
package com.wwdz.ch.db.impl.qiandao;
import com.wwdz.ch.db.dao.qiandao.WxCheckRecordDao;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecord;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecordExample;
import com.wwdz.ch.db.mapper.qiandao.WxCheckRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class WxCheckRecordDaoImpl implements WxCheckRecordDao {
@Autowired
WxCheckRecordMapper wxCheckRecordMapper;
@Override
public boolean insert(WxCheckRecord wxCheckRecord) {
return wxCheckRecordMapper.insert(wxCheckRecord) > 0;
}
@Override
public WxCheckRecord findByTraceId(String traceId) {
WxCheckRecordExample example = new WxCheckRecordExample();
WxCheckRecordExample.Criteria criteria = example.createCriteria();
criteria.andTraceIdEqualTo(traceId);
return wxCheckRecordMapper.selectOneByExample(example);
}
@Override
public boolean update(WxCheckRecord wxCheckRecord) {
WxCheckRecordExample example = new WxCheckRecordExample();
WxCheckRecordExample.Criteria criteria = example.createCriteria();
criteria.andTraceIdEqualTo(wxCheckRecord.getTraceId());
return wxCheckRecordMapper.updateByExampleSelective(wxCheckRecord,example) > 0;
}
@Override
public boolean updateByPrimaryKey(WxCheckRecord wxCheckRecord) {
return wxCheckRecordMapper.updateByPrimaryKeySelective(wxCheckRecord) > 0;
}
}
package com.wwdz.ch.db.mapper.qiandao;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecord;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface WxCheckRecordMapper {
long countByExample(WxCheckRecordExample example);
int deleteByExample(WxCheckRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(WxCheckRecord record);
int insertSelective(WxCheckRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
WxCheckRecord selectOneByExample(WxCheckRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
WxCheckRecord selectOneByExampleSelective(@Param("example") WxCheckRecordExample example, @Param("selective") WxCheckRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<WxCheckRecord> selectByExampleSelective(@Param("example") WxCheckRecordExample example, @Param("selective") WxCheckRecord.Column ... selective);
List<WxCheckRecord> selectByExample(WxCheckRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table wx_check_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
WxCheckRecord selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") WxCheckRecord.Column ... selective);
WxCheckRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") WxCheckRecord record, @Param("example") WxCheckRecordExample example);
int updateByExample(@Param("record") WxCheckRecord record, @Param("example") WxCheckRecordExample example);
int updateByPrimaryKeySelective(WxCheckRecord record);
int updateByPrimaryKey(WxCheckRecord record);
}
\ 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.wwdz.ch.db.mapper.qiandao.WxCheckRecordMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.qiandao.WxCheckRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="trace_id" jdbcType="VARCHAR" property="traceId" />
<result column="source_id" jdbcType="BIGINT" property="sourceId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="open_Id" jdbcType="VARCHAR" property="openId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="suggest" jdbcType="VARCHAR" property="suggest" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, trace_id, source_id, user_id, open_Id, `type`, suggest, create_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from wx_check_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, trace_id, source_id, user_id, open_Id, `type`, suggest, create_time
</otherwise>
</choose>
from wx_check_record
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from wx_check_record
where id = #{id,jdbcType=BIGINT}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, trace_id, source_id, user_id, open_Id, `type`, suggest, create_time
</otherwise>
</choose>
from wx_check_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from wx_check_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecordExample">
delete from wx_check_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into wx_check_record (trace_id, source_id, user_id,
open_Id, `type`, suggest,
create_time)
values (#{traceId,jdbcType=VARCHAR}, #{sourceId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{suggest,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into wx_check_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="traceId != null">
trace_id,
</if>
<if test="sourceId != null">
source_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="openId != null">
open_Id,
</if>
<if test="type != null">
`type`,
</if>
<if test="suggest != null">
suggest,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="traceId != null">
#{traceId,jdbcType=VARCHAR},
</if>
<if test="sourceId != null">
#{sourceId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="openId != null">
#{openId,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="suggest != null">
#{suggest,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecordExample" resultType="java.lang.Long">
select count(*) from wx_check_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update wx_check_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.traceId != null">
trace_id = #{record.traceId,jdbcType=VARCHAR},
</if>
<if test="record.sourceId != null">
source_id = #{record.sourceId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.openId != null">
open_Id = #{record.openId,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.suggest != null">
suggest = #{record.suggest,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update wx_check_record
set id = #{record.id,jdbcType=BIGINT},
trace_id = #{record.traceId,jdbcType=VARCHAR},
source_id = #{record.sourceId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
open_Id = #{record.openId,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=INTEGER},
suggest = #{record.suggest,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecord">
update wx_check_record
<set>
<if test="traceId != null">
trace_id = #{traceId,jdbcType=VARCHAR},
</if>
<if test="sourceId != null">
source_id = #{sourceId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="openId != null">
open_Id = #{openId,jdbcType=VARCHAR},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="suggest != null">
suggest = #{suggest,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecord">
update wx_check_record
set trace_id = #{traceId,jdbcType=VARCHAR},
source_id = #{sourceId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
open_Id = #{openId,jdbcType=VARCHAR},
`type` = #{type,jdbcType=INTEGER},
suggest = #{suggest,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.qiandao.WxCheckRecordExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from wx_check_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, trace_id, source_id, user_id, open_Id, `type`, suggest, create_time
</otherwise>
</choose>
from wx_check_record
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="sign_in_task" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="wx_check_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
...@@ -2,13 +2,19 @@ package com.wwdz.ch.wx.api; ...@@ -2,13 +2,19 @@ package com.wwdz.ch.wx.api;
import com.wwdz.ch.core.api.QdOfficialAccountApi; import com.wwdz.ch.core.api.QdOfficialAccountApi;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.OfficalAccountEnum; import com.wwdz.ch.core.consts.OfficalAccountEnum;
import com.wwdz.ch.core.consts.qiandao.WxCheckEnum;
import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.db.dao.qiandao.QdUserDao; import com.wwdz.ch.db.dao.qiandao.QdUserDao;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord; import com.wwdz.ch.db.dao.qiandao.QdUserSignInNoteDao;
import com.wwdz.ch.db.domain.qiandao.QdUser; import com.wwdz.ch.db.dao.qiandao.SignInTaskDao;
import com.wwdz.ch.db.dao.qiandao.WxCheckRecordDao;
import com.wwdz.ch.db.domain.qiandao.*;
import com.wwdz.ch.wx.api.aes.AesException; import com.wwdz.ch.wx.api.aes.AesException;
import com.wwdz.ch.wx.api.aes.WXBizMsgCrypt; import com.wwdz.ch.wx.api.aes.WXBizMsgCrypt;
import com.wwdz.ch.wx.service.qiandao.QdOfficialAccountSubscribeRecordService; import com.wwdz.ch.wx.service.qiandao.QdOfficialAccountSubscribeRecordService;
import com.xxdxxs.utils.JsonUtils;
import com.xxdxxs.utils.StringUtils; import com.xxdxxs.utils.StringUtils;
import com.xxdxxs.utils.XmlUtils; import com.xxdxxs.utils.XmlUtils;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
...@@ -50,6 +56,17 @@ public class QdAppletCallbackController { ...@@ -50,6 +56,17 @@ public class QdAppletCallbackController {
@Autowired @Autowired
QdUserDao qdUserDao; QdUserDao qdUserDao;
@Autowired
RedisUtils redisUtils;
@Autowired
WxCheckRecordDao wxCheckRecordDao;
@Autowired
QdUserSignInNoteDao qdUserSignInNoteDao;
@Autowired
SignInTaskDao signInTaskDao;
@RequestMapping(value ="/getNotice") @RequestMapping(value ="/getNotice")
public Object getNotice(@RequestParam(required = false, name = "signature") String signature, public Object getNotice(@RequestParam(required = false, name = "signature") String signature,
...@@ -57,10 +74,70 @@ public class QdAppletCallbackController { ...@@ -57,10 +74,70 @@ public class QdAppletCallbackController {
@RequestParam(required = false, name = "nonce") String nonce, @RequestParam(required = false, name = "nonce") String nonce,
@RequestParam(required = false, name = "echostr") String echostr, @RequestParam(required = false, name = "echostr") String echostr,
HttpServletRequest request, HttpServletResponse response){ HttpServletRequest request, HttpServletResponse response){
logger.info("接收小程序推送信息校验 -> appid: {}, signature:{}, timestamp:{}, nonce:{}, echostr : {}", APPID, signature, timestamp, nonce, echostr); logger.info("接收微信内容安全审核异步通知校验 -> appid: {}, signature:{}, timestamp:{}, nonce:{}, echostr : {}", APPID, signature, timestamp, nonce, echostr);
if (StringUtils.hasLength(echostr)) { if (StringUtils.hasLength(echostr)) {
return Long.valueOf(echostr.trim()); return Long.valueOf(echostr.trim());
} }
ByteArrayOutputStream output = null;
InputStream input = null;
try {
output = new ByteArrayOutputStream();
input = request.getInputStream();
byte[] by = new byte[1024];
int length = 0;
while ((length = input.read(by)) != -1) {
output.write(by, 0, length);
}
String noticeStr = new String(output.toByteArray(), "UTF-8");
String result = JsonUtils.getValueByPath(noticeStr, "result/suggest");
String traceId = JsonUtils.getValueByPath(noticeStr, "trace_id");
WxCheckRecord wxCheckRecord = wxCheckRecordDao.findByTraceId(traceId);
int type = wxCheckRecord.getType();
long sourceId = wxCheckRecord.getSourceId();
long userId = wxCheckRecord.getUserId();
if (wxCheckRecord != null) {
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSuggest(result);
wxCheckRecord.setCreateTime(new Date());
wxCheckRecordDao.updateByPrimaryKey(wxCheckRecord);
}
if (!"pass".equals(result)) {
//审核不通过,redis记录并标记
if (WxCheckEnum.TypeEnum.SIGN_IN_IMAGE.getCode() == type || WxCheckEnum.TypeEnum.SIGN_IN_AUDIO.getCode() == type) {
QdUserSignInNote qdUserSignInNote = new QdUserSignInNote();
qdUserSignInNote.setId(sourceId);
qdUserSignInNote.setIsDeleted(true);
qdUserSignInNoteDao.updateByPrimaryKey(qdUserSignInNote);
} else if (WxCheckEnum.TypeEnum.USER_AVATAR.getCode() == type) {
QdUser qdUser = new QdUser();
qdUser.setId(sourceId);
qdUser.setAvatar(CommConsts.QIANDAO_DEFAULT_AVATAR_URL);
qdUserDao.updateById(qdUser);
} else if (WxCheckEnum.TypeEnum.USER_TASK.getCode() == type) {
signInTaskDao.delete(sourceId);
}
String key = CommConsts.QIANDAO_CHECK_RESULT_KEY + userId;
redisUtils.set(key, result);
}
logger.info("微信内容安全审核异步通知原文:{}", noticeStr);
} catch (Exception e) {
logger.error("微信公众号通知回调接口 error : {}", e);
} finally {
if (output != null) {
try {
output.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
if (input != null) {
try {
input.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
return "success"; return "success";
} }
......
...@@ -199,4 +199,15 @@ public class QdHomePageServiceImpl implements QdHomePageService { ...@@ -199,4 +199,15 @@ public class QdHomePageServiceImpl implements QdHomePageService {
} }
return Result.failed(); return Result.failed();
} }
@Override
public Result check(QdUserSignInRequestDto dto) {
String key = CommConsts.QIANDAO_CHECK_RESULT_KEY + dto.getUserId();
if (redisUtils.hasKey(key)) {
redisUtils.delete(key);
return Result.failed();
}
return Result.success();
}
} }
...@@ -4,22 +4,22 @@ import com.github.pagehelper.PageInfo; ...@@ -4,22 +4,22 @@ import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.api.qiandao.QdWxAppletApi; import com.wwdz.ch.core.api.qiandao.QdWxAppletApi;
import com.wwdz.ch.core.consts.CommConsts; import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.qiandao.SignInTaskEnum; import com.wwdz.ch.core.consts.qiandao.SignInTaskEnum;
import com.wwdz.ch.core.consts.qiandao.WxCheckEnum;
import com.wwdz.ch.core.entity.WxCheckMediaRequestDto; import com.wwdz.ch.core.entity.WxCheckMediaRequestDto;
import com.wwdz.ch.core.type.PageSearchResult; import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.qiandao.QdUserDao; import com.wwdz.ch.db.dao.qiandao.*;
import com.wwdz.ch.db.dao.qiandao.QdUserSignInDao;
import com.wwdz.ch.db.dao.qiandao.QdUserSignInTaskDao;
import com.wwdz.ch.db.dao.qiandao.SignInTaskDao;
import com.wwdz.ch.db.domain.qiandao.QdUser; import com.wwdz.ch.db.domain.qiandao.QdUser;
import com.wwdz.ch.db.domain.qiandao.QdUserSignIn; import com.wwdz.ch.db.domain.qiandao.QdUserSignIn;
import com.wwdz.ch.db.domain.qiandao.SignInTask; import com.wwdz.ch.db.domain.qiandao.SignInTask;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecord;
import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInTaskRequestDto; import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInTaskRequestDto;
import com.wwdz.ch.db.dto.request.qiandao.SignInTaskRequestDto; import com.wwdz.ch.db.dto.request.qiandao.SignInTaskRequestDto;
import com.wwdz.ch.wx.entity.vo.qiandao.SignInTaskVo; import com.wwdz.ch.wx.entity.vo.qiandao.SignInTaskVo;
import com.wwdz.ch.wx.service.qiandao.QdSignInTaskService; import com.wwdz.ch.wx.service.qiandao.QdSignInTaskService;
import com.wwdz.ch.wx.service.qiandao.QdUserSignInTaskService; import com.wwdz.ch.wx.service.qiandao.QdUserSignInTaskService;
import com.xxdxxs.utils.EntityMapper; import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.utils.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -59,6 +59,9 @@ public class QdSignInTaskServiceImpl implements QdSignInTaskService { ...@@ -59,6 +59,9 @@ public class QdSignInTaskServiceImpl implements QdSignInTaskService {
@Autowired @Autowired
QdWxAppletApi qdWxAppletApi; QdWxAppletApi qdWxAppletApi;
@Autowired
WxCheckRecordDao wxCheckRecordDao;
@Override @Override
public Result add(SignInTaskRequestDto dto) { public Result add(SignInTaskRequestDto dto) {
try { try {
...@@ -97,6 +100,24 @@ public class QdSignInTaskServiceImpl implements QdSignInTaskService { ...@@ -97,6 +100,24 @@ public class QdSignInTaskServiceImpl implements QdSignInTaskService {
return Result.failed("创建任务后默认加入失败"); return Result.failed("创建任务后默认加入失败");
} }
} }
if (StringUtils.hasLength(dto.getImage())) {
//微信音频内容安全识别
wxCheckMediaRequestDto.setMediaType(2);
wxCheckMediaRequestDto.setMediaUrl(dto.getImage());
String traceId = qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
if (StringUtils.hasLength(traceId)) {
//保存该检测任务
WxCheckRecord wxCheckRecord = new WxCheckRecord();
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSourceId(taskId);
wxCheckRecord.setUserId(dto.getCreatorId());
wxCheckRecord.setCreateTime(new Date());
wxCheckRecord.setType(WxCheckEnum.TypeEnum.SIGN_IN_IMAGE.getCode());
wxCheckRecordDao.insert(wxCheckRecord);
}
logger.info("=========== 微信图片内容安全识别接口调用成功 ===========");
}
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
logger.error("创建签到任务失败 error:{}", e); logger.error("创建签到任务失败 error:{}", e);
......
...@@ -6,6 +6,7 @@ import com.wwdz.ch.core.api.WxAppletApi; ...@@ -6,6 +6,7 @@ import com.wwdz.ch.core.api.WxAppletApi;
import com.wwdz.ch.core.api.qiandao.QdWxAppletApi; import com.wwdz.ch.core.api.qiandao.QdWxAppletApi;
import com.wwdz.ch.core.api.qiandao.QdWxLoginManager; import com.wwdz.ch.core.api.qiandao.QdWxLoginManager;
import com.wwdz.ch.core.consts.CommConsts; import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.qiandao.WxCheckEnum;
import com.wwdz.ch.core.entity.QdUserInfo; import com.wwdz.ch.core.entity.QdUserInfo;
import com.wwdz.ch.core.entity.WxCheckMediaRequestDto; import com.wwdz.ch.core.entity.WxCheckMediaRequestDto;
import com.wwdz.ch.core.notify.AliSmsSender; import com.wwdz.ch.core.notify.AliSmsSender;
...@@ -16,7 +17,9 @@ import com.wwdz.ch.core.type.Result; ...@@ -16,7 +17,9 @@ import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.*; import com.wwdz.ch.core.util.*;
import com.wwdz.ch.core.util.bcrypt.BCryptPasswordEncoder; import com.wwdz.ch.core.util.bcrypt.BCryptPasswordEncoder;
import com.wwdz.ch.db.dao.qiandao.QdUserDao; import com.wwdz.ch.db.dao.qiandao.QdUserDao;
import com.wwdz.ch.db.dao.qiandao.WxCheckRecordDao;
import com.wwdz.ch.db.domain.qiandao.QdUser; import com.wwdz.ch.db.domain.qiandao.QdUser;
import com.wwdz.ch.db.domain.qiandao.WxCheckRecord;
import com.wwdz.ch.db.dto.request.qiandao.QdUserRequestDto; import com.wwdz.ch.db.dto.request.qiandao.QdUserRequestDto;
import com.wwdz.ch.wx.constant.CacheCodeConstants; import com.wwdz.ch.wx.constant.CacheCodeConstants;
import com.wwdz.ch.wx.dao.UserInfo; import com.wwdz.ch.wx.dao.UserInfo;
...@@ -90,6 +93,9 @@ public class QdUserServiceImpl implements QdUserService { ...@@ -90,6 +93,9 @@ public class QdUserServiceImpl implements QdUserService {
@Autowired @Autowired
QdWxAppletApi qdWxAppletApi; QdWxAppletApi qdWxAppletApi;
@Autowired
WxCheckRecordDao wxCheckRecordDao;
@Override @Override
public Result regCaptcha(QdUserRequestDto dto) { public Result regCaptcha(QdUserRequestDto dto) {
try { try {
...@@ -289,14 +295,19 @@ public class QdUserServiceImpl implements QdUserService { ...@@ -289,14 +295,19 @@ public class QdUserServiceImpl implements QdUserService {
wxCheckMediaRequestDto.setMediaType(2); wxCheckMediaRequestDto.setMediaType(2);
wxCheckMediaRequestDto.setMediaUrl(dto.getAvatar()); wxCheckMediaRequestDto.setMediaUrl(dto.getAvatar());
wxCheckMediaRequestDto.setWxOpenId(user.getWxOpenid()); wxCheckMediaRequestDto.setWxOpenId(user.getWxOpenid());
qdWxAppletApi.checkMedia(wxCheckMediaRequestDto); String traceId = qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
if (com.xxdxxs.utils.StringUtils.hasLength(traceId)) {
//保存该检测任务
WxCheckRecord wxCheckRecord = new WxCheckRecord();
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSourceId(user.getId());
wxCheckRecord.setUserId(user.getId());
wxCheckRecord.setCreateTime(new Date());
wxCheckRecord.setType(WxCheckEnum.TypeEnum.SIGN_IN_IMAGE.getCode());
wxCheckRecordDao.insert(wxCheckRecord);
}
logger.info("=========== 微信图片内容安全识别接口调用成功 ==========="); logger.info("=========== 微信图片内容安全识别接口调用成功 ===========");
} }
String key = dto.getUserId() + "_updateAvatar";
if (!redisUtils.hasKey(key)) {
redisUtils.set(key, key, 30);
return Result.failed("头像安全检测有风险,请更换");
}
user.setAvatar(dto.getAvatar()); user.setAvatar(dto.getAvatar());
qdUserDao.updateById(user); qdUserDao.updateById(user);
// 更新用户缓存 // 更新用户缓存
......
package com.wwdz.ch.wx.impl.qiandao; package com.wwdz.ch.wx.impl.qiandao;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.api.qiandao.QdWxAppletApi;
import com.wwdz.ch.core.consts.qiandao.WxCheckEnum;
import com.wwdz.ch.core.entity.WxCheckMediaRequestDto;
import com.wwdz.ch.core.type.PageSearchResult; import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.db.dao.qiandao.*; import com.wwdz.ch.db.dao.qiandao.*;
import com.wwdz.ch.db.domain.qiandao.QdUser; import com.wwdz.ch.db.domain.qiandao.*;
import com.wwdz.ch.db.domain.qiandao.QdUserSignIn;
import com.wwdz.ch.db.domain.qiandao.QdUserSignInNote;
import com.wwdz.ch.db.domain.qiandao.SignInTask;
import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInNoteRequestDto; import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInNoteRequestDto;
import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInRequestDto; import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInRequestDto;
import com.wwdz.ch.wx.entity.vo.qiandao.QdSignInNoteVo; import com.wwdz.ch.wx.entity.vo.qiandao.QdSignInNoteVo;
...@@ -19,6 +20,7 @@ import org.slf4j.Logger; ...@@ -19,6 +20,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -49,6 +51,15 @@ public class QdUserSignInNoteServiceImpl implements QdUserSignInNoteService { ...@@ -49,6 +51,15 @@ public class QdUserSignInNoteServiceImpl implements QdUserSignInNoteService {
@Autowired @Autowired
QdGiveLikeRecordDao qdGiveLikeRecordDao; QdGiveLikeRecordDao qdGiveLikeRecordDao;
@Autowired
QdWxAppletApi qdWxAppletApi;
@Autowired
RedisUtils redisUtils;
@Autowired
WxCheckRecordDao wxCheckRecordDao;
@Override @Override
public Result findSignInNoteList(QdUserSignInNoteRequestDto dto) { public Result findSignInNoteList(QdUserSignInNoteRequestDto dto) {
try { try {
...@@ -173,6 +184,10 @@ public class QdUserSignInNoteServiceImpl implements QdUserSignInNoteService { ...@@ -173,6 +184,10 @@ public class QdUserSignInNoteServiceImpl implements QdUserSignInNoteService {
@Override @Override
public Result update(QdUserSignInRequestDto dto) { public Result update(QdUserSignInRequestDto dto) {
try { try {
QdUserSignInNote note = qdUserSignInNoteDao.findByNoteId(dto.getId());
long sourceId = dto.getId();
long userId = note.getUserId();
//保存签到笔记 //保存签到笔记
QdUserSignInNote qdUserSignInNote = new QdUserSignInNote(); QdUserSignInNote qdUserSignInNote = new QdUserSignInNote();
qdUserSignInNote.setId(dto.getId()); qdUserSignInNote.setId(dto.getId());
...@@ -184,6 +199,52 @@ public class QdUserSignInNoteServiceImpl implements QdUserSignInNoteService { ...@@ -184,6 +199,52 @@ public class QdUserSignInNoteServiceImpl implements QdUserSignInNoteService {
qdUserSignInNote.setUpdateTime(new Date()); qdUserSignInNote.setUpdateTime(new Date());
qdUserSignInNote.setIsPrivate(dto.getIsPrivate()); qdUserSignInNote.setIsPrivate(dto.getIsPrivate());
qdUserSignInNoteDao.updateByPrimaryKey(qdUserSignInNote); qdUserSignInNoteDao.updateByPrimaryKey(qdUserSignInNote);
WxCheckMediaRequestDto wxCheckMediaRequestDto = new WxCheckMediaRequestDto();
QdUser user = qdUserDao.queryById(dto.getUserId());
wxCheckMediaRequestDto.setWxOpenId(user.getWxOpenid());
if (StringUtils.hasLength(dto.getContent())) {
//查询用户openid
wxCheckMediaRequestDto.setWordStr(dto.getContent());
boolean result = qdWxAppletApi.checkWord(wxCheckMediaRequestDto);
logger.info("=========== 微信文字内容安全识别接口调用成功 ===========");
if (!result) {
return Result.failed("发布的文字内容识别有风险,不可发布");
}
}
if (!CollectionUtils.isEmpty(dto.getImages())) {
//微信音频内容安全识别
wxCheckMediaRequestDto.setMediaType(2);
wxCheckMediaRequestDto.setMediaUrl(dto.getImages().get(0));
String traceId = qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
if (StringUtils.hasLength(traceId)) {
//保存该检测任务
WxCheckRecord wxCheckRecord = new WxCheckRecord();
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSourceId(sourceId);
wxCheckRecord.setUserId(userId);
wxCheckRecord.setCreateTime(new Date());
wxCheckRecord.setType(WxCheckEnum.TypeEnum.SIGN_IN_IMAGE.getCode());
wxCheckRecordDao.insert(wxCheckRecord);
}
logger.info("=========== 微信图片内容安全识别接口调用成功 ===========");
}
if (!StringUtils.isEmpty(dto.getAudio())) {
wxCheckMediaRequestDto.setMediaType(1);
wxCheckMediaRequestDto.setMediaUrl(dto.getAudio());
String traceId = qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
if (StringUtils.hasLength(traceId)) {
//保存该检测任务
WxCheckRecord wxCheckRecord = new WxCheckRecord();
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSourceId(sourceId);
wxCheckRecord.setUserId(userId);
wxCheckRecord.setCreateTime(new Date());
wxCheckRecord.setType(WxCheckEnum.TypeEnum.SIGN_IN_AUDIO.getCode());
wxCheckRecordDao.insert(wxCheckRecord);
}
logger.info("=========== 微信音频内容安全识别接口调用成功 ===========");
}
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
logger.error("修改笔记 error:{}", e); logger.error("修改笔记 error:{}", e);
......
...@@ -7,6 +7,7 @@ import com.wwdz.ch.core.consts.CommConsts; ...@@ -7,6 +7,7 @@ import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.consts.SigninEnum; import com.wwdz.ch.core.consts.SigninEnum;
import com.wwdz.ch.core.consts.qiandao.SignInTaskEnum; import com.wwdz.ch.core.consts.qiandao.SignInTaskEnum;
import com.wwdz.ch.core.consts.qiandao.WxCheckEnum;
import com.wwdz.ch.core.entity.WxCheckMediaRequestDto; import com.wwdz.ch.core.entity.WxCheckMediaRequestDto;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.IdUtils; import com.wwdz.ch.core.util.IdUtils;
...@@ -15,13 +16,11 @@ import com.wwdz.ch.db.dao.distribution.DistributionOrderDao; ...@@ -15,13 +16,11 @@ import com.wwdz.ch.db.dao.distribution.DistributionOrderDao;
import com.wwdz.ch.db.dao.qiandao.*; import com.wwdz.ch.db.dao.qiandao.*;
import com.wwdz.ch.db.domain.User; import com.wwdz.ch.db.domain.User;
import com.wwdz.ch.db.domain.distribution.DistributionOrder; import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.qiandao.QdUser; import com.wwdz.ch.db.domain.qiandao.*;
import com.wwdz.ch.db.domain.qiandao.QdUserSignIn;
import com.wwdz.ch.db.domain.qiandao.QdUserSignInNote;
import com.wwdz.ch.db.domain.qiandao.SignInTask;
import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInRequestDto; import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInRequestDto;
import com.wwdz.ch.wx.service.qiandao.QdUserSignInService; import com.wwdz.ch.wx.service.qiandao.QdUserSignInService;
import com.xxdxxs.utils.DateUtils; import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -69,6 +68,9 @@ public class QdUserSignInServiceImpl implements QdUserSignInService { ...@@ -69,6 +68,9 @@ public class QdUserSignInServiceImpl implements QdUserSignInService {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired
WxCheckRecordDao wxCheckRecordDao;
@Override @Override
public Result check(QdUserSignInRequestDto dto) { public Result check(QdUserSignInRequestDto dto) {
try { try {
...@@ -143,24 +145,14 @@ public class QdUserSignInServiceImpl implements QdUserSignInService { ...@@ -143,24 +145,14 @@ public class QdUserSignInServiceImpl implements QdUserSignInService {
//查询用户openid //查询用户openid
QdUser user = qdUserDao.queryById(dto.getUserId()); QdUser user = qdUserDao.queryById(dto.getUserId());
wxCheckMediaRequestDto.setWxOpenId(user.getWxOpenid()); wxCheckMediaRequestDto.setWxOpenId(user.getWxOpenid());
if (!CollectionUtils.isEmpty(dto.getImages())) {
//微信音频内容安全识别
wxCheckMediaRequestDto.setMediaType(2);
wxCheckMediaRequestDto.setMediaUrl(dto.getImages().get(0));
qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
logger.info("=========== 微信音频内容安全识别接口调用成功 ===========");
String key = dto.getUserId() + "_signIn";
if (!redisUtils.hasKey(key)) {
redisUtils.set(key, key, 30);
return Result.failed("图片安全检测有风险,请更换");
}
}
wxCheckMediaRequestDto.setWordStr(dto.getContent()); if (StringUtils.hasLength(dto.getContent())) {
boolean result = qdWxAppletApi.checkWord(wxCheckMediaRequestDto); wxCheckMediaRequestDto.setWordStr(dto.getContent());
logger.info("=========== 微信文字内容安全识别接口调用成功 ==========="); boolean result = qdWxAppletApi.checkWord(wxCheckMediaRequestDto);
if (!result) { logger.info("=========== 微信文字内容安全识别接口调用成功 ===========");
return Result.failed("发布的文字内容识别有风险,不可发布"); if (!result) {
return Result.failed("发布的文字内容识别有风险,不可发布");
}
} }
//签到记录id //签到记录id
Long recordId = null; Long recordId = null;
...@@ -211,7 +203,41 @@ public class QdUserSignInServiceImpl implements QdUserSignInService { ...@@ -211,7 +203,41 @@ public class QdUserSignInServiceImpl implements QdUserSignInService {
qdUserSignInNote.setUpdateTime(now); qdUserSignInNote.setUpdateTime(now);
qdUserSignInNote.setIsPrivate(dto.getIsPrivate()); qdUserSignInNote.setIsPrivate(dto.getIsPrivate());
qdUserSignInNote.setIsDeleted(false); qdUserSignInNote.setIsDeleted(false);
qdUserSignInNoteDao.insert(qdUserSignInNote); long id = qdUserSignInNoteDao.insert(qdUserSignInNote);
if (!CollectionUtils.isEmpty(dto.getImages())) {
//微信音频内容安全识别
wxCheckMediaRequestDto.setMediaType(2);
wxCheckMediaRequestDto.setMediaUrl(dto.getImages().get(0));
String traceId = qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
if (StringUtils.hasLength(traceId)) {
//保存该检测任务
WxCheckRecord wxCheckRecord = new WxCheckRecord();
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSourceId(id);
wxCheckRecord.setUserId(userId);
wxCheckRecord.setCreateTime(new Date());
wxCheckRecord.setType(WxCheckEnum.TypeEnum.SIGN_IN_IMAGE.getCode());
wxCheckRecordDao.insert(wxCheckRecord);
}
logger.info("=========== 微信图片内容安全识别接口调用成功 ===========");
}
if (!StringUtils.isEmpty(dto.getAudio())) {
wxCheckMediaRequestDto.setMediaType(1);
wxCheckMediaRequestDto.setMediaUrl(dto.getAudio());
String traceId = qdWxAppletApi.checkMedia(wxCheckMediaRequestDto);
if (StringUtils.hasLength(traceId)) {
//保存该检测任务
WxCheckRecord wxCheckRecord = new WxCheckRecord();
wxCheckRecord.setTraceId(traceId);
wxCheckRecord.setSourceId(id);
wxCheckRecord.setUserId(userId);
wxCheckRecord.setCreateTime(new Date());
wxCheckRecord.setType(WxCheckEnum.TypeEnum.SIGN_IN_AUDIO.getCode());
wxCheckRecordDao.insert(wxCheckRecord);
}
logger.info("=========== 微信音频内容安全识别接口调用成功 ===========");
}
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
logger.error("乾岛签到失败 error:{}", e); logger.error("乾岛签到失败 error:{}", e);
......
...@@ -35,4 +35,11 @@ public interface QdHomePageService { ...@@ -35,4 +35,11 @@ public interface QdHomePageService {
* @return * @return
*/ */
Result getShareInfo(QdUserSignInRequestDto dto); Result getShareInfo(QdUserSignInRequestDto dto);
/**
* 检测是否有内容安全检测不通过的情况给予提示
* @param dto
* @return
*/
Result check(QdUserSignInRequestDto dto);
} }
...@@ -66,4 +66,18 @@ public class QdHomePageController { ...@@ -66,4 +66,18 @@ public class QdHomePageController {
return qdHomePageService.getShareInfo(dto); return qdHomePageService.getShareInfo(dto);
} }
@ApiOperation(value = "检测是否有内容安全检测不通过的情况给予提示")
@PostMapping("/check")
public Result check(@RequestBody QdUserSignInRequestDto dto) {
logger.info("【请求开始】检测是否有内容安全检测不通过的情况给予提示,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("userId", "用户id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return qdHomePageService.check(dto);
}
} }
...@@ -89,12 +89,12 @@ public class WxPayServiceTest { ...@@ -89,12 +89,12 @@ public class WxPayServiceTest {
@Test @Test
public void refund() { public void refund() {
List<String> list = Arrays.asList("DA2412231422109063526"); List<String> list = Arrays.asList("DA2501081948572456638");
list.forEach(orderId ->{ list.forEach(orderId ->{
DistributionOrderRequestDto dto = new DistributionOrderRequestDto(); DistributionOrderRequestDto dto = new DistributionOrderRequestDto();
dto.setDistributionOrderId(orderId); dto.setDistributionOrderId(orderId);
dto.setAmount("10"); dto.setAmount("128");
dto.setRefundPrice("10"); dto.setRefundPrice("128");
Result result = wxPayServiceApi.refund(dto); Result result = wxPayServiceApi.refund(dto);
logger.info("申请微信支付退款:{}", result); logger.info("申请微信支付退款:{}", result);
}); });
......
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