diff --git a/README_API.md b/README_API.md index a3c7bd0..0771f9d 100644 --- a/README_API.md +++ b/README_API.md @@ -118,6 +118,7 @@ GET /api/articles/{id} "img": "图片URL", "createdAt": "2023-01-01T10:00:00", "updatedAt": "2023-01-01T10:00:00", + "viewCount": 101, "status": 1 } diff --git a/logs/web_project.log b/logs/web_project.log index b20d2a9..468e8ed 100644 --- a/logs/web_project.log +++ b/logs/web_project.log @@ -4482,3 +4482,941 @@ This generated password is for development use only. Your security configuration 2025-10-11 10:49:31 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID32: 成功=true 2025-10-11 10:49:31 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== 2025-10-11 10:49:31 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 11:18:17 [http-nio-8080-exec-4] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-10-11 11:18:17 [http-nio-8080-exec-4] INFO o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet' +2025-10-11 11:18:17 [http-nio-8080-exec-4] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 1 ms +2025-10-11 11:31:28 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 1 class path change (1 addition, 0 deletions, 0 modifications) +2025-10-11 11:31:28 [Thread-200] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 11:31:28 [Thread-200] INFO o.a.c.c.C.[.[localhost].[/] - Destroying Spring FrameworkServlet 'dispatcherServlet' +2025-10-11 11:31:28 [Thread-200] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 11:31:28 [Thread-200] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 11:31:28 [Thread-200] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 11:31:28 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 11:31:28 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 11:31:28 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 11:31:28 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 11:31:28 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 11:31:28 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 11:31:28 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 11:31:28 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 11:31:28 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 11:31:28 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 11:31:28 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 124 ms +2025-10-11 11:31:28 [restartedMain] ERROR o.s.b.w.e.tomcat.TomcatStarter - Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'corsFilter' defined in class path resource [com/qf/myafterprojecy/config/CorsConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.filter.CorsFilter]: Factory method 'corsFilter' threw exception; nested exception is java.lang.Error: Unresolved compilation problems: + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + +2025-10-11 11:31:28 [restartedMain] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 11:31:28 [restartedMain] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat +2025-10-11 11:31:28 [restartedMain] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener - + +Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. +2025-10-11 11:31:28 [restartedMain] ERROR o.s.boot.SpringApplication - Application run failed +org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.23.jar:5.3.23] + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) [spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) [spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) [spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.6.13.jar:2.6.13] + at com.qf.myafterprojecy.MyAfterProjecyApplication.main(MyAfterProjecyApplication.java:11) [classes/:na] + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_461] + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_461] + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_461] + at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_461] + at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.6.13.jar:2.6.13] +Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat + at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.(TomcatWebServer.java:104) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[spring-boot-2.6.13.jar:2.6.13] + ... 13 common frames omitted +Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corsFilter' defined in class path resource [com/qf/myafterprojecy/config/CorsConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.filter.CorsFilter]: Factory method 'corsFilter' threw exception; nested exception is java.lang.Error: Unresolved compilation problems: + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + + at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:212) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:175) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:170) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:155) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.ServletContextInitializerBeans.(ServletContextInitializerBeans.java:87) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:260) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234) ~[spring-boot-2.6.13.jar:2.6.13] + at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53) ~[spring-boot-2.6.13.jar:2.6.13] + at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5220) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_461] + at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_461] + at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[na:1.8.0_461] + at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_461] + at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_461] + at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[na:1.8.0_461] + at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) ~[tomcat-embed-core-9.0.68.jar:9.0.68] + at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) ~[spring-boot-2.6.13.jar:2.6.13] + ... 18 common frames omitted +Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.filter.CorsFilter]: Factory method 'corsFilter' threw exception; nested exception is java.lang.Error: Unresolved compilation problems: + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + + at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.23.jar:5.3.23] + at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.23.jar:5.3.23] + ... 61 common frames omitted +Caused by: java.lang.Error: Unresolved compilation problems: + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + Syntax error, insert ")" to complete Expression + + at com.qf.myafterprojecy.config.CorsConfig.corsFilter(CorsConfig.java:30) ~[classes/:na] + at com.qf.myafterprojecy.config.CorsConfig$$EnhancerBySpringCGLIB$$11dcd8ab.CGLIB$corsFilter$0() ~[classes/:na] + at com.qf.myafterprojecy.config.CorsConfig$$EnhancerBySpringCGLIB$$11dcd8ab$$FastClassBySpringCGLIB$$a3a731c6.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.23.jar:5.3.23] + at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.23.jar:5.3.23] + at com.qf.myafterprojecy.config.CorsConfig$$EnhancerBySpringCGLIB$$11dcd8ab.corsFilter() ~[classes/:na] + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_461] + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_461] + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_461] + at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_461] + at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.23.jar:5.3.23] + ... 62 common frames omitted +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 11:31:40 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 11:31:40 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 11:31:40 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 8 ms. Found 2 JPA repository interfaces. +2025-10-11 11:31:40 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 11:31:40 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 11:31:40 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 11:31:40 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 11:31:40 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 11:31:40 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 128 ms +2025-10-11 11:31:40 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 11:31:40 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 11:31:40 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 11:31:40 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 11:31:40 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 11:31:40 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 11:31:40 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: a44b2f73-737e-48c9-84af-24c5e71b937e + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 11:31:40 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@56b58137, org.springframework.security.web.context.SecurityContextPersistenceFilter@85e15be, org.springframework.security.web.header.HeaderWriterFilter@6cf68bd2, org.springframework.security.web.authentication.logout.LogoutFilter@26888dda, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@4c4a8ee2, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6732356, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@292a1469, org.springframework.security.web.access.ExceptionTranslationFilter@ac8076a, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@11cfdf1] +2025-10-11 11:31:40 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 11:31:40 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 11:31:40 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.271 seconds (JVM running for 4061.243) +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 11:31:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 11:31:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 11:31:41 CST 2025] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 33 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=33 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 33 +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [33] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [33] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [33] +2025-10-11 11:31:41 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [33] +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 33 +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID33: 成功=true +2025-10-11 11:31:41 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 11:31:41 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 11:31:55 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 17 class path changes (0 additions, 17 deletions, 0 modifications) +2025-10-11 11:31:55 [Thread-204] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 11:31:55 [Thread-204] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 11:31:55 [Thread-204] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 11:31:55 [Thread-204] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 11:31:55 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 11:31:55 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 11:31:55 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 11:31:55 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 11:31:55 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 11:31:55 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 11:31:55 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 11:31:55 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 11:31:55 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 11:31:56 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 11:31:56 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 189 ms +2025-10-11 11:31:56 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 11:31:56 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 11:31:56 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 11:31:56 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 11:31:56 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 11:31:56 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 11:31:56 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 55c054d7-4ef5-46b4-a326-14913a060e63 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 11:31:56 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4eff6c2f, org.springframework.security.web.context.SecurityContextPersistenceFilter@3e617894, org.springframework.security.web.header.HeaderWriterFilter@2d00d610, org.springframework.security.web.authentication.logout.LogoutFilter@7d49237a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@57ddf9a3, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6342ad13, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@13cf8af9, org.springframework.security.web.access.ExceptionTranslationFilter@695ae, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@539245c] +2025-10-11 11:31:56 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 11:31:56 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 11:31:56 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.321 seconds (JVM running for 4076.43) +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 11:31:56 CST 2025] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 34 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=34 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 34 +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [34] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [34] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [34] +2025-10-11 11:31:56 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [34] +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 34 +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID34: 成功=true +2025-10-11 11:31:56 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 11:31:56 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 11:31:57 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 20 class path changes (17 additions, 0 deletions, 3 modifications) +2025-10-11 11:31:57 [Thread-211] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 11:31:57 [Thread-211] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 11:31:57 [Thread-211] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 11:31:57 [Thread-211] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 11:31:57 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 11:31:57 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 11:31:57 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 11:31:57 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 11:31:57 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 11:31:57 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 11:31:57 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 11:31:57 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 11:31:57 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 11:31:57 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 11:31:57 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 117 ms +2025-10-11 11:31:57 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 11:31:57 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 11:31:57 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 11:31:57 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 11:31:57 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 11:31:57 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 11:31:57 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 777688dc-be15-4f42-a121-cff0d14127d3 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 11:31:57 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@423a38f, org.springframework.security.web.context.SecurityContextPersistenceFilter@46077e10, org.springframework.security.web.header.HeaderWriterFilter@55975400, org.springframework.security.web.authentication.logout.LogoutFilter@75676312, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@551d99fe, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@67b50443, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@25f13c80, org.springframework.security.web.access.ExceptionTranslationFilter@22b20503, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2e3485ee] +2025-10-11 11:31:57 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 11:31:57 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 11:31:57 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 11:31:57 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.237 seconds (JVM running for 4078.292) +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 11:31:58 CST 2025] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 35 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=35 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 35 +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [35] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [35] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [35] +2025-10-11 11:31:58 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [35] +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 35 +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID35: 成功=true +2025-10-11 11:31:58 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 11:31:58 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 11:33:52 [http-nio-8080-exec-1] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-10-11 11:33:52 [http-nio-8080-exec-1] INFO o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet' +2025-10-11 11:33:52 [http-nio-8080-exec-1] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 0 ms +2025-10-11 12:04:15 [http-nio-8080-exec-10] INFO c.q.m.controller.MessageController - 接收获取所有消息的请求 +2025-10-11 12:04:15 [http-nio-8080-exec-10] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:04:18 [http-nio-8080-exec-1] INFO c.q.m.controller.MessageController - 接收获取所有消息的请求 +2025-10-11 12:04:18 [http-nio-8080-exec-1] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:06:37 [http-nio-8080-exec-3] ERROR c.q.m.GlobalExceptionHandler - 请求路径:/api/articles/undefined,异常消息:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined" +2025-10-11 12:06:37 [http-nio-8080-exec-3] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined"] +2025-10-11 12:07:20 [http-nio-8080-exec-8] ERROR c.q.m.GlobalExceptionHandler - 请求路径:/api/articles/undefined,异常消息:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined" +2025-10-11 12:07:20 [http-nio-8080-exec-8] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined"] +2025-10-11 12:07:43 [http-nio-8080-exec-10] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:08:20 [http-nio-8080-exec-2] ERROR c.q.m.GlobalExceptionHandler - 请求路径:/api/articles/undefined,异常消息:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined" +2025-10-11 12:08:20 [http-nio-8080-exec-2] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined"] +2025-10-11 12:08:27 [http-nio-8080-exec-4] ERROR c.q.m.GlobalExceptionHandler - 请求路径:/api/articles/undefined,异常消息:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined" +2025-10-11 12:08:27 [http-nio-8080-exec-4] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined"] +2025-10-11 12:09:59 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 1 class path change (0 additions, 0 deletions, 1 modification) +2025-10-11 12:09:59 [Thread-215] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 12:09:59 [Thread-215] INFO o.a.c.c.C.[.[localhost].[/] - Destroying Spring FrameworkServlet 'dispatcherServlet' +2025-10-11 12:09:59 [Thread-215] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:09:59 [Thread-215] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:09:59 [Thread-215] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:09:59 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:09:59 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:09:59 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 12:09:59 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:09:59 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:09:59 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:09:59 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:09:59 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:09:59 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 123 ms +2025-10-11 12:09:59 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:09:59 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:09:59 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:09:59 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:09:59 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:09:59 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:09:59 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 9af6e5c9-5604-4ebc-bf11-70a40e49a04c + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:09:59 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@75299659, org.springframework.security.web.context.SecurityContextPersistenceFilter@47580ef7, org.springframework.security.web.header.HeaderWriterFilter@2ee3cc52, org.springframework.security.web.authentication.logout.LogoutFilter@684ebdd4, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@35d03406, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5f57ff8d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@464100eb, org.springframework.security.web.access.ExceptionTranslationFilter@7ada811, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7f0f994b] +2025-10-11 12:09:59 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:09:59 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:09:59 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.261 seconds (JVM running for 6359.986) +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 12:09:59 CST 2025] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 36 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=36 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 36 +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [36] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [36] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [36] +2025-10-11 12:09:59 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [36] +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 36 +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID36: 成功=true +2025-10-11 12:09:59 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 12:09:59 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 12:10:37 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 3 class path changes (0 additions, 0 deletions, 3 modifications) +2025-10-11 12:10:38 [Thread-219] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 12:10:38 [Thread-219] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:10:38 [Thread-219] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:10:38 [Thread-219] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:10:38 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:10:38 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:10:38 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 12:10:38 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:10:38 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:10:38 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:10:38 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:10:38 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:10:38 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 125 ms +2025-10-11 12:10:38 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:10:38 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:10:38 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:10:38 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:10:38 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:10:38 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:10:38 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 6dccd0de-a1cc-4d05-8ba4-f6e4aed9a260 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:10:38 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@476f9c70, org.springframework.security.web.context.SecurityContextPersistenceFilter@37c34bbc, org.springframework.security.web.header.HeaderWriterFilter@3d20f541, org.springframework.security.web.authentication.logout.LogoutFilter@1bc54180, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@527251c3, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@cc6047d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@27839d84, org.springframework.security.web.access.ExceptionTranslationFilter@5e800d55, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@5339b312] +2025-10-11 12:10:38 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:10:38 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:10:38 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.254 seconds (JVM running for 6398.695) +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 12:10:38 CST 2025] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 37 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=37 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 37 +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [37] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [37] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [37] +2025-10-11 12:10:38 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [37] +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 37 +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID37: 成功=true +2025-10-11 12:10:38 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 12:10:38 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 12:11:04 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 1 class path change (0 additions, 0 deletions, 1 modification) +2025-10-11 12:11:04 [Thread-223] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 12:11:04 [Thread-223] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:11:04 [Thread-223] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:11:04 [Thread-223] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:11:04 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:11:04 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:11:04 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 12:11:04 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:11:04 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:11:04 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:11:04 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:11:04 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:11:04 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 132 ms +2025-10-11 12:11:04 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:11:04 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:11:04 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:11:04 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:11:04 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:11:04 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:11:04 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 4b5c2974-4e76-4e11-907d-b60b7f954e40 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:11:04 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5c685aea, org.springframework.security.web.context.SecurityContextPersistenceFilter@2010a70b, org.springframework.security.web.header.HeaderWriterFilter@590eb888, org.springframework.security.web.authentication.logout.LogoutFilter@c8f4423, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@4e59d016, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5e4b42b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6ac9caf2, org.springframework.security.web.access.ExceptionTranslationFilter@469e3fd, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@6763ba0e] +2025-10-11 12:11:04 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:11:04 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:11:04 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.289 seconds (JVM running for 6425.093) +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 12:11:04 CST 2025] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 38 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=38 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 38 +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [38] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [38] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [38] +2025-10-11 12:11:04 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [38] +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 38 +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID38: 成功=true +2025-10-11 12:11:04 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 12:11:04 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 12:11:39 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 1 class path change (0 additions, 0 deletions, 1 modification) +2025-10-11 12:11:39 [Thread-227] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 12:11:39 [Thread-227] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:11:39 [Thread-227] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:11:39 [Thread-227] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:11:40 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:11:40 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:11:40 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 5 ms. Found 2 JPA repository interfaces. +2025-10-11 12:11:40 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:11:40 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:11:40 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:11:40 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:11:40 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:11:40 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 121 ms +2025-10-11 12:11:40 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:11:40 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:11:40 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:11:40 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:11:40 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:11:40 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:11:40 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 79c18e66-1c1d-4f6a-bee4-2b47d09b82c1 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:11:40 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5a8ec9ee, org.springframework.security.web.context.SecurityContextPersistenceFilter@561fe541, org.springframework.security.web.header.HeaderWriterFilter@1a9fcc6f, org.springframework.security.web.authentication.logout.LogoutFilter@2f7da61e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@23ea2452, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@62f93afa, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3c2f7d68, org.springframework.security.web.access.ExceptionTranslationFilter@5452b00d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@39d206a4] +2025-10-11 12:11:40 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:11:40 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:11:40 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.319 seconds (JVM running for 6460.601) +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 12:11:40 CST 2025] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 39 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=39 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 39 +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [39] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [39] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [39] +2025-10-11 12:11:40 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [39] +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 39 +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID39: 成功=true +2025-10-11 12:11:40 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 12:11:40 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 12:12:45 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 19 class path changes (0 additions, 19 deletions, 0 modifications) +2025-10-11 12:12:45 [Thread-231] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 12:12:45 [Thread-231] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:12:45 [Thread-231] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:12:45 [Thread-231] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:12:45 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 4432 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:12:45 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:12:45 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:12:45 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:12:45 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 0 ms. Found 0 JPA repository interfaces. +2025-10-11 12:12:45 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:12:45 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:12:45 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:12:45 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:12:45 [restartedMain] INFO o.a.c.c.C.[.[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:12:45 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 103 ms +2025-10-11 12:12:45 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:12:45 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:12:45 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:12:45 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:12:45 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:12:45 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:12:45 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:12:45 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 82255416-0f05-4abb-8089-2a31b8c78416 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:12:45 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4cacc0cc, org.springframework.security.web.context.SecurityContextPersistenceFilter@2d94ee61, org.springframework.security.web.header.HeaderWriterFilter@76cb048d, org.springframework.security.web.csrf.CsrfFilter@1f5e6a57, org.springframework.security.web.authentication.logout.LogoutFilter@2894bbc2, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@594b5c44, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@6248f607, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@2ef13b41, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@7b96090b, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2c5b2a9c, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@21abcf6, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5ec3c07b, org.springframework.security.web.session.SessionManagementFilter@417428ca, org.springframework.security.web.access.ExceptionTranslationFilter@5308fc0, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@d19cdc1] +2025-10-11 12:12:45 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:12:45 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:12:45 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.185 seconds (JVM running for 6525.719) +2025-10-11 12:12:45 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation delta: + + +========================== +CONDITION EVALUATION DELTA +========================== + + +Positive matches: +----------------- + + SpringBootWebSecurityConfiguration matched: + - found 'session' scope (OnWebApplicationCondition) + - AllNestedConditions 2 matched 0 did not; NestedCondition on DefaultWebSecurityCondition.Beans @ConditionalOnMissingBean (types: org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter,org.springframework.security.web.SecurityFilterChain; SearchStrategy: all) did not find any beans; NestedCondition on DefaultWebSecurityCondition.Classes @ConditionalOnClass found required classes 'org.springframework.security.web.SecurityFilterChain', 'org.springframework.security.config.annotation.web.builders.HttpSecurity' (DefaultWebSecurityCondition) + + WebSecurityEnablerConfiguration matched: + - @ConditionalOnClass found required class 'org.springframework.security.config.annotation.web.configuration.EnableWebSecurity' (OnClassCondition) + - found 'session' scope (OnWebApplicationCondition) + - @ConditionalOnMissingBean (names: springSecurityFilterChain; SearchStrategy: all) did not find any beans (OnBeanCondition) + + +Negative matches: +----------------- + + None + + +Exclusions: +----------- + + None + + +Unconditional classes: +---------------------- + + None + + + +2025-10-11 12:13:12 [SpringApplicationShutdownHook] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:13:12 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:13:12 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:13:16 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 12148 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:13:16 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:13:16 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:13:16 [restartedMain] INFO o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor - Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2025-10-11 12:13:16 [restartedMain] INFO o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor - For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2025-10-11 12:13:17 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:13:17 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 45 ms. Found 2 JPA repository interfaces. +2025-10-11 12:13:17 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:13:18 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:13:18 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:13:18 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:13:18 [restartedMain] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:13:18 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1639 ms +2025-10-11 12:13:18 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:13:18 [restartedMain] INFO org.hibernate.Version - HHH000412: Hibernate ORM core version 5.6.12.Final +2025-10-11 12:13:18 [restartedMain] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.1.2.Final} +2025-10-11 12:13:18 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:13:19 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:13:19 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:13:20 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:13:20 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:13:21 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 2e0f3b8e-0135-46e3-a9da-13ef2ad77893 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:13:21 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@6f007eaa, org.springframework.security.web.context.SecurityContextPersistenceFilter@209d588d, org.springframework.security.web.header.HeaderWriterFilter@1eed06a8, org.springframework.security.web.authentication.logout.LogoutFilter@3abcc0ce, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@61bcc8c6, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@bbf9cf9, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7ddf3e2, org.springframework.security.web.access.ExceptionTranslationFilter@25a47be4, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7dc51561] +2025-10-11 12:13:21 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:13:21 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:13:21 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 5.888 seconds (JVM running for 6.356) +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 12:13:22 CST 2025] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 40 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=40 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 40 +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [40] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [40] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [40] +2025-10-11 12:13:22 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [40] +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 40 +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID40: 成功=true +2025-10-11 12:13:22 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 12:13:28 [http-nio-8080-exec-1] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-10-11 12:13:28 [http-nio-8080-exec-1] INFO o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet' +2025-10-11 12:13:28 [http-nio-8080-exec-1] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 0 ms +2025-10-11 12:13:35 [http-nio-8080-exec-3] ERROR c.q.m.service.ArticleService - 获取文章失败: For input string: "undefined" +2025-10-11 12:13:53 [http-nio-8080-exec-4] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:14:01 [http-nio-8080-exec-5] ERROR c.q.m.service.ArticleService - 获取文章失败: For input string: "undefined" +2025-10-11 12:14:36 [http-nio-8080-exec-7] ERROR c.q.m.service.ArticleService - 获取文章失败: For input string: "undefined" +2025-10-11 12:14:42 [http-nio-8080-exec-8] ERROR c.q.m.service.ArticleService - 获取文章失败: For input string: "undefined" +2025-10-11 12:15:10 [File Watcher] INFO o.s.b.d.a.LocalDevToolsAutoConfiguration$RestartingClassPathChangeChangedEventListener - Restarting due to 1 class path change (0 additions, 0 deletions, 1 modification) +2025-10-11 12:15:10 [Thread-6] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +2025-10-11 12:15:10 [Thread-6] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Destroying Spring FrameworkServlet 'dispatcherServlet' +2025-10-11 12:15:10 [Thread-6] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:15:10 [Thread-6] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 12:15:10 [Thread-6] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Starting MyAfterProjecyApplication using Java 1.8.0_461 on DESKTOP-8G5GS0I with PID 12148 (E:\MyWebProject\MyAfterProjecy\target\classes started by 30803 in E:\MyWebProject\MyAfterProjecy) +2025-10-11 12:15:10 [restartedMain] DEBUG c.q.m.MyAfterProjecyApplication - Running with Spring Boot v2.6.13, Spring v5.3.23 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - No active profile set, falling back to 1 default profile: "default" +2025-10-11 12:15:10 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-10-11 12:15:10 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 8 ms. Found 2 JPA repository interfaces. +2025-10-11 12:15:10 [restartedMain] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.qf.myafterprojecy]' package. Please check your configuration. +2025-10-11 12:15:10 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +2025-10-11 12:15:10 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +2025-10-11 12:15:10 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68] +2025-10-11 12:15:10 [restartedMain] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext +2025-10-11 12:15:10 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 216 ms +2025-10-11 12:15:10 [restartedMain] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default] +2025-10-11 12:15:10 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Starting... +2025-10-11 12:15:10 [restartedMain] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Start completed. +2025-10-11 12:15:10 [restartedMain] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2025-10-11 12:15:10 [restartedMain] INFO o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2025-10-11 12:15:10 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 12:15:10 [restartedMain] WARN o.s.b.a.s.s.UserDetailsServiceAutoConfiguration - + +Using generated security password: 94d1eb2a-07bb-4058-9229-20c266bfc324 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2025-10-11 12:15:10 [restartedMain] INFO o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@10d5a59d, org.springframework.security.web.context.SecurityContextPersistenceFilter@4f5e5486, org.springframework.security.web.header.HeaderWriterFilter@2e871adf, org.springframework.security.web.authentication.logout.LogoutFilter@7eb5ca05, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@555a1ae7, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5535e512, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4136a8ac, org.springframework.security.web.access.ExceptionTranslationFilter@693d3a44, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@280244] +2025-10-11 12:15:10 [restartedMain] INFO o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html] +2025-10-11 12:15:10 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729 +2025-10-11 12:15:10 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.MyAfterProjecyApplication - Started MyAfterProjecyApplication in 0.495 seconds (JVM running for 115.243) +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化开始 ===== +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.init.MessageDataInit - 当前数据库中消息数量: 3 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.init.MessageDataInit - 数据库中已存在消息数据,无需初始化 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.init.MessageDataInit - ===== 消息数据初始化结束 ===== +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器开始运行 ===== +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 当前数据库中消息数量: 3 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Repository查询方法 ===== +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的消息数量: 2 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根消息数量: 2 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [VARCHAR] - [%张%] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [CHAR] - [\] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 昵称包含'张'的消息数量: 1 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 文章ID为1的评论数量: 2 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 消息ID为1的回复数量: 1 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 测试Service层方法 ===== +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 查询所有消息 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取所有消息: 成功=true, 消息数量=3 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 根据ID查询消息: 1 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 根据ID1获取消息: 成功=true, 昵称=张三 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 获取文章评论数量: 1 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取文章ID为1的评论数量: 成功=true, 数量=2 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 查询所有根消息 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 获取根消息: 成功=true, 数量=2 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 保存消息: 测试用户 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [1] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [2] as [VARCHAR] - [这是一条测试消息] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [3] as [TIMESTAMP] - [Sat Oct 11 12:15:10 CST 2025] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [4] as [VARCHAR] - [test@example.com] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [5] as [VARCHAR] - [测试用户] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [6] as [INTEGER] - [null] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 消息保存成功: 41 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 保存新消息: 成功=true, 消息ID=41 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 删除消息: 41 +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [41] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [41] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [41] +2025-10-11 12:15:10 [restartedMain] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [INTEGER] - [41] +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.service.MessageService - 消息删除成功: 41 +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - 删除消息ID41: 成功=true +2025-10-11 12:15:10 [restartedMain] INFO c.q.m.runner.MessageDataChecker - ===== 消息数据检查器运行结束 ===== +2025-10-11 12:15:10 [restartedMain] INFO o.s.b.d.a.ConditionEvaluationDeltaLoggingListener - Condition evaluation unchanged +2025-10-11 13:31:36 [SpringApplicationShutdownHook] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +2025-10-11 13:31:36 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown initiated... +2025-10-11 13:31:36 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - WebProjectHikariCP - Shutdown completed. diff --git a/src/main/java/com/qf/myafterprojecy/config/CorsConfig.java b/src/main/java/com/qf/myafterprojecy/config/CorsConfig.java new file mode 100644 index 0000000..22a52a6 --- /dev/null +++ b/src/main/java/com/qf/myafterprojecy/config/CorsConfig.java @@ -0,0 +1,50 @@ +package com.qf.myafterprojecy.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * CORS配置类,用于解决跨域问题 + */ +@Configuration +public class CorsConfig { + + /** + * 创建CORS过滤器,配置跨域请求的规则 + */ + @Bean + public CorsFilter corsFilter() { + // 创建CORS配置对象 + CorsConfiguration config = new CorsConfiguration(); + + // 允许的来源,这里允许所有来源,实际生产环境应该限制特定域名 + config.addAllowedOriginPattern("*"); + + // 允许携带凭证(如Cookie) + config.setAllowCredentials(true); + + // 允许的请求方法 + config.addAllowedMethod("*"); + + // 允许的请求头 + config.addAllowedHeader("*"); + + // 暴露的响应头,这些头信息可以被前端JavaScript访问 + config.addExposedHeader("*"); + + // 设置预检请求的有效期(秒) + config.setMaxAge(3600L); + + // 创建基于URL的CORS配置源 + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + + // 为所有路径应用CORS配置 + source.registerCorsConfiguration("/**", config); + + // 返回配置好的CORS过滤器 + return new CorsFilter(source); + } +} \ No newline at end of file diff --git a/src/main/java/com/qf/myafterprojecy/controller/ArticleController.java b/src/main/java/com/qf/myafterprojecy/controller/ArticleController.java index 68d954c..553b36a 100644 --- a/src/main/java/com/qf/myafterprojecy/controller/ArticleController.java +++ b/src/main/java/com/qf/myafterprojecy/controller/ArticleController.java @@ -30,9 +30,8 @@ public class ArticleController { * @return 返回包含文章信息的ResponseMessage对象 */ @GetMapping("/{id}") - public ResponseMessage
getArticle(@PathVariable Integer id) { + public ResponseMessage
getArticle(@PathVariable String id) { return articleService.getArticleById(id); - } /** diff --git a/src/main/java/com/qf/myafterprojecy/service/ArticleService.java b/src/main/java/com/qf/myafterprojecy/service/ArticleService.java index 3aa0e17..2c46677 100644 --- a/src/main/java/com/qf/myafterprojecy/service/ArticleService.java +++ b/src/main/java/com/qf/myafterprojecy/service/ArticleService.java @@ -25,9 +25,12 @@ public class ArticleService implements IArticleService { @Override @Transactional(readOnly = true) - public ResponseMessage
getArticleById(Integer id) { + public ResponseMessage
getArticleById(String id) { try { - Article article = articleRepository.findById(id) + if (id == null || id.isEmpty()) { + return ResponseMessage.failure("文章ID不能为空"); + } + Article article = articleRepository.findById(Integer.parseInt(id)) .orElseThrow(() -> new RuntimeException("文章不存在")); // 暂时不增加浏览次数,以避免事务问题 diff --git a/src/main/java/com/qf/myafterprojecy/service/IArticleService.java b/src/main/java/com/qf/myafterprojecy/service/IArticleService.java index b3cc047..bf99973 100644 --- a/src/main/java/com/qf/myafterprojecy/service/IArticleService.java +++ b/src/main/java/com/qf/myafterprojecy/service/IArticleService.java @@ -7,7 +7,7 @@ import com.qf.myafterprojecy.pojo.dto.ArticleDto; import java.util.List; public interface IArticleService { - ResponseMessage
getArticleById(Integer id); + ResponseMessage
getArticleById(String id); ResponseMessage> getAllArticles(); ResponseMessage
saveArticle(ArticleDto articleDto); ResponseMessage
updateArticle(Integer id, ArticleDto articleDto);