package sgc.portal.cw.cw0606.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0606.model.CW06060001U;
import sgc.portal.cw.cw0606.dto.CW06060001USearch;
import sgc.portal.cw.cw0606.service.CW06060001UService;

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

@RestController
@RequestMapping("/cw/cw0606")
public class CW06060001UController {
    private final CW06060001UService service;

    public CW06060001UController(CW06060001UService service) {
        this.service = service;
    }

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

    @PostMapping("/CW06060001U/listQuetion")
    public List<EasyHashMap<String, Object>> getListQuetion(@RequestBody CW06060001USearch search) {
        return service.getListQuetion(search);
    }

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

    @PostMapping("/CW06060001U/listSafeAnswer")
    public List<EasyHashMap<String, Object>> getListSafeAnswer(@RequestBody CW06060001USearch search) {
        return service.getListSafeAnswer(search);
    }

    @PostMapping("/CW06060001U/save")
    public Map<String, String> save(@RequestBody List<CW06060001U> CW06060001U) {
    	return service.save(CW06060001U);
    }
    
    @PostMapping("/CW06060001U/approve")
    public Map<String, String> approve(@RequestBody List<CW06060001U> CW06060001U) {
    	return service.approve(CW06060001U);
    }
    
    @PostMapping("/CW06060001U/cancel")
    public Map<String, String> cancel(@RequestBody List<CW06060001U> CW06060001U) {
    	return service.cancel(CW06060001U);
    }
    
    @PostMapping("/CW06060001U/saveAnswer")
    public void saveAnswer(@RequestBody CW06060001U cW06060001U) {
    	service.saveAnswer(cW06060001U);
    }
    
    @PostMapping("/CW06060001U/saveSafeAnswer")
    public void saveSafeAnswer(@RequestBody CW06060001U cW06060001U) {
    	service.saveSafeAnswer(cW06060001U);
    }
}
