package com.hotent.portal.persistence.manager.impl;

import com.hotent.base.model.CommonResult;
import com.hotent.base.util.StringUtil;
import com.hotent.uc.api.impl.util.ContextUtil;
import org.springframework.stereotype.Service;

import com.hotent.base.manager.impl.BaseManagerImpl;
import com.hotent.portal.model.MySchedule;
import com.hotent.portal.persistence.dao.MyScheduleDao;
import com.hotent.portal.persistence.manager.MyScheduleManager;

import javax.annotation.Resource;

/**
 * 
 * <pre> 
 * 描述：行程管理 处理实现类
 * 构建组：x7
 * 作者:heyf
 * 邮箱:heyf@jee-soft.cn
 * 日期:2018-09-10 09:51:04
 * 版权：广州宏天软件有限公司
 * </pre>
 */
@Service("myScheduleManager")
public class MyScheduleManagerImpl extends BaseManagerImpl<MyScheduleDao, MySchedule> implements MyScheduleManager{

    @Resource
    MyScheduleManager myScheduleManager;

    @Override
    public CommonResult<String> saveMySchedule(MySchedule mySchedule) {

        String msg = "添加行程管理成功";
        if(StringUtil.isEmpty(mySchedule.getId())){
            mySchedule.setUserId(ContextUtil.getCurrentUserId());
            myScheduleManager.create(mySchedule);
        }else{
            myScheduleManager.update(mySchedule);
            msg = "更新行程管理成功";
        }
        return new CommonResult<String>(msg);
    }
}
