From 6aeb2f87197040214f250c54f871dd373da95b07 Mon Sep 17 00:00:00 2001 From: Echo <4759156@qq.com> Date: Sun, 25 Feb 2024 16:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=B7=A5=E5=85=B7=E7=B1=BB-?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0Date=E6=97=A5=E6=9C=9F=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=88=90=E6=8C=87=E5=AE=9A=E6=A0=BC=E5=BC=8F=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/common/util/date/DateUtils.java | 13 ++++++++++ .../subscribe/SubscribeMessageSendApi.java | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/subscribe/SubscribeMessageSendApi.java diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java index a473518c..2a473ad3 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.common.util.date; import cn.hutool.core.date.LocalDateTimeUtil; +import java.text.SimpleDateFormat; import java.time.*; import java.util.Calendar; import java.util.Date; @@ -29,6 +30,18 @@ public class DateUtils { public static final String FORMAT_HOUR_MINUTE_SECOND = "HH:mm:ss"; + /** + * 根据传入的时间格式,将Date对象,转换成对应的时间格式 + * @param date + * @param format + * @return + */ + public static String dateFormat(Date date, String format) { + SimpleDateFormat formatter = new SimpleDateFormat(format); + String formattedDate = formatter.format(date); + return formattedDate ; + } + /** * 将 LocalDateTime 转换成 Date * diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/subscribe/SubscribeMessageSendApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/subscribe/SubscribeMessageSendApi.java new file mode 100644 index 00000000..dbb92056 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/subscribe/SubscribeMessageSendApi.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.system.api.subscribe; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO; +import cn.iocoder.yudao.module.system.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = +@Tag(name = "RPC 服务 - 微信小程序订阅消息发送") +public interface SubscribeMessageSendApi { + + String PREFIX = ApiConstants.PREFIX + "/subscribe/send"; + + @PostMapping(PREFIX + "/send-approval-result-notification") + @Operation(summary = "发送审批结果通知") + CommonResult sendApprovalResultNotification(SubscribeMessageReqDTO reqDTO); + + @PostMapping(PREFIX + "/send-process-todo-reminder") + @Operation(summary = "发送OA流程待办提醒") + CommonResult sendProcessToDoReminder(SubscribeMessageReqDTO reqDTO); +}