修改配置

This commit is contained in:
黄晓 2022-03-04 14:47:51 +08:00
parent fac44c3411
commit dbfb51ce71
2 changed files with 7 additions and 4 deletions

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.CommonMetaObjectHandler; import com.chinaweal.youfool.framework.springboot.mybatis.plus.CommonMetaObjectHandler;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
@ -25,9 +24,9 @@ public class PrjDataSource {
@Resource @Resource
private CommonMetaObjectHandler commonMetaObjectHandler; private CommonMetaObjectHandler commonMetaObjectHandler;
@Bean(name = "prjSqlSessionFactory") @Bean(name = "sqlSessionFactory")
@Primary @Primary
public MybatisSqlSessionFactoryBean sqlSessionFactory(@Qualifier("prjDS") DataSource dataSource) throws Exception { public MybatisSqlSessionFactoryBean sqlSessionFactory(DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean(); MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource); bean.setDataSource(dataSource);
GlobalConfig globalConfig = new GlobalConfig(); GlobalConfig globalConfig = new GlobalConfig();

View File

@ -61,4 +61,8 @@ knife4j:
# basic: # basic:
# enable: true # enable: true
# username: admin # username: admin
# password: 123456 # password: 123456
server:
servlet:
context-path: /prj