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

package com.persagy

import org.mybatis.spring.annotation.MapperScan
import org.slf4j.LoggerFactory
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 = ["com.persagy", "com.persagy.meiku", "com.persagy.legend", "com.sybotan"])           // 配置组件扫描路径
@MapperScan("com.persagy", "com.persagy.meiku", "com.persagy.legend", "com.sybotan","cn.sagacloud.server")                       // Mapper组件扫描路径
@SpringBootApplication
open class MeiKuApp : SpringBootServletInitializer() {
    companion object {
        // 日志
        private val logger = LoggerFactory.getLogger(MeiKuApp::class.java)
    } // Companion object

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

//    /**
//     * 配置FastJson
//     *
//     * @return  HttpMessageConverters
//     */
//    @Bean
//    @Suppress("MoveLambdaOutsideParentheses")
//    open fun jsonHttpMessageConverters(): SJsonHttpMessageConverter {
//        val fastConverter = SJsonHttpMessageConverter()
//        fastConverter.propertyNamingStrategy = com.alibaba.fastjson.PropertyNamingStrategy.CamelCase
//        return fastConverter
//    } // Function fastJsonHttpMessageConverters()

} // Class Application

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