/*
 * ********************************************************************************************************************
 *
 *                     :*$@@%$*:                         ;:                ;;    ;;
 *                   :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
 *                  :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
 *                  =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
 *                  =@*                                  %!              @ $= % %@=   =%@!      %=
 *             *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
 *           %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
 *         ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
 *         $@*   ;@@@%=!:                *@*
 *         =@$    ;;;!=%@@@@=!           =@!
 *          %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
 *           ;%@@$=$@@%*       *@@@$=%@@%;
 *              ::;::             ::;::                                              All rights reserved.
 *
 * ********************************************************************************************************************
 */
package cn.sagacloud.server.scheduler

import cn.sagacloud.server.Server
import org.mybatis.spring.annotation.MapperScan
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer

import org.springframework.context.annotation.ComponentScan

/**
 * 应用配置
 *
 * @author  Andy
 */
@ComponentScan(basePackages = ["cn.sagacloud.server", "com.sybotan"])           // 配置组件扫描路径
@MapperScan("com.sybotan", "cn.sagacloud.server")                       // Mapper组件扫描路径
//@EnableEurekaClient
//@EnableDiscoveryClient
@SpringBootApplication
open class SchedulerApp : SpringBootServletInitializer() {

    companion object {
        // 日志
        private val logger = LoggerFactory.getLogger(SchedulerApp::class.java)
    } // Companion object

    /**
     * 配置应用
     *
     * @param   application     应用构建对象
     */
    override fun configure(application: SpringApplicationBuilder): SpringApplicationBuilder {
        return application.sources(SchedulerApp::class.java)
    } // Function configure
} // Class Application

/**
 * Web应用入口
 *
 * @param   args        命令行参数
 */
fun main(args: Array<String>) {
    SpringApplication.run(SchedulerApp::class.java, *args)
//    Server().start()
    return
} // Function main()
