File tree Expand file tree Collapse file tree 4 files changed +9
-27
lines changed 
SpringBootAOP/src/main/kotlin/com/example/kotlin/web 
SpringBootAsync/src/main/kotlin/com/example/kotlin 
SpringBootCache/src/test/kotlin/com/example/kotlin Expand file tree Collapse file tree 4 files changed +9
-27
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,7 @@ import org.springframework.web.bind.annotation.GetMapping
66import  org.springframework.web.bind.annotation.RestController 
77
88@RestController
9- class  TestController  {
10- 
11-     @Autowired
12-     private  lateinit  var  service:  TestService 
9+ class  TestController  (val  service :  TestService ) {
1310
1411    @GetMapping(value =  [" /noAop" 
1512    fun  noAop (): String  {
Original file line number Diff line number Diff line change @@ -7,29 +7,18 @@ import org.springframework.stereotype.Service
77@Service
88class  BasicService  {
99
10+     companion  object  {
11+         private  val  logger =  LoggerFactory .getLogger(BasicService ::class .java)
12+     }
13+ 
1014    @Async
1115    fun  onAsync () {
12-         try  {
13-             Thread .sleep(1000 )
14-         } catch  (e:  InterruptedException ) {
15-             e.printStackTrace()
16-         }
17- 
16+         Thread .sleep(1000 )
1817        logger.info(" onAsync" 
1918    }
2019
2120    fun  onSync () {
22-         try  {
23-             Thread .sleep(1000 )
24-         } catch  (e:  InterruptedException ) {
25-             e.printStackTrace()
26-         }
27- 
21+         Thread .sleep(1000 )
2822        logger.info(" onSync" 
2923    }
30- 
31-     companion  object  {
32- 
33-         private  val  logger =  LoggerFactory .getLogger(BasicService ::class .java)
34-     }
3524}
Original file line number Diff line number Diff line change @@ -12,10 +12,7 @@ import org.springframework.web.reactive.function.client.WebClient
1212import  reactor.core.publisher.Mono 
1313
1414@RestController
15- class  BasicController  {
16- 
17-     @Autowired
18-     private  lateinit  var  service:  BasicService 
15+ class  BasicController  (val  service :  BasicService ) {
1916
2017    private  val  logger =  LoggerFactory .getLogger(BasicController ::class .java)
2118
Original file line number Diff line number Diff line change @@ -17,9 +17,8 @@ class SpringBootCacheApplicationTests {
1717    @Autowired
1818    private  lateinit  var  repository:  BookRepository 
1919
20-     private  var  startTime:  Long  =  0 
21- 
2220    companion  object  {
21+         private  var  startTime:  Long  =  0 
2322        private  val  logger =  LoggerFactory .getLogger(SpringBootCacheApplicationTests ::class .java)
2423    }
2524
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments