后端微服务框架初步完成(还没跑起来)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
server:
|
||||
port: 8001
|
||||
|
||||
# Mybatis 配置
|
||||
mybatis:
|
||||
type-aliases-package: com.cxyxiaomo.epp.pojo
|
||||
config-location: classpath:mybatis/mybatis-config.xml
|
||||
mapper-locations: classpath:mybatis/mapper/*.xml
|
||||
configuration:
|
||||
map-underscore-to-camel-case: on
|
||||
|
||||
# Spring 配置
|
||||
spring:
|
||||
application:
|
||||
name: microservice-provider-user
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/epp?useUnicode=true&characterEncoding=utf8&useSSL=false
|
||||
username: root
|
||||
password: root
|
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cxyxiaomo.epp.dao.UserDao">
|
||||
|
||||
<insert id="addUser" parameterType="com.cxyxiaomo.epp.pojo.User">
|
||||
INSERT INTO user (username, password)
|
||||
VALUES (#{username}, #{password})
|
||||
</insert>
|
||||
|
||||
<select id="getUserById" parameterType="java.lang.Long" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
SELECT * FROM user
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getUserList" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
SELECT * FROM user
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<settings>
|
||||
<!--开启二级缓存-->
|
||||
<setting name="cacheEnabled" value="true"/>
|
||||
</settings>
|
||||
</configuration>
|
Reference in New Issue
Block a user