package com.community.huiju.controller;

import com.community.commom.mode.ResponseBean;
import com.community.commom.session.UserElement;
import com.community.huiju.service.TpHotelServicel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * version V1.0
 * class_name: $METHOD_NAME$
 * param: $METHOD_PARAM$
 * describe: TODO
 * creat_user:fannaixi
 * creat_time: 2019/5/9
 **/
@RestController
@RefreshScope
@RequestMapping("/")
@Api(value = "酒店相关的API", description = "酒店相关的API")
public class TpHotelController extends BaseController {


    @Autowired
    private TpHotelServicel tpHotelServicel;


    @ApiOperation(value = "获取本小区酒店", notes = "获取本小区酒店")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
    })
    @RequestMapping(value = "/hotel",method = RequestMethod.GET)
    public Object getHotel(HttpSession session){
        UserElement userElement = getUserElement(session);
        ResponseBean responseBean = tpHotelServicel.getHotel(userElement);
        return responseBean;
    }

    @ApiOperation(value = "当前小区酒店是否需要展示", notes = "当前小区酒店是否需要展示")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
    })
    @RequestMapping(value = "/CommunityHotel",method = RequestMethod.GET)
    public Object getHotelCommunity(HttpSession session){
        UserElement userElement = getUserElement(session);
        ResponseBean responseBean = tpHotelServicel.getHotelCommunity(userElement);
        return responseBean;
    }


}
