提交修改
This commit is contained in:
parent
13fc3585de
commit
34d7a700ff
@ -59,6 +59,7 @@ public class ApiConstants {
|
||||
* 任务调度参数key
|
||||
*/
|
||||
public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
|
||||
public static Integer warning_flag = 500;
|
||||
|
||||
|
||||
/**
|
||||
@ -318,5 +319,8 @@ public class ApiConstants {
|
||||
*/
|
||||
public static final String third = "third";
|
||||
|
||||
public static final String IDCARD_VERIFICATION_TENCENT = "idcard_verification_tencent";
|
||||
public static final String IDCARD_VERIFICATION_THIRD = "idcard_verification_third";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -7,9 +7,11 @@ package com.heyu.api.data.dao.api;
|
||||
* @author quyixiao
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
import com.heyu.api.data.entity.api.ApiIdCardEntity;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.heyu.api.data.entity.api.ApiIdCardEntity;
|
||||
import com.lz.mybatis.plugin.annotations.LIMIT;
|
||||
import com.lz.mybatis.plugin.annotations.Plus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
@ -39,5 +41,5 @@ public interface ApiIdCardDao extends BaseMapper<ApiIdCardEntity> {
|
||||
|
||||
|
||||
|
||||
int updateApiIdCardUseCountById(Long useCount, Long id);
|
||||
int updateApiIdCardUseCountById(@Plus Long useCount, Long id);
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.heyu.api.data.dao.api;
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
import com.heyu.api.data.entity.api.ApiRechargeMoneyEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.mybatis.plugin.annotations.By;
|
||||
import com.lz.mybatis.plugin.annotations.LIMIT;
|
||||
import com.lz.mybatis.plugin.annotations.Sub;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface ApiRechargeMoneyDao extends BaseMapper<ApiRechargeMoneyEntity> {
|
||||
|
||||
|
||||
ApiRechargeMoneyEntity selectApiRechargeMoneyById(@Param("id")Long id);
|
||||
|
||||
|
||||
Long insertApiRechargeMoney(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
Long insertOrUpdateApiRechargeMoney(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
int updateApiRechargeMoneyById(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
int updateCoverApiRechargeMoneyById(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
int deleteApiRechargeMoneyById(@Param("id") Long id);
|
||||
|
||||
|
||||
@LIMIT
|
||||
ApiRechargeMoneyEntity selectApiRechargeMoneyByScene(String scene);
|
||||
|
||||
int updateApiRechargeMoneyByScene(@Sub Integer currentCount,@By String scene);
|
||||
}
|
||||
@ -0,0 +1,277 @@
|
||||
package com.heyu.api.data.entity.api;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
/**
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("api_recharge_money")
|
||||
public class ApiRechargeMoneyEntity implements java.io.Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public final static String CLASS_NAME ="com.heyu.api.data.entity.api.ApiRechargeMoneyEntity:";
|
||||
|
||||
public final static String all = CLASS_NAME + "*";
|
||||
public final static String id_ = CLASS_NAME + "id"; // 主键id
|
||||
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||
public final static String uri_ = CLASS_NAME + "uri"; // 哪个url 使用了
|
||||
public final static String class_info = CLASS_NAME + "class_info"; // 对应哪个类
|
||||
public final static String scene_ = CLASS_NAME + "scene"; // 哪种场景使用
|
||||
public final static String all_recharge_money = CLASS_NAME + "all_recharge_money"; // 总充值金额
|
||||
public final static String all_recharge_count = CLASS_NAME + "all_recharge_count"; // 次数
|
||||
public final static String current_count = CLASS_NAME + "current_count"; // 当前次数
|
||||
public final static String api_url = CLASS_NAME + "api_url"; // api 应对的url
|
||||
public final static String recharge_page_url = CLASS_NAME + "recharge_page_url"; // 充值页面url
|
||||
public final static String scene_name = CLASS_NAME + "scene_name"; // 场景名称
|
||||
//主键id
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
//是否删除:0 否 1 删除
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//修改时间
|
||||
private Date modifyTime;
|
||||
//哪个url 使用了
|
||||
private String uri;
|
||||
//对应哪个类
|
||||
private String classInfo;
|
||||
//哪种场景使用
|
||||
private String scene;
|
||||
//总充值金额
|
||||
private BigDecimal allRechargeMoney;
|
||||
//次数g
|
||||
private Long allRechargeCount;
|
||||
//当前次数
|
||||
private Integer currentCount;
|
||||
//api 应对的url
|
||||
private String apiUrl;
|
||||
//充值页面url
|
||||
private String rechargePageUrl;
|
||||
//场景名称
|
||||
private String sceneName;
|
||||
/**
|
||||
* 主键id
|
||||
* @return
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 主键id
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否删除:0 否 1 删除
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
/**
|
||||
* 是否删除:0 否 1 删除
|
||||
* @param isDelete
|
||||
*/
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
* @return
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
/**
|
||||
* 创建时间
|
||||
* @param createTime
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
* @return
|
||||
*/
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
/**
|
||||
* 修改时间
|
||||
* @param modifyTime
|
||||
*/
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 哪个url 使用了
|
||||
* @return
|
||||
*/
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
/**
|
||||
* 哪个url 使用了
|
||||
* @param uri
|
||||
*/
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应哪个类
|
||||
* @return
|
||||
*/
|
||||
public String getClassInfo() {
|
||||
return classInfo;
|
||||
}
|
||||
/**
|
||||
* 对应哪个类
|
||||
* @param classInfo
|
||||
*/
|
||||
public void setClassInfo(String classInfo) {
|
||||
this.classInfo = classInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 哪种场景使用
|
||||
* @return
|
||||
*/
|
||||
public String getScene() {
|
||||
return scene;
|
||||
}
|
||||
/**
|
||||
* 哪种场景使用
|
||||
* @param scene
|
||||
*/
|
||||
public void setScene(String scene) {
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
/**
|
||||
* 总充值金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getAllRechargeMoney() {
|
||||
return allRechargeMoney;
|
||||
}
|
||||
/**
|
||||
* 总充值金额
|
||||
* @param allRechargeMoney
|
||||
*/
|
||||
public void setAllRechargeMoney(BigDecimal allRechargeMoney) {
|
||||
this.allRechargeMoney = allRechargeMoney;
|
||||
}
|
||||
|
||||
/**
|
||||
* 次数
|
||||
* @return
|
||||
*/
|
||||
public Long getAllRechargeCount() {
|
||||
return allRechargeCount;
|
||||
}
|
||||
/**
|
||||
* 次数
|
||||
* @param allRechargeCount
|
||||
*/
|
||||
public void setAllRechargeCount(Long allRechargeCount) {
|
||||
this.allRechargeCount = allRechargeCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前次数
|
||||
* @return
|
||||
*/
|
||||
public Integer getCurrentCount() {
|
||||
return currentCount;
|
||||
}
|
||||
/**
|
||||
* 当前次数
|
||||
* @param currentCount
|
||||
*/
|
||||
public void setCurrentCount(Integer currentCount) {
|
||||
this.currentCount = currentCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* api 应对的url
|
||||
* @return
|
||||
*/
|
||||
public String getApiUrl() {
|
||||
return apiUrl;
|
||||
}
|
||||
/**
|
||||
* api 应对的url
|
||||
* @param apiUrl
|
||||
*/
|
||||
public void setApiUrl(String apiUrl) {
|
||||
this.apiUrl = apiUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值页面url
|
||||
* @return
|
||||
*/
|
||||
public String getRechargePageUrl() {
|
||||
return rechargePageUrl;
|
||||
}
|
||||
/**
|
||||
* 充值页面url
|
||||
* @param rechargePageUrl
|
||||
*/
|
||||
public void setRechargePageUrl(String rechargePageUrl) {
|
||||
this.rechargePageUrl = rechargePageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场景名称
|
||||
* @return
|
||||
*/
|
||||
public String getSceneName() {
|
||||
return sceneName;
|
||||
}
|
||||
/**
|
||||
* 场景名称
|
||||
* @param sceneName
|
||||
*/
|
||||
public void setSceneName(String sceneName) {
|
||||
this.sceneName = sceneName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApiRechargeMoneyEntity{" +
|
||||
",id=" + id +
|
||||
",isDelete=" + isDelete +
|
||||
",createTime=" + createTime +
|
||||
",modifyTime=" + modifyTime +
|
||||
",uri=" + uri +
|
||||
",classInfo=" + classInfo +
|
||||
",scene=" + scene +
|
||||
",allRechargeMoney=" + allRechargeMoney +
|
||||
",allRechargeCount=" + allRechargeCount +
|
||||
",currentCount=" + currentCount +
|
||||
",apiUrl=" + apiUrl +
|
||||
",rechargePageUrl=" + rechargePageUrl +
|
||||
",sceneName=" + sceneName +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.heyu.api.data.service.api;
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.heyu.api.data.entity.api.ApiRechargeMoneyEntity;
|
||||
public interface ApiRechargeMoneyService extends IService<ApiRechargeMoneyEntity> {
|
||||
|
||||
|
||||
|
||||
ApiRechargeMoneyEntity selectApiRechargeMoneyById(Long id);
|
||||
|
||||
|
||||
Long insertApiRechargeMoney(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
Long insertOrUpdateApiRechargeMoney(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
int updateApiRechargeMoneyById(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
int updateCoverApiRechargeMoneyById(ApiRechargeMoneyEntity apiRechargeMoney);
|
||||
|
||||
|
||||
int deleteApiRechargeMoneyById(Long id);
|
||||
|
||||
|
||||
void addUseCountAndSendWarnMsg(String idcardVerificationTencent, int count);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.heyu.api.data.service.impl.api;
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2025-04-16
|
||||
*/
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.heyu.api.data.constants.ApiConstants;
|
||||
import com.heyu.api.data.dao.api.ApiRechargeMoneyDao;
|
||||
import com.heyu.api.data.entity.api.ApiRechargeMoneyEntity;
|
||||
import com.heyu.api.data.service.api.ApiRechargeMoneyService;
|
||||
import com.heyu.api.data.utils.DingDingUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class ApiRechargeMoneyServiceImpl extends ServiceImpl<ApiRechargeMoneyDao, ApiRechargeMoneyEntity> implements ApiRechargeMoneyService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ApiRechargeMoneyDao apiRechargeMoneyDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ApiRechargeMoneyEntity selectApiRechargeMoneyById(Long id){
|
||||
return apiRechargeMoneyDao.selectApiRechargeMoneyById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertApiRechargeMoney(ApiRechargeMoneyEntity apiRechargeMoney){
|
||||
return apiRechargeMoneyDao.insertApiRechargeMoney(apiRechargeMoney);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertOrUpdateApiRechargeMoney(ApiRechargeMoneyEntity apiRechargeMoney){
|
||||
return apiRechargeMoneyDao.insertOrUpdateApiRechargeMoney(apiRechargeMoney);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateApiRechargeMoneyById(ApiRechargeMoneyEntity apiRechargeMoney){
|
||||
return apiRechargeMoneyDao.updateApiRechargeMoneyById(apiRechargeMoney);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverApiRechargeMoneyById(ApiRechargeMoneyEntity apiRechargeMoney) {
|
||||
return apiRechargeMoneyDao.updateCoverApiRechargeMoneyById(apiRechargeMoney);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteApiRechargeMoneyById(Long id) {
|
||||
return apiRechargeMoneyDao.deleteApiRechargeMoneyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addUseCountAndSendWarnMsg(String scene, int count) {
|
||||
ApiRechargeMoneyEntity apiRechargeMoney = apiRechargeMoneyDao.selectApiRechargeMoneyByScene(scene);
|
||||
if (apiRechargeMoney.getCurrentCount() <= ApiConstants.warning_flag) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(apiRechargeMoney.getSceneName()).append("\n")
|
||||
.append("当前预警域值:").append(ApiConstants.warning_flag).append("\n")
|
||||
.append("当前剩余次数:").append(apiRechargeMoney.getCurrentCount()).append("\n")
|
||||
.append("api 对应的url:").append(apiRechargeMoney.getApiUrl()).append("\n")
|
||||
.append("充值页面url:").append(apiRechargeMoney.getRechargePageUrl()).append("\n")
|
||||
;
|
||||
|
||||
DingDingUtils.sendText(sb.toString());
|
||||
|
||||
}
|
||||
apiRechargeMoneyDao.updateApiRechargeMoneyByScene(count, scene);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package com.heyu.api.data.utils;
|
||||
|
||||
|
||||
import com.dingtalk.api.DefaultDingTalkClient;
|
||||
import com.dingtalk.api.DingTalkClient;
|
||||
import com.dingtalk.api.request.OapiRobotSendRequest;
|
||||
import com.dingtalk.api.response.OapiRobotSendResponse;
|
||||
import com.lz.mybatis.plugins.interceptor.entity.DingTalkDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/***
|
||||
* https://oapi.dingtalk.com/robot/send?access_token=4e9917f5f782cec0bf139ac867b95c64b9c8bcd71266f334905f5196d9828314
|
||||
*/
|
||||
@Slf4j
|
||||
public class DingDingUtils {
|
||||
|
||||
|
||||
protected static String dingTalkUrlPre = "https://oapi.dingtalk.com/robot/send?access_token=";
|
||||
protected static String token = "4e9917f5f782cec0bf139ac867b95c64b9c8bcd71266f334905f5196d9828314";
|
||||
|
||||
|
||||
|
||||
|
||||
public static void sendText(String text) {
|
||||
try {
|
||||
String content = text + "\n";
|
||||
content = "【告警】:"
|
||||
+ "\n" + content;
|
||||
DingTalkDto dingTalk = new DingTalkDto();
|
||||
dingTalk.setToken("");
|
||||
dingTalk.setText(content);
|
||||
dingTalk.setTitle("赶快充钱");
|
||||
|
||||
dingTalk.setMsgType("text");
|
||||
process(dingTalk,token);
|
||||
} catch (Exception e) {
|
||||
log.error("DingDingUtils",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static OapiRobotSendResponse process(DingTalkDto dingTalk, String token ) throws Exception {
|
||||
DingTalkClient client = new DefaultDingTalkClient(dingTalkUrlPre + token);
|
||||
OapiRobotSendRequest request = new OapiRobotSendRequest();
|
||||
request.setMsgtype("text");
|
||||
|
||||
OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text();
|
||||
text.setContent(dingTalk.getText());
|
||||
request.setText(text);
|
||||
// 被@人的手机号(在text内容里要有@手机号)
|
||||
OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
|
||||
|
||||
String[] mobiles = "18969093321".split(",");
|
||||
|
||||
|
||||
if(StringUtils.isNotBlank(dingTalk.getAtMobiles())){
|
||||
mobiles = dingTalk.getAtMobiles().split(",");
|
||||
}
|
||||
at.setAtMobiles(Arrays.asList(mobiles));
|
||||
|
||||
request.setAt(at);
|
||||
OapiRobotSendResponse response = client.execute(request);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
sendText("ieoiew");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
<?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.heyu.api.data.dao.api.ApiRechargeMoneyDao">
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -93,7 +93,7 @@ public class MysqlMain_insert {
|
||||
System.out.println(MysqlMain_insert.save_path);
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
|
||||
list.add(new TablesBean("api_id_card"));
|
||||
list.add(new TablesBean("api_recharge_money"));
|
||||
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
|
||||
@ -33,10 +33,11 @@ public class MysqlMain_update {
|
||||
MysqlMain_insert.save_path = dir + "src/test/tmp";
|
||||
System.out.println(MysqlMain_insert.save_path);
|
||||
|
||||
String packageName = "activity";
|
||||
String packageName = "api";
|
||||
|
||||
MysqlMain_insert.initApi(packageName);
|
||||
|
||||
String entityPath = dir + "/src/main/java/com/linzi/pitpat/api/entity";
|
||||
String entityPath = dir + "/src/main/java/com/heyu/api/data/entity";
|
||||
List<String> resultFileName = new ArrayList<>();
|
||||
File file = new File(entityPath);
|
||||
MysqlMain_insert.ergodic(file, resultFileName);
|
||||
@ -46,7 +47,9 @@ public class MysqlMain_update {
|
||||
System.out.println(fileName);
|
||||
}
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
list.add(new TablesBean("zns_one_week_config"));
|
||||
list.add(new TablesBean("api_recharge_money"));
|
||||
|
||||
|
||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TablesBean obj = list.get(i);
|
||||
|
||||
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.heyu.api.data.constants.ApiConstants;
|
||||
import com.heyu.api.data.dao.api.ApiIdCardDao;
|
||||
import com.heyu.api.data.entity.api.ApiIdCardEntity;
|
||||
import com.heyu.api.data.service.api.ApiRechargeMoneyService;
|
||||
import com.heyu.api.data.utils.StringUtils;
|
||||
import com.heyu.api.tencent.TencentBaseHandle;
|
||||
import com.heyu.api.tencent.request.TTIdCardOCRVerificationRequest;
|
||||
@ -35,6 +36,10 @@ public class TIdCardOCRVerificationHandle extends TencentBaseHandle<TTIdCardOCRV
|
||||
@Autowired
|
||||
private ApiIdCardDao apiIdCardDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ApiRechargeMoneyService apiRechargeMoneyService;
|
||||
|
||||
@Override
|
||||
public String check(TTIdCardOCRVerificationRequest ttIdCardOCRVerificationRequest) {
|
||||
if (StringUtils.isNotBlank(ttIdCardOCRVerificationRequest.getIdCard())
|
||||
@ -119,6 +124,11 @@ public class TIdCardOCRVerificationHandle extends TencentBaseHandle<TTIdCardOCRV
|
||||
apiIdCardEntity.setEnableStatus(enable);
|
||||
apiIdCardEntity.setUseCount(1L);
|
||||
|
||||
|
||||
apiRechargeMoneyService.addUseCountAndSendWarnMsg(ApiConstants.IDCARD_VERIFICATION_TENCENT, 1);
|
||||
|
||||
|
||||
|
||||
apiIdCardDao.insertApiIdCard(apiIdCardEntity);
|
||||
|
||||
return resp;
|
||||
|
||||
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.heyu.api.data.constants.ApiConstants;
|
||||
import com.heyu.api.data.dao.api.ApiIdCardDao;
|
||||
import com.heyu.api.data.entity.api.ApiIdCardEntity;
|
||||
import com.heyu.api.data.service.api.ApiRechargeMoneyService;
|
||||
import com.heyu.api.data.utils.StringUtils;
|
||||
import com.heyu.api.tencent.TencentBaseHandle;
|
||||
import com.heyu.api.tencent.request.TTIdCardOCRVerificationRequest;
|
||||
@ -36,6 +37,9 @@ public class ThirdTIdCardVerificationHandle extends TencentBaseHandle<TTIdCardOC
|
||||
@Autowired
|
||||
private ApiIdCardDao apiIdCardDao;
|
||||
|
||||
@Autowired
|
||||
private ApiRechargeMoneyService apiRechargeMoneyService;
|
||||
|
||||
@Override
|
||||
public String check(TTIdCardOCRVerificationRequest ttIdCardOCRVerificationRequest) {
|
||||
if (StringUtils.isNotBlank(ttIdCardOCRVerificationRequest.getIdCard())
|
||||
@ -98,6 +102,11 @@ public class ThirdTIdCardVerificationHandle extends TencentBaseHandle<TTIdCardOC
|
||||
enable = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ApiIdCardEntity apiIdCardEntity = new ApiIdCardEntity();
|
||||
apiIdCardEntity.setIdCard(ap.getIdCard());
|
||||
apiIdCardEntity.setRealName(ap.getName());
|
||||
@ -106,6 +115,15 @@ public class ThirdTIdCardVerificationHandle extends TencentBaseHandle<TTIdCardOC
|
||||
apiIdCardEntity.setEnableStatus(enable);
|
||||
apiIdCardEntity.setUseCount(1L);
|
||||
apiIdCardDao.insertApiIdCard(apiIdCardEntity);
|
||||
|
||||
|
||||
|
||||
apiRechargeMoneyService.addUseCountAndSendWarnMsg(ApiConstants.IDCARD_VERIFICATION_THIRD, 1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user