package sgc.portal.ei.ei0501.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.ei0501.dto.EI05010001USearch;
import sgc.portal.ei.ei0501.model.EI05010001U;

import sgc.portal.ei.ei0501.service.EI05010001UService;

import lombok.extern.slf4j.Slf4j;


@Slf4j
@RestController
@RequestMapping("/ei/ei0501")
public class EI05010001UController {
    private final EI05010001UService service;

    public EI05010001UController(EI05010001UService service) {
        this.service = service;
    }
    
    /*
     * 조회 LIST
     */
    @PostMapping("/EI05010001U/list")
    public List<EasyHashMap<String, Object>> getList(@RequestBody EI05010001USearch search) {
        return service.getList(search);
    }
    
    @PostMapping("/EI05010001U/list2")
    public List<EasyHashMap<String, Object>> getList2(@RequestBody EI05010001USearch search) {
    	return service.getList2(search);
    }
    
    
    /*
     * SAVE LIST
     */
    @PostMapping("/EI05010001U/save1")
    public Map<String, String> save1(@RequestBody List<EI05010001U> eI05010001U) {
    	return service.update1(eI05010001U);
    }
    
    /*
     * PROCEDURE EXCUTE
     */
    @PostMapping("/EI05010001U/callMiEng")
    public Object callMiEng(@RequestBody EI05010001USearch search) {
    	return service.callMiEng(search);
    }
    
    @PostMapping("/EI05010001U/callMiEtec")
    public Object callMiEtec(@RequestBody EI05010001USearch search) {
    	return service.callMiEtec(search);
    }
       
}
