package com.wyz.demo.config;

import com.wyz.demo.dao.OrderRepository;
import com.wyz.demo.dao.UserRepository;
import com.wyz.demo.service.UserService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MapperConfig {

    @Autowired
    public SqlSession sqlSession;

    @Bean
    public UserRepository userRepository(){
        return sqlSession.getMapper(UserRepository.class);
    }

    @Bean
    public OrderRepository orderRepository(){
        return sqlSession.getMapper(OrderRepository.class);
    }
}
