package com.palmnest.webapp.controller.backstage;

import com.palmnest.application.bean.AppResultDto;
import com.palmnest.application.dto.input.ProjectConfigInputDto;
import com.palmnest.service.estateserve.airconditioner.ProjectConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;


//PC端
@Slf4j
@Controller
@RequestMapping(value = "/projectConfig")
public class ProjectConfigController {


	@Autowired
	private ProjectConfigService projectConfigService;

	/**
	 * @param request
	 * @return 查找维修单详情
	 */
	@RequestMapping(value = "/saveProjectConfig")
	@ResponseBody
	public AppResultDto saveProjectConfig(@ModelAttribute("projectConfigInputDto") ProjectConfigInputDto dto, HttpServletRequest request) {
		log.info("ProjectConfigController getDetail======");

		return projectConfigService.saveProjectConfig(dto, request);
	}


	/**
	 * @param request
	 * @return 查找维修单详情
	 */
	@RequestMapping(value = "/getProjectConfig")
	@ResponseBody
	public AppResultDto getProjectConfig(HttpServletRequest request) {
		log.info("ProjectConfigController getDetail======");

		return projectConfigService.getProjectConfig(request);
	}

}
