Merge branch 'master' of https://chonggaoxiao:xcg523511090712@gitee.com/chonggaoxiao/new_excoin.git
11 files modified
2 files added
| | |
| | | import com.xcong.excoin.utils.OssUtils; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import com.xcong.excoin.utils.SmsUtils; |
| | | import com.xcong.excoin.utils.mail.Sms106Send; |
| | | import com.xcong.excoin.utils.mail.SmsSend; |
| | | import com.xcong.excoin.utils.mail.SubMailSend; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | // 发送手机验证码 |
| | | if (AppContants.ACCOUNT_TYPE_MOBILE.equals(type)) { |
| | | boolean result = SmsSend.sendVerifyCode(account, code.toString(), 2); |
| | | boolean result = Sms106Send.sendVerifyCode(account, code.toString(), 2); |
| | | if (result) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | boolean flag = redisUtils.set(AppContants.VERIFY_CODE_PREFIX + account, code, 120); |
| | |
| | | SecurityContextHolder.clearContext(); |
| | | } |
| | | } else { |
| | | log.info("token为空:{}", request.getRequestURI()); |
| | | // log.info("token为空:{}", request.getRequestURI()); |
| | | SecurityContextHolder.clearContext(); |
| | | } |
| | | } else { |
| | |
| | | if (verifyTokenExpired(Long.parseLong(tokens[1]))) { |
| | | return tokens[0]; |
| | | } else { |
| | | log.info("前面token为{}", tokens[0]); |
| | | log.info("时间为:{}, 当前时间为:{}", tokens[1], System.currentTimeMillis()); |
| | | // log.info("前面token为{}", tokens[0]); |
| | | // log.info("时间为:{}, 当前时间为:{}", tokens[1], System.currentTimeMillis()); |
| | | return AppContants.TIME_OUT; |
| | | } |
| | | } |
| | | log.info("bearerToken---->{}", bearerToken); |
| | | // log.info("bearerToken---->{}", bearerToken); |
| | | } catch (Exception e) { |
| | | log.error("#解析token异常#", e); |
| | | return null; |
| | |
| | | import com.xcong.excoin.utils.LogRecordUtils; |
| | | import com.xcong.excoin.utils.ThreadPoolUtils; |
| | | import com.xcong.excoin.utils.dingtalk.DingTalkUtils; |
| | | import com.xcong.excoin.utils.mail.SmsSend; |
| | | import com.xcong.excoin.utils.mail.Sms106Send; |
| | | import com.xcong.excoin.utils.mail.SubMailSend; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | if (StrUtil.isNotBlank(member.getPhone())) { |
| | | String amount = newBalance.toPlainString() + "USDT-ERC20"; |
| | | SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo); |
| | | Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | if (StrUtil.isNotBlank(member.getPhone())) { |
| | | String amount = newBalance.toPlainString() + "ETH"; |
| | | SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo); |
| | | Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | if (StrUtil.isNotBlank(member.getPhone())) { |
| | | String amount = newBalance.toPlainString() + "USDT-OMNI"; |
| | | SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo); |
| | | Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | if (StrUtil.isNotBlank(member.getPhone())) { |
| | | String amount = newBalance.toPlainString() + "BTC"; |
| | | SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo); |
| | | Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | |
|
| | | MemberAgentIntoInfoVo memberAgentIntoInfoVo = new MemberAgentIntoInfoVo();
|
| | | List<MemberAccountMoneyChangeInfoVo> arrayList = new ArrayList<>();
|
| | | if(CollUtil.isNotEmpty(contractRecordList)) {
|
| | | if (ObjectUtil.isNotNull(contractRecordList)) {
|
| | | for (MemberAccountMoneyChange memberAccountMoneyChange : contractRecordList) {
|
| | | MemberAccountMoneyChangeInfoVo memberAccountMoneyChangeInfoVo = new MemberAccountMoneyChangeInfoVo();
|
| | |
| | | arrayList.add(memberAccountMoneyChangeInfoVo);
|
| | | }
|
| | | }
|
| | | }
|
| | | memberAgentIntoInfoVo.setMemberAccountMoneyChangeInfoVo(arrayList);
|
| | | return Result.ok(memberAgentIntoInfoVo);
|
| | | }
|
| | |
| | | memberWalletContractDao.increaseWalletContractBalanceById(prePaymentAmount.negate(), openFeePrice.negate(), null, walletContract.getId()); |
| | | |
| | | // 发送爆仓消息 |
| | | sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), forceClosingPrice, holdOrderEntity.getSymbol()); |
| | | sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), forceClosingPrice, holdOrderEntity.getSymbol(), holdOrderEntity.getOperateNo()); |
| | | |
| | | // 计算佣金 |
| | | ThreadPoolUtils.calReturnMoney(memberEntity.getId(), contractOrderEntity.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_OPEN); |
| | |
| | | |
| | | if (i > 0) { |
| | | // 发送爆仓消息 |
| | | sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), forceClosingPrice, holdOrderEntity.getSymbol()); |
| | | sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), forceClosingPrice, holdOrderEntity.getSymbol(), holdOrderEntity.getOperateNo()); |
| | | return Result.ok("调整成功"); |
| | | } |
| | | return Result.fail("调整失败"); |
| | |
| | | contractHoldOrderDao.updateById(holdOrderEntity); |
| | | |
| | | // 发送爆仓消息 |
| | | sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), newForcePrice, holdOrderEntity.getSymbol()); |
| | | sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), newForcePrice, holdOrderEntity.getSymbol(), holdOrderEntity.getOperateNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void sendOrderBombMsg(Long id, int type, BigDecimal forceClosingPrice, String symbol) { |
| | | public void sendOrderBombMsg(Long id, int type, BigDecimal forceClosingPrice, String symbol, int operateNo) { |
| | | OrderModel model = null; |
| | | // 开多 |
| | | if (ContractHoldOrderEntity.OPENING_TYPE_MORE == type) { |
| | | model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol, 1); |
| | | model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol, operateNo); |
| | | // 开空 |
| | | } else { |
| | | model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol, 1); |
| | | model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol, operateNo); |
| | | } |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | } |
| | |
| | | package com.xcong.excoin.rabbit.pricequeue; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | /** |
| | | * 处理消费者的订单止盈等价格信息 |
| | | */ |
| | | @Slf4j |
| | | public class OrderOperatePriceService { |
| | | |
| | | /** |
| | |
| | | Long orderId = order.getOrderId(); |
| | | queue.add(new DescBigDecimal(price)); |
| | | |
| | | log.info("原有:{}", JSONObject.toJSONString(orderMap)); |
| | | removeExistOrder(type, orderId, orderMap); |
| | | log.info("删除后:{}", JSONObject.toJSONString(orderMap)); |
| | | if (orderMap.containsKey(price)) { |
| | | // 有这个价的key |
| | | List<OrderModel> list = orderMap.get(price); |
| | | // 判断这个单的这个类型是否有 |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | // if (CollectionUtils.isNotEmpty(list)) { |
| | | // 新增 |
| | | OrderModel orderModel = new OrderModel(orderId, type, price, null,order.getOperateNo()); |
| | | list.add(orderModel); |
| | | } |
| | | // } |
| | | } else { |
| | | List<OrderModel> list = new ArrayList<OrderModel>(); |
| | | OrderModel orderModel = new OrderModel(orderId, type, price, null,order.getOperateNo()); |
| | | list.add(orderModel); |
| | | orderMap.put(price, list); |
| | | } |
| | | log.info("调整后:{}", JSONObject.toJSONString(orderMap)); |
| | | } |
| | | |
| | | |
| | |
| | | int type = order.getType(); |
| | | Long orderId = order.getOrderId(); |
| | | queue.add(new AscBigDecimal(price)); |
| | | log.info("原有:{}", JSONObject.toJSONString(orderMap)); |
| | | // 需要找到这个订单的原始的单进行处理 |
| | | removeExistOrder(type, orderId, orderMap); |
| | | |
| | | log.info("删除后:{}", JSONObject.toJSONString(orderMap)); |
| | | if (orderMap.containsKey(price)) { |
| | | // 有这个价的key |
| | | List<OrderModel> list = orderMap.get(price); |
| | | // 判断这个单的这个类型是否有 |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | // if (CollectionUtils.isNotEmpty(list)) { |
| | | // 新增 |
| | | OrderModel orderModel = new OrderModel(orderId, type, price, null,order.getOperateNo()); |
| | | list.add(orderModel); |
| | | } |
| | | // } |
| | | } else { |
| | | List<OrderModel> list = new ArrayList<OrderModel>(); |
| | | OrderModel orderModel = new OrderModel(orderId, type, price, null,order.getOperateNo()); |
| | | list.add(orderModel); |
| | | orderMap.put(price, list); |
| | | } |
| | | log.info("调整后:{}", JSONObject.toJSONString(orderMap)); |
| | | } |
| | | |
| | | private static void removeExistOrder(Integer type, Long orderId, Map<String, List<OrderModel>> orderMap) { |
| | |
| | | for (AscBigDecimal asc : list) { |
| | | String key = asc.getValue().toPlainString(); |
| | | assert orderMap != null; |
| | | log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key); |
| | | if (orderMap.containsKey(key)) { |
| | | orderModelList.addAll(orderMap.get(key)); |
| | | orderMap.remove(key); |
| | | } |
| | | |
| | | } |
| | | log.info("------>{}", JSONObject.toJSONString(orderModelList)); |
| | | if (CollectionUtils.isEmpty(orderModelList)) { |
| | | return; |
| | | } |
| | |
| | | for (DescBigDecimal desc : list) { |
| | | String key = desc.getValue().toPlainString(); |
| | | assert orderMap != null; |
| | | log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key); |
| | | if (orderMap.containsKey(key)) { |
| | | orderModelList.addAll(orderMap.get(key)); |
| | | orderMap.remove(key); |
New file |
| | |
| | | package com.xcong.excoin.utils.mail; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.core.util.XmlUtil; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.xcong.excoin.common.exception.GlobalException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-07-14 |
| | | **/ |
| | | @Slf4j |
| | | public class Sms106Send { |
| | | |
| | | private static final String URL = "http://www.qf106.com/sms.aspx"; |
| | | private static final String ID = "16580"; |
| | | private static final String ACCOUNT = "Biue"; |
| | | private static final String PASSWORD = "123456"; |
| | | |
| | | |
| | | /** |
| | | * @param phone 手机号 |
| | | * @param code 验证码 |
| | | * @param time 失效时间 |
| | | * @return |
| | | */ |
| | | public static boolean sendVerifyCode(String phone, String code, int time) { |
| | | String msg = "您的验证码是{},请在{}分钟内输入,请勿泄露给他人,如非本人操作,请及时修改密码。"; |
| | | String content = StrUtil.format(msg, code, time); |
| | | return request(phone, content, "验证码"); |
| | | } |
| | | |
| | | public static boolean sendRechargeMsg(String phone, String time, String orderNo) { |
| | | String msg = "尊敬的用户,您的帐号于{}有一笔成功充值订单,如有疑问请联系客服,订单编号为{}"; |
| | | String content = StrUtil.format(msg, time, orderNo); |
| | | return request(phone, content, "充值"); |
| | | } |
| | | |
| | | public static boolean sendWithdrawalMsg(String phone, String time, String orderNo) { |
| | | String msg = "尊敬的用户,您的帐号于{}有一笔成功提现订单,如有疑问请联系客服,订单编号为{}"; |
| | | String content = StrUtil.format(msg, time, orderNo); |
| | | return request(phone, content, "提现"); |
| | | } |
| | | |
| | | private static boolean request(String phone, String content, String tagName) { |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | param.put("userid", ID); |
| | | param.put("account", ACCOUNT); |
| | | param.put("password", PASSWORD); |
| | | param.put("mobile", phone); |
| | | param.put("content", content); |
| | | param.put("sendTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN)); |
| | | param.put("action", "send"); |
| | | param.put("checkcontent", 0); |
| | | param.put("taskName", tagName); |
| | | param.put("countnumber", 1); |
| | | param.put("mobilenumber", 1); |
| | | param.put("telephonenumber", 0); |
| | | |
| | | String response = HttpUtil.post(URL, param); |
| | | log.info("短信发送:{}, {}", tagName, response); |
| | | if ("Success".equals(XmlUtil.xmlToMap(response).get("returnstatus"))) { |
| | | return true; |
| | | } else { |
| | | throw new GlobalException((String) XmlUtil.xmlToMap(response).get("message")); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(sendVerifyCode("15773002834", "123456", 2)); |
| | | } |
| | | } |
| | |
| | | package com.xcong.excoin.utils.mail; |
| | | |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | |
| | | import org.apache.http.util.EntityUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | |
| | |
| | | public static final String TYPE_MD5 = "md5"; |
| | | public static final String TYPE_SHA1 = "sha1"; |
| | | |
| | | private static final String APP_ID = "16082"; |
| | | private static final String APP_KEY = "f34c792a1112c16c190ed7190d386c4f"; |
| | | private static final String FROM = "biue@submail.biue.me"; |
| | | private static final String SIGN_TYPE = ""; |
| | | |
| | | /** |
| | | * 发送验证码邮件 |
| | | * |
| | | * @param to 对象 |
| | | * @param code 验证码 |
| | | * @return true or false |
| | | */ |
| | | public static boolean sendMail(String to, String code) { |
| | | TreeMap<String, Object> requestData = new TreeMap<String, Object>(); |
| | | JSONObject vars = new JSONObject(); |
| | | vars.put("code", code); |
| | | |
| | | String appid = "16082"; |
| | | String appkey = "f34c792a1112c16c190ed7190d386c4f"; |
| | | String project = "zoKVB"; |
| | | String signtype = ""; |
| | | String from = "biue@submail.biue.me"; |
| | | return request(vars, project, to); |
| | | } |
| | | |
| | | requestData.put("appid", appid); |
| | | /** |
| | | * 发送充值成功邮件 |
| | | * |
| | | * @param to 对象 |
| | | * @param time 成功时间 |
| | | * @param orderNo 订单编号 |
| | | * @return true or false |
| | | */ |
| | | public static boolean sendRechargeMail(String to, String time, String orderNo) { |
| | | JSONObject vars = new JSONObject(); |
| | | vars.put("time", time); |
| | | vars.put("orderNo", orderNo); |
| | | String project = "x820C2"; |
| | | return request(vars, project, to); |
| | | } |
| | | |
| | | public static boolean sendWithdrawalMail(String to, String time) { |
| | | JSONObject vars = new JSONObject(); |
| | | vars.put("time", time); |
| | | String project = "e3BO91"; |
| | | return request(vars, project, to); |
| | | } |
| | | |
| | | |
| | | private static boolean request(JSONObject vars, String project, String to) { |
| | | TreeMap<String, Object> requestData = new TreeMap<String, Object>(); |
| | | requestData.put("appid", APP_ID); |
| | | requestData.put("project", project); |
| | | requestData.put("to", to); |
| | | requestData.put("from", from); |
| | | requestData.put("from", FROM); |
| | | if (!vars.isEmpty()) { |
| | | requestData.put("vars", vars.toString()); |
| | | } |
| | | |
| | | MultipartEntityBuilder builder = MultipartEntityBuilder.create(); |
| | | @SuppressWarnings("deprecation") |
| | | ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, HTTP.UTF_8); |
| | |
| | | builder.addTextBody(key, String.valueOf(value), contentType); |
| | | } |
| | | } |
| | | if (signtype.equals(TYPE_MD5) || signtype.equals(TYPE_SHA1)) { |
| | | if (SIGN_TYPE.equals(TYPE_MD5) || SIGN_TYPE.equals(TYPE_SHA1)) { |
| | | String timestamp = getTimestamp(); |
| | | requestData.put("timestamp", timestamp); |
| | | requestData.put("sign_type", signtype); |
| | | String signStr = appid + appkey + RequestEncoder.formatRequest(requestData) + appid + appkey; |
| | | requestData.put("sign_type", SIGN_TYPE); |
| | | String signStr = APP_ID + APP_KEY + RequestEncoder.formatRequest(requestData) + APP_ID + APP_KEY; |
| | | |
| | | builder.addTextBody("timestamp", timestamp); |
| | | builder.addTextBody("sign_type", signtype); |
| | | builder.addTextBody("signature", RequestEncoder.encode(signtype, signStr), contentType); |
| | | builder.addTextBody("sign_type", SIGN_TYPE); |
| | | builder.addTextBody("signature", RequestEncoder.encode(SIGN_TYPE, signStr), contentType); |
| | | } else { |
| | | builder.addTextBody("signature", appkey, contentType); |
| | | builder.addTextBody("signature", APP_KEY, contentType); |
| | | } |
| | | |
| | | HttpPost httpPost = new HttpPost(URL); |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(sendMail("546766039@qq.com", "123456")); |
| | | // System.out.println(sendMail("546766039@qq.com", "123456")); |
| | | |
| | | System.out.println(sendRechargeMail("546766039@qq.com", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN), "123456")); |
| | | } |
| | | } |
| | |
| | | ## redis配置 |
| | | redis: |
| | | ## Redis数据库索引(默认为0) |
| | | database: 1 |
| | | database: 2 |
| | | ## Redis服务器地址 |
| | | host: 47.114.114.219 |
| | | ## Redis服务器连接端口 |
| | |
| | | </select>
|
| | |
|
| | | <select id="selectWalletAgentIntoRecordsByMemIdTypeSymbol" resultType="com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange">
|
| | | select * from member_account_money_change where type = 3 and content like '%佣金入账%' and member_id = #{memberId} order by id desc
|
| | | select * from member_account_money_change where type = 3 and content like '%佣金到账%' and member_id = #{memberId} order by id desc
|
| | | </select>
|
| | |
|
| | | <select id="selectWalletCoinRecordsInPage" resultType="com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange">
|
New file |
| | |
| | | package com.xcong.excoin; |
| | | |
| | | import com.xcong.excoin.modules.member.dao.MemberDao; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-07-15 |
| | | **/ |
| | | @Slf4j |
| | | @SpringBootTest |
| | | public class RedisTest { |
| | | |
| | | @Resource |
| | | private MemberDao memberDao; |
| | | |
| | | @Resource |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Test |
| | | public void redisResetTest() { |
| | | MemberEntity member = memberDao.selectById(72L); |
| | | redisUtils.set("app_893e3963d1fe4be3b047d4a6e5f99ca9", member); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.xcong.excoin; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.text.UnicodeUtil; |
| | | import cn.hutool.core.util.XmlUtil; |
| | | import cn.hutool.http.HttpUtil; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | public class SmsTest { |
| | | |
| | | public static void main(String[] args) { |
| | | long time = 1594363341988L; |
| | | String url = "http://www.qf106.com/sms.aspx"; |
| | | HashMap<String,Object> param = new HashMap<>(); |
| | | param.put("userid", "16580"); |
| | | param.put("account", "Biue"); |
| | | param.put("password", "123456"); |
| | | param.put("mobile", "15773002834"); |
| | | param.put("content", "这是测试"); |
| | | param.put("sendTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN)); |
| | | param.put("action", "send"); |
| | | param.put("checkcontent", 0); |
| | | param.put("taskName", "验证码"); |
| | | param.put("countnumber", 1); |
| | | param.put("mobilenumber", 1); |
| | | param.put("telephonenumber", 0); |
| | | |
| | | System.out.println(DateUtil.date(time)); |
| | | String response = HttpUtil.post(url, param); |
| | | System.out.println(response); |
| | | System.out.println(XmlUtil.xmlToMap(response).get("returnstatus")); |
| | | } |
| | | |
| | | } |