package com.cirle.scientific.controller.questionnaireSurvey;


import com.cirle.scientific.questionnaire.service.QuestionnaireService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/questionnaire")
@Api("品牌专区相关接口")
public class questionnaireSurveyController {

    @GetMapping("/page")
    @ApiOperation("问卷调查页")
    public String page(
            @ApiParam(name = "from", value = "请求类型 web：网站 H5：手机端") @RequestParam(name = "from", required = true) String from,
            HttpServletRequest request
    ) {
        if (StringUtils.isNotBlank(from) && from.equals("H5")) {
            return "html5/questionnaire/index";
        } else if (StringUtils.isNotBlank(from) && from.equals("web")) {
            return "web/questionnaire/index";
        } else {
            return "";
        }
    }
}
