...
 
Commits (4)
applications:
- name: cdi-cloudfoundry-workshop
health-check-type: http
health-check-http-endpoint: /actuator/health
memory: 1G
path: target/cloudfoundryworkshop-1.0.jar
buildpack: java_buildpack
\ No newline at end of file
package de.cdiag.cfworkshop.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import de.cdiag.cfworkshop.domain.Candidature;
@RestController
public class ApplyController {
@GetMapping("/apply/{company}")
public Candidature getCandidature(@PathVariable String company) {
return new Candidature(company);
}
}
package de.cdiag.cfworkshop.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import de.cdiag.cfworkshop.domain.Name;
@RestController
public class NameController {
@GetMapping("/name")
public Name getName() {
return new Name("Sebastian Lammmering");
}
}
package de.cdiag.cfworkshop.domain;
public class Candidature {
private static final String TEMPLATE = "Bewirb die bei der %s!";
private String apply;
public Candidature(String company) {
this.apply = String.format(TEMPLATE, company);
}
public String getApply() {
return apply;
}
public void setApply(String apply) {
this.apply = apply;
}
@Override
public String toString() {
return "Candidature [apply=" + apply + "]";
}
}
package de.cdiag.cfworkshop.domain;
public class Name {
private String name;
public Name() {
}
public Name(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "Name [name=" + name + "]";
}
}