package com.madeu.crm.procedureReview.ctrl;

import com.madeu.init.ManagerDraftAction;
import com.madeu.crm.procedureReview.dto.ProcedureReviewDTO;
import com.madeu.crm.procedureReview.svc.ProcedureReviewService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

@Slf4j
@Controller
public class ProcedureReviewController extends ManagerDraftAction {

    @Autowired
    private ProcedureReviewService procedureReviewService;

    @RequestMapping(value = "/procedureReview/moveProcedureReviewList.do")
    public String moveProcedureReviewList(HttpSession session, HttpServletRequest request, Model model, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.moveProcedureReviewList(session, request, model, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/getProcedureReviewList.do")
    @ResponseBody
    public ProcedureReviewDTO getProcedureReviewList(HttpSession session, HttpServletRequest request, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.getProcedureReviewList(session, request, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/getProcedureReview.do")
    @ResponseBody
    public ProcedureReviewDTO getProcedureReview(HttpSession session, HttpServletRequest request, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.getProcedureReview(session, request, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/getCategoryList.do")
    @ResponseBody
    public ProcedureReviewDTO getCategoryList(HttpSession session, HttpServletRequest request, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.getCategoryList(session, request, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/putProcedureReviewFile.do")
    @ResponseBody
    public ProcedureReviewDTO putProcedureReviewFile(HttpSession session, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.putProcedureReviewFile(session, request, file, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/moveProcedureReviewInsert.do")
    public String moveProcedureReviewInsert(HttpSession session, HttpServletRequest request, Model model, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.moveProcedureReviewInsert(session, request, model, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/putProcedureReview.do")
    @ResponseBody
    public ProcedureReviewDTO putProcedureReview(HttpSession session, HttpServletRequest request, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.putProcedureReview(session, request, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/moveProcedureReviewUpdate.do")
    public String moveProcedureReviewUpdate(HttpSession session, HttpServletRequest request, Model model, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.moveProcedureReviewUpdate(session, request, model, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/modProcedureReview.do")
    @ResponseBody
    public ProcedureReviewDTO modProcedureReview(HttpSession session, HttpServletRequest request, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.modProcedureReview(session, request, paramDTO);
    }

    @RequestMapping(value = "/procedureReview/delProcedureReview.do")
    @ResponseBody
    public ProcedureReviewDTO delProcedureReview(HttpSession session, HttpServletRequest request, @ModelAttribute ProcedureReviewDTO paramDTO) throws Exception {
        return procedureReviewService.delProcedureReview(session, request, paramDTO);
    }
}

