package com.huatek.busi.service.impl.transformer;

import com.alibaba.dubbo.config.annotation.Service;
import com.huatek.busi.dao.SoundVibrationParamsDao;
import com.huatek.busi.entity.SoundVibrationParams;
import com.huatek.busi.mapper.SoundVibrationParamsMapper;
import com.huatek.busi.service.transformer.SoundVibrationParamsService;
import com.huatek.busi.vo.SoundVibrationParamsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Service(interfaceClass = SoundVibrationParamsService.class)
@Transactional(rollbackFor = Exception.class)
public class SoundVibrationParamsServiceImpl implements SoundVibrationParamsService {

    @Autowired
    private SoundVibrationParamsDao soundVibrationParamsDao;

    @Autowired
    private SoundVibrationParamsMapper soundVibrationParamsMapper;

    @Override
    public void save(SoundVibrationParams entity) {
        soundVibrationParamsDao.add(entity);
    }

    @Override
    public SoundVibrationParamsVo findLatestResult(String mainTreeId) {
        SoundVibrationParamsVo result = soundVibrationParamsMapper.findLatestResult(mainTreeId);
        return result;
    }
}
