package com.hotent.uc.controller;

import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.base.controller.BaseController;
import com.hotent.base.controller.BaseController2;
import com.hotent.base.model.CommonResult;
import com.hotent.base.query.PageList;
import com.hotent.base.query.QueryFilter;
import com.hotent.base.util.StringUtil;
import com.hotent.uc.manager.MatrixColDefManager;
import com.hotent.uc.model.MatrixColDef;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 
 * <pre> 
 * 描述：矩阵列定义 控制器类
 * 构建组：x7
 * 作者:pangq
 * 邮箱:pangq@jee-soft.cn
 * 日期:2020-06-05 14:02:42
 * 版权：广州宏天软件股份有限公司
 * </pre>
 */
@RestController
@RequestMapping(value="/uc/matrixColDef/v2")
@Api(tags="matrixColDefController2")
@ApiGroup(group= {ApiGroupConsts.GROUP_UC})
public class MatrixColDefController2 extends BaseController2<MatrixColDefManager,MatrixColDef> {
	@Resource
	MatrixColDefManager matrixColDefManager;
	
    /**
	 * 新增矩阵列定义
	 * @param matrixColDef
	 * @throws Exception 
	 * @return
	 * @exception 
	 */
	@PostMapping(value="save")
	@ApiOperation(value = "新增,更新矩阵列定义数据", httpMethod = "POST", notes = "新增,更新矩阵列定义数据")
	public CommonResult<String> save(@ApiParam(name="matrixColDef",value="矩阵列定义业务对象", required = true)@RequestBody MatrixColDef matrixColDef) throws Exception{
		String msg = "添加矩阵列定义成功";
		if(StringUtil.isEmpty(matrixColDef.getId())){
			matrixColDefManager.create(matrixColDef);
		}else{
			matrixColDefManager.update(matrixColDef);
			 msg = "更新矩阵列定义成功";
		}
		return CommonResult.<String>ok().message(msg);
	}

}
