package sgc.portal.cw.cw1301.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw1301.dto.CW13010001USearch;
import sgc.portal.cw.cw1301.model.CW13010001U;
import sgc.portal.cw.cw1301.service.CW13010001UService;

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

@RestController
@RequestMapping("/cw/cw1301")
public class CW13010001UController {
    private final CW13010001UService service;

    public CW13010001UController(CW13010001UService service) {
        this.service = service;
    }

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

    @PostMapping("/CW13010001U/content")
    public List<EasyHashMap<String, Object>> getContent(@RequestBody CW13010001USearch search) {
        return service.getContent(search);
    }

    @PostMapping("/CW13010001U/check")
    public List<EasyHashMap<String, Object>> checkResiNo(@RequestBody CW13010001USearch search) {
        return service.checkResiNo(search);
    }

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