package com.yeshi.buwan.service.imp.video;
|
|
import com.yeshi.buwan.dao.pptv.PPTVPlayProcessRecordDao;
|
import com.yeshi.buwan.domain.pptv.PPTVPlayProcessRecord;
|
import com.yeshi.buwan.exception.ParamsException;
|
import com.yeshi.buwan.service.inter.juhe.PPTVPlayProcessRecordService;
|
import org.springframework.stereotype.Service;
|
import org.springframework.validation.annotation.Validated;
|
|
import javax.annotation.Resource;
|
import javax.validation.Valid;
|
import java.util.Date;
|
|
@Service
|
public class PPTVPlayProcessRecordServiceImpl implements PPTVPlayProcessRecordService {
|
|
@Resource
|
private PPTVPlayProcessRecordDao pptvPlayProcessRecordDao;
|
|
@Validated
|
@Override
|
public void addRecord(@Valid PPTVPlayProcessRecord record) throws ParamsException {
|
if (record.getId() == null) {
|
record.setId(PPTVPlayProcessRecord.createId(record.getDetailSystemId(), record.getDeviceId(), record.getCid()));
|
}
|
if (record.getCreateTime() == null)
|
record.setCreateTime(new Date());
|
pptvPlayProcessRecordDao.save(record);
|
}
|
|
@Override
|
public PPTVPlayProcessRecord selectByPrimaryKey(String id) {
|
return pptvPlayProcessRecordDao.get(id);
|
}
|
}
|