package sgc.portal.ei.ei0106.web;

import org.springframework.web.bind.annotation.*;

import lombok.extern.slf4j.Slf4j;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.ei.ei0102.web.EI01020001UController;
import sgc.portal.ei.ei0106.dto.EI01060001USearch;
import sgc.portal.ei.ei0106.model.EI01060001U;
import sgc.portal.ei.ei0106.service.EI01060001UService;

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

@Slf4j
@RestController
@RequestMapping("/ei/ei0106")
public class EI01060001UController {
    private final EI01060001UService service;

    public EI01060001UController(EI01060001UService service) {
        this.service = service;
    }
    
    /*
     * 조회 LIST
     */
    @PostMapping("/EI01060001U/list")
    public List<EasyHashMap<String, Object>> getList(@RequestBody EI01060001USearch search) {
        return service.getList(search);
    }
    
    @PostMapping("/EI01060001U/pivotList")
    public List<EasyHashMap<String, Object>> pivotList(@RequestBody EI01060001USearch search) {
    	
    	List<EasyHashMap<String, Object>> list = service.pivotList(search);
    	return service.pivotList(search);
    }
    
    
    /*
     * SAVE LIST
     */
    @PostMapping("/EI01060001U/save")
    public Map<String, String> save(@RequestBody List<EI01060001U> eI01060001U) {
    	return service.save(eI01060001U);
    }
    
}
