package sgc.portal.cw.cw0605.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0605.dto.CW06050001USearch;
import sgc.portal.cw.cw0605.model.CW06050001U;
import sgc.portal.cw.cw0605.service.CW06050001UService;

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

@RestController
@RequestMapping("/cw/cw0605")
public class CW06050001UController {
    private final CW06050001UService service;

    public CW06050001UController(CW06050001UService service) {
        this.service = service;
    }

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

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

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

    @PostMapping("/CW06050001U/save")
    public Map<String, String> save(@RequestBody List<CW06050001U> CW06050001U) {
    	return service.save(CW06050001U);
    }
    
    @PostMapping("/CW06050001U/saveSafeAnswer")
    public void saveSafeAnswer(@RequestBody CW06050001U cW06050001U) {
    	service.saveSafeAnswer(cW06050001U);
    }
    
    @PostMapping("/CW06050001U/deleteSafeAnswer")
    public void deleteSafeAnswer(@RequestBody CW06050001U cW06050001U) {
    	service.deleteSafeAnswer(cW06050001U);
    }
    
    @PostMapping("/CW06050001U/approve")
    public Map<String, String> approve(@RequestBody List<CW06050001U> CW06050001U) {
    	return service.approve(CW06050001U);
    }
}
