/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.platform.service.impl;

import com.crunii.micro.domain.entitysql.main.TCallLogS;
import com.crunii.micro.platform.jdbc.log.CallLogJdbcDao;
import com.crunii.micro.platform.service.CallLogService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

/**
 * @author 田平 create 2018年8月7日下午4:31:48
 */
public class CallLogServiceImpl implements CallLogService {

	@Autowired
	private CallLogJdbcDao callLogJdbcDao;

	@Override
	public int createTCallLog(TCallLogS call) {
		call.setCreateTime(new Date());
		return callLogJdbcDao.insertTCallLog(call);
	}

	@Override
	public int createTCallLogs(List<TCallLogS> calls) {
		Date date = new Date();
		calls.stream().forEach(call -> call.setCreateTime(date));
		return callLogJdbcDao.insertTCallLogs(calls);
	}

}
