Use simplified @Grab where possible
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package org.test
|
||||
|
||||
@Grab("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
|
||||
@Grab("spring-boot-starter-actuator")
|
||||
|
||||
@Controller
|
||||
class SampleController {
|
||||
|
||||
@@ -6,15 +6,15 @@ class Example {
|
||||
|
||||
@RequestMapping("/")
|
||||
@ResponseBody
|
||||
public String helloWorld(Device device) {
|
||||
String helloWorld(Device device) {
|
||||
if (device.isNormal()) {
|
||||
return "Hello Normal Device!"
|
||||
"Hello Normal Device!"
|
||||
} else if (device.isMobile()) {
|
||||
return "Hello Mobile Device!"
|
||||
"Hello Mobile Device!"
|
||||
} else if (device.isTablet()) {
|
||||
return "Hello Tablet Device!"
|
||||
"Hello Tablet Device!"
|
||||
} else {
|
||||
return "Hello Unknown Device!"
|
||||
"Hello Unknown Device!"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.test
|
||||
|
||||
@Grab("org.hsqldb:hsqldb-j5:2.0.0")
|
||||
@Grab("hsqldb")
|
||||
@Configuration
|
||||
@EnableBatchProcessing
|
||||
class JobConfig {
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.test
|
||||
|
||||
@Grab('spring-boot-starter-web')
|
||||
@Component
|
||||
class Example implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private MyService myService
|
||||
|
||||
void run(String... args) {
|
||||
print "Hello " + this.myService.sayWorld()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Service
|
||||
class MyService {
|
||||
|
||||
String sayWorld() {
|
||||
return "World!"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.test
|
||||
|
||||
@Grab("org.hsqldb:hsqldb:2.2.9")
|
||||
@Grab("hsqldb")
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package app
|
||||
|
||||
import groovy.util.logging.Log
|
||||
|
||||
@Grab("org.thymeleaf:thymeleaf-spring3:2.0.16")
|
||||
@Grab("thymeleaf-spring3")
|
||||
@Controller
|
||||
class Example {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user