package com.bofeng.wx.controller;


import com.bofeng.service.HomeService;
import com.bofeng.service.MsSuspectedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: xielianghe
 * @Date: 2020/2/4 15:38
 */
@RestController
public class MsReportController {


    @Autowired
    private MsSuspectedService msSuspectedService;

    @PostMapping("/home/addRibao.json")
    public ModelAndView saveUser(HttpServletRequest request) {
        String userName = request.getParameter("userName");
        String conditionStatus = request.getParameter("conditionStatus");
        Integer medical = request.getParameter("medical").equals("on") ? 1 : 0;
        String remarks = request.getParameter("remarks");
        msSuspectedService.addSuspected(userName, conditionStatus, medical, remarks);
        return new ModelAndView("/home/home.ftl");
    }
}
