Skip to content

Commit

Permalink
feat($WebLog): support web log for all HTTP methods
Browse files Browse the repository at this point in the history
support web log for all HTTP methods

BREAKING CHANGE: support web log for all HTTP methods
  • Loading branch information
johnnymillergh committed Mar 9, 2020
1 parent 48e7984 commit 9de3114
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public class WebRequestLogAspect {

/**
* Define pointcut. Pointcut is a predicate or expression that matches join points. In WebRequestLogAspect, we need
* to cut any method annotated with `@GetMapping` or `@PostMapping` only.
* to cut any method annotated with `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`.
* <p>
* More detail at: <a href="https://howtodoinjava.com/spring-aop/aspectj-pointcut-expressions/">Spring aop aspectJ
* pointcut expression examples</a>
*/
@Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"|| @annotation(org.springframework.web.bind.annotation.PostMapping)")
" || @annotation(org.springframework.web.bind.annotation.PostMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PutMapping)" +
" || @annotation(org.springframework.web.bind.annotation.DeleteMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PatchMapping)" +
" || @annotation(org.springframework.web.bind.annotation.RequestMapping)")
public void requestLogPointcut() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public class WebRequestLogAspect {

/**
* Define pointcut. Pointcut is a predicate or expression that matches join points. In WebRequestLogAspect, we need
* to cut any method annotated with `@GetMapping` or `@PostMapping` only.
* to cut any method annotated with `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`.
* <p>
* More detail at: <a href="https://howtodoinjava.com/spring-aop/aspectj-pointcut-expressions/">Spring aop aspectJ
* pointcut expression examples</a>
*/
@Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"|| @annotation(org.springframework.web.bind.annotation.PostMapping)")
" || @annotation(org.springframework.web.bind.annotation.PostMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PutMapping)" +
" || @annotation(org.springframework.web.bind.annotation.DeleteMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PatchMapping)" +
" || @annotation(org.springframework.web.bind.annotation.RequestMapping)")
public void requestLogPointcut() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public class WebRequestLogAspect {

/**
* Define pointcut. Pointcut is a predicate or expression that matches join points. In WebRequestLogAspect, we need
* to cut any method annotated with `@GetMapping` or `@PostMapping` only.
* to cut any method annotated with `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`.
* <p>
* More detail at: <a href="https://howtodoinjava.com/spring-aop/aspectj-pointcut-expressions/">Spring aop aspectJ
* pointcut expression examples</a>
*/
@Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"|| @annotation(org.springframework.web.bind.annotation.PostMapping)")
" || @annotation(org.springframework.web.bind.annotation.PostMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PutMapping)" +
" || @annotation(org.springframework.web.bind.annotation.DeleteMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PatchMapping)" +
" || @annotation(org.springframework.web.bind.annotation.RequestMapping)")
public void requestLogPointcut() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public class WebRequestLogAspect {

/**
* Define pointcut. Pointcut is a predicate or expression that matches join points. In WebRequestLogAspect, we need
* to cut any method annotated with `@GetMapping` or `@PostMapping` only.
* to cut any method annotated with `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`.
* <p>
* More detail at: <a href="https://howtodoinjava.com/spring-aop/aspectj-pointcut-expressions/">Spring aop aspectJ
* pointcut expression examples</a>
*/
@Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"|| @annotation(org.springframework.web.bind.annotation.PostMapping)")
" || @annotation(org.springframework.web.bind.annotation.PostMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PutMapping)" +
" || @annotation(org.springframework.web.bind.annotation.DeleteMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PatchMapping)" +
" || @annotation(org.springframework.web.bind.annotation.RequestMapping)")
public void requestLogPointcut() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public class WebRequestLogAspect {

/**
* Define pointcut. Pointcut is a predicate or expression that matches join points. In WebRequestLogAspect, we need
* to cut any method annotated with `@GetMapping` or `@PostMapping` only.
* to cut any method annotated with `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`.
* <p>
* More detail at: <a href="https://howtodoinjava.com/spring-aop/aspectj-pointcut-expressions/">Spring aop aspectJ
* pointcut expression examples</a>
*/
@Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"|| @annotation(org.springframework.web.bind.annotation.PostMapping)")
" || @annotation(org.springframework.web.bind.annotation.PostMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PutMapping)" +
" || @annotation(org.springframework.web.bind.annotation.DeleteMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PatchMapping)" +
" || @annotation(org.springframework.web.bind.annotation.RequestMapping)")
public void requestLogPointcut() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public class WebRequestLogAspect {

/**
* Define pointcut. Pointcut is a predicate or expression that matches join points. In WebRequestLogAspect, we need
* to cut any method annotated with `@GetMapping` or `@PostMapping` only.
* to cut any method annotated with `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`.
* <p>
* More detail at: <a href="https://howtodoinjava.com/spring-aop/aspectj-pointcut-expressions/">Spring aop aspectJ
* pointcut expression examples</a>
*/
@Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)" +
"|| @annotation(org.springframework.web.bind.annotation.PostMapping)")
" || @annotation(org.springframework.web.bind.annotation.PostMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PutMapping)" +
" || @annotation(org.springframework.web.bind.annotation.DeleteMapping)" +
" || @annotation(org.springframework.web.bind.annotation.PatchMapping)" +
" || @annotation(org.springframework.web.bind.annotation.RequestMapping)")
public void requestLogPointcut() {
}

Expand Down

0 comments on commit 9de3114

Please sign in to comment.