package sgc.portal.ei.ei0203.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.ei0203.dto.EI02030001USearch;
import sgc.portal.ei.ei0203.model.EI02030001U;
import sgc.portal.ei.ei0203.service.EI02030001UService;

@RestController
@RequestMapping("/ei/ei0203")
public class EI02030001UController {
	private final EI02030001UService service;

	public EI02030001UController(EI02030001UService service) {
		this.service = service;
	}
	
	//대여금내역 조회
	@PostMapping("/EI02030001U/list1")
	public List<EasyHashMap<String, Object>> getList1(@RequestBody EI02030001USearch search) {
		return service.getList1(search);
	}
	
	//상환내역 조회
	@PostMapping("/EI02030001U/list2")
	public List<EasyHashMap<String, Object>> getList2(@RequestBody EI02030001USearch search) {
		return service.getList2(search);
	}
	
	//대여금내역 저장
	@PostMapping("/EI02030001U/save1")
	public Map<String, String> save1(@RequestBody List<EI02030001U> eI02030001U) {
		return service.save1(eI02030001U);
	}
	
	//상환내역 저장
	@PostMapping("/EI02030001U/save2")
	public Map<String, String> save2(@RequestBody List<EI02030001U> eI02030001U) {
		return service.save2(eI02030001U);
	}
	
	//복사
	@PostMapping("/EI02030001U/copy")
	public Map<String, String> copy(@RequestBody EI02030001USearch search) {
		return service.copy(search);
	}

}
