🎨 add test ,clear useless

This commit is contained in:
陈宁 2023-05-30 15:28:42 +08:00
parent c3669a14ad
commit 6c294ea44a
9 changed files with 95 additions and 40 deletions

View File

@ -19,5 +19,14 @@
<maven.install.skip>true</maven.install.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.axzo.msgcenter</groupId>
<artifactId>wx-notices</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,54 @@
package cn.axzo.msg.center.webapi;
import cn.axzo.msg.center.wx.notices.cp.WxCpMessageHandler;
import cn.axzo.msg.center.wx.notices.miniapp.WxMiniMessageHandler;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
/**
* @author cn
* @version 1.0
* @description
* @date 2023/5/30 13:49
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("test")
public class TestController {
private final WxMiniMessageHandler wxMiniMessageHandler;
private final WxCpMessageHandler wxCpMessageHandler;
@GetMapping("/mini")
public void testMiniMessage() throws WxErrorException {
WxMaSubscribeMessage wxMaSubscribeMessage = new WxMaSubscribeMessage();
wxMaSubscribeMessage.setToUser("o2cj55Ov0ObbG9gnvnXiN92uzimg");
wxMaSubscribeMessage.setTemplateId("Vuj7zSwCHqh4nkhw0hCp0z385e6NDUFUe90VLQk5zbM");
wxMaSubscribeMessage.setPage("");
wxMaSubscribeMessage.setMiniprogramState("");
ArrayList<WxMaSubscribeMessage.MsgData> objects = new ArrayList<>();
WxMaSubscribeMessage.MsgData msgData = new WxMaSubscribeMessage.MsgData();
msgData.setName("thing1");
msgData.setValue("{\"value\": 测试, \"color\": \"#173177\"}");
objects.add(msgData);
WxMaSubscribeMessage.MsgData msgData1 = new WxMaSubscribeMessage.MsgData();
msgData1.setName("time2");
msgData1.setValue("{\"value\": 2023年5月30号 14:28, \"color\": \"#173177\"}");
objects.add(msgData1);
WxMaSubscribeMessage.MsgData msgData2 = new WxMaSubscribeMessage.MsgData();
msgData2.setName("thing3");
msgData2.setValue("{\"value\":流比plus, \"color\": \"#173177\"}");
objects.add(msgData2);
wxMaSubscribeMessage.setData(objects);
wxMiniMessageHandler.switchConfig("wxa7568e4542244b54", "d8613a498e8e384de9790422e90278af")
.sendSubscribeMsg(wxMaSubscribeMessage);
}
}

View File

@ -20,14 +20,6 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.axzo.msg.notices.common</groupId>
<artifactId>msg-notices-common</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.dao</groupId>
<artifactId>msg-notices-dao</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.dao</groupId>
<artifactId>msg-notices-dao</artifactId>

View File

@ -20,14 +20,6 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.axzo.msg.notices.common</groupId>
<artifactId>msg-notices-common</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.manager.api</groupId>
<artifactId>msg-notices-manager-api</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.manager.api</groupId>
<artifactId>msg-notices-manager-api</artifactId>

View File

@ -20,14 +20,6 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.axzo.msg.notices.service.api</groupId>
<artifactId>msg-notices-service-api</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.manager</groupId>
<artifactId>msg-notices-manager</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
@ -50,12 +42,6 @@
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.manager.api</groupId>
<artifactId>msg-notices-manager-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.integration</groupId>
<artifactId>msg-notices-integration</artifactId>
@ -68,12 +54,6 @@
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.axzo.msg.notices.manager</groupId>
<artifactId>msg-notices-manager</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

10
pom.xml
View File

@ -68,6 +68,16 @@
<artifactId>msg-center-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cn.axzo.msgcenter</groupId>
<artifactId>wx-notices</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cn.axzo.msgcenter</groupId>
<artifactId>msg-center-webapi</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@ -6,7 +6,8 @@
<parent>
<groupId>cn.axzo.msgcenter</groupId>
<artifactId>msg-center</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>start</artifactId>
@ -18,6 +19,18 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.axzo.msgcenter</groupId>
<artifactId>msg-center-webapi</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.trade</groupId>
<artifactId>trade-web-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.msgcenter</groupId>
<artifactId>wx-notices</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>

View File

@ -3,6 +3,7 @@ package cn.axzo.msg.center;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
@ -13,7 +14,7 @@ import org.springframework.core.env.Environment;
* @date 2023/5/30 11:01
*/
@Slf4j
@SpringBootApplication
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class MsgCenterApplication {
public static void main(String[] args) {
ConfigurableApplicationContext run = SpringApplication.run(MsgCenterApplication.class, args);

View File

@ -8,6 +8,11 @@ spring:
deserialization:
fail-on-unknown-properties: false
read-unknown-enum-values-as-null: true
mvc:
throw-exception-if-no-handler-found: true
web:
resources:
add-mappings: false
mybatis-plus:
#枚举扫描多个package用逗号或者分号分隔
typeEnumsPackage: cn.axzo.diplomat.server.infrastructure.common.enums
@ -20,7 +25,6 @@ mybatis-plus:
logic-delete-value: id #逻辑已删除值(默认为 1)
logic-not-delete-value: 0 #逻辑未删除值(默认为 0)
logic-delete-field: is_delete #逻辑删除字段
trade:
config:
pool: