File tree Expand file tree Collapse file tree
zuul/customer-service/src/main/java/com/fd/sample/customer/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .fd .sample .customer .controller ;
22
33import com .fd .sample .customer .model .Customer ;
4+ import lombok .extern .slf4j .Slf4j ;
5+ import org .springframework .beans .factory .annotation .Value ;
46import org .springframework .web .bind .annotation .GetMapping ;
57import org .springframework .web .bind .annotation .RequestMapping ;
68import org .springframework .web .bind .annotation .RestController ;
1315 * @author furkand
1416 * 10/8/2018 9:59 AM
1517 */
18+ @ Slf4j
1619@ RestController
1720@ RequestMapping ("/api/customers" )
1821public class CustomerController {
1922
23+ @ Value ("${server.port}" )
24+ private int port ;
25+
2026 @ GetMapping
2127 public List <Customer > customerList () {
28+ log .info ("A request is received: " + port );
29+
2230 Customer c1 = Customer .builder ()
2331 .id ("1" ).name ("john doe" ).company ("acme" ).birthdate (LocalDate .now ().minusYears (28 )).build ();
2432 Customer c2 = Customer .builder ()
You can’t perform that action at this time.
0 commit comments