package sgc.portal.cw.cw0202.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0202.dto.CW02020001USearch;
import sgc.portal.cw.cw0202.model.CW02020001U;
import sgc.portal.cw.cw0202.service.CW02020001UService;

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

@RestController
@RequestMapping("/cw/cw0202")
public class CW02020001UController {
    private final CW02020001UService service;

    public CW02020001UController(CW02020001UService service) {
        this.service = service;
    }

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

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