package com.ruoyi.system.service.impl.customerServiceImpl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.datasource.DynamicDataSourceContextHolder;
import com.ruoyi.system.domain.customer.SessionEntity;
import com.ruoyi.system.mapper.customerServiceMapper.SessionMapper;
import com.ruoyi.system.service.impl.customerService.SessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;



@Service
@DataSource(value = DataSourceType.GIG_CUSTOMER)
public class SessionServiceImpl implements SessionService {
    @Autowired
    private SessionMapper sessionMapper;

    /**
     *
     * @param sessionEntity 会话信息
     * @return
     */
    @Override
    public List<SessionEntity> selectSessionList(SessionEntity sessionEntity) {
        try {
            return sessionMapper.selectSessionList(sessionEntity);
        } finally {
            DynamicDataSourceContextHolder.clearDataSourceType();
        }
    }
}

