package com.rf.psychological.scale.service.impl;

import com.rf.psychological.dao.model.HearingTestEntity;
import com.rf.psychological.dao.repository.HearingTestRepository;
import com.rf.psychological.scale.service.HearingTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zsy
 * @description:
 * @date 2021/5/14 10:51
 */
@Service
public class HearingTestServiceImpl implements HearingTestService {
    @Autowired
    private HearingTestRepository hearingTestRepository;

    /**
     * 根据flag获取全部答案
     *
     * @param flag
     */
    //@Override
    //public List<AnswerEntity> getAnswerByFlag(String flag) {
    //return this.answerRepository.getAnswerByFlag(flag);
    //}

    /**
     * 保存
     * @param hearingTestEntity
     */
    @Override
    public void save(HearingTestEntity hearingTestEntity) {
        this.hearingTestRepository.save(hearingTestEntity);
    }

    /**
     * 根据id修改状态
     * @param id
     */
    @Override
    public void updateStatus(String id) {
        this.hearingTestRepository.updateStatus(id);
    }

    /**
     * 根据phone获取用户进行中任务
     * @param phone
     */
    @Override
    public List<HearingTestEntity> getHearingTestList(String phone) {
        return this.hearingTestRepository.getHearingTestList(phone);
    }

    /**
     * 清除进行中任务
     * @param
     */
    @Override
    public void clearHearing(String phone) {
        this.hearingTestRepository.clearHearing(phone);
    }


}
