package sgc.portal.cd.cd0302.web;

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

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cd.cd0301.model.CD03010001P;
import sgc.portal.cd.cd0302.dto.CD03020001PSearch;
import sgc.portal.cd.cd0302.service.CD03020001PService;

@RestController
@RequestMapping("/cd/cd0302/CD03020001P")
public class CD03020001PController {

	private final CD03020001PService service;
	
	public CD03020001PController(CD03020001PService service) {
		this.service = service;
	}
	
	/**
	 * 메일전송 작업지시서 조회
	 * @param search
	 * @return
	 */
    @PostMapping("/selectConWkiOdrList")	
    public List<EasyHashMap<String, Object>> selectConWkiOdrList(@RequestBody CD03020001PSearch search) {
        return service.selectConWkiOdrList(search);
    }

    /**
     * 작업지시서 메일전송
     * @param search
     * @return
     */
    @PostMapping("/sendMailConWkiOdr")	
    public Map<String, String> sendMailConWkiOdr(@RequestBody CD03010001P cD03010001P) {
        return service.sendMailConWkiOdr(cD03010001P);
    }
    
}
