package com.hotent.portal.controller;


import com.hotent.base.controller.BaseController;
import com.hotent.portal.persistence.manager.PortalUserLayoutConfigManager;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import com.hotent.base.model.CommonResult;
import com.hotent.base.util.StringUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RestController;
import com.hotent.portal.model.PortalUserLayoutConfig;

/**
 * 用户布局配置 前端控制器
 *
 * @company 广州宏天软件股份有限公司
 * @author zengst
 * @since 2021-09-30
 */
@RestController
@RequestMapping("/portalUserLayoutConfig/v1/")
public class PortalUserLayoutConfigController extends BaseController<PortalUserLayoutConfigManager, PortalUserLayoutConfig> {
    /**
	 * 新增,更新用户布局配置
	 * @param portalUserLayoutConfig
	 * @throws Exception 
	 * @return
	 * @exception 
	 */
	@PostMapping(value="/save")
	@ApiOperation(value = "新增,更新用户布局配置数据", httpMethod = "POST", notes = "新增,更新用户布局配置数据")
	public CommonResult<String> save(@ApiParam(name="PortalUserLayoutConfig",value="用户布局配置对象", required = true)@RequestBody PortalUserLayoutConfig portalUserLayoutConfig) throws Exception{
		String msg = StringUtil.isEmpty(portalUserLayoutConfig.getId()) ? "添加用户布局配置成功" : "更新用户布局配置成功";
		baseService.createOrUpdate(portalUserLayoutConfig);
		return CommonResult.<String>ok().message(msg);
	}

}
