package sgc.portal.cw.cw0602.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0602.model.CW06020001U;
import sgc.portal.cw.cw0602.dto.CW06020001USearch;
import sgc.portal.cw.cw0602.service.CW06020001UService;

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

@RestController
@RequestMapping("/cw/cw0602")
public class CW06020001UController {
    private final CW06020001UService service;

    public CW06020001UController(CW06020001UService service) {
        this.service = service;
    }

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

    @PostMapping("/CW06020001U/listAnswer")
    public List<EasyHashMap<String, Object>> getListAnswer(@RequestBody CW06020001USearch search) {
        return service.getListAnswer(search);
    }

    @PostMapping("/CW06020001U/listQuetion")
    public List<EasyHashMap<String, Object>> getListQuetion(@RequestBody CW06020001USearch search) {
        return service.getListQuetion(search);
    }
    
    @PostMapping("/CW06020001U/save")
    public Map<String, String> save(@RequestBody List<CW06020001U> CW06020001U) {
    	return service.save(CW06020001U);
    }
    
    @PostMapping("/CW06020001U/approve")
    public Map<String, String> approve(@RequestBody List<CW06020001U> CW06020001U) {
    	return service.approve(CW06020001U);
    }
    
    @PostMapping("/CW06020001U/saveAnswer")
    public void saveAnswer(@RequestBody CW06020001U cW06020001U) {
    	service.saveAnswer(cW06020001U);
    }
}
