Skip to content

Commit

Permalink
update mybatis interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
rbmonster committed Jan 9, 2022
1 parent efe56a5 commit 578c7b7
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/learning/mybatis/dao/DemoMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @Date: 2021/1/23 17:17
*/
@TenantAppend
@Mapper
public interface DemoMapper {

Demo selectByPrimaryKey(Long demoId);
Expand All @@ -34,11 +33,8 @@ public interface DemoMapper {

int delete(String demoId);


List<Demo> selectWithoutParam(Long demoId, String demoName);


// List<Demo> selectWithoutParamByEntity(@Param("demo") Demo demo);
List<Demo> selectWithoutParamByEntity(Demo demo);

List<Demo> selectWithoutParamByEntityTwo (Demo demo1,Demo demo2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DynamicInterceptor implements Interceptor {

@Override
public Object intercept(Invocation invocation) throws Throwable {
log.info("this is intercept of db");
log.debug("this is intercept of db");
return invocation.proceed();
}

Expand Down
50 changes: 50 additions & 0 deletions src/main/java/com/other/DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# docker

```
docker run -d -p 80:80 docker/getting-started
```
- `-d `: run the container in detached mode (in the background)
- `-p 80:80`: map port 80 of the host to port 80 in the container
- `docker/getting-started`: the image to use

```
docker build -t getting-started .
```
`-t`: flag tags our image,Think of this simply as a human-readable name for the final image.

## Replace the old container

- `docker ps`: 查看所有容器
- `docker stop <the-container-id>` : 停止容器运行
- `docker rm <the-container-id>`:删除容器运行
- `docker image ls`: 查看所有镜像


`docker tag getting-started YOUR-USER-NAME/getting-started`:交换并赋予容器一个新的名字


`docker volume create todo-db` :创建数据卷

`docker run -dp 3000:3000 -v todo-db:/etc/todos getting-started`
- `-v`:-v flag to specify a volume mount.We will use the named volume and mount it to /etc/todos, which will capture all files created at the path.

`docker volume inspect todo-db` : 查看数据卷的信息,可以看到具体数据卷的挂在机器地址

`docker logs -f <container-id>`:查看日志

```
docker run -dp 3000:3000 \
-w /app -v "$(pwd):/app" \
node:12-alpine \
sh -c "yarn install && yarn run dev"
```
效果为Node动态监控app目录下面的代码,并进行热部署
- `-w /app`: sets the “working directory” or the current directory that the command will run from
- `-v "$(pwd):/app"`:bind mount the current directory from the host in the container into the /app directory
- `node:12-alpine`: the image to use. Note that this is the base image for our app from the Dockerfile
- `sh -c "yarn install && yarn run dev"` the command. We’re starting a shell using sh and running yarn install to install all dependencies and then running yarn run dev.




`docker network create todo-app` :创建容器网络
3 changes: 3 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ spring:
feign:
hystrix:
enabled: true

mybatis:
mapper-locations: mapper/*.xml

0 comments on commit 578c7b7

Please sign in to comment.