package sgc.portal.cd.cd0102.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.cd.cd0102.dto.CD01020001USearch;
import sgc.portal.cd.cd0102.service.CD01020001UService;
import sgc.portal.cd.cd0102.model.CD01020001U;

@RestController
@RequestMapping("/cd/cd0102")
public class CD01020001UController {
	
	private final CD01020001UService service;

    public CD01020001UController(CD01020001UService service) {
        this.service = service;
    }
	
    //현장 조회
    @PostMapping("/CD01020001U/selectConDaySiteList")
    public List<EasyHashMap<String, Object>> selectConDaySiteList(@RequestBody CD01020001USearch search) {
        return service.selectConDaySiteList(search);
    }
    
    //현장 저장
    @PostMapping("/CD01020001U/saveConDaySite")
    public Map<String, String> saveConDaySite(@RequestBody List<CD01020001U> cD01020001U) {
    	return service.saveConDaySite(cD01020001U);
    }
    
    //협력업체 조회
    @PostMapping("/CD01020001U/selectConDaySiteCovendList")
    public List<EasyHashMap<String, Object>> selectConDaySiteCovendList(@RequestBody CD01020001USearch search) {
        return service.selectConDaySiteCovendList(search);
    }
    
    //협력업체 저장
    @PostMapping("/CD01020001U/saveConDaySiteCovend")
    public Map<String, String> saveConDaySiteCovend(@RequestBody List<CD01020001U> cD01020001U) {
    	return service.saveConDaySiteCovend(cD01020001U);
    }
}