43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
package com.jasamedika.medifirst2000.controller;
|
|
|
|
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
|
import com.jasamedika.medifirst2000.entities.Alamat;
|
|
import com.jasamedika.medifirst2000.service.AlamatService;
|
|
import com.jasamedika.medifirst2000.vo.AlamatVO;
|
|
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
|
import static org.springframework.http.HttpStatus.OK;
|
|
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
|
|
|
/**
|
|
* Controller class for Pasien Business
|
|
*
|
|
* @author Roberto
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/alamat")
|
|
public class AlamatController extends LocaleController<PasienVO> {
|
|
|
|
@Autowired
|
|
private AlamatService<Alamat> alamatService;
|
|
|
|
@RequestMapping(value = "/cari-alamat-id/{id}", method = GET)
|
|
public ResponseEntity<AlamatVO> getVO(@PathVariable("id") Integer id) {
|
|
AlamatVO alamatVO = alamatService.findById(id);
|
|
return getJsonResponse(alamatVO, OK);
|
|
}
|
|
|
|
@RequestMapping(value = "/cari-alamat-by-pasien-id/{id}", method = GET)
|
|
public ResponseEntity<AlamatVO> getByPasienVO(@PathVariable("id") Integer id) {
|
|
AlamatVO alamatVO = alamatService.findByPasienId(id);
|
|
return getJsonResponse(alamatVO, OK);
|
|
}
|
|
|
|
}
|