package com.mortals.flowable.common.config;

import org.flowable.ui.modeler.service.FlowableModelQueryService;
import org.flowable.ui.modeler.service.ModelImageService;
import org.flowable.ui.modeler.service.ModelServiceImpl;
import org.flowable.ui.modeler.serviceapi.ModelService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 流程设计器serviceconfig
 *
 * @author: zxfei
 * @date: 2021/8/27 2:27
 */
@Configuration
public class ModelerBeanConfig {
//    @Autowired
//    private FlowableCommonAppProperties properties;
//    @Autowired
//    private UserDetailsService userDetailsService;
//    @Autowired
//    private PersistentTokenService persistentTokenService;

    @Bean
    public ModelService createModelService() {
        return new ModelServiceImpl();
    }

    @Bean
    public ModelImageService createModelImageService() {
        return new ModelImageService();
    }

    @Bean
    public FlowableModelQueryService createFlowableModelQueryService() {
        return new FlowableModelQueryService();
    }

//    @Bean
//    @ConditionalOnMissingBean
//    public RememberMeServices flowableUiRememberMeService(FlowableCommonAppProperties properties, UserDetailsService userDetailsService,
//                                                          PersistentTokenService persistentTokenService) {
//        CustomPersistentRememberMeServices customPersistentRememberMeServices = new CustomPersistentRememberMeServices(properties, userDetailsService, persistentTokenService);
//        customPersistentRememberMeServices.setCookieName("DRAGON_FLOW_REMEMBER_ME");
//        return customPersistentRememberMeServices;
//    }
}
