package sgc.portal.cw.cw1602.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw1602.model.CW16020001U;
import sgc.portal.cw.cw1602.dto.CW16020001USearch;
import sgc.portal.cw.cw1602.service.CW16020001UService;

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

@RestController
@RequestMapping("/cw/cw1602")
public class CW16020001UController {
    private final CW16020001UService service;

    public CW16020001UController(CW16020001UService service) {
        this.service = service;
    }

    @PostMapping("/CW16020001U/list")
    public List<EasyHashMap<String, Object>> getList(@RequestBody CW16020001USearch search) {
        return service.getList(search);
    }

    @PostMapping("/CW16020001U/save")
    public Map<String, String> save(@RequestBody List<CW16020001U> CW16020001U) {
    	return service.save(CW16020001U);
    }
    
    @PostMapping("/CW16020001U/updateStatus")
    public Map<String, String> updateStatus(@RequestBody List<CW16020001U> CW16020001U) {
    	return service.updateStatus(CW16020001U);
    }
    
    //문서관리 조회
    @PostMapping("/CW16020001U/selectCommonCode")
    public List<EasyHashMap<String, Object>> selectCommonCode(@RequestBody CW16020001USearch search) {
        return service.selectCommonCode(search);
    }
    
    //코드 마감 조회
    @PostMapping("/CW16020001U/selectCodeClose")
    public List<EasyHashMap<String, Object>> selectCodeClose(@RequestBody CW16020001USearch search) {
        return service.selectCodeClose(search);
    }
}
