package sgc.portal.cw.cw0101.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0101.dto.CW01010001USearch;
import sgc.portal.cw.cw0101.model.CW01010001U;
import sgc.portal.cw.cw0101.service.CW01010001UService;
import sgc.portal.cw.cw0101.model.CW01010001U;

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

@RestController
@RequestMapping("/cw/cw0101")
public class CW01010001UController {
    private final CW01010001UService service;

    public CW01010001UController(CW01010001UService service) {
        this.service = service;
    }

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

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