package com.huiju.estateagents.property.controller;


import com.huiju.estateagents.base.BaseController;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.center.taUser.entity.TaUser;
import com.huiju.estateagents.property.common.UserElement;
import com.huiju.estateagents.property.service.ITpShopSettingService;
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.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * <p>
 * 商铺开关设置 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-05-09
 */
@RestController
@RequestMapping("/")

@Api(value = "商铺配置API", description = "商铺配置API")
public class TpShopSettingController extends BaseController {

	@Autowired
	private ITpShopSettingService shopSettingService;
	
	// @ApiOperation(value = "商铺配置启动和关闭", notes = "商铺配置启动和关闭")
	@ApiImplicitParams({
			@ApiImplicitParam(paramType = "body", dataType = "String", name = "jsonString", value = "商铺配置值"),

	})
	@RequestMapping(value = "/shop/add/setting",method = RequestMethod.POST)
	public ResponseBean changeShopSetting(@RequestBody String jsonString, HttpServletRequest request){
		ResponseBean responseBean = new ResponseBean();
		TaUser userElement = getTaUser(request);
		responseBean = shopSettingService.changeShopSetting(userElement,jsonString);
		return responseBean;
	}
}
