package com.hotent.portal.controller;


import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.base.controller.BaseController;
import com.hotent.base.model.CommonResult;
import com.hotent.portal.model.PortalMeetingConfig;
import com.hotent.portal.persistence.manager.PortalMeetingConfigManager;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 会议室配置 前端控制器
 *
 * @company 广州宏天软件股份有限公司
 * @author zhangxw
 * @email zhangxw@jee-soft.cn
 * @since 2021-06-30
 */
@RestController
@Api(tags="会议室基本信息设置")
@ApiGroup(group= {ApiGroupConsts.GROUP_PORTAL})
@RequestMapping("/portalMeetingConfig/v1/")
public class PortalMeetingConfigController extends BaseController<PortalMeetingConfigManager, PortalMeetingConfig> {
	
	/**
     * 会议室配置
     * @param id
     * @return
     */
    @GetMapping(value="getConfig")
    @ApiOperation(value="会议室配置信息",httpMethod = "GET",notes = "会议室配置信息")
    public PortalMeetingConfig getConfig(){
        return baseService.getConfig();
    }
    
    @RequestMapping(value="save",method= {RequestMethod.POST,RequestMethod.PUT}, produces = {"application/json; charset=utf-8" })
	@ApiOperation("更新会议室配置信息")
	public CommonResult<String> save(@ApiParam(name="config", value="会议室配置信息") @RequestBody PortalMeetingConfig config) {
    	return super.updateById(config);
	}
    
    @GetMapping("issue")
	@ApiOperation("把第三级菜单发布成首页栏目")
	public CommonResult<String> issue(@ApiParam(name="id", value="主键") @RequestParam String id) throws Exception {
		return baseService.issue(id);
	}
}
