package sgc.portal.ei.ei0107.web;

import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.ei.ei0107.dto.EI01070001USearch;
import sgc.portal.ei.ei0107.model.EI01070001U;
import sgc.portal.ei.ei0107.service.EI01070001UService;

@RestController
@RequestMapping("/ei/ei0107")
public class EI01070001UController {
	private final EI01070001UService service;

	public EI01070001UController(EI01070001UService service) {
		this.service = service;
	}
	
	//(경영정보 - 보증) JOIN PIVOT(경영정보 - 보증 분기잔액) 조회
	@PostMapping("/EI01070001U/list1")
	public List<EasyHashMap<String, Object>> getList1(@RequestBody EI01070001USearch search) {
		return service.getList1(search);
	}
	
	//경영정보 - 보증 주요기재사항 조회
	@PostMapping("/EI01070001U/list2")
	public List<EasyHashMap<String, Object>> getList2(@RequestBody EI01070001USearch search) {
		return service.getList2(search);
	}
	
	//(경영정보 - 보증),(경영정보 - 보증 분기잔액) 저장
	@PostMapping("/EI01070001U/save")
	public Map<String, String> save(@RequestBody EI01070001U eI01070001U) {
		return service.save(eI01070001U);
	}
	
	//(경영정보 - 보증),(경영정보 - 보증 분기잔액),(경영정보 - 보증 주요기재사항) 전월 기록 복사
	@PostMapping("/EI01070001U/copy")
	public Map<String, String> copy(@RequestBody EI01070001USearch search) {
		return service.copy(search);
	}

}
