package sgc.portal.cw.cw0621.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0621.dto.CW06210001USearch;
import sgc.portal.cw.cw0621.model.CW06210001U;
import sgc.portal.cw.cw0621.service.CW06210001UService;

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

@RestController
@RequestMapping("/cw/cw0621")
public class CW06210001UController {
	
    private final CW06210001UService service;

    public CW06210001UController(CW06210001UService service) {
        this.service = service;
    }

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

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

    @PostMapping("/CW06210001U/updateCre")
    public Map<String, String> updateCre(@RequestBody List<CW06210001U> CW06210001U) {
    	Map<String, String> result = service.updateCre(CW06210001U);
    	return result;
    } 

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

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