package sgc.portal.cw.cw0802.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0802.dto.CW08020001USearch;
import sgc.portal.cw.cw0802.model.CW08020001U;
import sgc.portal.cw.cw0802.model.CW08020002U;
import sgc.portal.cw.cw0802.service.CW08020001UService;

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

@RestController
@RequestMapping("/cw/cw0802")
public class CW08020001UController {
	
    private final CW08020001UService service;

    public CW08020001UController(CW08020001UService service) {
        this.service = service;
    }

    @PostMapping("/CW08020001U/selectZehrRomResrvtnStatusList")
    public List<EasyHashMap<String, Object>> selectZehrRomResrvtnStatusList(@RequestBody CW08020001USearch search) {
        return service.selectZehrRomResrvtnStatusList(search);
    }
    
    @PostMapping("/CW08020001U/selectZehrRomHistrList")
    public List<EasyHashMap<String, Object>> selectZehrRomHistrList(@RequestBody CW08020001USearch search) {
        return service.selectZehrRomHistrList(search);
    }
    
    /**
     * 회의실 예약 승인
     * @param CW08020002U
     * @return
     */
    @PostMapping("/CW08020001U/saveZehrRomResrvtnStatusList30")
    public Map<String, String> saveZehrRomResrvtnStatusList30(@RequestBody List<CW08020002U> CW08020002U) {
    	return service.saveZehrRomResrvtnStatusList30(CW08020002U);
    }
    
    /**
     * 회의실 예약 반려
     * @param CW08020002U
     * @return
     */
    @PostMapping("/CW08020001U/saveZehrRomResrvtnStatusList40")
    public Map<String, String> saveZehrRomResrvtnStatusList40(@RequestBody List<CW08020002U> CW08020002U) {
    	return service.saveZehrRomResrvtnStatusList40(CW08020002U);
    }
    
}