Skip to content

Commit a62ad85

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/20200518-renxiaoya
2 parents e03ab05 + eba098c commit a62ad85

File tree

15 files changed

+168
-176
lines changed

15 files changed

+168
-176
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,14 @@ mvn install wechaty
263263

264264
### master
265265

266+
### v0.1.1 (May 31 2020)
267+
268+
1. update version to 0.1.1-SNAPSHOT
269+
1. finish all function of room
270+
1. remove log4j2 package from wechaty
271+
1. change all log level to debug
272+
1. remove log4j2.xml from wechaty
273+
266274
### v0.1 (May 18 2020)
267275

268276
We decided to use Kotlin to develop the Java Wechaty!

pom.xml

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>io.github.wechaty</groupId>
66
<artifactId>wechaty-parent</artifactId>
77
<packaging>pom</packaging>
8-
<version>0.1.0-SNAPSHOT</version>
8+
<version>0.1.1-SNAPSHOT</version>
99
<name>kotlin-wechaty</name>
1010

1111
<description>
@@ -26,8 +26,6 @@
2626
<dokka.version>0.10.1</dokka.version>
2727
</properties>
2828

29-
30-
3129
<modules>
3230
<module>wechaty</module>
3331
<module>wechaty-puppet</module>
@@ -74,22 +72,28 @@
7472
</dependency>
7573

7674

77-
<dependency>
78-
<groupId>org.apache.logging.log4j</groupId>
79-
<artifactId>log4j-api</artifactId>
80-
<version>2.13.1</version>
81-
</dependency>
82-
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
83-
<dependency>
84-
<groupId>org.apache.logging.log4j</groupId>
85-
<artifactId>log4j-core</artifactId>
86-
<version>2.13.1</version>
87-
</dependency>
88-
<dependency> <!-- 桥接:告诉Slf4j使用Log4j2 -->
89-
<groupId>org.apache.logging.log4j</groupId>
90-
<artifactId>log4j-slf4j-impl</artifactId>
91-
<version>2.13.1</version>
92-
</dependency>
75+
<!-- <dependency>-->
76+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
77+
<!-- <artifactId>log4j-api</artifactId>-->
78+
<!-- <version>2.13.1</version>-->
79+
<!-- </dependency>-->
80+
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core &ndash;&gt;-->
81+
<!-- <dependency>-->
82+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
83+
<!-- <artifactId>log4j-core</artifactId>-->
84+
<!-- <version>2.13.1</version>-->
85+
<!-- </dependency>-->
86+
<!-- <dependency> &lt;!&ndash; 桥接:告诉Slf4j使用Log4j2 &ndash;&gt;-->
87+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
88+
<!-- <artifactId>log4j-slf4j-impl</artifactId>-->
89+
<!-- <version>2.13.1</version>-->
90+
<!-- </dependency>-->
91+
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/com.lmax/disruptor &ndash;&gt;-->
92+
<!-- <dependency>-->
93+
<!-- <groupId>com.lmax</groupId>-->
94+
<!-- <artifactId>disruptor</artifactId>-->
95+
<!-- <version>3.4.2</version>-->
96+
<!-- </dependency>-->
9397

9498
<dependency>
9599
<groupId>org.slf4j</groupId>
@@ -109,13 +113,6 @@
109113
<version>2.11.0</version>
110114
</dependency>
111115

112-
<!-- https://mvnrepository.com/artifact/io.netty/netty-tcnative-boringssl-static -->
113-
<dependency>
114-
<groupId>io.netty</groupId>
115-
<artifactId>netty-tcnative-boringssl-static</artifactId>
116-
<version>2.0.30.Final</version>
117-
</dependency>
118-
119116
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
120117
<dependency>
121118
<groupId>com.fasterxml.jackson.core</groupId>
@@ -145,11 +142,11 @@
145142
</dependency>
146143

147144

148-
<dependency>
149-
<groupId>com.tinder.statemachine</groupId>
150-
<artifactId>statemachine</artifactId>
151-
<version>0.2.0</version>
152-
</dependency>
145+
<!-- <dependency>-->
146+
<!-- <groupId>com.tinder.statemachine</groupId>-->
147+
<!-- <artifactId>statemachine</artifactId>-->
148+
<!-- <version>0.2.0</version>-->
149+
<!-- </dependency>-->
153150

154151
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
155152
<dependency>
@@ -159,19 +156,19 @@
159156
</dependency>
160157

161158

162-
<!-- https://mvnrepository.com/artifact/com.lmax/disruptor -->
163-
<dependency>
164-
<groupId>com.lmax</groupId>
165-
<artifactId>disruptor</artifactId>
166-
<version>3.4.2</version>
167-
</dependency>
159+
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/com.lmax/disruptor &ndash;&gt;-->
160+
<!-- <dependency>-->
161+
<!-- <groupId>com.lmax</groupId>-->
162+
<!-- <artifactId>disruptor</artifactId>-->
163+
<!-- <version>3.4.2</version>-->
164+
<!-- </dependency>-->
168165

169-
<!-- https://mvnrepository.com/artifact/io.grpc/grpc-kotlin-stub -->
170-
<dependency>
171-
<groupId>io.grpc</groupId>
172-
<artifactId>grpc-kotlin-stub</artifactId>
173-
<version>0.1.1</version>
174-
</dependency>
166+
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/io.grpc/grpc-kotlin-stub &ndash;&gt;-->
167+
<!-- <dependency>-->
168+
<!-- <groupId>io.grpc</groupId>-->
169+
<!-- <artifactId>grpc-kotlin-stub</artifactId>-->
170+
<!-- <version>0.1.1</version>-->
171+
<!-- </dependency>-->
175172

176173
<dependency>
177174
<groupId>org.hamcrest</groupId>
@@ -198,8 +195,8 @@
198195
</dependencies>
199196
</dependencyManagement>
200197

201-
<!-- <build>-->
202-
<!-- <plugins>-->
198+
<build>
199+
<plugins>
203200
<!-- <plugin>-->
204201
<!-- <groupId>org.apache.maven.plugins</groupId>-->
205202
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
@@ -220,8 +217,8 @@
220217
<!-- </execution>-->
221218
<!-- </executions>-->
222219
<!-- </plugin>-->
223-
<!-- </plugins>-->
224-
<!-- </build>-->
220+
</plugins>
221+
</build>
225222

226223

227224
<contributors>

wechaty-puppet-hostie/pom.xml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.github.wechaty</groupId>
66
<artifactId>wechaty-parent</artifactId>
7-
<version>0.1.0-SNAPSHOT</version>
7+
<version>0.1.1-SNAPSHOT</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<artifactId>wechaty-puppet-hostie</artifactId>
@@ -30,18 +30,6 @@
3030
<groupId>io.github.wechaty</groupId>
3131
<artifactId>grpc</artifactId>
3232
</dependency>
33-
<!-- <dependency>-->
34-
<!-- <groupId>io.netty</groupId>-->
35-
<!-- <artifactId>netty-transport-native-kqueue</artifactId>-->
36-
<!-- <classifier>osx-x86_64</classifier>-->
37-
<!-- </dependency>-->
38-
39-
<!-- <dependency>-->
40-
<!-- <groupId>io.netty</groupId>-->
41-
<!-- <artifactId>netty-transport-native-epoll</artifactId>-->
42-
<!-- <classifier>linux-x86_64</classifier>-->
43-
<!-- </dependency>-->
44-
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
4533
<dependency>
4634
<groupId>com.squareup.okhttp3</groupId>
4735
<artifactId>okhttp</artifactId>
@@ -53,34 +41,33 @@
5341
<artifactId>guava</artifactId>
5442
</dependency>
5543

56-
<dependency>
57-
<groupId>org.apache.logging.log4j</groupId>
58-
<artifactId>log4j-api</artifactId>
59-
</dependency>
60-
<dependency>
61-
<groupId>org.apache.logging.log4j</groupId>
62-
<artifactId>log4j-core</artifactId>
63-
</dependency>
64-
<dependency>
65-
<groupId>org.apache.logging.log4j</groupId>
66-
<artifactId>log4j-slf4j-impl</artifactId>
67-
</dependency>
44+
<!-- <dependency>-->
45+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
46+
<!-- <artifactId>log4j-api</artifactId>-->
47+
<!-- </dependency>-->
48+
<!-- <dependency>-->
49+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
50+
<!-- <artifactId>log4j-core</artifactId>-->
51+
<!-- </dependency>-->
52+
<!-- <dependency>-->
53+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
54+
<!-- <artifactId>log4j-slf4j-impl</artifactId>-->
55+
<!-- </dependency>-->
6856
<dependency>
6957
<groupId>org.slf4j</groupId>
7058
<artifactId>slf4j-api</artifactId>
7159
</dependency>
7260

73-
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/io.netty/netty-tcnative-boringssl-static &ndash;&gt;-->
74-
<!-- <dependency>-->
75-
<!-- <groupId>io.netty</groupId>-->
76-
<!-- <artifactId>netty-tcnative-boringssl-static</artifactId>-->
77-
<!-- </dependency>-->
78-
7961
<dependency>
8062
<groupId>com.fasterxml.jackson.module</groupId>
8163
<artifactId>jackson-module-kotlin</artifactId>
8264
</dependency>
8365

66+
<dependency>
67+
<groupId>org.apache.commons</groupId>
68+
<artifactId>commons-lang3</artifactId>
69+
</dependency>
70+
8471
</dependencies>
8572

8673
<build>

wechaty-puppet-hostie/src/main/kotlin/io/github/wechaty/grpc/GrpcPuppet.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
2929

3030
private var channel: ManagedChannel? = null
3131

32-
private val GRPC_PROT = 8788
33-
3432
private val CHATIE_ENDPOINT = "https://api.chatie.io/v0/hosties/"
3533

3634
private val client: OkHttpClient = OkHttpClient()
@@ -75,7 +73,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
7573
state = try {
7674
startGrpcClient().get()
7775
val state = channel!!.getState(true)
78-
log.info(state.name)
76+
log.debug(state.name)
7977
val startRequest = Base.StartRequest.newBuilder().build()
8078
val start = grpcClient!!.start(startRequest)
8179
startGrpcStream()
@@ -92,7 +90,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
9290

9391
override fun stop(): Future<Void> {
9492

95-
log.info("stop()")
93+
log.debug("stop()")
9694
if (state == StateEnum.OFF) {
9795
log.warn("stop() is called on a OFF puppet. await ready(off) and return.")
9896
return CompletableFuture.completedFuture(null)
@@ -129,7 +127,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
129127

130128
override fun unref() {
131129

132-
log.info("unref")
130+
log.debug("unref")
133131
super.unref()
134132

135133
}
@@ -187,7 +185,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
187185
fun stopGrpcClient(): Future<Void> {
188186

189187
channel!!.shutdown().awaitTermination(5, TimeUnit.SECONDS)
190-
log.info("grpc is shutdown")
188+
log.debug("grpc is shutdown")
191189
return CompletableFuture.completedFuture(null)
192190
}
193191

@@ -580,8 +578,8 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
580578

581579
val fileJson = file.toJsonString()
582580

583-
log.info("json is {}", fileJson)
584-
log.info("json size is {}", fileJson.length)
581+
log.debug("json is {}", fileJson)
582+
log.debug("json size is {}", fileJson.length)
585583

586584
val request = Message.MessageSendFileRequest.newBuilder()
587585
.setConversationId(conversationId)
@@ -942,7 +940,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
942940
val type = event.type
943941
val payload = event.payload
944942

945-
log.info("PuppetHostie $type payload $payload")
943+
log.debug("PuppetHostie $type payload $payload")
946944

947945
if (type != Event.EventType.EVENT_TYPE_HEARTBEAT) {
948946
emit("heartbeat", EventHeartbeatPayload("heartbeat"))
@@ -1004,7 +1002,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
10041002

10051003
Event.EventType.EVENT_TYPE_SCAN -> {
10061004
val eventScanPayload = JsonUtils.readValue<EventScanPayload>(payload)
1007-
log.info("scan pay load is {}", eventScanPayload)
1005+
log.debug("scan pay load is {}", eventScanPayload)
10081006
emit("scan", eventScanPayload)
10091007
}
10101008

@@ -1018,7 +1016,7 @@ class GrpcPuppet(puppetOptions: PuppetOptions) : Puppet(puppetOptions) {
10181016

10191017

10201018
else -> {
1021-
log.info("PuppetHostie $type payload $payload")
1019+
log.debug("PuppetHostie $type payload $payload")
10221020
}
10231021

10241022

wechaty-puppet/pom.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.github.wechaty</groupId>
66
<artifactId>wechaty-parent</artifactId>
7-
<version>0.1.0-SNAPSHOT</version>
7+
<version>0.1.1-SNAPSHOT</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<artifactId>wechaty-puppet</artifactId>
@@ -40,21 +40,21 @@
4040
<artifactId>commons-lang3</artifactId>
4141
</dependency>
4242

43-
<!--log4j2核心包-->
44-
<dependency>
45-
<groupId>org.apache.logging.log4j</groupId>
46-
<artifactId>log4j-api</artifactId>
47-
</dependency>
48-
<dependency>
49-
<groupId>org.apache.logging.log4j</groupId>
50-
<artifactId>log4j-core</artifactId>
51-
</dependency>
52-
53-
<!--用于与slf4j保持桥接-->
54-
<dependency>
55-
<groupId>org.apache.logging.log4j</groupId>
56-
<artifactId>log4j-slf4j-impl</artifactId>
57-
</dependency>
43+
<!-- &lt;!&ndash;log4j2核心包&ndash;&gt;-->
44+
<!-- <dependency>-->
45+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
46+
<!-- <artifactId>log4j-api</artifactId>-->
47+
<!-- </dependency>-->
48+
<!-- <dependency>-->
49+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
50+
<!-- <artifactId>log4j-core</artifactId>-->
51+
<!-- </dependency>-->
52+
53+
<!-- &lt;!&ndash;用于与slf4j保持桥接&ndash;&gt;-->
54+
<!-- <dependency>-->
55+
<!-- <groupId>org.apache.logging.log4j</groupId>-->
56+
<!-- <artifactId>log4j-slf4j-impl</artifactId>-->
57+
<!-- </dependency>-->
5858
<!-- slf4j核心包-->
5959
<dependency>
6060
<groupId>org.slf4j</groupId>
@@ -95,10 +95,10 @@
9595
<artifactId>commons-io</artifactId>
9696
</dependency>
9797

98-
<dependency>
99-
<groupId>com.tinder.statemachine</groupId>
100-
<artifactId>statemachine</artifactId>
101-
</dependency>
98+
<!-- <dependency>-->
99+
<!-- <groupId>com.tinder.statemachine</groupId>-->
100+
<!-- <artifactId>statemachine</artifactId>-->
101+
<!-- </dependency>-->
102102

103103
<dependency>
104104
<groupId>com.squareup.okhttp3</groupId>

0 commit comments

Comments
 (0)