package sgc.portal.cw.cw0604.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cw.cw0604.dto.CW06040001USearch;
import sgc.portal.cw.cw0604.model.CW06040001U;
import sgc.portal.cw.cw0604.service.CW06040001UService;

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

@RestController
@RequestMapping("/cw/cw0604")
public class CW06040001UController {
    private final CW06040001UService service;

    public CW06040001UController(CW06040001UService service) {
        this.service = service;
    }

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

    @PostMapping("/CW06040001U/save")
    public Map<String, String> save(@RequestBody List<CW06040001U> CW06040001U) {
    	return service.save(CW06040001U);
    }
    
    @PostMapping("/CW06040001U/mail")
    public Map<String, String> mail(@RequestBody List<CW06040001U> CW06040001U) {
    	System.out.println("=================mail C================");
    	return service.sendMail(CW06040001U);
    }
}
