Skip to content

Commit

Permalink
Merge pull request #288 from rememberber/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rememberber authored Sep 4, 2023
2 parents 2e87693 + 6e3b4f2 commit ee7e57c
Show file tree
Hide file tree
Showing 32 changed files with 1,238 additions and 124 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ language: java

before_install:
- mvn install:install-file -Dfile=./lib/antlr-2.7.4.jar -DgroupId=net.sourceforge.cpdetector -DartifactId=antlr -Dpackaging=jar -Dversion=2.7.4 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/beautyeye_lnf.jar -DgroupId=com.beautyeye -DartifactId=beautyeye-lnf -Dpackaging=jar -Dversion=1.0 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/chardet-1.0.jar -DgroupId=net.sourceforge.cpdetector -DartifactId=chardet -Dpackaging=jar -Dversion=1.0.0 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/cpdetector_1.0.10.jar -DgroupId=net.sourceforge.cpdetector -DartifactId=cpdetector -Dpackaging=jar -Dversion=1.0.10 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/darcula.jar -DgroupId=com.darcula -DartifactId=darcula-lnf -Dpackaging=jar -Dversion=1.0 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/jargs-1.0.jar -DgroupId=net.sourceforge.cpdetector -DartifactId=jargs -Dpackaging=jar -Dversion=1.0.0 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/taobao-sdk-java-auto.jar -DgroupId=com.taobao -DartifactId=taobao-sdk-java-auto -Dpackaging=jar -Dversion=1.0.0 -DgeneratePom=true -DcreateChecksum=true
- mvn install:install-file -Dfile=./lib/weblaf-1.29.jar -DgroupId=com.weblaf -DartifactId=weblaf-lnf -Dpackaging=jar -Dversion=1.2.9 -DgeneratePom=true -DcreateChecksum=true

jdk:
- openjdk8
Expand Down
Binary file added assets/screen_shoot/theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/beautyeye_lnf.jar
Binary file not shown.
Binary file removed lib/darcula.jar
Binary file not shown.
Binary file removed lib/weblaf-1.29.jar
Binary file not shown.
131 changes: 54 additions & 77 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.fangxuele.tool</groupId>
<artifactId>WePush</artifactId>
<version>5.0.1</version>
<version>5.0.2</version>
<packaging>jar</packaging>

<name>WePush</name>
Expand Down Expand Up @@ -37,8 +37,8 @@
<yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version>
<velocity-engine-core.version>2.3</velocity-engine-core.version>
<lombok.version>1.18.20</lombok.version>
<mybatis.version>3.5.7</mybatis.version>
<sqlite-jdbc.version>3.36.0.3</sqlite-jdbc.version>
<mybatis.version>3.5.13</mybatis.version>
<sqlite-jdbc.version>3.42.0.1</sqlite-jdbc.version>
<junit.version>4.13.1</junit.version>
<httpasyncclient.version>4.1.4</httpasyncclient.version>
<HikariCP.version>3.4.5</HikariCP.version>
Expand All @@ -51,6 +51,7 @@
<flatlaf-extras.version>3.2</flatlaf-extras.version>
<flatlaf-intellij-themes.version>3.2</flatlaf-intellij-themes.version>
<json-path.version>2.6.0</json-path.version>
<tencentcloud-sdk-java.version>3.1.847</tencentcloud-sdk-java.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -425,6 +426,12 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>${tencentcloud-sdk-java.version}</version>
</dependency>

</dependencies>

<build>
Expand All @@ -440,36 +447,36 @@
<generateInstaller>true</generateInstaller>
</configuration>
<executions>
<!-- <execution>-->
<!-- <id>bundling-for-windows</id>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>package</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <platform>windows</platform>-->
<!-- <createZipball>true</createZipball>-->
<!-- <additionalModules>jdk.crypto.ec,jdk.charsets</additionalModules>-->
<!-- &lt;!&ndash; <administratorRequired>true</administratorRequired>&ndash;&gt;-->
<!-- <winConfig>-->

<!-- &lt;!&ndash; general properties &ndash;&gt;-->
<!-- <generateSetup>true</generateSetup>-->
<!-- <generateMsi>true</generateMsi>-->
<!-- <generateMsm>true</generateMsm>-->

<!-- &lt;!&ndash; setup generation properties &ndash;&gt;-->
<!-- <setupMode>installForAllUsers</setupMode>-->
<!-- <createDesktopIconTask>true</createDesktopIconTask>-->
<!-- <disableDirPage>false</disableDirPage>-->
<!-- <disableFinishedPage>false</disableFinishedPage>-->
<!-- <setupLanguages>-->
<!-- <english>compiler:Default.isl</english>-->
<!-- &lt;!&ndash; <spanish>compiler:Languages\Chinese.isl</spanish>&ndash;&gt;-->
<!-- </setupLanguages>-->
<!-- </winConfig>-->
<!-- </configuration>-->
<!-- </execution>-->
<execution>
<id>bundling-for-windows</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>windows</platform>
<createZipball>true</createZipball>
<additionalModules>jdk.crypto.ec,jdk.charsets</additionalModules>
<!-- <administratorRequired>true</administratorRequired>-->
<winConfig>

<!-- general properties -->
<generateSetup>true</generateSetup>
<generateMsi>true</generateMsi>
<generateMsm>true</generateMsm>

<!-- setup generation properties -->
<setupMode>installForAllUsers</setupMode>
<createDesktopIconTask>true</createDesktopIconTask>
<disableDirPage>false</disableDirPage>
<disableFinishedPage>false</disableFinishedPage>
<setupLanguages>
<english>compiler:Default.isl</english>
<!-- <spanish>compiler:Languages\Chinese.isl</spanish>-->
</setupLanguages>
</winConfig>
</configuration>
</execution>
<!-- <execution>-->
<!-- <id>bundling-for-linux</id>-->
<!-- <phase>package</phase>-->
Expand All @@ -483,20 +490,20 @@
<!-- <jdkPath>X:\\path\to\linux\jdk</jdkPath>-->
<!-- </configuration>-->
<!-- </execution>-->
<execution>
<id>bundling-for-mac</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>mac</platform>
<createTarball>true</createTarball>
<additionalModules>jdk.crypto.ec,jdk.charsets</additionalModules>
<customizedJre>false</customizedJre>
<!-- <jdkPath>X:\\path\to\mac\jdk</jdkPath>-->
</configuration>
</execution>
<!-- <execution>-->
<!-- <id>bundling-for-mac</id>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>package</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <platform>mac</platform>-->
<!-- <createTarball>true</createTarball>-->
<!-- <additionalModules>jdk.crypto.ec,jdk.charsets</additionalModules>-->
<!-- <customizedJre>false</customizedJre>-->
<!-- &lt;!&ndash; <jdkPath>X:\\path\to\mac\jdk</jdkPath>&ndash;&gt;-->
<!-- </configuration>-->
<!-- </execution>-->
</executions>
</plugin>

Expand All @@ -505,36 +512,6 @@
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-beautyeye</id>
<phase>clean</phase>
<configuration>
<file>lib/beautyeye_lnf.jar</file>
<groupId>com.beautyeye</groupId>
<artifactId>beautyeye-lnf</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-darcula</id>
<phase>clean</phase>
<configuration>
<file>lib/darcula.jar</file>
<groupId>com.darcula</groupId>
<artifactId>darcula-lnf</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-taobao-sdk-auto</id>
<phase>clean</phase>
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Windows • Linux • macOS
![Overview](assets/screen_shoot/5.png)
![Overview](assets/screen_shoot/7.png)
![Overview](assets/screen_shoot/6.png)
![Overview](assets/screen_shoot/theme.png)
### 安装文件下载

[WePush下载地址](https://gitee.com/zhoubochina/WePush/releases)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.fangxuele.tool.push.bean.account;

import lombok.Data;

/**
* 腾讯云3.0账号配置
*/
@Data
public class TxYun3AccountConfig {
private String secretId;
private String secretKey;
private String endPoint;
private String region;
private String sign;
private String sdkAppId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public class WxCpAccountConfig {
private String appName;
private String agentId;
private String secret;
private Boolean privateDep;
private String baseApiUrl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public enum MessageTypeEnum {
WX_UNIFORM_MESSAGE(17, "小程序-统一服务消息"),
MA_SUBSCRIBE(18, "小程序-订阅消息"),
MP_SUBSCRIBE(19, "公众号-订阅通知"),
WX_MP(20, "微信公众号"),
WX_MA(21, "微信小程序");
TX_YUN_3(20, "腾讯云短信3.0");

private int code;

Expand All @@ -55,6 +54,7 @@ public enum MessageTypeEnum {
public static final int WX_UNIFORM_MESSAGE_CODE = 17;
public static final int MA_SUBSCRIBE_CODE = 18;
public static final int MP_SUBSCRIBE_CODE = 19;
public static final int TX_YUN_3_CODE = 20;

MessageTypeEnum(int code, String name) {
this.code = code;
Expand Down Expand Up @@ -123,10 +123,7 @@ public static String getName(int code) {
name = MP_SUBSCRIBE.name;
break;
case 20:
name = WX_MP.name;
break;
case 21:
name = WX_MA.name;
name = TX_YUN_3.name;
break;
default:
name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public static IMsgMaker getMsgMaker(TMsg tMsg) {
case MessageTypeEnum.TX_YUN_CODE:
iMsgMaker = new TxYunMsgMaker(tMsg);
break;
case MessageTypeEnum.TX_YUN_3_CODE:
iMsgMaker = new TxYun3MsgMaker(tMsg);
break;
case MessageTypeEnum.HW_YUN_CODE:
iMsgMaker = new HwYunMsgMaker(tMsg);
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.fangxuele.tool.push.logic.msgmaker;

import com.alibaba.fastjson.JSON;
import com.fangxuele.tool.push.bean.TemplateData;
import com.fangxuele.tool.push.domain.TMsg;
import com.fangxuele.tool.push.domain.TMsgSms;
import com.fangxuele.tool.push.util.TemplateUtil;
import lombok.Getter;
import org.apache.velocity.VelocityContext;

import java.util.ArrayList;
import java.util.List;

/**
* <pre>
* 腾讯云3.0模板短信加工器
* </pre>
*
* @author <a href="https://github.com/rememberber">Zhou Bo</a>
* @since 2023/9/4.
*/
@Getter
public class TxYun3MsgMaker extends BaseMsgMaker implements IMsgMaker {

private String templateId;

private List<String> paramList;

public TxYun3MsgMaker(TMsg tMsg) {
TMsgSms tMsgSms = JSON.parseObject(tMsg.getContent(), TMsgSms.class);
this.templateId = tMsgSms.getTemplateId();
paramList = new ArrayList<>();
for (TemplateData templateData : tMsgSms.getTemplateDataList()) {
paramList.add(templateData.getValue());
}
}

/**
* 组织腾讯云短信消息
*
* @param msgData 消息信息
* @return String[]
*/
@Override
public String[] makeMsg(String[] msgData) {

VelocityContext velocityContext = getVelocityContext(msgData);
for (int i = 0; i < paramList.size(); i++) {
paramList.set(i, TemplateUtil.evaluate(paramList.get(i), velocityContext));
}
String[] paramArray = new String[paramList.size()];
return paramList.toArray(paramArray);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public static IMsgSender getMsgSender(Integer msgId, Integer dryRun) {
case MessageTypeEnum.TX_YUN_CODE:
iMsgSender = new TxYunMsgSender(msgId, dryRun);
break;
case MessageTypeEnum.TX_YUN_3_CODE:
iMsgSender = new TxYun3MsgSender(msgId, dryRun);
break;
case MessageTypeEnum.HW_YUN_CODE:
iMsgSender = new HwYunMsgSender(msgId, dryRun);
break;
Expand Down
Loading

0 comments on commit ee7e57c

Please sign in to comment.