package com.diagbot.web;

import com.diagbot.annotation.SysLoggerExport;
import com.diagbot.facade.UserFacade;
import com.diagbot.vo.UserExportVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;

import org.springframework.beans.factory.annotation.Autowired;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author wangfeng
 * @Description: 客户中心导出功能
 * @date 2018年9月25日 上午9:45:56
 */
@RestController
@Api(value = "客户中心导出功能API", tags = { "客户中心导出功能API" })
@RequestMapping("/report")
@SuppressWarnings("unchecked")
public class ReportFormController {

    @Autowired
    private UserFacade userFacade;

    @ApiOperation(value = "导出用户信息和机构信息:[by:wangfeng]", notes = "根据时间 导出用户信息和机构信息")
    @PostMapping("/exportUserInfoAll")
    @SysLoggerExport("exportUserInfoAll")
    @ResponseBody
    @ApiIgnore
    public  void export(@RequestBody UserExportVO userExportVO,HttpServletRequest request,HttpServletResponse response)
            throws Exception {
         userFacade.export(userExportVO, response);
        
    }
    @ApiOperation(value = "导出用户信息(新):[by:wangfeng]", notes = "根据时间 导出用户信息")
    @PostMapping("/exportUserInfo")
    @SysLoggerExport("exportUserInfo")
    @ResponseBody
    public  void exportUserInfo(@RequestBody UserExportVO userExportVO,HttpServletRequest request,HttpServletResponse response)
            throws Exception {
         userFacade.exportUserInfo(userExportVO, response);
        
    }
    @ApiOperation(value = "导出机构信息(新):[by:wangfeng]", notes = "根据时间 导出用户信息和机构信息")
    @PostMapping("/exportOrganization")
    @SysLoggerExport("exportOrganization")
    @ResponseBody
    public  void exportOrganization(@RequestBody UserExportVO userExportVO,HttpServletRequest request,HttpServletResponse response)
            throws Exception {
         userFacade.exportOrganization(userExportVO, response);
        
    }
    @ApiOperation(value = "导出认证中用户的信息(新):[by:wangfeng]", notes = "导出认证中用户的信息")
    @PostMapping("/exportKema")
    @SysLoggerExport("exportKema")
    @ResponseBody
    public  void exportKema(@RequestBody UserExportVO userExportVO,HttpServletRequest request,HttpServletResponse response)
            throws Exception {
         userFacade.exportKema(userExportVO, response);
        
    }
    @ApiOperation(value = "导出已认证用户的信息(新):[by:wangfeng]", notes = "根据时间 导出已认证用户的信息")
    @PostMapping("/exportVerified")
    @SysLoggerExport("exportVerified")
    @ResponseBody
    public  void exportVerified (@RequestBody UserExportVO userExportVO,HttpServletRequest request,HttpServletResponse response)
            throws Exception {
         userFacade.exportVerified(userExportVO, response);
        
    }
}
