-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHealthInsuranceController.java
43 lines (32 loc) · 1.4 KB
/
HealthInsuranceController.java
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
34
35
36
37
38
39
40
41
42
43
package com.mongodb.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.mongodb.domain.Address;
import com.mongodb.domain.InsuredMembers;
import com.mongodb.domain.Proposer;
import com.mongodb.service.HealthInsuranceService;
@RestController
public class HealthInsuranceController {
@Autowired
private HealthInsuranceService healthService;
@RequestMapping("/landing")
public String landingMessage() {
return "hello";
}
@RequestMapping(value="/saveInsuredMembers" ,consumes="application/json",method=RequestMethod.POST)
public void saveInsuredMembers(@RequestBody InsuredMembers insuredMembers){
healthService.saveInsuredMembers(insuredMembers);
}
@RequestMapping(value="/saveProposer" ,consumes="application/json",method=RequestMethod.POST)
public Long saveProposerInfo(@RequestBody Proposer proposer){
final Long id=healthService.saveProposer(proposer);
return id;
}
@RequestMapping(value="/saveAddress" ,consumes="application/json",method=RequestMethod.POST)
public void saveProposerAddress(@RequestBody Address address){
healthService.saveProposerAddress(address);
}
}