https://github.com/sarakhild/spring-boot-aop
This project simplify the Spring AOP
https://github.com/sarakhild/spring-boot-aop
java spring-aop spring-aop-annotation spring-boot
Last synced: 5 months ago
JSON representation
This project simplify the Spring AOP
- Host: GitHub
- URL: https://github.com/sarakhild/spring-boot-aop
- Owner: SaraKhild
- Created: 2023-10-21T10:57:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-04T17:51:39.000Z (over 1 year ago)
- Last Synced: 2024-12-29T04:51:32.856Z (6 months ago)
- Topics: java, spring-aop, spring-aop-annotation, spring-boot
- Language: Java
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot Aop Project
## Overview
In this project I implement an Aspect for logging execution for service, controller, and repository Spring components using Spring AOP
## Usages
- SpringBoot
- Spring AOP
- Lombok
- MySQL
## Architecture of the Project
### 1-src folder
- Aspect
- Exception
- Controller
- Model
- Service
- Repository
### 2-Maven pom.xml
```
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-web
com.mysql
mysql-connector-j
runtime
org.projectlombok
lombok
true
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-aop
```
### 3-Application.Properties```
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3312/db
spring.datasource.username=db
spring.datasource.password=nFLhPPKOnkW1FA1e
spring.jpa.show-sql=true```
## Let's Start :mechanical_arm:##### :pencil2: `Pointcut that matches all repositories, services, and Web REST endpoints. Method is empty as this is just a Pointcut, the implementations are in the Before advices. The second Before that matche with create employee method with 0 or many args, employee type that match with advice args. The AfterReturning is executed after a join point completes normally, for example, if the method returns without throwing an exception.`
###### Code :computer:

###### Result :star_struck:

---
##### :pencil2: `Pointcut that matches all repositories, services, and Web REST endpoints. Method is empty as this is just a Pointcut, the implementations are in the Before advices. Around that matches all methods service which logs when a method is entered and exited.`
###### Code :computer:


###### Result :star_struck:

---
##### :pencil2: `Pointcut that matches all repositories, services, and Web REST endpoints. Method is empty as this is just a Pointcut, the implementations are in the Before advices. Around that matches all methods service which logs when a method is entered and when throwing exception.`
###### Code :computer:


###### Result :star_struck:

---### Good Luck
![]()