package com.palmnest.service.washcar.manager.impl;

import com.palmnest.dao.washcar.OrderExtraServiceDao;
import com.palmnest.model.washcar.OrderExtraService;
import com.palmnest.service.impl.GenericManagerImpl;
import com.palmnest.service.washcar.manager.OrderExtraServiceManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Slf4j
@Service("orderExtraServiceManager")
public class OrderExtraServiceManagerImpl extends GenericManagerImpl<OrderExtraService, Long> implements OrderExtraServiceManager {


	private OrderExtraServiceDao orderExtraServiceDao;

	@Autowired
	public void setOrderExtraServiceDao(OrderExtraServiceDao orderExtraServiceDao) {
		this.orderExtraServiceDao = orderExtraServiceDao;
		this.dao = orderExtraServiceDao;
	}

	@Override
	public OrderExtraService saveOrderExt(OrderExtraService orderExt,
										  String userId) throws Exception {
		orderExt.setCreateTime(new Date());
		orderExt.setCreator(userId);
		return orderExtraServiceDao.save(orderExt);
	}


}
