feat(channel): 新增 mci-channel-wecom 模块及 WeComChannelAdapter 桩实现
This commit is contained in:
32
backend/mci-channel-wecom/pom.xml
Normal file
32
backend/mci-channel-wecom/pom.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>com.sino</groupId>
|
||||||
|
<artifactId>sino-mci-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>mci-channel-wecom</artifactId>
|
||||||
|
<name>mci-channel-wecom</name>
|
||||||
|
<description>WeCom channel adapter</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sino</groupId>
|
||||||
|
<artifactId>mci-channel-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.sino.mci.channel.wecom;
|
||||||
|
|
||||||
|
import com.sino.mci.channel.common.dto.CallbackPayload;
|
||||||
|
import com.sino.mci.channel.common.dto.ChannelInitRequest;
|
||||||
|
import com.sino.mci.channel.common.dto.ChannelInitResult;
|
||||||
|
import com.sino.mci.channel.common.dto.SendMessageRequest;
|
||||||
|
import com.sino.mci.channel.common.dto.SendMessageResult;
|
||||||
|
import com.sino.mci.channel.common.model.ChannelType;
|
||||||
|
import com.sino.mci.channel.common.spi.ChannelAdapter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class WeComChannelAdapter implements ChannelAdapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChannelType getChannelType() {
|
||||||
|
return ChannelType.WECOM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChannelInitResult initAccount(ChannelInitRequest request) {
|
||||||
|
ChannelInitResult result = new ChannelInitResult();
|
||||||
|
result.setSuccess(false);
|
||||||
|
result.setMessage("WeCom channel adapter is a stub and has not been implemented yet.");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SendMessageResult sendMessage(SendMessageRequest request) {
|
||||||
|
SendMessageResult result = new SendMessageResult();
|
||||||
|
result.setSuccess(false);
|
||||||
|
result.setMessage("WeCom channel adapter is a stub and has not been implemented yet.");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CallbackPayload parseCallback(String rawBody) {
|
||||||
|
CallbackPayload payload = new CallbackPayload();
|
||||||
|
payload.setChannelType(ChannelType.WECOM.name());
|
||||||
|
payload.setRawBody(rawBody);
|
||||||
|
return payload;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,10 @@
|
|||||||
<groupId>com.sino</groupId>
|
<groupId>com.sino</groupId>
|
||||||
<artifactId>mci-channel-common</artifactId>
|
<artifactId>mci-channel-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sino</groupId>
|
||||||
|
<artifactId>mci-channel-wecom</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module>mci-shared</module>
|
<module>mci-shared</module>
|
||||||
<module>mci-channel-common</module>
|
<module>mci-channel-common</module>
|
||||||
|
<module>mci-channel-wecom</module>
|
||||||
<module>mci-server</module>
|
<module>mci-server</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
@@ -44,6 +45,11 @@
|
|||||||
<artifactId>mci-channel-common</artifactId>
|
<artifactId>mci-channel-common</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sino</groupId>
|
||||||
|
<artifactId>mci-channel-wecom</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user