配置信息
application.yml中:
#访问资源、#配置*Mapper.xml、 #配置别名
#访问资源
spring:
datasource:
username: root
password: 123456
#(?serverTimezone=GMT%2B8 解决数据库访问时间格式问题)
url: jdbc:mysql:///cms?serverTimezone=GMT%2B8
driver-class-name: com.mysql.jdbc.Driver
#配置可访问其他路径及资源
mvc:
view:
prefix: /WEB-INF/views/
suffix: .jsp
mybatis:
#配置*Mapper.xml
mapper-locations: cn/itsource/mapper/*.xml
#配置别名
type-aliases-package: cn.source.domian
#日志打印
logging:
level:
cn:
itsource: debug
#配置端口
server:
port: 8080
App类中配置:
扫描mapper接口