package com.hotent.portal.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.query.QueryOP;
import com.hotent.base.util.StringUtil;
import com.hotent.portal.model.MySchedule;
import com.hotent.portal.persistence.manager.MyScheduleManager;
import com.hotent.uc.api.impl.util.ContextUtil;
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
 * 作者:heyf
 * 邮箱:heyf@jee-soft.cn
 * 日期:2018-09-10 09:51:04
 * 版权：广州宏天软件有限公司
 * </pre>
 */
@RestController
@RequestMapping(value="/portal/mySchedule/v2")
@Api(tags="行程管理2")
@ApiGroup(group= {ApiGroupConsts.GROUP_PORTAL})
public class MyScheduleController2 extends BaseController2<MyScheduleManager, MySchedule> {
	@Resource
	MyScheduleManager myScheduleManager;
	
	/**
	 * 行程管理列表(分页条件查询)数据
	 * @param request
	 * @return
	 * @throws Exception 
	 * PageJson
	 * @exception 
	 */
	@PostMapping("/list")
	@ApiOperation(value="行程管理数据列表", httpMethod = "POST", notes = "获取行程管理列表")
	public CommonResult<PageList<MySchedule>> list(@ApiParam(name="queryFilter",value="查询对象")@RequestBody QueryFilter<MySchedule> queryFilter) throws Exception{
		queryFilter.addFilter("USER_ID_", ContextUtil.getCurrentUserId(), QueryOP.EQUAL);
		PageList<MySchedule> query = myScheduleManager.query(queryFilter);
		return CommonResult.<PageList<MySchedule>>ok().value(query);
	}

}
