package net.mingsoft.cms.action.web;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;

public class SqlSession {
    private SqlSessionFactory sessionFactory;
    @Autowired
    private DataSource dataSource;


    public SqlSessionFactory testBoradReturnType() throws Exception {
        ResultEntity resultEntity = new ResultEntity();
        resultEntity.message = dataSource.getConnection().toString();
        resultEntity.status = dataSource.getLoginTimeout();
        return sessionFactory;
    }


    public void init() {
        List<String> list = new ArrayList<>();
        list.stream().map(clazz -> "t" + (this.getClass().getSimpleName()));
    }

    public void pushDownStream(ResultEntity businessStatusBack) {
        String store = businessStatusBack.getMessage();
        int s = 0;
        if ("1".equals(store)) {
            s = 1;
        } else if ("2".equals(store)) {
            s = 2;
        }
    }
}
