package sgc.portal.cw.cw0204.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0204.dto.CW02040001USearch;
import sgc.portal.cw.cw0204.model.CW02040001U;
import sgc.portal.cw.cw0204.service.CW02040001UService;

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

@RestController
@RequestMapping("/cw/cw0204")
public class CW02040001UController {
    private final CW02040001UService service;

    public CW02040001UController(CW02040001UService service) {
        this.service = service;
    }

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

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