完成用户账号不足5元短信发送提示

This commit is contained in:
little-cat-sweet 2021-08-17 11:36:27 +08:00
parent 84c96a235c
commit 374036ed76
3 changed files with 4 additions and 4 deletions

View File

@ -14,6 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping;
@FeignClient(contextId = "smsService",value = ServiceNameConstants.XHPC_GENERAL, fallbackFactory = SmsFallbackFactory.class)
public interface SmsService {
@PostMapping("/send")
@PostMapping("/sms/send")
R sendNotice(String phone, String content);
}

View File

@ -43,6 +43,7 @@ public class XhpcSmsController extends BaseController {
@GetMapping(value = "/send")
public void send(String phone , String content){
xhpcSmsService.sendNotice(phone, content);
}
}

View File

@ -106,12 +106,11 @@ public class RealtimeDataLogic implements ServiceLogic {
cacheOrder.put("realtimeDataList", realtimeDataList);
REDIS.setCacheMap(orderkey, cacheOrder);
if ((balance - cacheRealtimeData.getAmountCharged()) < 500) {
String alerted = (String) cacheOrder.get("alerted");
String alerted = (String) cacheOrder.get("lt5alerted");
String tel = (String) cacheOrder.get("tel");
if (alerted == null && tel != null) {
// todo send sms
smsService.sendNotice(tel,"【小华充电】尊敬的用户你的账户余额小于5元,为不影响您的正常充电,请您尽快充值交费,谢谢。");
cacheOrder.put("alerted", "true");
cacheOrder.put("lt5alerted", "true");
}
}
} else {