package com.zcloud.controller.questionnaire;

import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.PageData;
import com.zcloud.service.questionnaire.SurveyquestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

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

/**
 * 说明：习题管理
 * 作者：luoxiaobao
 * 时间：2021-07-03
 * 官网：www.zcloudchina.com
 */
@Controller
@RequestMapping("/app/surveyquestion")
public class AppSurveyquestionController extends BaseController {



	@Autowired
	private SurveyquestionService surveyquestionService;



//	/**通过试卷ID获取阶段试卷相关数据（试卷、试卷试题）
//	 * @param
//	 * @throws Exception
//	 */
//	@RequestMapping(value="/getSurvey")
//	@ResponseBody
////	@LogAnno(menuType= "手机",menuServer= "阶段考试试卷表",instructionsOperate = "阶段考试试卷表",instructionsType = "通过试卷ID获取阶段试卷相关数据")
//	public Object getExam() throws Exception{
//		Map<String,Object> map = new HashMap<String,Object>();
//		String errInfo = "success";
//		PageData pd = new PageData();
//		pd = this.getPageData();
//		pd = surveycorpinfoService.getSurvey(pd);	//通过试卷ID获取数据
//		map.put("pd", pd);
//		map.put("result", errInfo);
//		return map;
//	}

	/**去修改页面获取数据
	 * @param
	 * @throws Exception
	 */
	@RequestMapping(value="/goEdit")
//	// @RequiresPermissions("survey:edit")
	@ResponseBody
	public Object goEdit() throws Exception{
		Map<String,Object> map = new HashMap<String,Object>();
		String errInfo = "success";
		PageData pd = new PageData();
		pd = this.getPageData();

		List<PageData> itemList = surveyquestionService.findById(pd);

//		pd = surveyquestionService.findById(pd);	//根据ID读取
//		map.put("pd", pd);
		map.put("itemList", itemList);
		map.put("result", errInfo);
		return map;
	}

}
