From 9f0a3c629f6e4fe157848d6ba2503305f3a88bb7 Mon Sep 17 00:00:00 2001 From: xiafang Date: Tue, 7 May 2024 18:06:19 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=BD=93=E6=9E=84=E5=BB=BA=E6=8A=BD=E8=B1=A1?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/message/FileMessageBody.java | 21 ++++++- .../domain/message/ImageMessageBody.java | 21 ++++++- .../domain/message/MarkdownMessageBody.java | 21 ++++++- .../domain/message/MessageBodyBuilder.java | 61 +++++++++++++++++++ .../message/MiniprogramMessageBody.java | 21 ++++++- .../domain/message/MpNewsMessageBody.java | 21 ++++++- .../domain/message/NewsMessageBody.java | 22 ++++++- .../message/TemplateCardMessageBody.java | 39 ++++++------ .../domain/message/TextCardMessageBody.java | 21 ++++++- .../domain/message/TextMessageBody.java | 22 ++++++- .../domain/message/VideoMessageBody.java | 20 +++++- .../domain/message/VoiceMessageBody.java | 22 ++++++- 12 files changed, 283 insertions(+), 29 deletions(-) create mode 100644 wecom-objects/src/main/java/cn/felord/domain/message/MessageBodyBuilder.java diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/FileMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/FileMessageBody.java index 03cfd59f..1d76e4cb 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/FileMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/FileMessageBody.java @@ -35,7 +35,7 @@ protected FileMessageBody(String touser, String toparty, String totag, MessageSa this.file = file; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MediaId file; private String touser; private String toparty; @@ -49,21 +49,39 @@ protected Builder(MediaId file) { this.file = file; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder safe(MessageSafe safe) { this.safe = safe; return this; @@ -79,6 +97,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public FileMessageBody build() { return new FileMessageBody(touser, toparty, totag, safe, enableDuplicateCheck, duplicateCheckInterval, file); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/ImageMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/ImageMessageBody.java index 60a3dac5..b6dadfbe 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/ImageMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/ImageMessageBody.java @@ -35,7 +35,7 @@ protected ImageMessageBody(String touser, String toparty, String totag, MessageS this.image = image; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MediaId file; private String touser; private String toparty; @@ -49,21 +49,39 @@ protected Builder(MediaId file) { this.file = file; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder safe(MessageSafe safe) { this.safe = safe; return this; @@ -79,6 +97,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public ImageMessageBody build() { return new ImageMessageBody(touser, toparty, totag, safe, enableDuplicateCheck, duplicateCheckInterval, file); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/MarkdownMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/MarkdownMessageBody.java index 2c9bdfc2..0ff9ef90 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/MarkdownMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/MarkdownMessageBody.java @@ -34,7 +34,7 @@ protected MarkdownMessageBody(String touser, String toparty, String totag, BoolE this.markdown = markdown; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final ContentText markdown; private String touser; private String toparty; @@ -47,21 +47,39 @@ protected Builder(ContentText markdown) { this.markdown = markdown; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableDuplicateCheck(BoolEnum enableDuplicateCheck) { this.enableDuplicateCheck = enableDuplicateCheck; return this; @@ -72,6 +90,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public MarkdownMessageBody build() { return new MarkdownMessageBody(touser, toparty, totag, enableDuplicateCheck, duplicateCheckInterval, markdown); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/MessageBodyBuilder.java b/wecom-objects/src/main/java/cn/felord/domain/message/MessageBodyBuilder.java new file mode 100644 index 00000000..07a82761 --- /dev/null +++ b/wecom-objects/src/main/java/cn/felord/domain/message/MessageBodyBuilder.java @@ -0,0 +1,61 @@ +package cn.felord.domain.message; + +/** + * The interface Message body builder. + * + * @author dax + * @since 2024 /4/29 + */ +public interface MessageBodyBuilder { + /** + * Touser message body builder. + * + * @param touser the touser + * @return the message body builder + */ + MessageBodyBuilder touser(String touser); + + /** + * Touser string. + * + * @return the string + */ + String touser(); + + /** + * Toparty message body builder. + * + * @param toparty the toparty + * @return the message body builder + */ + MessageBodyBuilder toparty(String toparty); + + /** + * Toparty string. + * + * @return the string + */ + String toparty(); + + /** + * Totag message body builder. + * + * @param totag the totag + * @return the message body builder + */ + MessageBodyBuilder totag(String totag); + + /** + * Totag string. + * + * @return the string + */ + String totag(); + + /** + * Build abstract message body. + * + * @return the abstract message body + */ + AbstractMessageBody build(); +} diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/MiniprogramMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/MiniprogramMessageBody.java index 12dffcf9..9aa2205e 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/MiniprogramMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/MiniprogramMessageBody.java @@ -38,7 +38,7 @@ protected MiniprogramMessageBody(String touser, String toparty, String totag, Bo this.enableIdTrans = enableIdTrans; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MiniprogramNotice miniprogramNotice; private String touser; private String toparty; @@ -51,21 +51,39 @@ protected Builder(MiniprogramNotice miniprogramNotice) { this.miniprogramNotice = miniprogramNotice; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableIdTrans(BoolEnum enableIdTrans) { this.enableIdTrans = enableIdTrans; return this; @@ -81,6 +99,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public MiniprogramMessageBody build() { return new MiniprogramMessageBody(touser, toparty, totag, enableIdTrans, enableDuplicateCheck, duplicateCheckInterval, miniprogramNotice); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/MpNewsMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/MpNewsMessageBody.java index befa6f40..b703a3ba 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/MpNewsMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/MpNewsMessageBody.java @@ -36,7 +36,7 @@ protected MpNewsMessageBody(String touser, String toparty, String totag, BoolEnu this.enableIdTrans = enableIdTrans; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MessageNews mpnews; private String touser; private String toparty; @@ -50,21 +50,39 @@ protected Builder(MessageNews mpnews) { this.mpnews = mpnews; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableIdTrans(BoolEnum enableIdTrans) { this.enableIdTrans = enableIdTrans; return this; @@ -85,6 +103,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public MpNewsMessageBody build() { return new MpNewsMessageBody(touser, toparty, totag, enableIdTrans, safe, enableDuplicateCheck, duplicateCheckInterval, mpnews); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/NewsMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/NewsMessageBody.java index 689ce775..27002173 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/NewsMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/NewsMessageBody.java @@ -36,7 +36,7 @@ protected NewsMessageBody(String touser, String toparty, String totag, BoolEnum this.enableIdTrans = enableIdTrans; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MessageNews news; private String touser; private String toparty; @@ -49,21 +49,40 @@ protected Builder(MessageNews news) { this.news = news; } + + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableIdTrans(BoolEnum enableIdTrans) { this.enableIdTrans = enableIdTrans; return this; @@ -80,6 +99,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public NewsMessageBody build() { return new NewsMessageBody(touser, toparty, totag, enableIdTrans, enableDuplicateCheck, duplicateCheckInterval, news); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/TemplateCardMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/TemplateCardMessageBody.java index 3d646c23..f4803dd2 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/TemplateCardMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/TemplateCardMessageBody.java @@ -56,7 +56,7 @@ protected TemplateCardMessageBody(String touser, String toparty, String totag, B * * @param the type parameter */ - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final M templateCard; private String touser; private String toparty; @@ -74,39 +74,40 @@ protected Builder(M templateCard) { this.templateCard = templateCard; } - /** - * Touser builder. - * - * @param touser the touser - * @return the builder - */ + + @Override public Builder touser(String touser) { this.touser = touser; return this; } - /** - * Toparty builder. - * - * @param toparty the toparty - * @return the builder - */ + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } - /** - * Totag builder. - * - * @param totag the totag - * @return the builder - */ + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + /** * Enable id trans builder. * diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/TextCardMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/TextCardMessageBody.java index 1556864c..63742323 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/TextCardMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/TextCardMessageBody.java @@ -38,7 +38,7 @@ protected TextCardMessageBody(String touser, String toparty, String totag, BoolE } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MessageTextCard textcard; private String touser; private String toparty; @@ -51,21 +51,39 @@ protected Builder(MessageTextCard textcard) { this.textcard = textcard; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableIdTrans(BoolEnum enableIdTrans) { this.enableIdTrans = enableIdTrans; return this; @@ -81,6 +99,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public TextCardMessageBody build() { return new TextCardMessageBody(touser, toparty, totag, enableIdTrans, enableDuplicateCheck, duplicateCheckInterval, textcard); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/TextMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/TextMessageBody.java index a33b4a44..64d4bf89 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/TextMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/TextMessageBody.java @@ -40,7 +40,7 @@ protected TextMessageBody(String touser, String toparty, String totag, BoolEnum } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final ContentText text; private String touser; private String toparty; @@ -54,21 +54,40 @@ protected Builder(ContentText text) { this.text = text; } + + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableIdTrans(BoolEnum enableIdTrans) { this.enableIdTrans = enableIdTrans; return this; @@ -89,6 +108,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public TextMessageBody build() { return new TextMessageBody(touser, toparty, totag, enableIdTrans, safe, enableDuplicateCheck, duplicateCheckInterval, text); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/VideoMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/VideoMessageBody.java index 57c9bccc..1a1e1ebb 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/VideoMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/VideoMessageBody.java @@ -34,7 +34,7 @@ protected VideoMessageBody(String touser, String toparty, String totag, MessageS this.video = video; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MessageVideo video; private String touser; private String toparty; @@ -47,21 +47,38 @@ protected Builder(MessageVideo video) { this.video = video; } + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } public Builder safe(MessageSafe safe) { this.safe = safe; return this; @@ -77,6 +94,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public VideoMessageBody build() { return new VideoMessageBody(touser, toparty, totag, safe, enableDuplicateCheck, duplicateCheckInterval, video); } diff --git a/wecom-objects/src/main/java/cn/felord/domain/message/VoiceMessageBody.java b/wecom-objects/src/main/java/cn/felord/domain/message/VoiceMessageBody.java index 44dad8f5..d18ba8a6 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/message/VoiceMessageBody.java +++ b/wecom-objects/src/main/java/cn/felord/domain/message/VoiceMessageBody.java @@ -35,7 +35,7 @@ protected VoiceMessageBody(String touser, String toparty, String totag, BoolEnum this.voice = voice; } - public static class Builder { + public static class Builder implements MessageBodyBuilder { private final MediaId voice; private String touser; private String toparty; @@ -48,21 +48,40 @@ protected Builder(MediaId voice) { this.voice = voice; } + + @Override public Builder touser(String touser) { this.touser = touser; return this; } + @Override + public String touser() { + return this.touser; + } + + @Override public Builder toparty(String toparty) { this.toparty = toparty; return this; } + @Override + public String toparty() { + return this.toparty; + } + + @Override public Builder totag(String totag) { this.totag = totag; return this; } + @Override + public String totag() { + return this.totag; + } + public Builder enableDuplicateCheck(BoolEnum enableDuplicateCheck) { this.enableDuplicateCheck = enableDuplicateCheck; return this; @@ -73,6 +92,7 @@ public Builder duplicateCheckInterval(Integer duplicateCheckInterval) { return this; } + @Override public VoiceMessageBody build() { return new VoiceMessageBody(touser, toparty, totag, enableDuplicateCheck, duplicateCheckInterval, voice); } From 12ad8cac8f3dcdd32a146117104381832ebefc0a Mon Sep 17 00:00:00 2001 From: xiafang Date: Sat, 22 Jun 2024 09:34:37 +0800 Subject: [PATCH 2/7] =?UTF-8?q?-=20=E6=8F=90=E4=BA=A4=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=EF=BC=8C=E5=8F=AF=E6=8C=87=E5=AE=9A=E8=B7=A8?= =?UTF-8?q?=E5=A4=A9=E8=AF=B7=E5=81=87=E3=80=81=E5=A4=96=E5=87=BA=E3=80=81?= =?UTF-8?q?=E5=87=BA=E5=B7=AE=E3=80=81=E5=8A=A0=E7=8F=AD=E7=9A=84=E6=AF=8F?= =?UTF-8?q?=E5=A4=A9=E5=88=86=E7=89=87=E6=97=B6=E9=95=BF=20-=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=8F=AF=E4=BF=A1=E4=BC=81=E4=B8=9A=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=94=AF=E6=8C=81=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E7=9A=84=E8=AE=BE=E5=A4=87=E7=BC=96=E7=A0=81?= =?UTF-8?q?=20-=20=E6=94=AF=E6=8C=81=E6=96=B0=E5=BB=BA=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/felord/reactive/api/DepartmentApi.java | 2 + .../domain/approval/ApprovalApplyRequest.java | 1 + .../domain/approval/DateRangeWrapper.java | 17 ++++- .../cn/felord/domain/approval/SliceInfo.java | 41 +++++++++-- .../felord/domain/approval/VacationValue.java | 72 ++++++++++++++++--- .../domain/contactbook/user/UserDetail.java | 3 +- .../contactbook/user/UserInfoRequest.java | 5 +- .../felord/domain/security/DeviceResult.java | 6 ++ .../java/cn/felord/enumeration/DocType.java | 8 ++- .../java/cn/felord/enumeration/Gender.java | 68 ++++++++++++++++++ .../java/cn/felord/api/DepartmentApi.java | 2 + .../src/main/java/cn/felord/api/FormApi.java | 4 +- 12 files changed, 207 insertions(+), 22 deletions(-) create mode 100644 wecom-objects/src/main/java/cn/felord/enumeration/Gender.java diff --git a/rx-wecom-sdk/src/main/java/cn/felord/reactive/api/DepartmentApi.java b/rx-wecom-sdk/src/main/java/cn/felord/reactive/api/DepartmentApi.java index e0c2eb2a..d2cd6d7c 100644 --- a/rx-wecom-sdk/src/main/java/cn/felord/reactive/api/DepartmentApi.java +++ b/rx-wecom-sdk/src/main/java/cn/felord/reactive/api/DepartmentApi.java @@ -66,6 +66,8 @@ public interface DepartmentApi { /** * 获取部门列表(自建) + *

+ * 获取指定部门及其下的子部门(以及子部门的子部门等等,递归) * * @param departmentId departmentId * @return DeptResponse generic response diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/ApprovalApplyRequest.java b/wecom-objects/src/main/java/cn/felord/domain/approval/ApprovalApplyRequest.java index 130ab320..7ffa8aca 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/ApprovalApplyRequest.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/ApprovalApplyRequest.java @@ -29,6 +29,7 @@ * @author dax * @since 2024 /5/25 * @deprecated + * @see ProcessApplyRequest */ @ToString @Getter diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/DateRangeWrapper.java b/wecom-objects/src/main/java/cn/felord/domain/approval/DateRangeWrapper.java index f6f81bcc..5c8c5399 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/DateRangeWrapper.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/DateRangeWrapper.java @@ -29,18 +29,33 @@ * The type Date range wrapper. * * @author dax - * @since 2024/12/19 + * @since 2024 /12/19 */ @ToString @Getter public class DateRangeWrapper { + /** + * 时间展示类型 + */ private final DateRangeType type; + /** + * 开始时间戳 + */ private final Instant newBegin; + /** + * 结束时间戳 + */ private final Instant newEnd; + /** + * 请假时长,单位秒 当slice_info有值时,无需填写,系统会根据slice_info 计算总时长 + */ @JsonFormat(shape = JsonFormat.Shape.NUMBER, pattern = "SECONDS") private final Duration newDuration; @JsonFormat(shape = JsonFormat.Shape.NUMBER, pattern = "SECONDS") private final Duration perdayDuration; + /** + * 时区信息,只有在非UTC+8的情况下会返回 + */ private final TimezoneInfo timezoneInfo; /** diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/SliceInfo.java b/wecom-objects/src/main/java/cn/felord/domain/approval/SliceInfo.java index 2464b0b8..727c6286 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/SliceInfo.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/SliceInfo.java @@ -16,18 +16,47 @@ package cn.felord.domain.approval; import cn.felord.enumeration.SliceState; -import lombok.Data; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; import java.time.Duration; import java.util.List; /** + * The type Slice info. + * * @author dax - * @since 2023/12/19 + * @since 2023 /12/19 */ -@Data +@Getter public class SliceInfo { - private Duration duration; - private SliceState state; - private List dayItems; + private final Duration duration; + private final SliceState state; + private final List dayItems; + + /** + * Instantiates a new Slice info. + * + * @param duration the duration + * @param state the state + * @param dayItems the day items + */ + @JsonCreator + SliceInfo(@JsonProperty("duration") Duration duration, + @JsonProperty("state") SliceState state, + @JsonProperty("day_items") List dayItems) { + this.duration = duration; + this.state = state; + this.dayItems = dayItems; + } + + /** + * Instantiates a new Slice info. + * + * @param dayItems the day items + */ + public SliceInfo(List dayItems) { + this(null, null, dayItems); + } } diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/VacationValue.java b/wecom-objects/src/main/java/cn/felord/domain/approval/VacationValue.java index 3f99dc55..6ed30e9f 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/VacationValue.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/VacationValue.java @@ -29,7 +29,7 @@ * 假勤组件-请假组件 * * @author dax - * @since 2024/5/27 + * @since 2024 /5/27 */ @ToString @Getter @@ -52,12 +52,13 @@ public class VacationValue implements ContentDataValue { * @param key {@code ApprovalTmpDetailResponse#getVacationList()} * @param attendanceType the attendance type * @param dateRange the date range + * @param sliceInfo the slice info * @return the vacation value */ - public static VacationValue from(String key, AttendanceType attendanceType, DateRangeWrapper dateRange) { + public static VacationValue from(String key, AttendanceType attendanceType, DateRangeWrapper dateRange, SliceInfo sliceInfo) { CtrlOption options = new CtrlOption(); options.setKey(key); - return new VacationValue(new Wrapper(options, attendanceType, dateRange)); + return new VacationValue(new Wrapper(options, attendanceType, dateRange, sliceInfo)); } /** @@ -68,7 +69,20 @@ public static VacationValue from(String key, AttendanceType attendanceType, Date * @return the vacation value */ public static VacationValue leave(String key, DateRangeWrapper dateRange) { - return from(key, AttendanceType.LEAVE, dateRange); + return from(key, AttendanceType.LEAVE, dateRange, null); + } + + /** + * 请假 + * + * @param key the key + * @param dateRange the date range + * @param sliceInfo the slice info + * @return the vacation value + * @since 1.2.8 + */ + public static VacationValue leave(String key, DateRangeWrapper dateRange, SliceInfo sliceInfo) { + return from(key, AttendanceType.LEAVE, dateRange, sliceInfo); } /** @@ -79,7 +93,20 @@ public static VacationValue leave(String key, DateRangeWrapper dateRange) { * @return the vacation value */ public static VacationValue trip(String key, DateRangeWrapper dateRange) { - return from(key, AttendanceType.BUSINESS_TRIP, dateRange); + return trip(key, dateRange, null); + } + + /** + * 出差 + * + * @param key the key + * @param dateRange the date range + * @param sliceInfo the slice info + * @return the vacation value + * @since 1.2.8 + */ + public static VacationValue trip(String key, DateRangeWrapper dateRange, SliceInfo sliceInfo) { + return from(key, AttendanceType.BUSINESS_TRIP, dateRange, sliceInfo); } /** @@ -90,7 +117,20 @@ public static VacationValue trip(String key, DateRangeWrapper dateRange) { * @return the vacation value */ public static VacationValue goingOut(String key, DateRangeWrapper dateRange) { - return from(key, AttendanceType.GOING_OUT, dateRange); + return goingOut(key, dateRange, null); + } + + /** + * 外出 + * + * @param key the key + * @param dateRange the date range + * @param sliceInfo the slice info + * @return the vacation value + * @since 1.2.8 + */ + public static VacationValue goingOut(String key, DateRangeWrapper dateRange, SliceInfo sliceInfo) { + return from(key, AttendanceType.GOING_OUT, dateRange, sliceInfo); } /** @@ -101,7 +141,20 @@ public static VacationValue goingOut(String key, DateRangeWrapper dateRange) { * @return the vacation value */ public static VacationValue overtime(String key, DateRangeWrapper dateRange) { - return from(key, AttendanceType.OVERTIME_WORK, dateRange); + return overtime(key, dateRange, null); + } + + /** + * 加班 + * + * @param key the key + * @param dateRange the date range + * @param sliceInfo the slice info + * @return the vacation value + * @since 1.2.8 + */ + public static VacationValue overtime(String key, DateRangeWrapper dateRange, SliceInfo sliceInfo) { + return from(key, AttendanceType.OVERTIME_WORK, dateRange, sliceInfo); } /** @@ -131,9 +184,10 @@ public static class Wrapper { * @param options the options * @param type the type * @param dateRange the date range + * @param sliceInfo the slice info */ - Wrapper(CtrlOption options, AttendanceType type, DateRangeWrapper dateRange) { - this(new Selector(Collections.singletonList(options)), new Attendance(type, dateRange, null)); + Wrapper(CtrlOption options, AttendanceType type, DateRangeWrapper dateRange, SliceInfo sliceInfo) { + this(new Selector(Collections.singletonList(options)), new Attendance(type, dateRange, sliceInfo)); } } diff --git a/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserDetail.java b/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserDetail.java index 3fec92c2..a42bd8af 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserDetail.java +++ b/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserDetail.java @@ -15,6 +15,7 @@ package cn.felord.domain.contactbook.user; +import cn.felord.enumeration.Gender; import cn.felord.enumeration.UserStatus; import lombok.Data; @@ -32,7 +33,7 @@ public class UserDetail { private List department; private List order; private String position; - private String gender; + private Gender gender; private String email; private String bizMail; private List isLeaderInDept; diff --git a/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserInfoRequest.java b/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserInfoRequest.java index c08c4aba..e848b31b 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserInfoRequest.java +++ b/wecom-objects/src/main/java/cn/felord/domain/contactbook/user/UserInfoRequest.java @@ -15,6 +15,7 @@ package cn.felord.domain.contactbook.user; +import cn.felord.enumeration.Gender; import lombok.Data; import java.util.List; @@ -35,7 +36,7 @@ public class UserInfoRequest { private List department; private List order; private String position; - private Integer gender; + private Gender gender; private String email; private String bizMail; private String telephone; @@ -50,4 +51,4 @@ public class UserInfoRequest { private String nickname; private String address; private Long mainDepartment; -} \ No newline at end of file +} diff --git a/wecom-objects/src/main/java/cn/felord/domain/security/DeviceResult.java b/wecom-objects/src/main/java/cn/felord/domain/security/DeviceResult.java index 455a4d10..1484936b 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/security/DeviceResult.java +++ b/wecom-objects/src/main/java/cn/felord/domain/security/DeviceResult.java @@ -34,6 +34,12 @@ public class DeviceResult { * 设备的唯一标识,仅导入成功的记录返回 */ private String deviceCode; + /** + * 当重复导入(status=2)时,与当前导入记录冲突的设备的device_code + * + * @since 1.2.8 + */ + private String duplicatedDeviceCode; /** * 导入结果 */ diff --git a/wecom-objects/src/main/java/cn/felord/enumeration/DocType.java b/wecom-objects/src/main/java/cn/felord/enumeration/DocType.java index ebe16a77..fda3b7ed 100644 --- a/wecom-objects/src/main/java/cn/felord/enumeration/DocType.java +++ b/wecom-objects/src/main/java/cn/felord/enumeration/DocType.java @@ -34,7 +34,13 @@ public enum DocType { /** * 表格 */ - SHEET(4); + SHEET(4), + /** + * 智能表格 + * + * @since 1.2.8 + */ + SMART_SHEET(10); private final int type; diff --git a/wecom-objects/src/main/java/cn/felord/enumeration/Gender.java b/wecom-objects/src/main/java/cn/felord/enumeration/Gender.java new file mode 100644 index 00000000..b5998110 --- /dev/null +++ b/wecom-objects/src/main/java/cn/felord/enumeration/Gender.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023. felord.cn + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * https://www.apache.org/licenses/LICENSE-2.0 + * Website: + * https://felord.cn + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.felord.enumeration; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * The Gender + * + * @author dax + * @since 2024/10/6 + */ +public enum Gender { + /** + * 男 + */ + MALE(1), + /** + * 女 + */ + FEMALE(2); + + private final int type; + + Gender(int type) { + this.type = type; + } + + /** + * Gets type. + * + * @return the type + */ + @JsonValue + public int getType() { + return type; + } + + /** + * Deserialize Gender + * + * @param type the type + * @return the Gender + */ + @JsonCreator + public static Gender deserialize(int type) { + return Arrays.stream(Gender.values()) + .filter(callType -> callType.type == type) + .findFirst() + .orElse(null); + } +} diff --git a/wecom-sdk/src/main/java/cn/felord/api/DepartmentApi.java b/wecom-sdk/src/main/java/cn/felord/api/DepartmentApi.java index 0328966b..e00081ad 100644 --- a/wecom-sdk/src/main/java/cn/felord/api/DepartmentApi.java +++ b/wecom-sdk/src/main/java/cn/felord/api/DepartmentApi.java @@ -69,6 +69,8 @@ public interface DepartmentApi { /** * 获取部门列表(自建) + *

+ * 获取指定部门及其下的子部门(以及子部门的子部门等等,递归) * * @param departmentId departmentId * @return DeptResponse generic response diff --git a/wecom-sdk/src/main/java/cn/felord/api/FormApi.java b/wecom-sdk/src/main/java/cn/felord/api/FormApi.java index 2cd4fb95..9379ba61 100644 --- a/wecom-sdk/src/main/java/cn/felord/api/FormApi.java +++ b/wecom-sdk/src/main/java/cn/felord/api/FormApi.java @@ -27,14 +27,14 @@ * 收集表 * * @author dax - * @since 2024/3/13 16:27 + * @since 2024 /3/13 16:27 */ public interface FormApi { /** * 创建收集表 - * + *

* 已过时,不带校验 * * @param request the request From e58ee5b119f8bcdbfc8a358c1b53e71518aa2004 Mon Sep 17 00:00:00 2001 From: xiafang Date: Thu, 27 Jun 2024 11:25:20 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=AE=A2?= =?UTF-8?q?=E6=B8=A0=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/felord/enumeration/AddWays.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wecom-objects/src/main/java/cn/felord/enumeration/AddWays.java b/wecom-objects/src/main/java/cn/felord/enumeration/AddWays.java index 33082b3b..73e6b614 100644 --- a/wecom-objects/src/main/java/cn/felord/enumeration/AddWays.java +++ b/wecom-objects/src/main/java/cn/felord/enumeration/AddWays.java @@ -24,7 +24,7 @@ * 添加客户的来源 * * @author dax - * @since 2021/9/9 9:22 + * @since 2021 /9/9 9:22 */ public enum AddWays { /** @@ -32,7 +32,7 @@ public enum AddWays { */ UNKNOWN(0), /** - *扫描二维码 + * 扫描二维码 */ QR_CODE_SCANNED(1), /** @@ -103,6 +103,18 @@ public enum AddWays { * @since 1.2.6 */ REQ_REPLY(18), + /** + * 通过第三方服务售前客服添加 + * + * @since 1.2.8 + */ + THIRD_PRE_SALES_SERVICER(21), + /** + * 通过接受微信账号收到的好友申请添加 + * + * @since 1.2.8 + */ + WECHAT_FRIEND(24), /** * 内部成员共享 */ From 78b7c6d8278ebe8791729c7b7cdce46a8f3e2987 Mon Sep 17 00:00:00 2001 From: xiafang Date: Wed, 17 Jul 2024 09:48:28 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=A7=A3=E6=9E=90=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #IAA7JU --- .../cn/felord/wecom/SpringBootWecomSdkTests.java | 2 +- .../main/java/cn/felord/retrofit/WecomUserAgent.java | 2 +- .../java/cn/felord/domain/approval/TableConfig.java | 12 ++++++------ .../java/cn/felord/domain/common/TemplateId.java | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java b/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java index ab47daab..3f14b1c5 100644 --- a/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java +++ b/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java @@ -427,7 +427,7 @@ void approval() { // 模板 String templateId = "C4UEh71DAPh775HPfXipikZ5eAGosskDibU8hkfxJ"; // 查询模板配置 可以用缓存优化性能 避免直接查询企业微信 - ApprovalTmpDetailResponse templateDetail = approvalApi.getTemplateDetail(new TemplateId(templateId)); + ApprovalTmpDetailResponse templateDetail = approvalApi.getTemplateDetail(TemplateId.of(templateId)); Assertions.assertTrue(templateDetail.isSuccessful()); // 审批人模式:0-通过接口指定审批人、抄送人(此时approver、notifyer等参数可用); // 1-使用此模板在管理后台设置的审批流程(需要保证审批流程中没有“申请人自选”节点),支持条件审批。 diff --git a/wecom-common/src/main/java/cn/felord/retrofit/WecomUserAgent.java b/wecom-common/src/main/java/cn/felord/retrofit/WecomUserAgent.java index b738a27d..cd5e5e82 100644 --- a/wecom-common/src/main/java/cn/felord/retrofit/WecomUserAgent.java +++ b/wecom-common/src/main/java/cn/felord/retrofit/WecomUserAgent.java @@ -27,7 +27,7 @@ public final class WecomUserAgent { /** * 版本号 */ - public static final String VERSION = "1.2.5"; + public static final String VERSION = "1.2.8"; /** * UserAgent */ diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/TableConfig.java b/wecom-objects/src/main/java/cn/felord/domain/approval/TableConfig.java index a43348d2..dbc27c5a 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/TableConfig.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/TableConfig.java @@ -54,7 +54,7 @@ public class TableConfig implements ControlConfig { * @param sumField the sum field * @return the table config */ - public static TableConfig from(@NonNull List children, BoolEnum printFormat, List statField, List sumField) { + public static TableConfig from(@NonNull List children, BoolEnum printFormat, List statField, List sumField) { return new TableConfig(new Wrapper(children, printFormat, statField, sumField)); } @@ -66,7 +66,7 @@ public static TableConfig from(@NonNull List children, BoolEn * @param statField the stat field * @return the table config */ - public static TableConfig from(@NonNull List children, BoolEnum printFormat, List statField) { + public static TableConfig from(@NonNull List children, BoolEnum printFormat, List statField) { return from(children, printFormat, statField, null); } @@ -99,8 +99,8 @@ public static TableConfig from(@NonNull List children) { public static class Wrapper { private final List children; private final BoolEnum printFormat; - private final List statField; - private final List sumField; + private final List statField; + private final List sumField; /** * Instantiates a new Wrapper. @@ -113,8 +113,8 @@ public static class Wrapper { @JsonCreator Wrapper(@JsonProperty("children") List children, @JsonProperty("print_format") BoolEnum printFormat, - @JsonProperty("stat_field") List statField, - @JsonProperty("sum_field") List sumField) { + @JsonProperty("stat_field") List statField, + @JsonProperty("sum_field") List sumField) { this.printFormat = printFormat; this.children = children; this.statField = statField; diff --git a/wecom-objects/src/main/java/cn/felord/domain/common/TemplateId.java b/wecom-objects/src/main/java/cn/felord/domain/common/TemplateId.java index 6fab8287..d2da588e 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/common/TemplateId.java +++ b/wecom-objects/src/main/java/cn/felord/domain/common/TemplateId.java @@ -38,7 +38,7 @@ public class TemplateId { * @param templateId the template id */ @JsonCreator - public TemplateId(@JsonProperty("template_id") String templateId) { + TemplateId(@JsonProperty("template_id") String templateId) { this.templateId = templateId; } From 1a2d2ddcb09d4a7f8ea9d3d66fc47adc318a6677 Mon Sep 17 00:00:00 2001 From: xiafang Date: Wed, 17 Jul 2024 11:04:55 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../felord/wecom/SpringBootWecomSdkTests.java | 56 ++++++++++++++++++- .../felord/domain/approval/ProcessNode.java | 13 ++--- .../cn/felord/domain/approval/Summary.java | 39 +++++++++++-- .../cn/felord/domain/approval/TextValue.java | 11 +++- 4 files changed, 105 insertions(+), 14 deletions(-) diff --git a/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java b/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java index 3f14b1c5..5de934d1 100644 --- a/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java +++ b/samples/spring-boot-sample/src/test/java/cn/felord/wecom/SpringBootWecomSdkTests.java @@ -41,7 +41,6 @@ import cn.felord.domain.approval.ApprovalApplyRequest; import cn.felord.domain.approval.ApprovalDetail; import cn.felord.domain.approval.ApprovalSpNo; -import cn.felord.domain.approval.ApprovalTitle; import cn.felord.domain.approval.ApprovalTmpDetailResponse; import cn.felord.domain.approval.Approver; import cn.felord.domain.approval.ContactValue; @@ -55,6 +54,8 @@ import cn.felord.domain.approval.MoneyValue; import cn.felord.domain.approval.NumberValue; import cn.felord.domain.approval.PhoneNumberValue; +import cn.felord.domain.approval.ProcessApplyRequest; +import cn.felord.domain.approval.ProcessNode; import cn.felord.domain.approval.RelatedApprovalValue; import cn.felord.domain.approval.SelectorValue; import cn.felord.domain.approval.Summary; @@ -106,6 +107,7 @@ import cn.felord.domain.wedoc.form.FormAnswerRequest; import cn.felord.domain.wedrive.BufferSource; import cn.felord.enumeration.AnswerReplyItemType; +import cn.felord.enumeration.ApvRel; import cn.felord.enumeration.BoolEnum; import cn.felord.enumeration.MediaTypeEnum; import cn.felord.enumeration.NativeAgent; @@ -357,6 +359,56 @@ public void kf() { ImageKfMessageRequest kfMessageRequest = new ImageKfMessageRequest("客户id", "客服id", "图片素材 mediaid"); } + /** + * 新版审批 + * + * @since 1.2.8 + */ + @Test + void newApproval() { + String templateId = "3WLtyn8eQcZ5BhCx7CiBg35i4n7E1eDihMAgethW"; + AgentDetails nativeAgent = DefaultAgent.of("企业ID", "审批应用密钥", "xxxx"); + ApprovalApi approvalApi = workWeChatApi.approvalApi(nativeAgent); + ApprovalTmpDetailResponse templateDetail = approvalApi.getTemplateDetail(TemplateId.of(templateId)); + System.out.println("templateDetail = " + templateDetail); + + List

summaryList = Collections.singletonList(Summary.zhCN("测试模板")); + + + List dataValues = Arrays.asList( + TextValue.tip(), + TextValue.from("洗发水"), + // 明细 + ListContentDataValue.of(Arrays.asList( + MoneyValue.from(12.30), + NumberValue.from(7) + )) + .append(Arrays.asList( + MoneyValue.from(34.64), + NumberValue.from(22) + + )) + ); + + List nodeList = Arrays.asList( + ProcessNode.cc(Collections.singletonList("3958")), + ProcessNode.assignees(ApvRel.ALL, Arrays.asList("4921", "2774")), + ProcessNode.assignees(ApvRel.OR, Arrays.asList("3958", "2824")), + ProcessNode.processor(Collections.singletonList("1008")), + ProcessNode.cc(Collections.singletonList("3804")) + + ); + GenericResponse stringGenericResponse = approvalApi.applyEvent(ProcessApplyRequest.approverMode("3958", + templateId, + nodeList, + templateDetail.getTemplateContent().getControls(), + dataValues, + summaryList + )); + System.out.println("stringGenericResponse = " + stringGenericResponse); + + + } /** * 企业微信发起审批 */ @@ -423,7 +475,7 @@ void approval() { new Approver("123"), new Approver("123") ); // 摘要 - List summaryList = Collections.singletonList(new Summary(Collections.singletonList(ApprovalTitle.zhCN("测试模板")))); + List summaryList = Collections.singletonList(Summary.zhCN("测试模板")); // 模板 String templateId = "C4UEh71DAPh775HPfXipikZ5eAGosskDibU8hkfxJ"; // 查询模板配置 可以用缓存优化性能 避免直接查询企业微信 diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/ProcessNode.java b/wecom-objects/src/main/java/cn/felord/domain/approval/ProcessNode.java index be1378df..407239d7 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/ProcessNode.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/ProcessNode.java @@ -61,7 +61,7 @@ public static ProcessNode create(ProcessNodeType type, ApvRel apvRel, List userid) { } /** - * Cc process node. + * 抄送节点,支持前抄送后抄送 * - * @param apvRel the apv rel * @param userid the userid * @return the process node */ - public static ProcessNode cc(ApvRel apvRel, List userid) { - return create(ProcessNodeType.CC, apvRel, userid); + public static ProcessNode cc(List userid) { + return create(ProcessNodeType.CC, ApvRel.ALL, userid); } /** - * Processor process node. + * 办理人节点 * * @param userid the userid * @return the process node */ public static ProcessNode processor(List userid) { - return create(ProcessNodeType.PROCESSOR, null, userid); + return create(ProcessNodeType.PROCESSOR, ApvRel.ALL, userid); } } diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/Summary.java b/wecom-objects/src/main/java/cn/felord/domain/approval/Summary.java index 2b7d916c..23ac7d5a 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/Summary.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/Summary.java @@ -15,24 +15,34 @@ package cn.felord.domain.approval; -import lombok.Data; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.ToString; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; /** * The type Summary. * * @author dax - * @since 2024/5/26 + * @since 2024 /5/26 */ -@Data +@ToString +@Getter public class Summary { private final List summaryInfo; + @JsonCreator + Summary(@JsonProperty("summary_info") List summaryInfo) { + this.summaryInfo = summaryInfo; + } + /** - * Zh cn summary. + * 单个中文 * * @param text the text * @return the summary @@ -41,6 +51,18 @@ public static Summary zhCN(String text) { return new Summary(Collections.singletonList(ApprovalTitle.zhCN(text))); } + /** + * 多个中文 + * + * @param texts the texts + * @return the summary + */ + public static Summary zhCN(List texts) { + return new Summary(texts.stream() + .map(ApprovalTitle::zhCN) + .collect(Collectors.toList())); + } + /** * Summary summary. * @@ -51,4 +73,13 @@ public static Summary summary(ApprovalTitle title) { return new Summary(Collections.singletonList(title)); } + /** + * Summary summary. + * + * @param titles the titles + * @return the summary + */ + public static Summary summary(List titles) { + return new Summary(titles); + } } diff --git a/wecom-objects/src/main/java/cn/felord/domain/approval/TextValue.java b/wecom-objects/src/main/java/cn/felord/domain/approval/TextValue.java index e24ba78c..e957e97d 100644 --- a/wecom-objects/src/main/java/cn/felord/domain/approval/TextValue.java +++ b/wecom-objects/src/main/java/cn/felord/domain/approval/TextValue.java @@ -25,7 +25,7 @@ * The type Text value. * * @author dax - * @since 2024/5/26 + * @since 2024 /5/26 */ @ToString @Getter @@ -60,4 +60,13 @@ public static TextValue from(String text) { public static TextValue nullValue() { return new TextValue(""); } + + /** + * Tip text value. + * + * @return the text value + */ + public static TextValue tip() { + return nullValue(); + } } From e10f236bab6253b85eea9f458f4da61321383ee4 Mon Sep 17 00:00:00 2001 From: xiafang Date: Thu, 18 Jul 2024 10:02:39 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=96=B0=E4=B8=AD=E5=A4=AE=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 9b573512..9f79b05e 100644 --- a/pom.xml +++ b/pom.xml @@ -84,8 +84,8 @@ maven-gpg-plugin - org.sonatype.plugins - nexus-staging-maven-plugin + org.sonatype.central + central-publishing-maven-plugin org.apache.maven.plugins @@ -264,14 +264,13 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 true - ossrh - https://oss.sonatype.org/ - false + ossrh + From a7c8e905011f54e19e96694856db1ddd89634887 Mon Sep 17 00:00:00 2001 From: xiafang Date: Thu, 18 Jul 2024 10:06:15 +0800 Subject: [PATCH 7/7] 1.2.8 --- README.md | 6 +++--- pom.xml | 2 +- rx-wecom-sdk/pom.xml | 2 +- samples/spring-boot-sample/pom.xml | 2 +- wecom-common/pom.xml | 2 +- wecom-objects/pom.xml | 2 +- wecom-sdk/pom.xml | 2 +- wemp-objects/pom.xml | 2 +- wemp-sdk/pom.xml | 2 +- wepay-objects/pom.xml | 2 +- wepay-sdk/pom.xml | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 93c167c5..8c05038f 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ void webHooks()throws IOException{ cn.felord wecom-sdk - 1.2.7 + 1.2.8 ``` @@ -115,7 +115,7 @@ void webHooks()throws IOException{ cn.felord rx-wecom-sdk - 1.2.7 + 1.2.8 ``` @@ -127,7 +127,7 @@ void webHooks()throws IOException{ cn.felord wecom-sdk - 1.2.7 + 1.2.8 com.squareup.okhttp3 diff --git a/pom.xml b/pom.xml index 9f79b05e..0a998f0d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 pom wecom diff --git a/rx-wecom-sdk/pom.xml b/rx-wecom-sdk/pom.xml index adba8c84..1d2e1b18 100644 --- a/rx-wecom-sdk/pom.xml +++ b/rx-wecom-sdk/pom.xml @@ -22,7 +22,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 rx-wecom-sdk jar diff --git a/samples/spring-boot-sample/pom.xml b/samples/spring-boot-sample/pom.xml index 1ea19a73..1f4b9f9b 100644 --- a/samples/spring-boot-sample/pom.xml +++ b/samples/spring-boot-sample/pom.xml @@ -39,7 +39,7 @@ cn.felord wecom-sdk - 1.2.7 + 1.2.8 net.sf.ehcache diff --git a/wecom-common/pom.xml b/wecom-common/pom.xml index 862fdf68..bc83328f 100644 --- a/wecom-common/pom.xml +++ b/wecom-common/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wecom-common diff --git a/wecom-objects/pom.xml b/wecom-objects/pom.xml index 7645d2af..b5cdb8ec 100644 --- a/wecom-objects/pom.xml +++ b/wecom-objects/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wecom-objects jar diff --git a/wecom-sdk/pom.xml b/wecom-sdk/pom.xml index ff99e856..54c7a532 100644 --- a/wecom-sdk/pom.xml +++ b/wecom-sdk/pom.xml @@ -22,7 +22,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wecom-sdk jar diff --git a/wemp-objects/pom.xml b/wemp-objects/pom.xml index 9f4794fb..3e445e80 100644 --- a/wemp-objects/pom.xml +++ b/wemp-objects/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wemp-objects diff --git a/wemp-sdk/pom.xml b/wemp-sdk/pom.xml index 1344dbae..64070927 100644 --- a/wemp-sdk/pom.xml +++ b/wemp-sdk/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wemp-sdk diff --git a/wepay-objects/pom.xml b/wepay-objects/pom.xml index 154d8ec2..20f209bf 100644 --- a/wepay-objects/pom.xml +++ b/wepay-objects/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wepay-objects jar diff --git a/wepay-sdk/pom.xml b/wepay-sdk/pom.xml index 818f870e..59538e81 100644 --- a/wepay-sdk/pom.xml +++ b/wepay-sdk/pom.xml @@ -21,7 +21,7 @@ cn.felord wecom - 1.2.7 + 1.2.8 wepay-sdk