package sgc.portal.cw.cw0201.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0201.dto.CW02010001USearch;
import sgc.portal.cw.cw0201.model.CW02010001U;
import sgc.portal.cw.cw0201.service.CW02010001UService;

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

@RestController
@RequestMapping("/cw/cw0201")
public class CW02010001UController {
    private final CW02010001UService service;

    public CW02010001UController(CW02010001UService service) {
        this.service = service;
    }

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

    @PostMapping("/CW02010001U/save")
    public Map<String, String> save(@RequestBody List<CW02010001U> CW02010001U) {
    	return service.save(CW02010001U);
    }
    
    @PostMapping("/CW02010001U/approve")
    public Map<String, String> approve(@RequestBody List<CW02010001U> CW02010001U) {
    	return service.approve(CW02010001U);
    }
}
