This commit is contained in:
@@ -16,12 +16,14 @@ import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.util.function.Tuple4;
|
||||
import tools.jackson.databind.JsonNode;
|
||||
import tools.jackson.databind.json.JsonMapper;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author bamanker
|
||||
@@ -149,7 +151,8 @@ public class PushDailyController {
|
||||
.map(tokenResp -> mapper.readTree(tokenResp).get("access_token").asString())
|
||||
.flatMap(accessToken -> wechatRequestService.sendMsg(accessToken, resultVo)
|
||||
.doOnNext(this::printPushLog)
|
||||
.onErrorMap(throwable -> new PushException("发送微信消息失败: " + throwable.getMessage(), throwable)));
|
||||
.onErrorMap(throwable -> new PushException("发送微信消息失败: " + throwable.getMessage(), throwable)))
|
||||
.log();
|
||||
} catch (Exception e) {
|
||||
log.error("处理晚安推送数据时发生错误", e);
|
||||
return Mono.error(new PushException("处理晚安推送数据时发生错误", e));
|
||||
@@ -257,8 +260,9 @@ public class PushDailyController {
|
||||
.onErrorMap(throwable -> new PushException("获取微信访问令牌失败: " + throwable.getMessage(), throwable))
|
||||
.map(tokenResp -> mapper.readTree(tokenResp).get("access_token").asString())
|
||||
.flatMap(accessToken -> wechatRequestService.sendMsg(accessToken, resultVo)
|
||||
.doOnNext(this::printPushLog)
|
||||
.onErrorMap(throwable -> new PushException("发送微信消息失败: " + throwable.getMessage(), throwable)));
|
||||
.doOnNext(PushDailyController.this::printPushLog)
|
||||
.onErrorMap(throwable -> new PushException("发送微信消息失败: " + throwable.getMessage(), throwable)))
|
||||
.log();
|
||||
} catch (Exception e) {
|
||||
log.error("处理早安推送数据时发生错误", e);
|
||||
return Mono.error(new PushException("处理早安推送数据时发生错误", e));
|
||||
|
||||
Reference in New Issue
Block a user