Skip to content

Autowiring WxMpService

Hippoom edited this page Jun 29, 2017 · 2 revisions

The starter provides a WxMpService instance by default. You can provide a WxMpService instance instead:

    @Configuration
    public class YourWeChatMpConfiguration { 
        @Bean
        protected WxMpService wxMpService(WxMpConfigStorage wxMpConfigStorage) {
            WxMpService wxMpService = new WxMpServiceImpl();
            wxMpService.setWxMpConfigStorage(wxMpConfigStorage);
            // omitted setters
            return wxMpService;
        }
    }
Clone this wiki locally