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); +}