package sgc.portal.cd.cd0301.web;

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.cd.cd0301.dto.CD03010001PSearch;
import sgc.portal.cd.cd0301.model.CD03010001P;
import sgc.portal.cd.cd0301.service.CD03010001PService;

@RestController
@RequestMapping("/cd/cd0301/CD03010001P")
public class CD03010001PController {
	
	private final CD03010001PService service;

	public CD03010001PController(CD03010001PService service) {
		this.service = service;
	}
	
	/**
	 * 작업지시서 작성(팝업) 조회
	 * @param search
	 * @return
	 */
    @PostMapping("/selectConWkiOdr")	
    public CD03010001P selectConWkiOdr(@RequestBody CD03010001PSearch search) {
        return service.selectConWkiOdr(search);
    }
	
    /**
	 * 작업지시서 작성(팝업) 저장
     * @param cD03010001P
     * @return
     */
    @PostMapping("/saveConWkiOdr")
    public Map<String, String> saveConWkiOdr(@RequestBody CD03010001P cD03010001P) {
    	return service.saveConWkiOdr(cD03010001P);
    }
    
    /**
     * 작업지시서 작성(팝업) 삭제
     * @param cD03010001P
     * @return
     */
    @PostMapping("/deleteConWkiOdr")
    public Map<String, String> deleteConWkiOdr(@RequestBody CD03010001P cD03010001P) {
    	return service.deleteConWkiOdr(cD03010001P);
    }

    /**
     * 작업지시서 작성(팝업) 결재 후처리
     * @param cD03010001P
     * @return
     */
    @PostMapping("/approval")
    public Map<String, String> approval(@RequestBody CD03010001P cD03010001P) {
    	return service.approval(cD03010001P);
    }
    
}
