package com.iwe3.langchain4j.service.impl;

import com.iwe3.langchain4j.entity.AppointmentEntity;
import com.iwe3.langchain4j.mapper.AppointmentMapper;
import com.iwe3.langchain4j.record.AppointmentRecord;
import com.iwe3.langchain4j.service.IAppointmentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AppointmentServiceImpl implements IAppointmentService {

    private final AppointmentMapper appointmentMapper;
    public AppointmentServiceImpl(AppointmentMapper appointmentMapper) {
        this.appointmentMapper = appointmentMapper;
    }

    @Transactional
    @Override
    public void saveAppointmentEntity(AppointmentRecord record) {
        appointmentMapper.saveAppointmentEntity(record);
    }

    @Transactional
    @Override
    public void removeById(long id) {
        appointmentMapper.removeById(id);
    }

    @Override
    public AppointmentEntity getOne(AppointmentRecord record) {
        return appointmentMapper.getOne(record);
    }
}
