Commit 92f03e22 authored by LeMinhChien-06's avatar LeMinhChien-06

200

parent aa41380b
Pipeline #5847 failed with stages
/mvnw text eol=lf
*.cmd text eol=crlf
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
2025-04-17 11:39:20 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 18448 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 11:39:20 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 11:39:22 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 11:39:22 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 11:39:22 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 11:39:22 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 11:39:23 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 11:39:24 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@53a09566
2025-04-17 11:39:24 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 11:39:24 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 11:39:24 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 11:39:26 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 11:39:27 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 11:39:27 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 7.133 seconds (process running for 8.398)
2025-04-17 11:53:34 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 11:53:34 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 11:53:38 [main] ERROR o.s.boot.SpringApplication traceId: - Application run failed
java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:347)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:353)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
at com.example.nextadsservicebe.NextadsServiceBeApplication.main(NextadsServiceBeApplication.java:10)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@62dae540 - Failed to create converter for [%clr] keyword
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reportConfigurationErrorsIfNecessary(LogbackLoggingSystem.java:291)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:269)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:81)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:61)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:197)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:332)
... 19 common frames omitted
2025-04-17 11:54:12 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 27660 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 11:54:12 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 11:54:14 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 11:54:14 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 11:54:14 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 11:54:14 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 11:54:15 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 11:54:15 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@23ec63af
2025-04-17 11:54:15 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 11:54:15 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 11:54:15 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 11:54:17 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 11:54:18 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 11:54:18 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 7.132 seconds (process running for 7.98)
2025-04-17 11:56:45 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 43808 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 11:56:45 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 11:56:47 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 11:56:47 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 11:56:47 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 11:56:47 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 11:56:48 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 11:56:48 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@174e1b99
2025-04-17 11:56:48 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 11:56:48 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 11:56:48 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 11:56:50 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 11:56:51 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 11:56:51 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 6.657 seconds (process running for 7.603)
2025-04-17 12:00:18 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:00:18 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:00:23 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 52012 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:00:23 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:00:25 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:00:25 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:00:25 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:00:25 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:00:26 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:00:27 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1fe05fff
2025-04-17 12:00:27 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:00:27 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:00:27 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:00:30 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:00:31 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:00:31 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 8.854 seconds (process running for 9.818)
2025-04-17 12:00:47 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:00:47 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:00:52 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 50512 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:00:52 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:00:54 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:00:54 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:00:54 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:00:54 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:00:55 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:00:55 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@4449b273
2025-04-17 12:00:55 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:00:55 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:00:55 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:00:57 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:00:58 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:00:58 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 6.554 seconds (process running for 7.532)
2025-04-17 12:01:48 [http-nio-8080-exec-3] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:01:48 [http-nio-8080-exec-3] INFO c.e.n.c.log.RequestLoggingFilter traceId:7af35778-c912-4824-86ea-f0c53960b84b - REQ: traceId=7af35778-c912-4824-86ea-f0c53960b84b, method=GET, url=http://localhost:8080/a, headers={postman-token=4bf993af-a00c-4556-b897-747a35396e34, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:01:48 [http-nio-8080-exec-3] INFO c.e.n.c.log.RequestLoggingFilter traceId:7af35778-c912-4824-86ea-f0c53960b84b - RES: traceId=7af35778-c912-4824-86ea-f0c53960b84b, method=GET, url=http://localhost:8080/a, status=200, body=a, duration=149ms
2025-04-17 12:02:41 [http-nio-8080-exec-7] INFO c.e.n.c.log.RequestLoggingFilter traceId:06932156-18d0-4ced-9c83-7a4790c3e3ba - REQ: traceId=06932156-18d0-4ced-9c83-7a4790c3e3ba, method=GET, url=http://localhost:8080/a, headers={postman-token=3c49b8f4-92cc-4570-8d37-1792df4d55cb, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:02:41 [http-nio-8080-exec-7] INFO c.e.n.c.log.RequestLoggingFilter traceId:06932156-18d0-4ced-9c83-7a4790c3e3ba - RES: traceId=06932156-18d0-4ced-9c83-7a4790c3e3ba, method=GET, url=http://localhost:8080/a, status=200, body=a, duration=5ms
2025-04-17 12:04:26 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:04:27 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:04:33 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 54748 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:04:33 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:04:35 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:04:35 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:04:35 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:04:35 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:04:36 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:04:36 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@3a751535
2025-04-17 12:04:36 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:04:36 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:04:36 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:04:38 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:04:39 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:04:39 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 6.982 seconds (process running for 8.048)
2025-04-17 12:04:52 [http-nio-8080-exec-1] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:04:52 [http-nio-8080-exec-1] INFO c.e.n.c.log.RequestLoggingFilter traceId:4dee271a-d775-4983-87b8-f4df25ccf549 - REQ: traceId=4dee271a-d775-4983-87b8-f4df25ccf549, method=GET, url=http://localhost:8080/a, headers={postman-token=703eb2ce-65cf-4988-adf0-ce91d2e86833, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:04:52 [http-nio-8080-exec-1] INFO c.e.n.c.log.RequestLoggingFilter traceId:4dee271a-d775-4983-87b8-f4df25ccf549 - RES: traceId=4dee271a-d775-4983-87b8-f4df25ccf549, method=GET, url=http://localhost:8080/a, status=200, body=a, duration=134ms
2025-04-17 12:05:26 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:05:26 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:05:31 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 27660 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:05:31 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:05:32 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:05:32 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:05:32 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:05:33 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:05:33 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:05:33 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@4ad8d36f
2025-04-17 12:05:33 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:05:33 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:05:33 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:05:35 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:05:36 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:05:36 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 5.839 seconds (process running for 6.79)
2025-04-17 12:05:40 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:05:40 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:907682d5-601f-4366-bc81-c61c59d0a22e - REQ: traceId=907682d5-601f-4366-bc81-c61c59d0a22e, method=GET, url=http://localhost:8080/a, headers={postman-token=778a3fc1-68b5-41dd-a0d3-755dc2440bdd, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:05:40 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:907682d5-601f-4366-bc81-c61c59d0a22e - RES: traceId=907682d5-601f-4366-bc81-c61c59d0a22e, method=GET, url=http://localhost:8080/a, status=200, body=, duration=99ms
2025-04-17 12:06:29 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:06:29 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:06:34 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 33996 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:06:34 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:06:35 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:06:35 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:06:35 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:06:35 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:06:36 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:06:36 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1d9bd1d6
2025-04-17 12:06:36 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:06:36 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:06:36 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:06:38 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:06:38 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:06:38 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 4.909 seconds (process running for 5.646)
2025-04-17 12:06:51 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:06:51 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:a167fbcf-21c3-4020-b2eb-1ce4c382cb46 - REQ: traceId=a167fbcf-21c3-4020-b2eb-1ce4c382cb46, method=GET, url=http://localhost:8080/a, headers={postman-token=adb0a31e-bc61-42c9-98fc-33990480cc64, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:06:51 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:a167fbcf-21c3-4020-b2eb-1ce4c382cb46 - RES: traceId=a167fbcf-21c3-4020-b2eb-1ce4c382cb46, method=GET, url=http://localhost:8080/a, status=200, body=, duration=106ms
2025-04-17 12:07:39 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:07:39 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:07:45 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 19004 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:07:45 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:07:46 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:07:46 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:07:46 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:07:47 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:07:47 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:07:47 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1fa18f87
2025-04-17 12:07:47 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:07:47 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:07:47 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:07:49 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:07:49 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:07:49 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 5.348 seconds (process running for 6.268)
2025-04-17 12:08:01 [http-nio-8080-exec-3] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:08:01 [http-nio-8080-exec-3] INFO c.e.n.c.log.RequestLoggingFilter traceId:36f51763-9898-4194-8723-d7b6fdcc98cd - REQ: traceId=36f51763-9898-4194-8723-d7b6fdcc98cd, method=GET, url=http://localhost:8080/a, headers={postman-token=8469169a-d42d-4440-9439-cb29dab18de8, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:08:01 [http-nio-8080-exec-3] INFO c.e.n.c.log.RequestLoggingFilter traceId:36f51763-9898-4194-8723-d7b6fdcc98cd - RES: traceId=36f51763-9898-4194-8723-d7b6fdcc98cd, method=GET, url=http://localhost:8080/a, status=200, body=, duration=118ms
2025-04-17 12:10:51 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:10:51 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:10:57 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 13996 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:10:57 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:10:59 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:10:59 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:10:59 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:10:59 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:10:59 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:11:00 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1fa18f87
2025-04-17 12:11:00 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:11:00 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:11:00 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:11:01 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:11:02 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:11:02 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 5.715 seconds (process running for 6.674)
2025-04-17 12:11:11 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:11:11 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:a7ffa374-e603-4f06-aac2-1b4bbcd12a10 - REQ: traceId=a7ffa374-e603-4f06-aac2-1b4bbcd12a10, method=GET, url=http://localhost:8080/a, headers={postman-token=323a88c0-9620-40c4-9acb-f993f6d754f9, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:11:12 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:a7ffa374-e603-4f06-aac2-1b4bbcd12a10 - RES: traceId=a7ffa374-e603-4f06-aac2-1b4bbcd12a10, method=GET, url=http://localhost:8080/a, status=200, body=, duration=129ms
2025-04-17 12:11:44 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:11:44 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:11:49 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 27684 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:11:49 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:11:51 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:11:51 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:11:51 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:11:51 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:11:51 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:11:51 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1fa18f87
2025-04-17 12:11:51 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:11:52 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:11:52 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:11:53 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:11:54 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:11:54 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 5.596 seconds (process running for 6.474)
2025-04-17 12:12:46 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:12:46 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:d3922547-cda8-41cb-92dc-b967259996fa - REQ: traceId=d3922547-cda8-41cb-92dc-b967259996fa, method=GET, url=http://localhost:8080/a, headers={postman-token=c0e4686c-6dee-4661-9248-995dc105c40b, host=localhost:8080, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body=
2025-04-17 12:12:46 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:d3922547-cda8-41cb-92dc-b967259996fa - RES: traceId=d3922547-cda8-41cb-92dc-b967259996fa, method=GET, url=http://localhost:8080/a, status=200, body=, duration=132ms
2025-04-17 12:14:21 [http-nio-8080-exec-5] INFO c.e.n.c.log.RequestLoggingFilter traceId:a216a932-16fc-4417-aee0-badcfc72cee3 - REQ: traceId=a216a932-16fc-4417-aee0-badcfc72cee3, method=GET, url=http://localhost:8080/a, headers={content-length=19, postman-token=d26f4eb6-f89c-4bdf-8d3f-c5fc06f9d6da, host=localhost:8080, content-type=application/json, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body={"ab":"a"}
2025-04-17 12:14:21 [http-nio-8080-exec-5] INFO c.e.n.c.log.RequestLoggingFilter traceId:a216a932-16fc-4417-aee0-badcfc72cee3 - RES: traceId=a216a932-16fc-4417-aee0-badcfc72cee3, method=GET, url=http://localhost:8080/a, status=200, body=, duration=35ms
2025-04-17 12:16:07 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:16:07 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:16:14 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 12528 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:16:14 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:16:16 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:16:16 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:16:16 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:16:16 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:16:17 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:16:17 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1fa18f87
2025-04-17 12:16:17 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:16:17 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:16:17 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:16:19 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:16:20 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:16:20 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 6.902 seconds (process running for 7.922)
2025-04-17 12:16:23 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:16:23 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:0e73c7c4-ee7f-4d8b-9e80-c4728e214486 - REQ: traceId=0e73c7c4-ee7f-4d8b-9e80-c4728e214486, method=GET, url=http://localhost:8080/a, headers={content-length=19, postman-token=faa203c0-a6e3-45a4-a634-b58a3e735300, host=localhost:8080, content-type=application/json, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body={"ab":"a"}
2025-04-17 12:16:24 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:0e73c7c4-ee7f-4d8b-9e80-c4728e214486 - RES: traceId=0e73c7c4-ee7f-4d8b-9e80-c4728e214486, method=GET, url=http://localhost:8080/a, status=200, body=, duration=131ms
2025-04-17 12:16:51 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:16:51 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:16:57 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 34460 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:16:57 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:16:59 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:16:59 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:16:59 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:16:59 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:16:59 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:17:00 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@7fb82f73
2025-04-17 12:17:00 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:17:00 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:17:00 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:17:02 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:17:02 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:17:02 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 6.097 seconds (process running for 7.044)
2025-04-17 12:17:08 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:17:08 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:47ca1248-14d4-475c-975b-ac10fa055f87 - REQ: traceId=47ca1248-14d4-475c-975b-ac10fa055f87, method=GET, url=http://localhost:8080/a, headers={content-length=19, postman-token=457b6b97-912c-4ba4-94f4-44347ecb8731, host=localhost:8080, content-type=application/json, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body={"ab":"a"}
2025-04-17 12:17:08 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:47ca1248-14d4-475c-975b-ac10fa055f87 - RES: traceId=47ca1248-14d4-475c-975b-ac10fa055f87, method=GET, url=http://localhost:8080/a, status=200, body=, duration=151ms
2025-04-17 12:17:19 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:17:19 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:17:25 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 6528 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:17:25 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:17:27 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:17:27 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:17:27 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:17:27 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:17:27 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:17:28 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1dfe5dd1
2025-04-17 12:17:28 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:17:28 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:17:28 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:17:29 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:17:30 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:17:30 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 6.258 seconds (process running for 7.222)
2025-04-17 12:17:43 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:17:43 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
2025-04-17 12:17:47 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Starting NextadsServiceBeApplication using Java 17.0.7 with PID 34408 (D:\cong_ty\Xtel\nextads-service-be\target\classes started by DELL in D:\cong_ty\Xtel\nextads-service-be)
2025-04-17 12:17:47 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - No active profile set, falling back to 1 default profile: "default"
2025-04-17 12:17:49 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Initializing ProtocolHandler ["http-nio-8080"]
2025-04-17 12:17:49 [main] INFO o.a.catalina.core.StandardService traceId: - Starting service [Tomcat]
2025-04-17 12:17:49 [main] INFO o.a.catalina.core.StandardEngine traceId: - Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-17 12:17:49 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring embedded WebApplicationContext
2025-04-17 12:17:50 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Starting...
2025-04-17 12:17:50 [main] INFO com.zaxxer.hikari.pool.HikariPool traceId: - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1fa18f87
2025-04-17 12:17:50 [main] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Start completed.
2025-04-17 12:17:50 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-04-17 12:17:50 [main] WARN org.hibernate.orm.deprecation traceId: - HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2025-04-17 12:17:52 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration traceId: - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-04-17 12:17:52 [main] INFO o.a.coyote.http11.Http11NioProtocol traceId: - Starting ProtocolHandler ["http-nio-8080"]
2025-04-17 12:17:52 [main] INFO c.e.n.NextadsServiceBeApplication traceId: - Started NextadsServiceBeApplication in 5.546 seconds (process running for 6.435)
2025-04-17 12:18:05 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] traceId: - Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-04-17 12:18:05 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:3a908dde-69c5-456b-921a-9238412c35ae - REQ: traceId=3a908dde-69c5-456b-921a-9238412c35ae, method=GET, url=http://localhost:8080/a, headers={content-length=19, postman-token=ebc20144-7ae1-457c-9245-a7d49b49fdba, host=localhost:8080, content-type=application/json, connection=keep-alive, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.43.3, accept=*/*}, params={}, body={"ab":"a"}
2025-04-17 12:18:05 [http-nio-8080-exec-2] INFO c.e.n.c.log.RequestLoggingFilter traceId:3a908dde-69c5-456b-921a-9238412c35ae - RES: traceId=3a908dde-69c5-456b-921a-9238412c35ae, method=GET, url=http://localhost:8080/a, status=200, body=chien, duration=146ms
2025-04-17 12:18:37 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown initiated...
2025-04-17 12:18:37 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource traceId: - HikariPool-1 - Shutdown completed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>nextads-service-be</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>nextads-service-be</name>
<description>nextads-service-be</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<!-- Jackson for JSON processing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Lombok for reducing boilerplate -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- &lt;!&ndash; Redis&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-redis</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; Redis&ndash;&gt;-->
<!-- Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.6</version>
</dependency>
<!-- Swagger -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.example.nextadsservicebe;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class NextadsServiceBeApplication {
public static void main(String[] args) {
SpringApplication.run(NextadsServiceBeApplication.class, args);
}
}
package com.example.nextadsservicebe.auth;
public class AdminGuard {
}
package com.example.nextadsservicebe.common;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PageResponse<T> {
private int pageIndex;
private int pageSize;
private int totalPages;
private int totalItems;
private T items;
public PageResponse(int pageIndex, int pageSize, int totalItems, T items) {
this.pageIndex = pageIndex;
this.pageSize = pageSize;
this.totalPages = (int) Math.ceil((double) totalItems / pageSize);
this.totalItems = totalItems;
this.items = items;
}
}
package com.example.nextadsservicebe.config;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.util.List;
@Configuration
public class AppConfig {
private static final String[] CORS_ALLOWED_ORIGINS = {
"http://localhost:3000",
// "http://example.com"
};
private static final String[] CORS_ALLOWED_METHODS = {
"GET", "PUT", "POST", "DELETE", "UPDATE", "OPTIONS"
};
private static final String[] CORS_ALLOWED_HEADERS = {
"X-Requested-With", "X-HTTP-Method-Override",
"Content-Type", "Accept", "Observe", "Authorization",
"X-Lang", "Access-Control-Allow-Origin", "X-Channel"
};
@Bean
public FilterRegistrationBean<CorsFilter> corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.setAllowedOrigins(List.of(CORS_ALLOWED_ORIGINS)); // domain
config.setAllowedMethods(List.of(CORS_ALLOWED_METHODS)); // Các phương thức được phép
config.setAllowedHeaders(List.of(CORS_ALLOWED_HEADERS)); // Các header được phép
source.registerCorsConfiguration("/**", config); // Áp dụng CORS cho tất cả các endpoint
FilterRegistrationBean<CorsFilter> bean = new FilterRegistrationBean<>(new CorsFilter(source));
bean.setOrder(Ordered.HIGHEST_PRECEDENCE); // có thể set = 0
return bean;
}
}
package com.example.nextadsservicebe.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class StaticResourceConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/uploads/**")
.addResourceLocations("file:uploads/");
}
}
package com.example.nextadsservicebe.config;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.List;
//@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI openAPI(@Value("${open.api.title}") String title,
@Value("${open.api.version}") String version,
@Value("${open.api.description}") String description,
@Value("${open.api.serverUrl}") String serverUrl,
@Value("${open.api.serverName}") String serverName
) {
return new OpenAPI().info(new Info().title(title)
.version(version)
.description(description)
.license(new License().name("Develop by XTEL").url("https://xtel.vn")))
.servers(List.of(new Server().url(serverUrl).description(serverName)));
// .components(
// new Components()
// .addSecuritySchemes(
// "bearerAuth",
// new SecurityScheme()
// .type(SecurityScheme.Type.HTTP)
// .scheme("bearer")
// .bearerFormat("JWT")))
// .security(List.of(new SecurityRequirement().addList("bearerAuth")));
}
@Bean
public GroupedOpenApi groupedOpenApi() {
return GroupedOpenApi.builder()
.group("api-service")
.packagesToScan("com.example.nextadsservicebe.controller")
// .pathsToMatch("api/**")
.build();
}
}
package com.example.nextadsservicebe.config.log;
import jakarta.servlet.ServletInputStream;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.util.StreamUtils;
import java.io.*;
public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper {
private final byte[] cachedBody;
public CachedBodyHttpServletRequest(HttpServletRequest request) throws IOException {
super(request);
InputStream requestInputStream = request.getInputStream();
this.cachedBody = StreamUtils.copyToByteArray(requestInputStream);
}
@Override
public ServletInputStream getInputStream() throws IOException {
return new CachedBodyServletInputStream(cachedBody);
}
@Override
public BufferedReader getReader() throws IOException {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(cachedBody);
return new BufferedReader(new InputStreamReader(byteArrayInputStream));
}
public byte[] getCachedBody() {
return cachedBody;
}
private static class CachedBodyServletInputStream extends ServletInputStream {
private final ByteArrayInputStream inputStream;
public CachedBodyServletInputStream(byte[] cachedBody) {
this.inputStream = new ByteArrayInputStream(cachedBody);
}
@Override
public int read() throws IOException {
return inputStream.read();
}
@Override
public boolean isFinished() {
return inputStream.available() == 0;
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setReadListener(jakarta.servlet.ReadListener readListener) {
throw new UnsupportedOperationException();
}
}
}
\ No newline at end of file
package com.example.nextadsservicebe.config.log;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
//@Slf4j
public class RequestLoggingFilter implements jakarta.servlet.Filter {
private static final Logger log = LoggerFactory.getLogger(RequestLoggingFilter.class);
private static final String RESET = "\u001B[0m";
private static final String BLUE = "\u001B[34m";
private static final String GREEN = "\u001B[32m";
private static final String TRACE_ID = "traceId";
private final ObjectMapper objectMapper;
private final Set<String> sensitiveFields = new HashSet<>(Arrays.asList("password", "token"));
public RequestLoggingFilter(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String traceId = UUID.randomUUID().toString();
MDC.put(TRACE_ID, traceId);
CachedBodyHttpServletRequest cachedRequest = new CachedBodyHttpServletRequest(httpRequest);
ResponseBodyCaptureWrapper responseWrapper = new ResponseBodyCaptureWrapper(httpResponse);
long startTime = System.currentTimeMillis();
try {
logRequest(cachedRequest);
chain.doFilter(cachedRequest, responseWrapper);
} finally {
long duration = System.currentTimeMillis() - startTime;
logResponse(cachedRequest, responseWrapper, duration);
MDC.clear();
}
}
private void logRequest(CachedBodyHttpServletRequest request) throws IOException {
String queryString = request.getQueryString() == null ? "" : "?" + request.getQueryString();
String url = request.getRequestURL().toString() + queryString;
String method = request.getMethod();
String contentType = request.getContentType();
Map<String, String> headers = getHeaders(request);
Map<String, String> params = getRequestParams(request);
String body = new String(request.getCachedBody(), StandardCharsets.UTF_8);
String maskedBody = maskSensitiveData(body, contentType);
log.info(GREEN + "REQ: traceId={}, method={}, url={}, headers={}, params={}, body={}" + RESET,
MDC.get(TRACE_ID), method, url, headers, params, maskedBody);
}
private void logResponse(HttpServletRequest request, ResponseBodyCaptureWrapper response, long duration) {
String responseBody = new String(response.getCapturedBody(), StandardCharsets.UTF_8);
String maskedResponseBody = maskSensitiveData(responseBody, response.getContentType());
log.info(BLUE + "RES: traceId={}, method={}, url={}, status={}, body={}, duration={}ms" + RESET,
MDC.get(TRACE_ID), request.getMethod(), request.getRequestURL(), response.getStatus(),
maskedResponseBody, duration);
}
private Map<String, String> getHeaders(HttpServletRequest request) {
Map<String, String> headers = new HashMap<>();
Enumeration<String> headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
String headerValue = request.getHeader(headerName);
headers.put(headerName, maskSensitiveHeader(headerName, headerValue));
}
return headers;
}
private String maskSensitiveHeader(String headerName, String headerValue) {
if (headerName.toLowerCase().contains("authorization")) {
return "********";
}
return headerValue;
}
private Map<String, String> getRequestParams(HttpServletRequest request) {
Map<String, String> params = new HashMap<>();
Enumeration<String> paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = paramNames.nextElement();
String paramValue = request.getParameter(paramName);
params.put(paramName, maskSensitiveParam(paramName, paramValue));
}
return params;
}
private String maskSensitiveParam(String paramName, String paramValue) {
if (sensitiveFields.contains(paramName.toLowerCase())) {
return "********";
}
return paramValue;
}
private String maskSensitiveData(String body, String contentType) {
if (contentType != null && contentType.startsWith(MediaType.APPLICATION_JSON_VALUE)) {
try {
JsonNode jsonNode = objectMapper.readTree(body);
maskSensitiveJsonFields(jsonNode);
return objectMapper.writeValueAsString(jsonNode);
} catch (IOException e) {
log.warn("Failed to parse JSON body for masking", e);
return "{\"error\": \"Failed to parse JSON body\"}";
}
}
return body;
}
private void maskSensitiveJsonFields(JsonNode jsonNode) {
if (jsonNode.isObject()) {
ObjectNode objectNode = (ObjectNode) jsonNode;
objectNode.fields().forEachRemaining(entry -> {
String fieldName = entry.getKey();
JsonNode fieldValue = entry.getValue();
if (sensitiveFields.contains(fieldName.toLowerCase())) {
objectNode.put(fieldName, "********");
} else if (fieldValue.isObject() || fieldValue.isArray()) {
maskSensitiveJsonFields(fieldValue);
}
});
} else if (jsonNode.isArray()) {
jsonNode.forEach(this::maskSensitiveJsonFields);
}
}
}
\ No newline at end of file
package com.example.nextadsservicebe.config.log;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.WriteListener;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponseWrapper;
import java.io.*;
public class ResponseBodyCaptureWrapper extends HttpServletResponseWrapper {
private final ByteArrayOutputStream capturedBody = new ByteArrayOutputStream();
private PrintWriter writer;
public ResponseBodyCaptureWrapper(HttpServletResponse response) {
super(response);
}
@Override
public ServletOutputStream getOutputStream() throws IOException {
return new CachedBodyServletOutputStream(capturedBody);
}
@Override
public PrintWriter getWriter() throws IOException {
if (writer == null) {
writer = new PrintWriter(new OutputStreamWriter(capturedBody, getCharacterEncoding()));
}
return writer;
}
public byte[] getCapturedBody() {
if (writer != null) {
writer.flush();
}
return capturedBody.toByteArray();
}
private static class CachedBodyServletOutputStream extends ServletOutputStream {
private final ByteArrayOutputStream outputStream;
public CachedBodyServletOutputStream(ByteArrayOutputStream outputStream) {
this.outputStream = outputStream;
}
@Override
public void write(int b) throws IOException {
outputStream.write(b);
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
throw new UnsupportedOperationException();
}
}
}
package com.example.nextadsservicebe.controller;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/a")
public class a {
@Operation(summary = "Get user by ID", description = "Returns user details")
@GetMapping
public String b() {
return "chien";
}
}
package com.example.nextadsservicebe.dto.response;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ResponseData<T> {
private final int status;
private final String message;
@JsonInclude(JsonInclude.Include.NON_NULL)
private T data;
/**
* Response data for the API to retrieve data successfully. For GET, POST only
*
* @param status
* @param message
* @param data
*/
public ResponseData(int status, String message, T data) {
this.status = status;
this.message = message;
this.data = data;
}
/**
* Response data when the API executes successfully or getting error. For PUT, PATCH, DELETE
*
* @param status
* @param message
*/
public ResponseData(int status, String message) {
this.status = status;
this.message = message;
}
}
package com.example.nextadsservicebe.dto.response;
public class ResponseError extends ResponseData {
public ResponseError(int status, String message) {
super(status, message);
}
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@Table(name = "achievements")
public class Achievements {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "homePageId", nullable = false)
private Integer homePageId;
@Column(nullable = false)
private Integer count;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "achievements", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<AchievementsTranslate> achievementsTranslate;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "achievements_translate")
public class AchievementsTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY, optional = false) // optional = false: bắt buộc phải có Achievement
@JoinColumn(name = "achievementsId", nullable = false)
private Achievements achievements;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "benefit")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Benefit {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "homePageId", nullable = false)
private Integer homePageId;
@Column(name = "image", nullable = false)
private String image;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "benefit", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<BenefitTranslate> benefitTranslate;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "benefit_translate")
public class BenefitTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "lang_code")
private String langCode;
@Column(name = "description")
private String description;
@Column(name = "title")
private String title;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "benefitId", nullable = false)
private Benefit benefit;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "campaign")
public class Campaign {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name", nullable = false)
private String name;
@Column(name = "date_from", nullable = false)
private LocalDateTime dateFrom;
@Column(name = "date_to", nullable = false)
private LocalDateTime dateTo;
@Column(name = "address", nullable = false)
private String address;
@Column(name = "config_file", nullable = false)
private String configFile;
@Column(name = "qrcode", nullable = false)
private String qrcode;
@Column(name = "link", nullable = false)
private String link;
@Column(name = "join_person", nullable = false)
private Integer joinPerson;
@Column(name = "turn_play", nullable = false)
private Integer turnPlay;
@Column(name = "turn_played", nullable = false)
private Integer turnPlayed;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameCode", referencedColumnName = "code")
private Game game;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "customerId", nullable = false)
private Customer customer;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "case_study")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CaseStudy {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String slug;
private String image;
@Column(name = "date_from", nullable = false)
private LocalDateTime dateFrom;
@Column(name = "date_to", nullable = false)
private LocalDateTime dateTo;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "caseStudy", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<CaseStudyTranslate> caseStudyTranslates;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "customerId", nullable = false)
private Customer customer;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "case_study_translate")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CaseStudyTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long Id;
private String name;
private String content;
@Column(name = "lang_code")
private String lang_code;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "caseStudyId", nullable = false)
private CaseStudy caseStudy;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.contact.Status;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
@Entity
@Table(name = "contact")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Contact {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String fullName;
@Column(nullable = false)
private String phone;
@Column(nullable = false)
private String email;
@Column(name = "type_code", nullable = false)
private String typeCode;
@Column(name = "company_name", nullable = false)
private String companyName;
@Column(name = "gameId", nullable = true)
private Long gameId;
@Column(name = "updated_by", nullable = true)
private Integer updatedBy;
@Column(nullable = false)
private String message;
@Enumerated(EnumType.ORDINAL)
private Status status;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "updated_by", referencedColumnName = "id", insertable = false, updatable = false)
private User user;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameId", referencedColumnName = "id", insertable = false, updatable = false)
private Game game;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "content_mail")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ContentMail {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String title;
private String content;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "settingMailId", nullable = false)
private SettingMail settingMail;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.IsActive;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "customer")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String code;
private String name;
@Column(nullable = false)
private String phone;
@Column(nullable = false)
private String email;
@Column(nullable = false)
private String image;
@Column(nullable = false)
private String address;
@Column(nullable = false)
private String password;
@Column(name = "company_name", nullable = false)
private String companyName;
@Column(name = "number_turns", nullable = false)
private Long numberTurns; // so luot quay
@Column(name = "reset_token", nullable = false)
private String resetToken;
@Column(name = "expires_time")
private LocalDateTime expiresTime;
@Enumerated(EnumType.ORDINAL)
private IsActive isActive;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "customer", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Campaign> campaigns;
@OneToMany(mappedBy = "customer", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<CaseStudy> caseStudies;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "galaxy")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Galaxy {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private Integer homePageId;
@Column(nullable = false)
private String image;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "galaxy", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<GalaxyTranslate> galaxyTranslates;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "galaxy_translate")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class GalaxyTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private String description;
@Column(name = "lang_code")
private String langCode;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "galaxyId", nullable = false)
private Galaxy galaxy;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.NaturalId;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "game")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Game {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NaturalId // Hibernate hiểu đây là một khóa tự nhiên
@Column(unique = true, nullable = false)
private String code;
@Column(nullable = false)
private String slug;
@Column(nullable = false)
private Integer rate;
@Column(nullable = false)
private Integer vote;
@Column(nullable = false)
private Integer price;
@Column(nullable = false)
private String iframe;
@Column(nullable = false)
private String thumbnail;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Column(name = "is_hot", nullable = false)
private Integer isHot;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameTranslate> gameTranslate;
@OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Contact> contact;
@OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Campaign> campaign;
@OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameHasType> gameHasTypes;
@OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameHasCategory> gameHasCategories;
@OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameHasPlatform> gameHasPlatforms;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "updated_by", referencedColumnName = "id", insertable = false, updatable = false)
private User user;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_category")
public class GameCategory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String slug;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "gameCategory", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameCategoryTranslate> gameCategoryTranslates;
@OneToMany(mappedBy = "gameCategory", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameHasCategory> gameHasCategories;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_category_translate")
public class GameCategoryTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "title", nullable = false)
private String title;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameCategoryId")
private GameCategory gameCategory;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_has_category")
public class GameHasCategory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameId", nullable = false)
private Game game;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameCategoryId", nullable = false)
private GameCategory gameCategory;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_has_platform")
public class GameHasPlatform {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "game_id", nullable = false)
private Game game;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "platform_id", nullable = false)
private Platform platform;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_has_type")
public class GameHasType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "game_id", nullable = false)
private Game game;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "game_type_id", nullable = false)
private GameType gameType;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.IsHost;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "game_package")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class GamePackage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String image;
private Integer price;
@Enumerated(EnumType.ORDINAL)
private IsHost isHost;
@Column(nullable = false)
private Status status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "gamePackage", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<GamePackageTranslate> gamePackageTranslates;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "game_package_translate")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class GamePackageTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String content;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String description;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gamePackageId", nullable = false)
private GamePackage gamePackage;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_translate")
public class GameTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String content;
@Column(nullable = false)
private String description;
@Column(name = "lang_code", nullable = false)
private String langCode;
@Column(name = "meta_keyword", nullable = false)
private String metaKeyword;
@Column(name = "meta_description", nullable = false)
private String metaDescription;
@Column(name = "meta_title", nullable = false)
private String metaTitle;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameId")
private Game game;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_type")
public class GameType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String slug;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "gameType", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameTypeTranslate> gameTypeTranslates;
@OneToMany(mappedBy = "gameType", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<GameHasType> gameHasTypes;
}
\ No newline at end of file
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "game_type_translate")
public class GameTypeTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String title;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gameTypeId")
private GameType gameType;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "general")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class General {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String phone;
@Column(nullable = false)
private String favicon;
@Column(nullable = false)
private String logo;
@Column(nullable = false)
private String email;
@Column(nullable = false)
private String link;
@Column(nullable = false)
private String map;
@Column(name = "add_header", nullable = false)
private String addHeader;
@Column(name = "add_body", nullable = false)
private String addBody;
@Column(name = "src_analytics", nullable = false)
private String srcAnalytics;
@Column(name = "inner_analytics", nullable = false)
private String innerAnalytics;
@Column(name = "business_license", nullable = false)
private String businessLicense;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "general", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private List<GeneralTranslate> generalTranslates;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "general_translate")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class GeneralTranslate {
@Id
private Integer id;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String address;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "generalId", nullable = false)
private General general;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "home_page")
public class HomePage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String slug;
@Column(nullable = false)
private String image;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "homePage", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<HomePageTranslate> homePageTranslates;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "home_page_translate")
public class HomePageTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String description;
@Column(nullable = false)
private String slogun;
@Column(name = "meta_title", nullable = false)
private String metaTitle;
@Column(name = "lang_code", nullable = false)
private String langCode;
@Column(name = "meta_keyword", nullable = false)
private String metaKeyword;
@Column(name = "meta_description", nullable = false)
private String metaDescription;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "homePageId", nullable = false)
private HomePage homePage;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.IsHost;
import com.example.nextadsservicebe.enums.Status;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "news")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class News {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String slug;
@Column(nullable = false)
private String image;
@Column(nullable = false)
private Status status;
@Enumerated(EnumType.ORDINAL)
@Column(name = "is_hot", nullable = false)
private IsHost isHot;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "news", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JsonIgnore
private List<NewsTranslate> newsTranslate;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "updated_by", referencedColumnName = "id", insertable = false, updatable = false)
private User user;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "news_translate")
public class NewsTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String content;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String description;
@Column(name = "meta_title", nullable = false)
private String metaTitle;
@Column(name = "meta_description", nullable = false)
private String metaDescription;
@Column(name = "meta_keyword", nullable = false)
private String metaKeyword;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "newsId", referencedColumnName = "id", nullable = false)
private News news;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "order")
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String code;
@Column(nullable = false)
private String type;
@Column(nullable = false)
private Integer amount;
@Column(nullable = false)
private String status;
@Column(nullable = false)
private String paymentGate;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn
private TurnPackage turnPackage;
@OneToOne(mappedBy = "order",cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Transaction transaction;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "partner")
public class Partner {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String image;
private Integer status;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "payment_gate")
public class PaymentGate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String code;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String image;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "permission")
public class Permission {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String code;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String slug;
private Integer status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
// permission cha
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "parent_id", nullable = false)
private Permission parent;
// permission con
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<Permission> children;
@OneToMany(mappedBy = "permission", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<RoleHasPermission> roleHasPermissions;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "platform")
public class Platform {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "platform", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<GameHasPlatform> gameHasPlatforms;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "policy")
public class Policy {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "policy_translate")
public class PolicyTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private String content;
@Column(name = "meta_title", nullable = false)
private String metaTitle;
@Column(name = "lang_code", nullable = false)
private String langCode;
@Column(name = "meta_keyword", nullable = false)
private String metaKeyword;
@Column(name = "meta_description", nullable = false)
private String metaDescription;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "policyId", nullable = false)
private Policy policy;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "role")
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String code;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private Integer status;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@OneToMany(mappedBy = "role", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<RoleHasPermission> roleHasPermissions;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "role_has_permission")
public class RoleHasPermission {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "role_id", nullable = false)
private Role role;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "permission_id", nullable = false)
private Permission permission;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "role_log")
public class RoleLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String action;
@Column(nullable = false)
private String description;
@Column(nullable = false)
private Integer createdBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@Entity
@Table(name = "setting_mail")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SettingMail {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String host;
private Integer port;
private Integer secure;
private String user;
private String pass;
private String address;
@OneToMany(mappedBy = "settingMail", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<ContentMail> contentMails;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "slider")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Slider {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String slug;
private String image;
private Integer position;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "slider", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<SliderTranslate> sliderTranslates;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Table(name = "slider_translate")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SliderTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
@Column(name = "lang_code", nullable = false)
private String langCode;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "sliderId", nullable = false)
private Slider slider;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "transaction")
public class Transaction {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private LocalDateTime payDate;
@Column(nullable = false)
private Integer transactionNo;
@Column(nullable = false)
private String transactionStatus;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private TransactionDetail transactionDetail;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "orderCode", referencedColumnName = "code")
private Order order;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "customerId")
private Customer customer;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "transaction_detail")
public class TransactionDetail {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String bankCode;
@Column(nullable = false)
private Integer price;
@Column(nullable = false)
private String bankTranNo;
@Column(nullable = false)
private String cardType;
@Column(nullable = false)
private String orderInfo;
@Column(nullable = false)
private String responseCode;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "transactionId", nullable = false)
private Transaction transaction;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "turn_balance")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class TurnBalance {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Integer number_turns;
private String perHash;
private String hash;
private String type;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
}
package com.example.nextadsservicebe.entity;
import com.example.nextadsservicebe.enums.IsHost;
import com.example.nextadsservicebe.enums.Status;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "turn_package")
public class TurnPackage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String slug;
@Enumerated(EnumType.ORDINAL)
private Status status;
@Enumerated(EnumType.ORDINAL)
private IsHost isHost;
@Column(nullable = false)
private Integer price;
@Column(nullable = false)
private Integer amount;
@Column(nullable = false)
private String image;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@OneToMany(mappedBy = "turnPackage", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<TurnPackageTranslate> turnPackageTranslates;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import javax.print.attribute.standard.MediaSize;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "turn_package_translate")
public class TurnPackageTranslate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String content;
@Column(nullable = false)
private String description;
@Column(nullable = false)
private String lang_code;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "turnPackageId", nullable = false)
private TurnPackage turnPackage;
}
package com.example.nextadsservicebe.entity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
import java.util.List;
@Entity
@Table(name = "user")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false)
private String name;
@Column(nullable = true)
private String email;
@Column(nullable = false)
private String username;
@Column(nullable = false)
private String password;
@Column(nullable = true)
private String phone;
@Column(nullable = true)
private String image;
@Column(nullable = false) // Default value là 0
private Integer status;
@Column(name = "role_id", nullable = true) // Liên kết với cột role_id
private Integer roleId;
@CreationTimestamp
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@Column(name = "created_by", nullable = false)
private Integer createdBy;
@Column(name = "updated_by", nullable = false)
private Integer updatedBy;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<News> news;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Game> game;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Contact> contact;
}
\ No newline at end of file
package com.example.nextadsservicebe.enums;
public enum IsActive {
AUTHENTICATION, NOT_AUTHENTICATED
}
package com.example.nextadsservicebe.enums;
public enum IsHost {
HOT, NOT_HOST
}
package com.example.nextadsservicebe.enums;
public enum Status {
ACTIVE, LOCK
}
package com.example.nextadsservicebe.enums.contact;
public enum Status {
CONTACTED, NOT_CONTACTED
}
package com.example.nextadsservicebe.exception;
import lombok.*;
import java.util.Date;
import java.util.Map;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ErrorResponse {
private Date timestamp;
private int status;
private String path;
private String error;
private String message;
private Map<String, String> details;
}
package com.example.nextadsservicebe.exception;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.ConstraintViolationException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
@ExceptionHandler({MethodArgumentNotValidException.class, jakarta.validation.ConstraintViolationException.class})
@ResponseStatus(HttpStatus.BAD_REQUEST)
public ResponseEntity<ErrorResponse> handleValidationException(Exception e, WebRequest request) {
log.error("Validation error occurred: {}", e.getMessage(), e);
ErrorResponse errorResponse = new ErrorResponse();
errorResponse.setTimestamp(new Date());
errorResponse.setStatus(HttpStatus.BAD_REQUEST.value());
errorResponse.setPath(request.getDescription(false).replace("uri=", ""));
Map<String, String> errorDetails = new HashMap<>();
if (e instanceof MethodArgumentNotValidException) {
MethodArgumentNotValidException ex = (MethodArgumentNotValidException) e;
errorResponse.setError("Payload Invalid");
ex.getBindingResult().getAllErrors().forEach((error) -> {
if (error instanceof FieldError) {
String fieldName = ((FieldError) error).getField();
String errorMessage = error.getDefaultMessage();
errorDetails.put(fieldName, errorMessage);
} else {
errorDetails.put("global", errorResponse.getError());
}
});
errorResponse.setMessage("Validation failed for request body");
} else if (e instanceof ConstraintViolationException) {
ConstraintViolationException ex = (ConstraintViolationException) e;
errorResponse.setError("PathVariable Invalid");
for (ConstraintViolation<?> violation : ex.getConstraintViolations()) {
String fieldName = violation.getPropertyPath().toString();
String errorMessage = violation.getMessage();
errorDetails.put(fieldName, errorMessage);
}
errorResponse.setMessage("Validation failed for path variables or query params");
}
errorResponse.setDetails(errorDetails);
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}
}
package com.example.nextadsservicebe.exception;
public class ResourceNotFoundException extends RuntimeException {
public ResourceNotFoundException(String message) {
super(message);
}
public ResourceNotFoundException(String message, Throwable cause) {
super(message, cause);
}
}
spring.application.name=nextads-service-be
# Cau hinh DataSource
########-- MAIN -- #########
#spring.datasource.url=jdbc:mysql://103.147.35.60:3306/nextadsv2?useSSL=false&serverTimezone=UTC
#spring.datasource.username=nextadsv2
#spring.datasource.password=nextadsv2@123
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
########-- MAIN -- #########
########-- TEST -- #########
spring.datasource.url=jdbc:mysql://localhost/nextadsv2_test?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=12345678
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
########-- TEST -- #########
# Cau hinh JPA/Hibernate
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
#TRACE < DEBUG < INFO < WARN < ERROR < OFF
# Logging
logging.level.root=INFO
logging.level.com.example.nextadsservicebe=INFO
logging.level.org.springframework=WARN
logging.level.org.hibernate=WARN
# upload file
#spring.servlet.multipart.max-file-size=50MB
#spring.servlet.multipart.max-request-size=50MB
#spring.http.multipart.max-file-size=50MB
#spring.http.multipart.max-request-size=50MB
#spring.servlet.multipart.enabled=true
open:
api:
title: NextADS V2 Api Documents
version: 1.0
description: NextADS V2 Documents description
serverUrl: http://localhost:8080
serverName: server
springdoc:
api-docs:
path: /v3/api-docs
enabled: true
swagger-ui:
path: /swagger-ui.html
operations-sorter: alpha
csrf:
enabled: true
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %highlight(%-5level) %logger{36} [%X{traceId}] - %msg%n
</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/application.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/application.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} traceId:%X{traceId} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
</configuration>
package com.example.nextadsservicebe;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class NextadsServiceBeApplicationTests {
@Test
void contextLoads() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment