package sgc.portal.ei.ei0301.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.ei0301.dto.EI03010001USearch;
import sgc.portal.ei.ei0301.model.EI03010001U;

import sgc.portal.ei.ei0301.service.EI03010001UService;

import lombok.extern.slf4j.Slf4j;


@Slf4j
@RestController
@RequestMapping("/ei/ei0301")
public class EI03010001UController {
    private final EI03010001UService service;

    public EI03010001UController(EI03010001UService service) {
        this.service = service;
    }
    
    /*
     * 조회 LIST
     */
    @PostMapping("/EI03010001U/list")
    public List<EasyHashMap<String, Object>> getList(@RequestBody EI03010001USearch search) {
        return service.getList(search);
    }
    
    @PostMapping("/EI03010001U/list2")
    public List<EasyHashMap<String, Object>> getList2(@RequestBody EI03010001USearch search) {
    	return service.getList2(search);
    }
    
    @PostMapping("/EI03010001U/list3")
    public List<EasyHashMap<String, Object>> getList3(@RequestBody EI03010001USearch search) {
        return service.getList3(search);
    }
    
    @PostMapping("/EI03010001U/cdEqpDtlCd")
    public List<EasyHashMap<String, Object>> getEqpDtlCd(@RequestBody EI03010001USearch search) {
        return service.getEqpDtlCd(search);
    }
    
    /*
     * SAVE LIST
     */
    @PostMapping("/EI03010001U/save1")
    public Map<String, String> save1(@RequestBody List<EI03010001U> eI03010001U) {
    	return service.update1(eI03010001U);
    }
    
    @PostMapping("/EI03010001U/save2")
    public Map<String, String> save2(@RequestBody List<EI03010001U> eI03010001U) {
    	return service.update2(eI03010001U);
    }
    
    @PostMapping("/EI03010001U/save3")
    public Map<String, String> save3(@RequestBody List<EI03010001U> eI03010001U) {
    	return service.save3(eI03010001U);
    }
       
}
