java-wechaty-getting-started icon indicating copy to clipboard operation
java-wechaty-getting-started copied to clipboard

How to configure to springboot project

Open wu1005690803 opened this issue 5 years ago • 1 comments
trafficstars

How to configure to springboot project

wu1005690803 avatar Jun 14 '20 03:06 wu1005690803

目前没有提供直接可用的 springboot starter. 你可以尝试自己写一个. 现在可以尝试在 @Configrationable 类里面。初始化。然后就可以

@Bean
public Wecahty wecahty(){
    return Wechaty.instance()
      .onScan((qrcode, statusScanStatus, data) -> System.out.println(QrcodeUtils.getQr(qrcode)))
      .onLogin(user -> System.out.println("User logined :" + user))
      .onMessage(message -> System.out.println("Message:" + message))
      .start(true);
}
@Autowired
private Wecahty wechaty 

diaozxin007 avatar Jun 14 '20 08:06 diaozxin007