EquipComponentApp.kt 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * ********************************************************************************************************************
  3. *
  4. * :*$@@%$*: ;: ;; ;;
  5. * :@@%! :!@@%: %! ;%%@@%$ =@@@@@@@%; @%@@@%%%%@@@@@
  6. * :@%; :$= %%$$$%$$ ;$$ ;$@= !@$
  7. * =@! %! @ $=;% !@@@%: !$$$$$$$$$$$$$$=
  8. * =@* %! @ $= % %@= =%@! %=
  9. * *$%%! @@= ;=$%%%$*: %! @ $= % =%%%%%%@$ *%: =%
  10. * %@@!: !@@@%=$@@@@%! :*@@$: %! @ $= % $* ;@ @* :%*
  11. * ;@@! ;!!!;: ;@%: =======@%========* @ $$ % $%*****$@ :@$=*********=@$
  12. * $@* ;@@@%=!: *@*
  13. * =@$ ;;;!=%@@@@=! =@!
  14. * %@$: =@%: :*@@@* %@= Copyright (c) 2016-2019. 北京上格云技术有限公司
  15. * ;%@@$=$@@%* *@@@$=%@@%;
  16. * ::;:: ::;:: All rights reserved.
  17. *
  18. * ********************************************************************************************************************
  19. */
  20. package com.persagy.server
  21. import com.persagy.service.json.SJsonHttpMessageConverter
  22. import org.mybatis.spring.annotation.MapperScan
  23. import org.slf4j.LoggerFactory
  24. import org.springframework.boot.SpringApplication
  25. import org.springframework.boot.autoconfigure.SpringBootApplication
  26. import org.springframework.boot.builder.SpringApplicationBuilder
  27. import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
  28. import org.springframework.context.annotation.Bean
  29. import org.springframework.context.annotation.ComponentScan
  30. import org.springframework.scheduling.annotation.EnableScheduling
  31. /**
  32. * 应用配置
  33. *
  34. * @author Andy
  35. */
  36. @ComponentScan(basePackages = ["com.persagy"]) // 配置组件扫描路径
  37. @MapperScan("com.persagy") // Mapper组件扫描路径
  38. //@EnableEurekaClient
  39. //@EnableDiscoveryClient
  40. @SpringBootApplication
  41. @EnableScheduling
  42. open class EquipComponentApp : SpringBootServletInitializer() {
  43. companion object {
  44. // 日志
  45. private val logger = LoggerFactory.getLogger(EquipComponentApp::class.java)
  46. } // Companion object
  47. /**
  48. * 配置应用
  49. *
  50. * @param application 应用构建对象
  51. */
  52. override fun configure(application: SpringApplicationBuilder): SpringApplicationBuilder {
  53. return application.sources(EquipComponentApp::class.java)
  54. } // Function configure
  55. /**
  56. * 配置FastJson
  57. *
  58. * @return HttpMessageConverters
  59. */
  60. @Bean
  61. @Suppress("MoveLambdaOutsideParentheses")
  62. open fun jsonHttpMessageConverters(): SJsonHttpMessageConverter {
  63. val fastConverter = SJsonHttpMessageConverter()
  64. fastConverter.propertyNamingStrategy = com.alibaba.fastjson.PropertyNamingStrategy.PascalCase
  65. return fastConverter
  66. } // Function fastJsonHttpMessageConverters()
  67. } // Class Application
  68. /**
  69. * Web应用入口
  70. *
  71. * @param args 命令行参数
  72. */
  73. fun main(args: Array<String>) {
  74. SpringApplication.run(EquipComponentApp::class.java, *args)
  75. return
  76. } // Function main()