-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathCustomerController.java
More file actions
33 lines (23 loc) · 947 Bytes
/
CustomerController.java
File metadata and controls
33 lines (23 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package hello.hellospring.controller;
import hello.hellospring.domain.Customer;
import hello.hellospring.service.CustomerService;
import org.apache.tomcat.util.json.JSONParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class CustomerController {
private final CustomerService customerService;
@Autowired
public CustomerController(CustomerService customerService) {
this.customerService = customerService;
}
@GetMapping("new")
void join(@RequestParam("email") String em, @RequestParam("password") String ps ) {
Customer cus = new Customer();
cus.setemail(em);
cus.setpassword(ps);
customerService.join(cus);
}
}