package sgc.portal.cw.cw0102.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0102.dto.CW01020001USearch;
import sgc.portal.cw.cw0102.model.CW01020001U;
import sgc.portal.cw.cw0102.service.CW01020001UService;
import sgc.portal.cw.cw0202.model.CW02020001U;
import sgc.portal.cw.cw0102.model.CW01020001U;

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

@RestController
@RequestMapping("/cw/cw0102")
public class CW01020001UController {
    private final CW01020001UService service;

    public CW01020001UController(CW01020001UService service) {
        this.service = service;
    }

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

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