|
@@ -1,5 +1,9 @@
|
|
|
package com.keao.edu.user;
|
|
|
|
|
|
+import com.huifu.adapay.Adapay;
|
|
|
+import com.huifu.adapay.model.MerConfig;
|
|
|
+import com.keao.edu.thirdparty.adapay.ConfigInit;
|
|
|
+import com.keao.edu.user.service.NotifyCallback;
|
|
|
import com.spring4all.swagger.EnableSwagger2Doc;
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
@@ -32,4 +36,15 @@ public class UserServerApplication {
|
|
|
public RestTemplate restTemplate() {
|
|
|
return new RestTemplate();
|
|
|
}
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public static void startMqtt() {
|
|
|
+ MerConfig merConfig = ConfigInit.merConfig;
|
|
|
+ NotifyCallback notifyCallback = new NotifyCallback();
|
|
|
+ try {
|
|
|
+ Adapay.startMqttListener(merConfig, notifyCallback);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|