diff --git a/backend/backend_complete.log b/backend/backend_complete.log new file mode 100644 index 0000000..d725c37 --- /dev/null +++ b/backend/backend_complete.log @@ -0,0 +1,313 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 1 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:16:50.735 INFO 6824 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 6824 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:16:50.740 INFO 6824 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:16:56.239 INFO 6824 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:16:56.265 INFO 6824 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:16:56.266 INFO 6824 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:16:56.426 INFO 6824 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:16:56.426 INFO 6824 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5611 ms +2026-01-29 12:16:56.484 INFO 6824 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:16:57.245 INFO 6824 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:16:57.269 INFO 6824 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:21 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:16:59.759 WARN 6824 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 926319ab-f1b3-4bae-8d73-5c7dc57ed41e + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:17:00.150 INFO 6824 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@26be9a6, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4d518c66, org.springframework.security.web.context.SecurityContextPersistenceFilter@5a4dda2, org.springframework.security.web.header.HeaderWriterFilter@6df4af5, org.springframework.security.web.authentication.logout.LogoutFilter@582e9152, com.gpf.pethospital.security.JwtAuthenticationFilter@411fa0ce, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@34045582, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1edccfd4, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@251d7fdd, org.springframework.security.web.session.SessionManagementFilter@250d440, org.springframework.security.web.access.ExceptionTranslationFilter@4966bab1, org.springframework.security.web.access.intercept.AuthorizationFilter@60b5e80d] +2026-01-29 12:17:01.506 INFO 6824 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:17:01.520 INFO 6824 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.044 seconds (JVM running for 12.638) +2026-01-29 12:17:06.961 INFO 6824 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:17:06.961 INFO 6824 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:17:06.963 INFO 6824 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c9c63df] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@598865562 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin123(String), admin123(String), admin123(String) +<== Total: 0 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c9c63df] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@66aeebc4] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@947374894 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), 13900139001(String), customer@example.com(String) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@66aeebc4] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@407d98a4] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@952904848 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO `user` ( username, phone, email, password, role, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: customer(String), 13900139001(String), customer@example.com(String), $2a$10$xQOy/03sZQwPYhFu613TA.pfqYWVVwm8ObpQ7qnhuiW4vHpbEN7fy(String), CUSTOMER(String), 1(Integer), 2026-01-29T12:17:11.108203849(LocalDateTime), 2026-01-29T12:17:11.108203849(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@407d98a4] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7038ac66] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2130660369 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, customer, 13900139001, customer@example.com, $2a$10$xQOy/03sZQwPYhFu613TA.pfqYWVVwm8ObpQ7qnhuiW4vHpbEN7fy, CUSTOMER, 1, null, 2026-01-29 12:17:11.108204, 2026-01-29 12:17:11.108204, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7038ac66] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@79f8c3da] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1968400554 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO pet ( owner_id, name, breed, gender, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ? ) +==> Parameters: 1(Long), 小黄(String), 拉布拉多(String), F(String), 2026-01-29T12:17:18.870163031(LocalDateTime), 2026-01-29T12:17:18.870163031(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@79f8c3da] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70112bd5] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1858967151 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70112bd5] +2026-01-29 12:17:23.261 ERROR 6824 --- [nio-8081-exec-8] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error updating database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] +### The error may exist in com/gpf/pethospital/mapper/AppointmentMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.AppointmentMapper.insert +### The error occurred while executing an update +### SQL: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Table.getColumn(Table.java:749) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumn(Parser.java:1256) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumnList(Parser.java:1241) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseInsert(Parser.java:1641) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:814) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:1099) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:372) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:84) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.update(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.insert(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy77.insert(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:60) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.AppointmentServiceImpl$$EnhancerBySpringCGLIB$$4a795df8.save() ~[classes/:na] + at com.gpf.pethospital.controller.AppointmentController.create(AppointmentController.java:33) ~[classes/:na] + at com.gpf.pethospital.controller.AppointmentController$$FastClassBySpringCGLIB$$4329551c.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.controller.AppointmentController$$EnhancerBySpringCGLIB$$e7e92bd4.create() ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@337f2551] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1035521358 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin123(String), admin123(String), admin123(String) +<== Total: 0 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@337f2551] +2026-01-29 12:17:30.582 INFO 6824 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:17:30.584 INFO 6824 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 49.018 s +[INFO] Finished at: 2026-01-29T12:17:30+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_final.log b/backend/backend_final.log new file mode 100644 index 0000000..be8e012 --- /dev/null +++ b/backend/backend_final.log @@ -0,0 +1,79 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 1 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:09:25.156 INFO 6050 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 6050 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:09:25.161 INFO 6050 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:09:30.848 INFO 6050 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:09:30.873 INFO 6050 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:09:30.873 INFO 6050 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:09:31.043 INFO 6050 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:09:31.043 INFO 6050 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5806 ms +2026-01-29 12:09:31.101 INFO 6050 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:09:31.897 INFO 6050 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:09:31.923 INFO 6050 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:6 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:09:34.317 WARN 6050 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 332a46eb-449c-42d8-94b3-6f0bba3c5735 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:09:34.688 INFO 6050 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@21edd891, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@de579ff, org.springframework.security.web.context.SecurityContextPersistenceFilter@7abeabe9, org.springframework.security.web.header.HeaderWriterFilter@22d477c2, org.springframework.security.web.authentication.logout.LogoutFilter@bb3ecfe, com.gpf.pethospital.security.JwtAuthenticationFilter@7971c2a9, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1b52699c, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@250d440, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@2fd39436, org.springframework.security.web.session.SessionManagementFilter@448c92fc, org.springframework.security.web.access.ExceptionTranslationFilter@79ecc507, org.springframework.security.web.access.intercept.AuthorizationFilter@582e9152] +2026-01-29 12:09:36.166 INFO 6050 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:09:36.179 INFO 6050 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.27 seconds (JVM running for 12.892) +2026-01-29 12:09:53.265 INFO 6050 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:09:53.269 INFO 6050 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 37.310 s +[INFO] Finished at: 2026-01-29T12:09:53+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_final_fixed.log b/backend/backend_final_fixed.log new file mode 100644 index 0000000..ee108dc --- /dev/null +++ b/backend/backend_final_fixed.log @@ -0,0 +1,276 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 2 resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:17:52.260 INFO 6984 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 6984 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:17:52.265 INFO 6984 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:17:57.768 INFO 6984 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:17:57.795 INFO 6984 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:17:57.796 INFO 6984 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:17:57.957 INFO 6984 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:17:57.957 INFO 6984 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5612 ms +2026-01-29 12:17:58.012 INFO 6984 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:17:58.796 INFO 6984 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:17:58.826 INFO 6984 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:16 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:18:01.177 WARN 6984 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 26737b8f-8750-49cd-b844-01692eface7e + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:18:01.533 INFO 6984 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@435e416c, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@6af310c7, org.springframework.security.web.context.SecurityContextPersistenceFilter@21edd891, org.springframework.security.web.header.HeaderWriterFilter@340cb97f, org.springframework.security.web.authentication.logout.LogoutFilter@370c9018, com.gpf.pethospital.security.JwtAuthenticationFilter@4aed311e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7971c2a9, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@60b5e80d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4c38cd16, org.springframework.security.web.session.SessionManagementFilter@582e9152, org.springframework.security.web.access.ExceptionTranslationFilter@291a4791, org.springframework.security.web.access.intercept.AuthorizationFilter@482c351d] +2026-01-29 12:18:03.110 INFO 6984 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:18:03.124 INFO 6984 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.261 seconds (JVM running for 12.885) +2026-01-29 12:18:11.902 INFO 6984 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:18:11.902 INFO 6984 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:18:11.903 INFO 6984 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1f20fef4] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@208105529 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 3, customer, 13900139000, customer@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, CUSTOMER, 1, null, 2026-01-29 12:17:59.555682, 2026-01-29 12:17:59.555682, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1f20fef4] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b030f70] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1718503198 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b030f70] +2026-01-29 12:18:20.043 ERROR 6984 --- [nio-8081-exec-3] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error updating database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] +### The error may exist in com/gpf/pethospital/mapper/AppointmentMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.AppointmentMapper.insert +### The error occurred while executing an update +### SQL: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Table.getColumn(Table.java:749) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumn(Parser.java:1256) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumnList(Parser.java:1241) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseInsert(Parser.java:1641) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:814) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:1099) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:372) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:84) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.update(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.insert(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy77.insert(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:60) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.AppointmentServiceImpl$$EnhancerBySpringCGLIB$$cb78fdc9.save() ~[classes/:na] + at com.gpf.pethospital.controller.AppointmentController.create(AppointmentController.java:33) ~[classes/:na] + at com.gpf.pethospital.controller.AppointmentController$$FastClassBySpringCGLIB$$4329551c.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.controller.AppointmentController$$EnhancerBySpringCGLIB$$29d26cb5.create() ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +2026-01-29 12:18:53.316 INFO 6984 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:18:53.318 INFO 6984 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 01:10 min +[INFO] Finished at: 2026-01-29T12:18:53+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_final_flow.log b/backend/backend_final_flow.log new file mode 100644 index 0000000..b8b6c4b --- /dev/null +++ b/backend/backend_final_flow.log @@ -0,0 +1,188 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 3 resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:23:12.006 INFO 7496 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 7496 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:23:12.011 INFO 7496 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:23:17.378 INFO 7496 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:23:17.408 INFO 7496 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:23:17.408 INFO 7496 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:23:17.592 INFO 7496 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:23:17.593 INFO 7496 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5498 ms +2026-01-29 12:23:17.652 INFO 7496 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:23:18.530 INFO 7496 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:23:18.554 INFO 7496 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:11 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:23:19.273 WARN 7496 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentController' defined in file [/mnt/d/bs/gpf_pet_hospital/backend/target/classes/com/gpf/pethospital/controller/AppointmentController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentMapper' defined in file [/mnt/d/bs/gpf_pet_hospital/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #4 of URL [file:/mnt/d/bs/gpf_pet_hospital/backend/target/classes/data.sql]: INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] +2026-01-29 12:23:19.274 INFO 7496 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:23:19.275 INFO 7496 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +2026-01-29 12:23:19.280 INFO 7496 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] +2026-01-29 12:23:19.294 INFO 7496 --- [ main] ConditionEvaluationReportLoggingListener : + +Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. +2026-01-29 12:23:19.381 ERROR 7496 --- [ main] o.s.boot.SpringApplication : Application run failed + +org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentController' defined in file [/mnt/d/bs/gpf_pet_hospital/backend/target/classes/com/gpf/pethospital/controller/AppointmentController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentMapper' defined in file [/mnt/d/bs/gpf_pet_hospital/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #4 of URL [file:/mnt/d/bs/gpf_pet_hospital/backend/target/classes/data.sql]: INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] + at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:929) ~[spring-context-5.3.31.jar:5.3.31] + at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591) ~[spring-context-5.3.31.jar:5.3.31] + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289) ~[spring-boot-2.7.18.jar:2.7.18] + at com.gpf.pethospital.PetHospitalApplication.main(PetHospitalApplication.java:15) ~[classes/:na] +Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentMapper' defined in file [/mnt/d/bs/gpf_pet_hospital/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #4 of URL [file:/mnt/d/bs/gpf_pet_hospital/backend/target/classes/data.sql]: INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] + at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:713) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:693) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:408) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-5.3.31.jar:5.3.31] + ... 19 common frames omitted +Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appointmentMapper' defined in file [/mnt/d/bs/gpf_pet_hospital/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #4 of URL [file:/mnt/d/bs/gpf_pet_hospital/backend/target/classes/data.sql]: INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1534) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1417) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:710) ~[spring-beans-5.3.31.jar:5.3.31] + ... 34 common frames omitted +Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #4 of URL [file:/mnt/d/bs/gpf_pet_hospital/backend/target/classes/data.sql]: INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1519) ~[spring-beans-5.3.31.jar:5.3.31] + ... 45 common frames omitted +Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #4 of URL [file:/mnt/d/bs/gpf_pet_hospital/backend/target/classes/data.sql]: INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] + at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:282) ~[spring-jdbc-5.3.31.jar:5.3.31] + at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:254) ~[spring-jdbc-5.3.31.jar:5.3.31] + at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:54) ~[spring-jdbc-5.3.31.jar:5.3.31] + at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.runScripts(DataSourceScriptDatabaseInitializer.java:90) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.runScripts(AbstractScriptDatabaseInitializer.java:145) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyScripts(AbstractScriptDatabaseInitializer.java:107) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyDataScripts(AbstractScriptDatabaseInitializer.java:101) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:76) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65) ~[spring-boot-2.7.18.jar:2.7.18] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.31.jar:5.3.31] + at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.31.jar:5.3.31] + ... 57 common frames omitted +Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "AGE" not found; SQL statement: +INSERT INTO pet (name, species, breed, gender, age, owner_id, health_status) VALUES ('小白', '狗', '金毛', 'M', 3, 3, '健康') [42122-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Table.getColumn(Table.java:749) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumn(Parser.java:1256) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumnList(Parser.java:1241) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseInsert(Parser.java:1641) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:814) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:237) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na] + at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:261) ~[spring-jdbc-5.3.31.jar:5.3.31] + ... 67 common frames omitted + +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 16.764 s +[INFO] Finished at: 2026-01-29T12:23:19+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 1 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_full_flow.log b/backend/backend_full_flow.log new file mode 100644 index 0000000..cfca15b --- /dev/null +++ b/backend/backend_full_flow.log @@ -0,0 +1,344 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 3 resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:21:46.885 INFO 7324 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 7324 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:21:46.888 INFO 7324 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:21:52.609 INFO 7324 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:21:52.633 INFO 7324 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:21:52.634 INFO 7324 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:21:52.800 INFO 7324 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:21:52.801 INFO 7324 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5830 ms +2026-01-29 12:21:52.855 INFO 7324 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:21:53.685 INFO 7324 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:21:53.707 INFO 7324 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:15 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:21:56.382 WARN 7324 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 3ae24633-3a04-4e91-9dd2-f686ccd8de18 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:21:56.775 INFO 7324 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@240f350a, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@706f6d26, org.springframework.security.web.context.SecurityContextPersistenceFilter@6a1568d6, org.springframework.security.web.header.HeaderWriterFilter@40df6090, org.springframework.security.web.authentication.logout.LogoutFilter@6b27b2d0, com.gpf.pethospital.security.JwtAuthenticationFilter@3af2f846, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1b37fbec, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@bb3ecfe, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6af65f29, org.springframework.security.web.session.SessionManagementFilter@291a4791, org.springframework.security.web.access.ExceptionTranslationFilter@11a3a45f, org.springframework.security.web.access.intercept.AuthorizationFilter@62b6c045] +2026-01-29 12:21:58.151 INFO 7324 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:21:58.168 INFO 7324 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.599 seconds (JVM running for 13.252) +2026-01-29 12:22:05.764 INFO 7324 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:22:05.765 INFO 7324 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:22:05.766 INFO 7324 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@31b23466] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@155985460 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, ADMIN, 1, null, 2026-01-29 12:21:54.441399, 2026-01-29 12:21:54.441399, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@31b23466] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@11618e07] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1428743376 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) +==> Parameters: 1(Long), 1(Long), DRAFT(String), 2026-01-29T12:22:11.451463382(LocalDateTime), 2026-01-29T12:22:11.451463382(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@11618e07] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1eccf175] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1908255895 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM appointment WHERE deleted = 0 +==> Parameters: +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1eccf175] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@530348d5] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1397845812 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM appointment WHERE deleted = 0 +==> Parameters: +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@530348d5] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@773e0205] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2046423698 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 3, customer, 13900139000, customer@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, CUSTOMER, 1, null, 2026-01-29 12:21:54.449498, 2026-01-29 12:21:54.449498, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@773e0205] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1402ee31] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@449123009 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, ADMIN, 1, null, 2026-01-29 12:21:54.441399, 2026-01-29 12:21:54.441399, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1402ee31] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@393abbd] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@503935856 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM appointment WHERE deleted = 0 AND (customer_id = ?) +==> Parameters: 3(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@393abbd] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22dbff1c] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@126819480 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM appointment WHERE deleted = 0 +==> Parameters: +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22dbff1c] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@27695f1d] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1044329755 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM pet WHERE deleted = 0 +==> Parameters: +<== Columns: TOTAL +<== Row: 1 +<== Total: 1 +==> Preparing: SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 LIMIT ? +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@27695f1d] +2026-01-29 12:22:42.469 ERROR 7324 --- [nio-8081-exec-6] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "BIRTHDAY" not found; SQL statement: +SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 LIMIT ? [42122-214] +### The error may exist in com/gpf/pethospital/mapper/PetMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.PetMapper.selectList +### The error occurred while executing a query +### SQL: SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 LIMIT ? +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "BIRTHDAY" not found; SQL statement: +SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 LIMIT ? [42122-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "BIRTHDAY" not found; SQL statement: +SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 LIMIT ? [42122-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "BIRTHDAY" not found; SQL statement: +SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 LIMIT ? [42122-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:244) ~[h2-2.1.214.jar:2.1.214] + at org.h2.expression.ExpressionColumn.optimizeOther(ExpressionColumn.java:226) ~[h2-2.1.214.jar:2.1.214] + at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:213) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.query.Select.optimizeExpressionsAndPreserveAliases(Select.java:1285) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.query.Select.prepareExpressions(Select.java:1167) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.query.Query.prepare(Query.java:218) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:575) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:88) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.query(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.selectList(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:164) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy85.selectList(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.core.mapper.BaseMapper.selectPage(BaseMapper.java:348) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732) ~[na:na] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$DefaultMethodInvoker.invoke(MybatisMapperProxy.java:166) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy85.selectPage(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.page(IService.java:448) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.PetServiceImpl$$EnhancerBySpringCGLIB$$e0f570e.page() ~[classes/:na] + at com.gpf.pethospital.controller.PetController.list(PetController.java:33) ~[classes/:na] + at com.gpf.pethospital.controller.PetController$$FastClassBySpringCGLIB$$78a1db9c.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.controller.PetController$$EnhancerBySpringCGLIB$$28c5e4ba.list() ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:529) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +2026-01-29 12:22:57.837 INFO 7324 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:22:57.838 INFO 7324 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 01:20 min +[INFO] Finished at: 2026-01-29T12:22:57+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_jwt_fixed.log b/backend/backend_jwt_fixed.log new file mode 100644 index 0000000..f02f47d --- /dev/null +++ b/backend/backend_jwt_fixed.log @@ -0,0 +1,429 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 1 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:11:44.343 INFO 6533 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 6533 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:11:44.348 INFO 6533 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:11:49.720 INFO 6533 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:11:49.746 INFO 6533 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:11:49.746 INFO 6533 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:11:49.915 INFO 6533 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:11:49.915 INFO 6533 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5483 ms +2026-01-29 12:11:49.970 INFO 6533 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:11:50.790 INFO 6533 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:11:50.821 INFO 6533 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:16 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:11:53.249 WARN 6533 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 609d260c-f511-4bb7-8d09-763961b92f36 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:11:53.571 INFO 6533 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@797fcf9, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@16bd7ae1, org.springframework.security.web.context.SecurityContextPersistenceFilter@69796bd0, org.springframework.security.web.header.HeaderWriterFilter@7abeabe9, org.springframework.security.web.authentication.logout.LogoutFilter@46394f65, com.gpf.pethospital.security.JwtAuthenticationFilter@15d114ce, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@8c0a23f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@26c8b296, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3312f4f4, org.springframework.security.web.session.SessionManagementFilter@8c43966, org.springframework.security.web.access.ExceptionTranslationFilter@251c8145, org.springframework.security.web.access.intercept.AuthorizationFilter@391515c7] +2026-01-29 12:11:55.004 INFO 6533 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:11:55.018 INFO 6533 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 11.983 seconds (JVM running for 12.531) +2026-01-29 12:12:01.117 INFO 6533 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:12:01.118 INFO 6533 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:12:01.120 INFO 6533 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c9c63df] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@598865562 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Total: 0 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c9c63df] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4d78424f] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@905814132 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), 13800138000(String), admin@example.com(String) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4d78424f] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5bd3eccd] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1551126099 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO `user` ( username, phone, email, password, role, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: admin(String), 13800138000(String), admin@example.com(String), $2a$10$m3/z7X3iQBgyaxxexhuKFuELrtYEWeWp819vohmW3WrY6pWj/R5HK(String), CUSTOMER(String), 1(Integer), 2026-01-29T12:12:05.326822806(LocalDateTime), 2026-01-29T12:12:05.326822806(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5bd3eccd] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@35fa3ce5] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@993903658 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$m3/z7X3iQBgyaxxexhuKFuELrtYEWeWp819vohmW3WrY6pWj/R5HK, CUSTOMER, 1, null, 2026-01-29 12:12:05.326823, 2026-01-29 12:12:05.326823, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@35fa3ce5] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4fbe9fd8] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1098479711 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$m3/z7X3iQBgyaxxexhuKFuELrtYEWeWp819vohmW3WrY6pWj/R5HK, CUSTOMER, 1, null, 2026-01-29 12:12:05.326823, 2026-01-29 12:12:05.326823, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4fbe9fd8] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2f3cfa05] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@142534824 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$m3/z7X3iQBgyaxxexhuKFuELrtYEWeWp819vohmW3WrY6pWj/R5HK, CUSTOMER, 1, null, 2026-01-29 12:12:05.326823, 2026-01-29 12:12:05.326823, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2f3cfa05] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@337f2551] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2089142133 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$m3/z7X3iQBgyaxxexhuKFuELrtYEWeWp819vohmW3WrY6pWj/R5HK, CUSTOMER, 1, null, 2026-01-29 12:12:05.326823, 2026-01-29 12:12:05.326823, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@337f2551] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@58aced53] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1449859126 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), 13800138000(String), admin@example.com(String) +<== Columns: TOTAL +<== Row: 1 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@58aced53] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6153cf09] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1871986003 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin123(String), 13900139000(String), admin123@example.com(String) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6153cf09] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6baba479] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@782841704 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO `user` ( username, phone, email, password, role, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: admin123(String), 13900139000(String), admin123@example.com(String), $2a$10$/.neXm.CfrMpzxtwb9/nqeKxVQwOaim7Y77IUqmMH4XtlRVdgcNr.(String), CUSTOMER(String), 1(Integer), 2026-01-29T12:14:01.189417382(LocalDateTime), 2026-01-29T12:14:01.189417382(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6baba479] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7038ac66] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2130660369 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin123(String), admin123(String), admin123(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 2, admin123, 13900139000, admin123@example.com, $2a$10$/.neXm.CfrMpzxtwb9/nqeKxVQwOaim7Y77IUqmMH4XtlRVdgcNr., CUSTOMER, 1, null, 2026-01-29 12:14:01.189417, 2026-01-29 12:14:01.189417, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7038ac66] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@57e83702] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1496302479 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin123(String), admin123(String), admin123(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 2, admin123, 13900139000, admin123@example.com, $2a$10$/.neXm.CfrMpzxtwb9/nqeKxVQwOaim7Y77IUqmMH4XtlRVdgcNr., CUSTOMER, 1, null, 2026-01-29 12:14:01.189417, 2026-01-29 12:14:01.189417, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@57e83702] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@234e6504] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1656828531 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM pet WHERE deleted = 0 AND (owner_id = ?) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@234e6504] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1a43436d] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2100380753 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM pet WHERE deleted = 0 AND (owner_id = ?) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1a43436d] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@649b7e0d] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@67890336 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM report WHERE deleted = 0 +==> Parameters: +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@649b7e0d] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@63c52e8c] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1349410361 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM order_info WHERE deleted = 0 AND (customer_id = ?) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@63c52e8c] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@39c88552] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@912272537 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM order_info WHERE deleted = 0 AND (customer_id = ?) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@39c88552] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@27aa8fcf] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@22254561 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin123(String), admin123(String), admin123(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 2, admin123, 13900139000, admin123@example.com, $2a$10$/.neXm.CfrMpzxtwb9/nqeKxVQwOaim7Y77IUqmMH4XtlRVdgcNr., CUSTOMER, 1, null, 2026-01-29 12:14:01.189417, 2026-01-29 12:14:01.189417, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@27aa8fcf] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@67592afd] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@111282002 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO pet ( owner_id, name, breed, gender, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ? ) +==> Parameters: 2(Long), 小白(String), 金毛(String), M(String), 2026-01-29T12:16:24.527753394(LocalDateTime), 2026-01-29T12:16:24.527753394(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@67592afd] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b91672] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2134699660 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2b91672] +2026-01-29 12:16:30.731 ERROR 6533 --- [nio-8081-exec-8] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error updating database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] +### The error may exist in com/gpf/pethospital/mapper/AppointmentMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.AppointmentMapper.insert +### The error occurred while executing an update +### SQL: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TIME_SLOT" not found; SQL statement: +INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) [42122-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Table.getColumn(Table.java:749) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumn(Parser.java:1256) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseColumnList(Parser.java:1241) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseInsert(Parser.java:1641) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:814) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:1099) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:372) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:84) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.update(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.insert(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy77.insert(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:60) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.AppointmentServiceImpl$$EnhancerBySpringCGLIB$$4448a06d.save() ~[classes/:na] + at com.gpf.pethospital.controller.AppointmentController.create(AppointmentController.java:33) ~[classes/:na] + at com.gpf.pethospital.controller.AppointmentController$$FastClassBySpringCGLIB$$4329551c.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.controller.AppointmentController$$EnhancerBySpringCGLIB$$181e5b83.create() ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +2026-01-29 12:16:37.467 INFO 6533 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:16:37.469 INFO 6533 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 05:02 min +[INFO] Finished at: 2026-01-29T12:16:37+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_output.log b/backend/backend_output.log new file mode 100644 index 0000000..58a3817 --- /dev/null +++ b/backend/backend_output.log @@ -0,0 +1,454 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 0 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:04:47.805 INFO 5373 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 5373 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:04:47.811 INFO 5373 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:04:53.186 INFO 5373 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:04:53.211 INFO 5373 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:04:53.212 INFO 5373 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:04:53.398 INFO 5373 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:04:53.398 INFO 5373 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5482 ms +2026-01-29 12:04:53.460 INFO 5373 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:04:54.407 INFO 5373 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:04:54.438 INFO 5373 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:11 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:04:56.741 WARN 5373 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: bcbf67e6-f301-431f-9886-fb2c36acea73 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:04:57.057 INFO 5373 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@35145874, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@77524ca7, org.springframework.security.web.context.SecurityContextPersistenceFilter@fbe70d8, org.springframework.security.web.header.HeaderWriterFilter@265c1a7c, org.springframework.security.web.authentication.logout.LogoutFilter@49580ca8, com.gpf.pethospital.security.JwtAuthenticationFilter@11df2829, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7d2c345d, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5db948c9, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@18e4674d, org.springframework.security.web.session.SessionManagementFilter@78c262ba, org.springframework.security.web.access.ExceptionTranslationFilter@740a0d5e, org.springframework.security.web.access.intercept.AuthorizationFilter@5b733ef7] +2026-01-29 12:04:58.379 INFO 5373 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:04:58.391 INFO 5373 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 11.994 seconds (JVM running for 12.596) +2026-01-29 12:05:12.695 INFO 5373 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:05:12.695 INFO 5373 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:05:12.696 INFO 5373 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5dfce1d1] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@61730178 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5dfce1d1] +2026-01-29 12:05:13.662 ERROR 5373 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214] +### The error may exist in com/gpf/pethospital/mapper/UserMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.UserMapper.selectList +### The error occurred while executing a query +### SQL: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getSyntaxError(DbException.java:261) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readIdentifier(Parser.java:5656) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTablePrimary(Parser.java:1814) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTableReference(Parser.java:2334) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseSelectFromPart(Parser.java:2772) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseSelect(Parser.java:2878) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryPrimary(Parser.java:2762) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryTerm(Parser.java:2633) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpressionBody(Parser.java:2612) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpressionBodyAndEndOfQuery(Parser.java:2605) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpression(Parser.java:2598) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQuery(Parser.java:2567) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:724) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:88) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.query(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.selectList(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:164) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy78.selectList(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.core.mapper.BaseMapper.selectOne(BaseMapper.java:222) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732) ~[na:na] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$DefaultMethodInvoker.invoke(MybatisMapperProxy.java:166) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy78.selectOne(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.getOne(ServiceImpl.java:242) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService.getOne(IService.java:327) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$1dbf3365.getOne() ~[classes/:na] + at com.gpf.pethospital.controller.AuthController.login(AuthController.java:67) ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4d886b99] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1331623698 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4d886b99] +2026-01-29 12:05:38.384 ERROR 5373 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT COUNT( * ) AS total FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT COUNT( * ) AS total FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214] +### The error may exist in com/gpf/pethospital/mapper/UserMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.UserMapper.selectCount +### The error occurred while executing a query +### SQL: SELECT COUNT( * ) AS total FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT COUNT( * ) AS total FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT COUNT( * ) AS total FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT COUNT( * ) AS total FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT COUNT( * ) AS total FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT COUNT( * ) AS total FROM [*]user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?)"; expected "identifier"; SQL statement: +SELECT COUNT( * ) AS total FROM user WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42001-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getSyntaxError(DbException.java:261) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readIdentifier(Parser.java:5656) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTablePrimary(Parser.java:1814) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTableReference(Parser.java:2334) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseSelectFromPart(Parser.java:2772) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseSelect(Parser.java:2878) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryPrimary(Parser.java:2762) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryTerm(Parser.java:2633) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpressionBody(Parser.java:2612) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpressionBodyAndEndOfQuery(Parser.java:2605) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpression(Parser.java:2598) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQuery(Parser.java:2567) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:724) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:88) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.query(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:75) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.selectOne(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:87) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy78.selectCount(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.count(IService.java:397) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$1dbf3365.count() ~[classes/:na] + at com.gpf.pethospital.controller.AuthController.register(AuthController.java:45) ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +2026-01-29 12:07:30.955 INFO 5373 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:07:30.957 INFO 5373 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 02:52 min +[INFO] Finished at: 2026-01-29T12:07:31+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_output_new.log b/backend/backend_output_new.log new file mode 100644 index 0000000..edfa5b1 --- /dev/null +++ b/backend/backend_output_new.log @@ -0,0 +1,271 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 0 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Changes detected - recompiling the module! +[INFO] Compiling 89 source files to /mnt/d/bs/gpf_pet_hospital/backend/target/classes +[INFO] /mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java: /mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java uses or overrides a deprecated API. +[INFO] /mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java: Recompile with -Xlint:deprecation for details. +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:07:59.679 INFO 5891 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 5891 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:07:59.683 INFO 5891 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:08:05.074 INFO 5891 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:08:05.099 INFO 5891 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:08:05.099 INFO 5891 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:08:05.262 INFO 5891 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:08:05.263 INFO 5891 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5506 ms +2026-01-29 12:08:05.337 INFO 5891 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:08:06.177 INFO 5891 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:08:06.202 INFO 5891 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:12 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:08:08.609 WARN 5891 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 07eb8acb-7b5d-4e82-b3ad-dce7bd7d3078 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:08:08.986 INFO 5891 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@626b639e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@273fa9e, org.springframework.security.web.context.SecurityContextPersistenceFilter@3b35798, org.springframework.security.web.header.HeaderWriterFilter@7d2c345d, org.springframework.security.web.authentication.logout.LogoutFilter@39e53bef, com.gpf.pethospital.security.JwtAuthenticationFilter@527a8665, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@4702e7a5, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@73bb1337, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7ab2a07e, org.springframework.security.web.session.SessionManagementFilter@7d1c164a, org.springframework.security.web.access.ExceptionTranslationFilter@fbe70d8, org.springframework.security.web.access.intercept.AuthorizationFilter@4b957db0] +2026-01-29 12:08:10.363 INFO 5891 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:08:10.378 INFO 5891 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 11.89 seconds (JVM running for 12.459) +2026-01-29 12:08:41.327 INFO 5891 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:08:41.328 INFO 5891 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:08:41.330 INFO 5891 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@121856cf] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@754552516 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@121856cf] +2026-01-29 12:08:42.218 ERROR 5891 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: +### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USER" not found (this database is empty); SQL statement: +SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42104-214] +### The error may exist in com/gpf/pethospital/mapper/UserMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.UserMapper.selectCount +### The error occurred while executing a query +### SQL: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USER" not found (this database is empty); SQL statement: +SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42104-214] +; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USER" not found (this database is empty); SQL statement: +SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42104-214]] with root cause + +org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USER" not found (this database is empty); SQL statement: +SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) [42104-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8385) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTableOrView(Parser.java:8358) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTablePrimary(Parser.java:1863) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.readTableReference(Parser.java:2334) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseSelectFromPart(Parser.java:2772) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseSelect(Parser.java:2878) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryPrimary(Parser.java:2762) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryTerm(Parser.java:2633) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpressionBody(Parser.java:2612) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpressionBodyAndEndOfQuery(Parser.java:2605) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQueryExpression(Parser.java:2598) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parseQuery(Parser.java:2567) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parsePrepared(Parser.java:724) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214] + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:53) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy64.prepareStatement(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:88) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:60) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy107.prepare(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:90) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.query(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:75) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.selectOne(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:87) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy78.selectCount(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.count(IService.java:397) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$4a59e45d.count() ~[classes/:na] + at com.gpf.pethospital.controller.AuthController.register(AuthController.java:45) ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +2026-01-29 12:08:51.001 INFO 5891 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:08:51.003 INFO 5891 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 01:16 min +[INFO] Finished at: 2026-01-29T12:08:51+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_test_tables.log b/backend/backend_test_tables.log new file mode 100644 index 0000000..7cea338 --- /dev/null +++ b/backend/backend_test_tables.log @@ -0,0 +1,218 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 1 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:10:45.802 INFO 6379 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 6379 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:10:45.807 INFO 6379 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:10:51.211 INFO 6379 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:10:51.236 INFO 6379 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:10:51.236 INFO 6379 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:10:51.393 INFO 6379 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:10:51.394 INFO 6379 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5501 ms +2026-01-29 12:10:51.447 INFO 6379 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:10:52.275 INFO 6379 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:10:52.301 INFO 6379 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:16 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:10:54.594 WARN 6379 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 65907ba7-9111-4082-a03f-e9415af71a0f + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:10:54.914 INFO 6379 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@26be9a6, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4d518c66, org.springframework.security.web.context.SecurityContextPersistenceFilter@5a4dda2, org.springframework.security.web.header.HeaderWriterFilter@6df4af5, org.springframework.security.web.authentication.logout.LogoutFilter@582e9152, com.gpf.pethospital.security.JwtAuthenticationFilter@411fa0ce, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@34045582, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1edccfd4, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@251d7fdd, org.springframework.security.web.session.SessionManagementFilter@250d440, org.springframework.security.web.access.ExceptionTranslationFilter@4966bab1, org.springframework.security.web.access.intercept.AuthorizationFilter@60b5e80d] +2026-01-29 12:10:56.356 INFO 6379 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:10:56.372 INFO 6379 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 11.887 seconds (JVM running for 12.549) +2026-01-29 12:11:04.613 INFO 6379 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:11:04.614 INFO 6379 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:11:04.616 INFO 6379 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4643f176] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1864698444 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), 13800138000(String), admin@example.com(String) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4643f176] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3ec2f335] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1531731496 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO `user` ( username, phone, email, password, role, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: admin(String), 13800138000(String), admin@example.com(String), $2a$10$u68s2dGuJN0ETaIThD74HeDNq9hkdpKQ2aNxQjPW7jTG8/yr.ZId.(String), CUSTOMER(String), 1(Integer), 2026-01-29T12:11:05.481399469(LocalDateTime), 2026-01-29T12:11:05.481399469(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3ec2f335] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@d12e787] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1057347592 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$u68s2dGuJN0ETaIThD74HeDNq9hkdpKQ2aNxQjPW7jTG8/yr.ZId., CUSTOMER, 1, null, 2026-01-29 12:11:05.481399, 2026-01-29 12:11:05.481399, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@d12e787] +2026-01-29 12:11:08.292 ERROR 6379 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is io.jsonwebtoken.io.DecodingException: Illegal base64 character: '-'] with root cause + +io.jsonwebtoken.io.DecodingException: Illegal base64 character: '-' + at io.jsonwebtoken.io.Base64.ctoi(Base64.java:221) ~[jjwt-api-0.11.5.jar:0.11.5] + at io.jsonwebtoken.io.Base64.decodeFast(Base64.java:270) ~[jjwt-api-0.11.5.jar:0.11.5] + at io.jsonwebtoken.io.Base64Decoder.decode(Base64Decoder.java:36) ~[jjwt-api-0.11.5.jar:0.11.5] + at io.jsonwebtoken.io.Base64Decoder.decode(Base64Decoder.java:23) ~[jjwt-api-0.11.5.jar:0.11.5] + at io.jsonwebtoken.io.ExceptionPropagatingDecoder.decode(ExceptionPropagatingDecoder.java:36) ~[jjwt-api-0.11.5.jar:0.11.5] + at io.jsonwebtoken.impl.DefaultJwtBuilder.signWith(DefaultJwtBuilder.java:132) ~[jjwt-impl-0.11.5.jar:0.11.5] + at com.gpf.pethospital.util.JwtUtil.generateToken(JwtUtil.java:31) ~[classes/:na] + at com.gpf.pethospital.controller.AuthController.login(AuthController.java:74) ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@9b849ba] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@125810429 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT( * ) AS total FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), 13800138000(String), admin@example.com(String) +<== Columns: TOTAL +<== Row: 1 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@9b849ba] +2026-01-29 12:11:28.228 INFO 6379 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:11:28.231 INFO 6379 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 51.530 s +[INFO] Finished at: 2026-01-29T12:11:28+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_with_correct_schema.log b/backend/backend_with_correct_schema.log new file mode 100644 index 0000000..ab4cb13 --- /dev/null +++ b/backend/backend_with_correct_schema.log @@ -0,0 +1,489 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 3 resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:19:06.333 INFO 7141 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 7141 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:19:06.337 INFO 7141 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:19:11.871 INFO 7141 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:19:11.896 INFO 7141 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:19:11.896 INFO 7141 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:19:12.057 INFO 7141 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:19:12.058 INFO 7141 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5645 ms +2026-01-29 12:19:12.111 INFO 7141 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:19:12.854 INFO 7141 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:19:12.876 INFO 7141 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:8 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:19:15.314 WARN 7141 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 77b1aeeb-4e18-4223-9721-ff793ec89ea1 + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:19:15.635 INFO 7141 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@240f350a, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@706f6d26, org.springframework.security.web.context.SecurityContextPersistenceFilter@6a1568d6, org.springframework.security.web.header.HeaderWriterFilter@40df6090, org.springframework.security.web.authentication.logout.LogoutFilter@6b27b2d0, com.gpf.pethospital.security.JwtAuthenticationFilter@3af2f846, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1b37fbec, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@bb3ecfe, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6af65f29, org.springframework.security.web.session.SessionManagementFilter@291a4791, org.springframework.security.web.access.ExceptionTranslationFilter@11a3a45f, org.springframework.security.web.access.intercept.AuthorizationFilter@62b6c045] +2026-01-29 12:19:16.997 INFO 7141 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:19:17.013 INFO 7141 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.033 seconds (JVM running for 12.689) +2026-01-29 12:19:22.832 INFO 7141 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:19:22.832 INFO 7141 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:19:22.833 INFO 7141 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@31b23466] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@155985460 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 3, customer, 13900139000, customer@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, CUSTOMER, 1, null, 2026-01-29 12:19:13.654131, 2026-01-29 12:19:13.654131, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@31b23466] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1562f046] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@495463010 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: 3(Long), 1(Long), 2026-02-01(LocalDate), 09:00-10:00(String), PENDING(String), 常规检查(String), 2026-01-29T12:19:31.025850900(LocalDateTime), 2026-01-29T12:19:31.025850900(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1562f046] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e0b09b] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@153570839 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, ADMIN, 1, null, 2026-01-29 12:19:13.645158, 2026-01-29 12:19:13.645158, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7e0b09b] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@14fac782] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2084292749 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) +==> Parameters: 1(Long), 1(Long), DRAFT(String), 2026-01-29T12:19:48.104064819(LocalDateTime), 2026-01-29T12:19:48.104064819(LocalDateTime) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@14fac782] +2026-01-29 12:19:48.218 ERROR 7141 --- [nio-8081-exec-9] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: +### Error updating database. Cause: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "CUSTOMER_ID"; SQL statement: +INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) [23502-214] +### The error may exist in com/gpf/pethospital/mapper/PrescriptionMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.PrescriptionMapper.insert-Inline +### The error occurred while setting parameters +### SQL: INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) +### Cause: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "CUSTOMER_ID"; SQL statement: +INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) [23502-214] +; NULL not allowed for column "CUSTOMER_ID"; SQL statement: +INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) [23502-214]; nested exception is org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "CUSTOMER_ID"; SQL statement: +INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) [23502-214]] with root cause + +org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "CUSTOMER_ID"; SQL statement: +INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) [23502-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:508) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Column.validateConvertUpdateSequence(Column.java:365) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Table.convertInsertRow(Table.java:926) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.dml.Insert.insertRows(Insert.java:167) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.dml.Insert.update(Insert.java:135) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.CommandContainer.executeUpdateWithGeneratedKeys(CommandContainer.java:242) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.CommandContainer.update(CommandContainer.java:163) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Command.executeUpdate(Command.java:252) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:254) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy107.execute(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.update(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.update(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.insert(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy86.insert(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:60) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.PrescriptionServiceImpl$$EnhancerBySpringCGLIB$$834c711.save() ~[classes/:na] + at com.gpf.pethospital.controller.PrescriptionController.create(PrescriptionController.java:28) ~[classes/:na] + at com.gpf.pethospital.controller.PrescriptionController$$FastClassBySpringCGLIB$$6a1d26f5.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.security.authorization.method.AuthorizationManagerBeforeMethodInterceptor.invoke(AuthorizationManagerBeforeMethodInterceptor.java:162) ~[spring-security-core-5.7.11.jar:5.7.11] + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.controller.PrescriptionController$$EnhancerBySpringCGLIB$$a4312665.create() ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1402ee31] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@449123009 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 3, customer, 13900139000, customer@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, CUSTOMER, 1, null, 2026-01-29 12:19:13.654131, 2026-01-29 12:19:13.654131, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1402ee31] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@d3345fe] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@503378629 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM prescription WHERE deleted = 0 +==> Parameters: +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@d3345fe] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22dbff1c] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@543824485 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) +==> Parameters: DRAFT(String), 2026-01-29T12:20:41.789304708(LocalDateTime), 2026-01-29T12:20:41.789304708(LocalDateTime) +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22dbff1c] +2026-01-29 12:20:41.792 ERROR 7141 --- [nio-8081-exec-4] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: +### Error updating database. Cause: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "VISIT_ID"; SQL statement: +INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) [23502-214] +### The error may exist in com/gpf/pethospital/mapper/PrescriptionMapper.java (best guess) +### The error may involve com.gpf.pethospital.mapper.PrescriptionMapper.insert-Inline +### The error occurred while setting parameters +### SQL: INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) +### Cause: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "VISIT_ID"; SQL statement: +INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) [23502-214] +; NULL not allowed for column "VISIT_ID"; SQL statement: +INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) [23502-214]; nested exception is org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "VISIT_ID"; SQL statement: +INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) [23502-214]] with root cause + +org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "VISIT_ID"; SQL statement: +INSERT INTO prescription ( status, create_time, update_time ) VALUES ( ?, ?, ? ) [23502-214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:508) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] + at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Column.validateConvertUpdateSequence(Column.java:365) ~[h2-2.1.214.jar:2.1.214] + at org.h2.table.Table.convertInsertRow(Table.java:926) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.dml.Insert.insertRows(Insert.java:167) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.dml.Insert.update(Insert.java:135) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.CommandContainer.executeUpdateWithGeneratedKeys(CommandContainer.java:242) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.CommandContainer.update(CommandContainer.java:163) ~[h2-2.1.214.jar:2.1.214] + at org.h2.command.Command.executeUpdate(Command.java:252) ~[h2-2.1.214.jar:2.1.214] + at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:254) ~[h2-2.1.214.jar:2.1.214] + at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-4.0.3.jar:na] + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy3/jdk.proxy3.$Proxy107.execute(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy106.update(Unknown Source) ~[na:na] + at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.15.jar:3.5.15] + at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.15.jar:3.5.15] + at jdk.proxy2/jdk.proxy2.$Proxy105.update(Unknown Source) ~[na:na] + at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.15.jar:3.5.15] + at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.15.jar:3.5.15] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.2.jar:2.1.2] + at jdk.proxy2/jdk.proxy2.$Proxy71.insert(Unknown Source) ~[na:na] + at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.1.2.jar:2.1.2] + at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.5.jar:3.5.5] + at jdk.proxy2/jdk.proxy2.$Proxy86.insert(Unknown Source) ~[na:na] + at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:60) ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke() ~[mybatis-plus-extension-3.5.5.jar:3.5.5] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.service.impl.PrescriptionServiceImpl$$EnhancerBySpringCGLIB$$834c711.save() ~[classes/:na] + at com.gpf.pethospital.controller.PrescriptionController.create(PrescriptionController.java:28) ~[classes/:na] + at com.gpf.pethospital.controller.PrescriptionController$$FastClassBySpringCGLIB$$6a1d26f5.invoke() ~[classes/:na] + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.security.authorization.method.AuthorizationManagerBeforeMethodInterceptor.invoke(AuthorizationManagerBeforeMethodInterceptor.java:162) ~[spring-security-core-5.7.11.jar:5.7.11] + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) ~[spring-aop-5.3.31.jar:5.3.31] + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707) ~[spring-aop-5.3.31.jar:5.3.31] + at com.gpf.pethospital.controller.PrescriptionController$$EnhancerBySpringCGLIB$$a4312665.create() ~[classes/:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] + at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.31.jar:5.3.31] + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.31.jar:5.3.31] + at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.83.jar:4.0.FR] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at com.gpf.pethospital.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:45) ~[classes/:na] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.11.jar:5.7.11] + at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.31.jar:5.3.31] + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.31.jar:5.3.31] + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.83.jar:9.0.83] + at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] + +2026-01-29 12:21:21.609 INFO 7141 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:21:21.611 INFO 7141 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 02:24 min +[INFO] Finished at: 2026-01-29T12:21:21+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_with_init.log b/backend/backend_with_init.log new file mode 100644 index 0000000..5326745 --- /dev/null +++ b/backend/backend_with_init.log @@ -0,0 +1,2 @@ +Error: Could not find or load main class org.springframework.boot.loader.PropertiesLauncher +Caused by: java.lang.ClassNotFoundException: org.springframework.boot.loader.PropertiesLauncher diff --git a/backend/backend_with_schema.log b/backend/backend_with_schema.log new file mode 100644 index 0000000..3d2f67e --- /dev/null +++ b/backend/backend_with_schema.log @@ -0,0 +1,79 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 1 resource +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:10:07.544 INFO 6203 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 6203 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:10:07.549 INFO 6203 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:10:13.073 INFO 6203 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:10:13.103 INFO 6203 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:10:13.104 INFO 6203 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:10:13.299 INFO 6203 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:10:13.300 INFO 6203 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5675 ms +2026-01-29 12:10:13.353 INFO 6203 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:10:14.132 INFO 6203 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:10:14.158 INFO 6203 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:16 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:10:16.530 WARN 6203 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: a12500af-8981-4b37-ac7e-b23ca72f676d + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:10:16.846 INFO 6203 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@46394f65, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@31aab981, org.springframework.security.web.context.SecurityContextPersistenceFilter@76c86567, org.springframework.security.web.header.HeaderWriterFilter@4966bab1, org.springframework.security.web.authentication.logout.LogoutFilter@357f6391, com.gpf.pethospital.security.JwtAuthenticationFilter@26be9a6, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@5a4dda2, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@34045582, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4d518c66, org.springframework.security.web.session.SessionManagementFilter@1b52699c, org.springframework.security.web.access.ExceptionTranslationFilter@38e83838, org.springframework.security.web.access.intercept.AuthorizationFilter@7971c2a9] +2026-01-29 12:10:18.165 INFO 6203 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:10:18.180 INFO 6203 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.026 seconds (JVM running for 12.681) +2026-01-29 12:10:28.895 INFO 6203 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... +2026-01-29 12:10:28.897 INFO 6203 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 30.614 s +[INFO] Finished at: 2026-01-29T12:10:28+08:00 +[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.18:run (default-cli) on project pet-hospital: Application finished with exit code: 143 -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException diff --git a/backend/backend_working.log b/backend/backend_working.log new file mode 100644 index 0000000..59d5b61 --- /dev/null +++ b/backend/backend_working.log @@ -0,0 +1,180 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< com.gpf:pet-hospital >------------------------ +[INFO] Building 爱维宠物医院管理平台 1.0.0 +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot-maven-plugin:2.7.18:run (default-cli) > test-compile @ pet-hospital >>> +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] Copying 2 resources +[INFO] Copying 3 resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ pet-hospital --- +[INFO] Nothing to compile - all classes are up to date +[INFO] +[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ pet-hospital --- +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Using 'UTF-8' encoding to copy filtered properties files. +[INFO] skip non existing resourceDirectory /mnt/d/bs/gpf_pet_hospital/backend/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ pet-hospital --- +[INFO] No sources to compile +[INFO] +[INFO] <<< spring-boot-maven-plugin:2.7.18:run (default-cli) < test-compile @ pet-hospital <<< +[INFO] +[INFO] +[INFO] --- spring-boot-maven-plugin:2.7.18:run (default-cli) @ pet-hospital --- +[INFO] Attaching agents: [] + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v2.7.18) + +2026-01-29 12:24:05.772 INFO 7628 --- [ main] c.g.pethospital.PetHospitalApplication : Starting PetHospitalApplication using Java 17.0.17 on LAPTOP-FS8K5GSO with PID 7628 (/mnt/d/bs/gpf_pet_hospital/backend/target/classes started by wangzq in /mnt/d/bs/gpf_pet_hospital/backend) +2026-01-29 12:24:05.778 INFO 7628 --- [ main] c.g.pethospital.PetHospitalApplication : The following 1 profile is active: "dev" +2026-01-29 12:24:11.364 INFO 7628 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) +2026-01-29 12:24:11.390 INFO 7628 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2026-01-29 12:24:11.390 INFO 7628 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] +2026-01-29 12:24:11.547 INFO 7628 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring embedded WebApplicationContext +2026-01-29 12:24:11.547 INFO 7628 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5683 ms +2026-01-29 12:24:11.602 INFO 7628 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2026-01-29 12:24:12.451 INFO 7628 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2026-01-29 12:24:12.476 INFO 7628 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb' +Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. +Initialization Sequence datacenterId:1 workerId:22 + _ _ |_ _ _|_. ___ _ | _ +| | |\/|_)(_| | |_\ |_)||_|_\ + / | + 3.5.5 +2026-01-29 12:24:14.953 WARN 7628 --- [ main] .s.s.UserDetailsServiceAutoConfiguration : + +Using generated security password: 894a2f39-1097-4906-9582-c51d7962caac + +This generated password is for development use only. Your security configuration must be updated before running your application in production. + +2026-01-29 12:24:15.337 INFO 7628 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@4aed311e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4c38cd16, org.springframework.security.web.context.SecurityContextPersistenceFilter@7971c2a9, org.springframework.security.web.header.HeaderWriterFilter@11c88cca, org.springframework.security.web.authentication.logout.LogoutFilter@111c229c, com.gpf.pethospital.security.JwtAuthenticationFilter@7ddcb0dc, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@60b5e80d, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@31aab981, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@f5bf288, org.springframework.security.web.session.SessionManagementFilter@349c4d1c, org.springframework.security.web.access.ExceptionTranslationFilter@340cb97f, org.springframework.security.web.access.intercept.AuthorizationFilter@320be73] +2026-01-29 12:24:16.661 INFO 7628 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/api' +2026-01-29 12:24:16.675 INFO 7628 --- [ main] c.g.pethospital.PetHospitalApplication : Started PetHospitalApplication in 12.299 seconds (JVM running for 12.864) +2026-01-29 12:24:21.966 INFO 7628 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/api] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2026-01-29 12:24:21.966 INFO 7628 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2026-01-29 12:24:21.968 INFO 7628 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1f20fef4] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@208105529 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 3, customer, 13900139000, customer@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, CUSTOMER, 1, null, 2026-01-29 12:24:13.2463, 2026-01-29 12:24:13.2463, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1f20fef4] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@75e8fc76] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1168243154 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM pet WHERE deleted = 0 AND (owner_id = ?) +==> Parameters: 3(Long) +<== Columns: TOTAL +<== Row: 1 +<== Total: 1 +==> Preparing: SELECT id,owner_id,name,breed,gender,birthday,weight,photo,remark,create_time,update_time,deleted FROM pet WHERE deleted=0 AND (owner_id = ?) LIMIT ? +==> Parameters: 3(Long), 10(Long) +<== Columns: ID, OWNER_ID, NAME, BREED, GENDER, BIRTHDAY, WEIGHT, PHOTO, REMARK, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, 3, 小白, 金毛, MALE, 2023-01-01, null, null, null, 2026-01-29 12:24:13.247041, 2026-01-29 12:24:13.247041, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@75e8fc76] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@41493577] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@2016262451 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO appointment ( customer_id, pet_id, appointment_date, time_slot, status, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: 3(Long), 1(Long), 2026-02-01(LocalDate), 09:00-10:00(String), PENDING(String), 常规检查(String), 2026-01-29T12:24:32.546247898(LocalDateTime), 2026-01-29T12:24:32.546247898(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@41493577] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@bf1d89a] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@87439252 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: admin(String), admin(String), admin(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 1, admin, 13800138000, admin@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, ADMIN, 1, null, 2026-01-29 12:24:13.23867, 2026-01-29 12:24:13.23867, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@bf1d89a] +2026-01-29 12:24:40.495 WARN 7628 --- [nio-8081-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter 'status' for method parameter type String is not present] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c2f1f92] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1931573387 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: UPDATE appointment SET status=?, update_time=? WHERE id=? AND deleted=0 +==> Parameters: ARRIVED(String), 2026-01-29T12:24:45.469184613(LocalDateTime), 1(Long) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c2f1f92] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2cd992d5] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1326776275 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT id,username,phone,email,password,role,status,avatar,create_time,update_time,deleted FROM `user` WHERE deleted=0 AND (username = ? OR phone = ? OR email = ?) +==> Parameters: customer(String), customer(String), customer(String) +<== Columns: ID, USERNAME, PHONE, EMAIL, PASSWORD, ROLE, STATUS, AVATAR, CREATE_TIME, UPDATE_TIME, DELETED +<== Row: 3, customer, 13900139000, customer@example.com, $2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi, CUSTOMER, 1, null, 2026-01-29 12:24:13.2463, 2026-01-29 12:24:13.2463, 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2cd992d5] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@47af24ef] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@630841539 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO visit ( appointment_id, customer_id, pet_id, doctor_id, status, payment_status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: 1(Long), 3(Long), 1(Long), 1(Long), COMPLETED(String), UNPAID(String), 2026-01-29T12:24:49.989305686(LocalDateTime), 2026-01-29T12:24:49.989305686(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@47af24ef] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@15774d6c] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1399738390 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO prescription ( visit_id, doctor_id, status, create_time, update_time ) VALUES ( ?, ?, ?, ?, ? ) +==> Parameters: 1(Long), 1(Long), SUBMITTED(String), 2026-01-29T12:24:54.704878297(LocalDateTime), 2026-01-29T12:24:54.704878297(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@15774d6c] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3f2e9c5] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1704824955 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: INSERT INTO order_info ( visit_id, customer_id, amount, status, payment_method, remark, create_time, update_time ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) +==> Parameters: 1(Long), 3(Long), 50.00(BigDecimal), PAID(String), WECHAT(String), 支付处方费用(String), 2026-01-29T12:24:58.817900417(LocalDateTime), 2026-01-29T12:24:58.817900417(LocalDateTime) +<== Updates: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3f2e9c5] +Creating a new SqlSession +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@48c4f857] was not registered for synchronization because synchronization is not active +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7b6b5f95] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1731465716 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +JDBC Connection [HikariProxyConnection@1306442745 wrapping conn1: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM order_info WHERE deleted = 0 AND (customer_id = ?) +==> Preparing: SELECT COUNT(*) AS total FROM visit WHERE deleted = 0 AND (customer_id = ?) +==> Parameters: 2(Long) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Columns: TOTAL +<== Total: 1 +<== Row: 0 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7b6b5f95] +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@48c4f857] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@338fc1da] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@46490719 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM pet WHERE deleted = 0 AND (owner_id = ?) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@338fc1da] +Creating a new SqlSession +SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5490b9c8] was not registered for synchronization because synchronization is not active +JDBC Connection [HikariProxyConnection@1309118785 wrapping conn0: url=jdbc:h2:mem:testdb user=SA] will not be managed by Spring +==> Preparing: SELECT COUNT(*) AS total FROM pet WHERE deleted = 0 AND (owner_id = ?) +==> Parameters: 2(Long) +<== Columns: TOTAL +<== Row: 0 +<== Total: 1 +Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5490b9c8] diff --git a/backend/pom.xml b/backend/pom.xml new file mode 100644 index 0000000..9af278b --- /dev/null +++ b/backend/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.18 + + + + com.gpf + pet-hospital + 1.0.0 + 爱维宠物医院管理平台 + 爱维宠物医院管理平台后端服务 + + + 17 + 8.0.33 + 3.5.5 + 0.11.5 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-security + + + + + org.springframework.boot + spring-boot-starter-validation + + + + + jakarta.validation + jakarta.validation-api + 3.0.2 + + + + + com.mysql + mysql-connector-j + runtime + + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus.version} + + + + + io.jsonwebtoken + jjwt-api + ${jwt.version} + + + io.jsonwebtoken + jjwt-impl + ${jwt.version} + runtime + + + io.jsonwebtoken + jjwt-jackson + ${jwt.version} + runtime + + + + + com.h2database + h2 + runtime + + + + + org.projectlombok + lombok + true + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + org.springframework.security + spring-security-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + diff --git a/backend/src/main/java/com/gpf/pethospital/PetHospitalApplication.java b/backend/src/main/java/com/gpf/pethospital/PetHospitalApplication.java new file mode 100644 index 0000000..771b3ec --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/PetHospitalApplication.java @@ -0,0 +1,17 @@ +package com.gpf.pethospital; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 爱维宠物医院管理平台主应用 + */ +@SpringBootApplication +@MapperScan("com.gpf.pethospital.mapper") +public class PetHospitalApplication { + + public static void main(String[] args) { + SpringApplication.run(PetHospitalApplication.class, args); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/common/ApiResponse.java b/backend/src/main/java/com/gpf/pethospital/common/ApiResponse.java new file mode 100644 index 0000000..b812df2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/common/ApiResponse.java @@ -0,0 +1,37 @@ +package com.gpf.pethospital.common; + +public class ApiResponse { + private final int code; + private final String message; + private final T data; + + private ApiResponse(int code, String message, T data) { + this.code = code; + this.message = message; + this.data = data; + } + + public static ApiResponse success(T data) { + return new ApiResponse<>(0, "ok", data); + } + + public static ApiResponse success(String message, T data) { + return new ApiResponse<>(0, message, data); + } + + public static ApiResponse error(int code, String message) { + return new ApiResponse<>(code, message, null); + } + + public int getCode() { + return code; + } + + public String getMessage() { + return message; + } + + public T getData() { + return data; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/config/MybatisPlusConfig.java b/backend/src/main/java/com/gpf/pethospital/config/MybatisPlusConfig.java new file mode 100644 index 0000000..8e0e39f --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/config/MybatisPlusConfig.java @@ -0,0 +1,37 @@ +package com.gpf.pethospital.config; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.apache.ibatis.reflection.MetaObject; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.time.LocalDateTime; + +@Configuration +public class MybatisPlusConfig { + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); + return interceptor; + } + + @Bean + public MetaObjectHandler metaObjectHandler() { + return new MetaObjectHandler() { + @Override + public void insertFill(MetaObject metaObject) { + LocalDateTime now = LocalDateTime.now(); + strictInsertFill(metaObject, "createTime", LocalDateTime.class, now); + strictInsertFill(metaObject, "updateTime", LocalDateTime.class, now); + } + + @Override + public void updateFill(MetaObject metaObject) { + strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); + } + }; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/config/SecurityConfig.java b/backend/src/main/java/com/gpf/pethospital/config/SecurityConfig.java new file mode 100644 index 0000000..9278a36 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/config/SecurityConfig.java @@ -0,0 +1,49 @@ +package com.gpf.pethospital.config; + +import com.gpf.pethospital.security.JwtAuthenticationFilter; +import com.gpf.pethospital.util.JwtUtil; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +@Configuration +@EnableMethodSecurity +public class SecurityConfig { + @Value("${jwt.secret}") + private String jwtSecret; + + @Value("${jwt.expiration}") + private long jwtExpiration; + + @Bean + public JwtUtil jwtUtil() { + return new JwtUtil(jwtSecret, jwtExpiration); + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Bean + public SecurityFilterChain filterChain(HttpSecurity http, JwtUtil jwtUtil) throws Exception { + http + .csrf(csrf -> csrf.disable()) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(auth -> auth + .requestMatchers(new AntPathRequestMatcher("/auth/**")).permitAll() + .requestMatchers(new AntPathRequestMatcher("/public/**")).permitAll() + .anyRequest().authenticated() + ) + .addFilterBefore(new JwtAuthenticationFilter(jwtUtil), UsernamePasswordAuthenticationFilter.class); + return http.build(); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/config/WebConfig.java b/backend/src/main/java/com/gpf/pethospital/config/WebConfig.java new file mode 100644 index 0000000..ccbd146 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/config/WebConfig.java @@ -0,0 +1,17 @@ +package com.gpf.pethospital.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH") + .allowedHeaders("*") + .maxAge(3600); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/AppointmentController.java b/backend/src/main/java/com/gpf/pethospital/controller/AppointmentController.java new file mode 100644 index 0000000..b0ec840 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/AppointmentController.java @@ -0,0 +1,72 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Appointment; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.AppointmentService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +@RestController +@RequestMapping("/appointments") +public class AppointmentController { + private final AppointmentService appointmentService; + + public AppointmentController(AppointmentService appointmentService) { + this.appointmentService = appointmentService; + } + + @PostMapping + public ApiResponse create(@RequestBody Appointment appointment) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + appointment.setCustomerId(user.getId()); + } + if (appointment.getStatus() == null) { + appointment.setStatus("PENDING"); + } + appointmentService.save(appointment); + return ApiResponse.success("created", null); + } + + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + AuthUser user = SecurityUtils.currentUser(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + wrapper.eq(Appointment::getCustomerId, user.getId()); + } + return ApiResponse.success(appointmentService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @GetMapping("/admin") + public ApiResponse adminList(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) String status) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (status != null && !status.isBlank()) { + wrapper.eq(Appointment::getStatus, status); + } + return ApiResponse.success(appointmentService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}/status") + public ApiResponse updateStatus(@PathVariable Long id, @RequestParam String status) { + Appointment update = new Appointment(); + update.setId(id); + update.setStatus(status); + if ("CANCELLED".equals(status)) { + update.setCancelTime(LocalDateTime.now()); + } + appointmentService.updateById(update); + return ApiResponse.success("updated", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/AuthController.java b/backend/src/main/java/com/gpf/pethospital/controller/AuthController.java new file mode 100644 index 0000000..134b77d --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/AuthController.java @@ -0,0 +1,82 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.dto.LoginRequest; +import com.gpf.pethospital.dto.RegisterRequest; +import com.gpf.pethospital.entity.User; +import com.gpf.pethospital.service.UserService; +import com.gpf.pethospital.util.JwtUtil; +import jakarta.validation.Valid; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/auth") +public class AuthController { + private final UserService userService; + private final PasswordEncoder passwordEncoder; + private final JwtUtil jwtUtil; + + public AuthController(UserService userService, PasswordEncoder passwordEncoder, JwtUtil jwtUtil) { + this.userService = userService; + this.passwordEncoder = passwordEncoder; + this.jwtUtil = jwtUtil; + } + + @PostMapping("/register") + public ApiResponse register(@Valid @RequestBody RegisterRequest request) { + if ((request.getPhone() == null || request.getPhone().isBlank()) + && (request.getEmail() == null || request.getEmail().isBlank())) { + return ApiResponse.error(400, "phone or email is required"); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(User::getUsername, request.getUsername()) + .or() + .eq(request.getPhone() != null && !request.getPhone().isBlank(), User::getPhone, request.getPhone()) + .or() + .eq(request.getEmail() != null && !request.getEmail().isBlank(), User::getEmail, request.getEmail()); + if (userService.count(wrapper) > 0) { + return ApiResponse.error(409, "user already exists"); + } + User user = new User(); + user.setUsername(request.getUsername()); + user.setPhone(request.getPhone()); + user.setEmail(request.getEmail()); + user.setPassword(passwordEncoder.encode(request.getPassword())); + user.setRole("CUSTOMER"); + user.setStatus(1); + userService.save(user); + return ApiResponse.success("registered", null); + } + + @PostMapping("/login") + public ApiResponse login(@Valid @RequestBody LoginRequest request) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(User::getUsername, request.getAccount()) + .or() + .eq(User::getPhone, request.getAccount()) + .or() + .eq(User::getEmail, request.getAccount()); + User user = userService.getOne(wrapper); + if (user == null || user.getStatus() != null && user.getStatus() == 0) { + return ApiResponse.error(401, "invalid account or disabled"); + } + if (!passwordEncoder.matches(request.getPassword(), user.getPassword())) { + return ApiResponse.error(401, "invalid account or password"); + } + String token = jwtUtil.generateToken(user.getId(), user.getRole(), user.getUsername()); + Map data = new HashMap<>(); + data.put("token", token); + data.put("role", user.getRole()); + data.put("userId", user.getId()); + data.put("username", user.getUsername()); + return ApiResponse.success(data); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/DrugController.java b/backend/src/main/java/com/gpf/pethospital/controller/DrugController.java new file mode 100644 index 0000000..4a93099 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/DrugController.java @@ -0,0 +1,58 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Drug; +import com.gpf.pethospital.service.DrugService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/drugs") +public class DrugController { + private final DrugService drugService; + + public DrugController(DrugService drugService) { + this.drugService = drugService; + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) String keyword) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (keyword != null && !keyword.isBlank()) { + wrapper.like(Drug::getName, keyword) + .or() + .like(Drug::getSpecification, keyword); + } + return ApiResponse.success(drugService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasRole('ADMIN')") + @PostMapping + public ApiResponse create(@RequestBody Drug drug) { + if (drug.getStatus() == null) { + drug.setStatus(1); + } + drugService.save(drug); + return ApiResponse.success("created", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Drug drug) { + drug.setId(id); + drugService.updateById(drug); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @DeleteMapping("/{id}") + public ApiResponse delete(@PathVariable Long id) { + drugService.removeById(id); + return ApiResponse.success("deleted", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/MedicalRecordController.java b/backend/src/main/java/com/gpf/pethospital/controller/MedicalRecordController.java new file mode 100644 index 0000000..355a704 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/MedicalRecordController.java @@ -0,0 +1,50 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.MedicalRecord; +import com.gpf.pethospital.service.MedicalRecordService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/medical-records") +public class MedicalRecordController { + private final MedicalRecordService medicalRecordService; + + public MedicalRecordController(MedicalRecordService medicalRecordService) { + this.medicalRecordService = medicalRecordService; + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PostMapping + public ApiResponse create(@RequestBody MedicalRecord record) { + if (record.getStatus() == null) { + record.setStatus("DRAFT"); + } + medicalRecordService.save(record); + return ApiResponse.success("created", null); + } + + @GetMapping + public ApiResponse list(@RequestParam Long visitId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper() + .eq(MedicalRecord::getVisitId, visitId); + return ApiResponse.success(medicalRecordService.list(wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody MedicalRecord record) { + record.setId(id); + medicalRecordService.updateById(record); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @DeleteMapping("/{id}") + public ApiResponse delete(@PathVariable Long id) { + medicalRecordService.removeById(id); + return ApiResponse.success("deleted", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/MessageController.java b/backend/src/main/java/com/gpf/pethospital/controller/MessageController.java new file mode 100644 index 0000000..786a7cd --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/MessageController.java @@ -0,0 +1,65 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.dto.ReplyRequest; +import com.gpf.pethospital.entity.Message; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.MessageService; +import com.gpf.pethospital.util.SecurityUtils; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +@RestController +@RequestMapping("/messages") +public class MessageController { + private final MessageService messageService; + + public MessageController(MessageService messageService) { + this.messageService = messageService; + } + + @PostMapping + public ApiResponse create(@RequestBody Message message) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null) { + message.setUserId(user.getId()); + message.setUserName(user.getUsername()); + } + message.setStatus("PENDING"); + messageService.save(message); + return ApiResponse.success("created", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping("/admin") + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) String status) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (status != null && !status.isBlank()) { + wrapper.eq(Message::getStatus, status); + } + return ApiResponse.success(messageService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasRole('ADMIN')") + @PutMapping("/admin/{id}/reply") + public ApiResponse reply(@PathVariable Long id, @Valid @RequestBody ReplyRequest request) { + AuthUser user = SecurityUtils.currentUser(); + Message update = new Message(); + update.setId(id); + update.setReply(request.getReply()); + update.setStatus("PROCESSED"); + update.setReplyTime(LocalDateTime.now()); + if (user != null) { + update.setReplyUserId(user.getId()); + } + messageService.updateById(update); + return ApiResponse.success("updated", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/NoticeController.java b/backend/src/main/java/com/gpf/pethospital/controller/NoticeController.java new file mode 100644 index 0000000..78ae7f2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/NoticeController.java @@ -0,0 +1,66 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Notice; +import com.gpf.pethospital.service.NoticeService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping +public class NoticeController { + private final NoticeService noticeService; + + public NoticeController(NoticeService noticeService) { + this.noticeService = noticeService; + } + + @GetMapping("/public/notices") + public ApiResponse publicList(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper() + .eq(Notice::getStatus, 1) + .orderByDesc(Notice::getIsTop) + .orderByDesc(Notice::getCreateTime); + return ApiResponse.success(noticeService.page(new Page<>(page, size), wrapper)); + } + + @GetMapping("/public/notices/{id}") + public ApiResponse publicDetail(@PathVariable Long id) { + return ApiResponse.success(noticeService.getById(id)); + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping("/notices") + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + return ApiResponse.success(noticeService.page(new Page<>(page, size))); + } + + @PreAuthorize("hasRole('ADMIN')") + @PostMapping("/notices") + public ApiResponse create(@RequestBody Notice notice) { + if (notice.getStatus() == null) { + notice.setStatus(1); + } + noticeService.save(notice); + return ApiResponse.success("created", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @PutMapping("/notices/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Notice notice) { + notice.setId(id); + noticeService.updateById(notice); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @DeleteMapping("/notices/{id}") + public ApiResponse delete(@PathVariable Long id) { + noticeService.removeById(id); + return ApiResponse.success("deleted", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/OrderController.java b/backend/src/main/java/com/gpf/pethospital/controller/OrderController.java new file mode 100644 index 0000000..42bbf41 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/OrderController.java @@ -0,0 +1,53 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Order; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.OrderService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/orders") +public class OrderController { + private final OrderService orderService; + + public OrderController(OrderService orderService) { + this.orderService = orderService; + } + + @PostMapping + public ApiResponse create(@RequestBody Order order) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + order.setCustomerId(user.getId()); + } + if (order.getStatus() == null) { + order.setStatus("UNPAID"); + } + orderService.save(order); + return ApiResponse.success("created", null); + } + + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + AuthUser user = SecurityUtils.currentUser(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + wrapper.eq(Order::getCustomerId, user.getId()); + } + return ApiResponse.success(orderService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Order order) { + order.setId(id); + orderService.updateById(order); + return ApiResponse.success("updated", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/PetController.java b/backend/src/main/java/com/gpf/pethospital/controller/PetController.java new file mode 100644 index 0000000..ec190bc --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/PetController.java @@ -0,0 +1,79 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Pet; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.PetService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/pets") +public class PetController { + private final PetService petService; + + public PetController(PetService petService) { + this.petService = petService; + } + + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) Long ownerId) { + AuthUser user = SecurityUtils.currentUser(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + wrapper.eq(Pet::getOwnerId, user.getId()); + } else if (ownerId != null) { + wrapper.eq(Pet::getOwnerId, ownerId); + } + return ApiResponse.success(petService.page(new Page<>(page, size), wrapper)); + } + + @PostMapping + public ApiResponse create(@RequestBody Pet pet) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + pet.setOwnerId(user.getId()); + } + petService.save(pet); + return ApiResponse.success("created", null); + } + + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Pet pet) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + Pet existing = petService.getById(id); + if (existing == null || !existing.getOwnerId().equals(user.getId())) { + return ApiResponse.error(403, "forbidden"); + } + } + pet.setId(id); + petService.updateById(pet); + return ApiResponse.success("updated", null); + } + + @DeleteMapping("/{id}") + public ApiResponse delete(@PathVariable Long id) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + Pet existing = petService.getById(id); + if (existing == null || !existing.getOwnerId().equals(user.getId())) { + return ApiResponse.error(403, "forbidden"); + } + } + petService.removeById(id); + return ApiResponse.success("deleted", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping("/admin/all") + public ApiResponse adminList(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + return ApiResponse.success(petService.page(new Page<>(page, size))); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionController.java b/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionController.java new file mode 100644 index 0000000..6651659 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionController.java @@ -0,0 +1,54 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Prescription; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.PrescriptionService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/prescriptions") +public class PrescriptionController { + private final PrescriptionService prescriptionService; + + public PrescriptionController(PrescriptionService prescriptionService) { + this.prescriptionService = prescriptionService; + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PostMapping + public ApiResponse create(@RequestBody Prescription prescription) { + if (prescription.getStatus() == null) { + prescription.setStatus("DRAFT"); + } + prescriptionService.save(prescription); + return ApiResponse.success("created", null); + } + + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) Long visitId) { + AuthUser user = SecurityUtils.currentUser(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (visitId != null) { + wrapper.eq(Prescription::getVisitId, visitId); + } + if (user != null && "DOCTOR".equals(user.getRole())) { + wrapper.eq(Prescription::getDoctorId, user.getId()); + } + return ApiResponse.success(prescriptionService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Prescription prescription) { + prescription.setId(id); + prescriptionService.updateById(prescription); + return ApiResponse.success("updated", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionItemController.java b/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionItemController.java new file mode 100644 index 0000000..153e97a --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionItemController.java @@ -0,0 +1,47 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.PrescriptionItem; +import com.gpf.pethospital.service.PrescriptionItemService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/prescription-items") +public class PrescriptionItemController { + private final PrescriptionItemService prescriptionItemService; + + public PrescriptionItemController(PrescriptionItemService prescriptionItemService) { + this.prescriptionItemService = prescriptionItemService; + } + + @GetMapping + public ApiResponse list(@RequestParam Long prescriptionId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper() + .eq(PrescriptionItem::getPrescriptionId, prescriptionId); + return ApiResponse.success(prescriptionItemService.list(wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PostMapping + public ApiResponse create(@RequestBody PrescriptionItem item) { + prescriptionItemService.save(item); + return ApiResponse.success("created", null); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody PrescriptionItem item) { + item.setId(id); + prescriptionItemService.updateById(item); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @DeleteMapping("/{id}") + public ApiResponse delete(@PathVariable Long id) { + prescriptionItemService.removeById(id); + return ApiResponse.success("deleted", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/ReportController.java b/backend/src/main/java/com/gpf/pethospital/controller/ReportController.java new file mode 100644 index 0000000..1fc769b --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/ReportController.java @@ -0,0 +1,58 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Report; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.ReportService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/reports") +public class ReportController { + private final ReportService reportService; + + public ReportController(ReportService reportService) { + this.reportService = reportService; + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PostMapping + public ApiResponse create(@RequestBody Report report) { + reportService.save(report); + return ApiResponse.success("created", null); + } + + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) Long petId) { + AuthUser user = SecurityUtils.currentUser(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (petId != null) { + wrapper.eq(Report::getPetId, petId); + } + if (user != null && "DOCTOR".equals(user.getRole())) { + wrapper.eq(Report::getDoctorId, user.getId()); + } + return ApiResponse.success(reportService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Report report) { + report.setId(id); + reportService.updateById(report); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @DeleteMapping("/{id}") + public ApiResponse delete(@PathVariable Long id) { + reportService.removeById(id); + return ApiResponse.success("deleted", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/StatsController.java b/backend/src/main/java/com/gpf/pethospital/controller/StatsController.java new file mode 100644 index 0000000..4ebe2ad --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/StatsController.java @@ -0,0 +1,64 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Order; +import com.gpf.pethospital.entity.User; +import com.gpf.pethospital.service.AppointmentService; +import com.gpf.pethospital.service.OrderService; +import com.gpf.pethospital.service.PetService; +import com.gpf.pethospital.service.UserService; +import com.gpf.pethospital.service.VisitService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/admin/stats") +public class StatsController { + private final OrderService orderService; + private final AppointmentService appointmentService; + private final VisitService visitService; + private final PetService petService; + private final UserService userService; + + public StatsController(OrderService orderService, + AppointmentService appointmentService, + VisitService visitService, + PetService petService, + UserService userService) { + this.orderService = orderService; + this.appointmentService = appointmentService; + this.visitService = visitService; + this.petService = petService; + this.userService = userService; + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping + public ApiResponse summary() { + Map data = new HashMap<>(); + data.put("orders", orderService.count()); + data.put("appointments", appointmentService.count()); + data.put("visits", visitService.count()); + data.put("pets", petService.count()); + data.put("customers", userService.count(new LambdaQueryWrapper().eq(User::getRole, "CUSTOMER"))); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.select("SUM(amount) AS total"); + List> result = orderService.listMaps(wrapper); + BigDecimal total = BigDecimal.ZERO; + if (!result.isEmpty() && result.get(0).get("total") != null) { + total = new BigDecimal(result.get(0).get("total").toString()); + } + data.put("orderAmountTotal", total); + return ApiResponse.success(data); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/StockInController.java b/backend/src/main/java/com/gpf/pethospital/controller/StockInController.java new file mode 100644 index 0000000..8335850 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/StockInController.java @@ -0,0 +1,52 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Drug; +import com.gpf.pethospital.entity.StockIn; +import com.gpf.pethospital.service.DrugService; +import com.gpf.pethospital.service.StockInService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/stock-in") +public class StockInController { + private final StockInService stockInService; + private final DrugService drugService; + + public StockInController(StockInService stockInService, DrugService drugService) { + this.stockInService = stockInService; + this.drugService = drugService; + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) Long drugId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (drugId != null) { + wrapper.eq(StockIn::getDrugId, drugId); + } + return ApiResponse.success(stockInService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasRole('ADMIN')") + @PostMapping + @Transactional + public ApiResponse create(@RequestBody StockIn stockIn) { + stockInService.save(stockIn); + if (stockIn.getDrugId() != null && stockIn.getQuantity() != null) { + Drug drug = drugService.getById(stockIn.getDrugId()); + if (drug != null) { + int current = drug.getStock() == null ? 0 : drug.getStock(); + drug.setStock(current + stockIn.getQuantity()); + drugService.updateById(drug); + } + } + return ApiResponse.success("created", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/StockOutController.java b/backend/src/main/java/com/gpf/pethospital/controller/StockOutController.java new file mode 100644 index 0000000..152d8b6 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/StockOutController.java @@ -0,0 +1,52 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Drug; +import com.gpf.pethospital.entity.StockOut; +import com.gpf.pethospital.service.DrugService; +import com.gpf.pethospital.service.StockOutService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/stock-out") +public class StockOutController { + private final StockOutService stockOutService; + private final DrugService drugService; + + public StockOutController(StockOutService stockOutService, DrugService drugService) { + this.stockOutService = stockOutService; + this.drugService = drugService; + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) Long drugId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (drugId != null) { + wrapper.eq(StockOut::getDrugId, drugId); + } + return ApiResponse.success(stockOutService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasRole('ADMIN')") + @PostMapping + @Transactional + public ApiResponse create(@RequestBody StockOut stockOut) { + stockOutService.save(stockOut); + if (stockOut.getDrugId() != null && stockOut.getQuantity() != null) { + Drug drug = drugService.getById(stockOut.getDrugId()); + if (drug != null) { + int current = drug.getStock() == null ? 0 : drug.getStock(); + drug.setStock(Math.max(0, current - stockOut.getQuantity())); + drugService.updateById(drug); + } + } + return ApiResponse.success("created", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/UserController.java b/backend/src/main/java/com/gpf/pethospital/controller/UserController.java new file mode 100644 index 0000000..b0f7f0a --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/UserController.java @@ -0,0 +1,115 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.User; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.UserService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/users") +public class UserController { + private final UserService userService; + private final PasswordEncoder passwordEncoder; + + public UserController(UserService userService, PasswordEncoder passwordEncoder) { + this.userService = userService; + this.passwordEncoder = passwordEncoder; + } + + @GetMapping("/me") + public ApiResponse me() { + AuthUser authUser = SecurityUtils.currentUser(); + if (authUser == null) { + return ApiResponse.error(401, "unauthorized"); + } + User user = userService.getById(authUser.getId()); + if (user != null) { + user.setPassword(null); + } + return ApiResponse.success(user); + } + + @PutMapping("/me") + public ApiResponse updateMe(@RequestBody User payload) { + AuthUser authUser = SecurityUtils.currentUser(); + if (authUser == null) { + return ApiResponse.error(401, "unauthorized"); + } + User update = new User(); + update.setId(authUser.getId()); + update.setUsername(payload.getUsername()); + update.setPhone(payload.getPhone()); + update.setEmail(payload.getEmail()); + update.setAvatar(payload.getAvatar()); + userService.updateById(update); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size, + @RequestParam(required = false) String role) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (role != null && !role.isBlank()) { + wrapper.eq(User::getRole, role); + } + Page result = userService.page(new Page<>(page, size), wrapper); + result.getRecords().forEach(u -> u.setPassword(null)); + return ApiResponse.success(result); + } + + @PreAuthorize("hasRole('ADMIN')") + @PostMapping + public ApiResponse create(@RequestBody User user) { + if (user.getPassword() == null || user.getPassword().isBlank()) { + return ApiResponse.error(400, "password required"); + } + user.setPassword(passwordEncoder.encode(user.getPassword())); + if (user.getStatus() == null) { + user.setStatus(1); + } + userService.save(user); + return ApiResponse.success("created", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @PutMapping("/{id}/status") + public ApiResponse updateStatus(@PathVariable Long id, @RequestParam Integer status) { + User update = new User(); + update.setId(id); + update.setStatus(status); + userService.updateById(update); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @PutMapping("/{id}/reset-password") + public ApiResponse resetPassword(@PathVariable Long id, @RequestParam String newPassword) { + User update = new User(); + update.setId(id); + update.setPassword(passwordEncoder.encode(newPassword)); + userService.updateById(update); + return ApiResponse.success("updated", null); + } + + @PreAuthorize("hasRole('ADMIN')") + @GetMapping("/stats") + public ApiResponse stats() { + Map data = new HashMap<>(); + data.put("total", userService.count()); + data.put("admins", userService.count(new LambdaQueryWrapper().eq(User::getRole, "ADMIN"))); + data.put("doctors", userService.count(new LambdaQueryWrapper().eq(User::getRole, "DOCTOR"))); + data.put("customers", userService.count(new LambdaQueryWrapper().eq(User::getRole, "CUSTOMER"))); + return ApiResponse.success(data); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/VaccineRecordController.java b/backend/src/main/java/com/gpf/pethospital/controller/VaccineRecordController.java new file mode 100644 index 0000000..6878514 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/VaccineRecordController.java @@ -0,0 +1,59 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Pet; +import com.gpf.pethospital.entity.VaccineRecord; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.PetService; +import com.gpf.pethospital.service.VaccineRecordService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/vaccines") +public class VaccineRecordController { + private final VaccineRecordService vaccineRecordService; + private final PetService petService; + + public VaccineRecordController(VaccineRecordService vaccineRecordService, PetService petService) { + this.vaccineRecordService = vaccineRecordService; + this.petService = petService; + } + + @GetMapping + public ApiResponse list(@RequestParam Long petId, + @RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + AuthUser user = SecurityUtils.currentUser(); + if (user != null && "CUSTOMER".equals(user.getRole())) { + Pet pet = petService.getById(petId); + if (pet == null || !pet.getOwnerId().equals(user.getId())) { + return ApiResponse.error(403, "forbidden"); + } + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper() + .eq(VaccineRecord::getPetId, petId); + return ApiResponse.success(vaccineRecordService.page(new Page<>(page, size), wrapper)); + } + + @PostMapping + public ApiResponse create(@RequestBody VaccineRecord record) { + vaccineRecordService.save(record); + return ApiResponse.success("created", null); + } + + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody VaccineRecord record) { + record.setId(id); + vaccineRecordService.updateById(record); + return ApiResponse.success("updated", null); + } + + @DeleteMapping("/{id}") + public ApiResponse delete(@PathVariable Long id) { + vaccineRecordService.removeById(id); + return ApiResponse.success("deleted", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/controller/VisitController.java b/backend/src/main/java/com/gpf/pethospital/controller/VisitController.java new file mode 100644 index 0000000..beb881f --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/controller/VisitController.java @@ -0,0 +1,57 @@ +package com.gpf.pethospital.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gpf.pethospital.common.ApiResponse; +import com.gpf.pethospital.entity.Visit; +import com.gpf.pethospital.security.AuthUser; +import com.gpf.pethospital.service.VisitService; +import com.gpf.pethospital.util.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/visits") +public class VisitController { + private final VisitService visitService; + + public VisitController(VisitService visitService) { + this.visitService = visitService; + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PostMapping + public ApiResponse create(@RequestBody Visit visit) { + if (visit.getStatus() == null) { + visit.setStatus("IN_PROGRESS"); + } + if (visit.getPaymentStatus() == null) { + visit.setPaymentStatus("UNPAID"); + } + visitService.save(visit); + return ApiResponse.success("created", null); + } + + @GetMapping + public ApiResponse list(@RequestParam(defaultValue = "1") long page, + @RequestParam(defaultValue = "10") long size) { + AuthUser user = SecurityUtils.currentUser(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (user != null) { + if ("CUSTOMER".equals(user.getRole())) { + wrapper.eq(Visit::getCustomerId, user.getId()); + } else if ("DOCTOR".equals(user.getRole())) { + wrapper.eq(Visit::getDoctorId, user.getId()); + } + } + return ApiResponse.success(visitService.page(new Page<>(page, size), wrapper)); + } + + @PreAuthorize("hasAnyRole('ADMIN','DOCTOR')") + @PutMapping("/{id}") + public ApiResponse update(@PathVariable Long id, @RequestBody Visit visit) { + visit.setId(id); + visitService.updateById(visit); + return ApiResponse.success("updated", null); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/dto/LoginRequest.java b/backend/src/main/java/com/gpf/pethospital/dto/LoginRequest.java new file mode 100644 index 0000000..8fbd115 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/dto/LoginRequest.java @@ -0,0 +1,26 @@ +package com.gpf.pethospital.dto; + +import jakarta.validation.constraints.NotBlank; + +public class LoginRequest { + @NotBlank + private String account; + @NotBlank + private String password; + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/dto/RegisterRequest.java b/backend/src/main/java/com/gpf/pethospital/dto/RegisterRequest.java new file mode 100644 index 0000000..011cb1b --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/dto/RegisterRequest.java @@ -0,0 +1,46 @@ +package com.gpf.pethospital.dto; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; + +public class RegisterRequest { + @NotBlank + private String username; + private String phone; + @Email + private String email; + @NotBlank + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/dto/ReplyRequest.java b/backend/src/main/java/com/gpf/pethospital/dto/ReplyRequest.java new file mode 100644 index 0000000..868b5cd --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/dto/ReplyRequest.java @@ -0,0 +1,16 @@ +package com.gpf.pethospital.dto; + +import jakarta.validation.constraints.NotBlank; + +public class ReplyRequest { + @NotBlank + private String reply; + + public String getReply() { + return reply; + } + + public void setReply(String reply) { + this.reply = reply; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Appointment.java b/backend/src/main/java/com/gpf/pethospital/entity/Appointment.java new file mode 100644 index 0000000..2de36d7 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Appointment.java @@ -0,0 +1,83 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 门诊预约实体 + */ +@Data +@Accessors(chain = true) +@TableName("appointment") +public class Appointment { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 顾客ID + */ + private Long customerId; + + /** + * 宠物ID + */ + private Long petId; + + /** + * 预约医生ID(可为空,表示不指定医生) + */ + private Long doctorId; + + /** + * 科室 + */ + private String department; + + /** + * 预约日期 + */ + private LocalDate appointmentDate; + + /** + * 预约时段(例如:09:00-10:00) + */ + private String timeSlot; + + /** + * 预约状态:PENDING-待确认, CONFIRMED-已确认, ARRIVED-已到诊, CANCELLED-已取消, NO_SHOW-爽约 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 取消时间 + */ + private LocalDateTime cancelTime; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Drug.java b/backend/src/main/java/com/gpf/pethospital/entity/Drug.java new file mode 100644 index 0000000..d46c5d2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Drug.java @@ -0,0 +1,93 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 药品实体 + */ +@Data +@Accessors(chain = true) +@TableName("drug") +public class Drug { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 药品名称 + */ + private String name; + + /** + * 规格 + */ + private String specification; + + /** + * 单位(如:片、盒、瓶) + */ + private String unit; + + /** + * 当前库存数量 + */ + private Integer stock; + + /** + * 预警阈值 + */ + private Integer alertThreshold; + + /** + * 进价 + */ + private BigDecimal purchasePrice; + + /** + * 售价 + */ + private BigDecimal salePrice; + + /** + * 生产厂家 + */ + private String manufacturer; + + /** + * 批准文号 + */ + private String approvalNumber; + + /** + * 有效期 + */ + private LocalDateTime expiryDate; + + /** + * 状态:0-禁用, 1-启用 + */ + private Integer status; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/MedicalRecord.java b/backend/src/main/java/com/gpf/pethospital/entity/MedicalRecord.java new file mode 100644 index 0000000..a056ec4 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/MedicalRecord.java @@ -0,0 +1,82 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 病历实体 + */ +@Data +@Accessors(chain = true) +@TableName("medical_record") +public class MedicalRecord { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 就诊记录ID + */ + private Long visitId; + + /** + * 主诉 + */ + private String chiefComplaint; + + /** + * 现病史 + */ + private String presentIllness; + + /** + * 体格检查 + */ + private String physicalExamination; + + /** + * 检查结果 + */ + private String examinationResults; + + /** + * 诊断结论 + */ + private String diagnosis; + + /** + * 治疗方案 + */ + private String treatmentPlan; + + /** + * 医嘱 + */ + private String advice; + + /** + * 状态:DRAFT-草稿, COMPLETED-已完成 + */ + private String status; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Message.java b/backend/src/main/java/com/gpf/pethospital/entity/Message.java new file mode 100644 index 0000000..fd040f1 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Message.java @@ -0,0 +1,82 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 留言实体 + */ +@Data +@Accessors(chain = true) +@TableName("message") +public class Message { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 留言人ID + */ + private Long userId; + + /** + * 留言人姓名 + */ + private String userName; + + /** + * 联系方式 + */ + private String contact; + + /** + * 标题 + */ + private String title; + + /** + * 内容 + */ + private String content; + + /** + * 处理状态:PENDING-待处理, PROCESSED-已处理 + */ + private String status; + + /** + * 回复内容 + */ + private String reply; + + /** + * 回复时间 + */ + private LocalDateTime replyTime; + + /** + * 回复者ID + */ + private Long replyUserId; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Notice.java b/backend/src/main/java/com/gpf/pethospital/entity/Notice.java new file mode 100644 index 0000000..633be31 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Notice.java @@ -0,0 +1,62 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 公告实体 + */ +@Data +@Accessors(chain = true) +@TableName("notice") +public class Notice { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 标题 + */ + private String title; + + /** + * 内容 + */ + private String content; + + /** + * 是否置顶:0-否, 1-是 + */ + private Integer isTop; + + /** + * 状态:0-下架, 1-上架 + */ + private Integer status; + + /** + * 发布者ID + */ + private Long publisherId; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Order.java b/backend/src/main/java/com/gpf/pethospital/entity/Order.java new file mode 100644 index 0000000..5901b47 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Order.java @@ -0,0 +1,78 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 订单实体 + */ +@Data +@Accessors(chain = true) +@TableName("order_info") +public class Order { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 就诊记录ID + */ + private Long visitId; + + /** + * 顾客ID + */ + private Long customerId; + + /** + * 订单金额 + */ + private BigDecimal amount; + + /** + * 订单状态:UNPAID-未支付, PAID-已支付, CANCELLED-已取消, REFUNDING-退款中, REFUNDED-已退款 + */ + private String status; + + /** + * 支付方式:OFFLINE-线下支付, ALIPAY-支付宝, WECHAT-微信支付 + */ + private String paymentMethod; + + /** + * 支付时间 + */ + private LocalDateTime paymentTime; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Pet.java b/backend/src/main/java/com/gpf/pethospital/entity/Pet.java new file mode 100644 index 0000000..3cd3f98 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Pet.java @@ -0,0 +1,78 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 宠物实体 + */ +@Data +@Accessors(chain = true) +@TableName("pet") +public class Pet { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 宠物主人ID + */ + private Long ownerId; + + /** + * 宠物名称 + */ + private String name; + + /** + * 品种 + */ + private String breed; + + /** + * 性别:MALE-雄性, FEMALE-雌性 + */ + private String gender; + + /** + * 生日 + */ + private LocalDate birthday; + + /** + * 体重(kg) + */ + private Double weight; + + /** + * 照片URL + */ + private String photo; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Prescription.java b/backend/src/main/java/com/gpf/pethospital/entity/Prescription.java new file mode 100644 index 0000000..03879bf --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Prescription.java @@ -0,0 +1,57 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 处方实体 + */ +@Data +@Accessors(chain = true) +@TableName("prescription") +public class Prescription { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 就诊记录ID + */ + private Long visitId; + + /** + * 医生ID + */ + private Long doctorId; + + /** + * 处方状态:DRAFT-草稿, SUBMITTED-已提交, ISSUED-已发药, VOIDED-已作废 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/PrescriptionItem.java b/backend/src/main/java/com/gpf/pethospital/entity/PrescriptionItem.java new file mode 100644 index 0000000..9cf5d7c --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/PrescriptionItem.java @@ -0,0 +1,83 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 处方明细实体 + */ +@Data +@Accessors(chain = true) +@TableName("prescription_item") +public class PrescriptionItem { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 处方ID + */ + private Long prescriptionId; + + /** + * 药品ID + */ + private Long drugId; + + /** + * 药品名称(冗余字段,方便查询) + */ + private String drugName; + + /** + * 规格 + */ + private String specification; + + /** + * 数量 + */ + private Integer quantity; + + /** + * 用法用量 + */ + private String usage; + + /** + * 用药天数 + */ + private Integer days; + + /** + * 单价 + */ + private BigDecimal unitPrice; + + /** + * 小计 + */ + private BigDecimal subtotal; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Report.java b/backend/src/main/java/com/gpf/pethospital/entity/Report.java new file mode 100644 index 0000000..86bcb7f --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Report.java @@ -0,0 +1,72 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 检查报告实体 + */ +@Data +@Accessors(chain = true) +@TableName("report") +public class Report { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 就诊记录ID + */ + private Long visitId; + + /** + * 宠物ID + */ + private Long petId; + + /** + * 报告类型(如:血常规、X光、B超等) + */ + private String type; + + /** + * 报告名称 + */ + private String title; + + /** + * 报告内容摘要 + */ + private String summary; + + /** + * 附件URL(图片或PDF) + */ + private String attachmentUrl; + + /** + * 检查医生ID + */ + private Long doctorId; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/StockIn.java b/backend/src/main/java/com/gpf/pethospital/entity/StockIn.java new file mode 100644 index 0000000..0bc96fc --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/StockIn.java @@ -0,0 +1,67 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 入库流水实体 + */ +@Data +@Accessors(chain = true) +@TableName("stock_in") +public class StockIn { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 药品ID + */ + private Long drugId; + + /** + * 入库数量 + */ + private Integer quantity; + + /** + * 经办人ID + */ + private Long operatorId; + + /** + * 入库时间 + */ + private LocalDateTime stockInTime; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/StockOut.java b/backend/src/main/java/com/gpf/pethospital/entity/StockOut.java new file mode 100644 index 0000000..23cc3ad --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/StockOut.java @@ -0,0 +1,72 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 出库/消耗流水实体 + */ +@Data +@Accessors(chain = true) +@TableName("stock_out") +public class StockOut { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 药品ID + */ + private Long drugId; + + /** + * 处方ID(可为空) + */ + private Long prescriptionId; + + /** + * 出库数量 + */ + private Integer quantity; + + /** + * 经办人ID + */ + private Long operatorId; + + /** + * 出库时间 + */ + private LocalDateTime stockOutTime; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/User.java b/backend/src/main/java/com/gpf/pethospital/entity/User.java new file mode 100644 index 0000000..adbb94e --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/User.java @@ -0,0 +1,72 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 用户实体 + */ +@Data +@Accessors(chain = true) +@TableName("`user`") +public class User { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 用户名/姓名 + */ + private String username; + + /** + * 手机号 + */ + private String phone; + + /** + * 邮箱 + */ + private String email; + + /** + * 密码(加密后) + */ + private String password; + + /** + * 角色:ADMIN-管理员, DOCTOR-医生, CUSTOMER-顾客 + */ + private String role; + + /** + * 状态:0-禁用, 1-启用 + */ + private Integer status; + + /** + * 头像URL + */ + private String avatar; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/VaccineRecord.java b/backend/src/main/java/com/gpf/pethospital/entity/VaccineRecord.java new file mode 100644 index 0000000..40ff488 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/VaccineRecord.java @@ -0,0 +1,68 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 疫苗/驱虫记录实体 + */ +@Data +@Accessors(chain = true) +@TableName("vaccine_record") +public class VaccineRecord { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 宠物ID + */ + private Long petId; + + /** + * 记录类型:VACCINE-疫苗, DEWORMING-驱虫 + */ + private String type; + + /** + * 项目名称(如:狂犬疫苗、体内驱虫等) + */ + private String itemName; + + /** + * 执行日期 + */ + private LocalDate executeDate; + + /** + * 下次提醒日期 + */ + private LocalDate nextReminderDate; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/entity/Visit.java b/backend/src/main/java/com/gpf/pethospital/entity/Visit.java new file mode 100644 index 0000000..952d95a --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/entity/Visit.java @@ -0,0 +1,93 @@ +package com.gpf.pethospital.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 就诊记录实体 + */ +@Data +@Accessors(chain = true) +@TableName("visit") +public class Visit { + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 预约ID(可为空,现场挂号无预约) + */ + private Long appointmentId; + + /** + * 顾客ID + */ + private Long customerId; + + /** + * 宠物ID + */ + private Long petId; + + /** + * 接诊医生ID + */ + private Long doctorId; + + /** + * 就诊状态:IN_PROGRESS-就诊中, COMPLETED-已完成 + */ + private String status; + + /** + * 总费用 + */ + private BigDecimal totalAmount; + + /** + * 支付状态:UNPAID-未支付, PAID-已支付, REFUNDING-退款中, REFUNDED-已退款 + */ + private String paymentStatus; + + /** + * 支付方式:OFFLINE-线下支付, ALIPAY-支付宝, WECHAT-微信支付 + */ + private String paymentMethod; + + /** + * 支付时间 + */ + private LocalDateTime paymentTime; + + /** + * 开始就诊时间 + */ + private LocalDateTime startTime; + + /** + * 结束就诊时间 + */ + private LocalDateTime endTime; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 删除标记:0-未删除, 1-已删除 + */ + @TableLogic + private Integer deleted; +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/AppointmentMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/AppointmentMapper.java new file mode 100644 index 0000000..48cda86 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/AppointmentMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Appointment; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface AppointmentMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/DrugMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/DrugMapper.java new file mode 100644 index 0000000..93bc8ad --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/DrugMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Drug; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DrugMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/MedicalRecordMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/MedicalRecordMapper.java new file mode 100644 index 0000000..2917944 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/MedicalRecordMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.MedicalRecord; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MedicalRecordMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/MessageMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/MessageMapper.java new file mode 100644 index 0000000..e356ead --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/MessageMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Message; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MessageMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/NoticeMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/NoticeMapper.java new file mode 100644 index 0000000..f2a9002 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/NoticeMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Notice; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface NoticeMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/OrderMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/OrderMapper.java new file mode 100644 index 0000000..50993aa --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/OrderMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Order; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface OrderMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/PetMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/PetMapper.java new file mode 100644 index 0000000..bd7d18f --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/PetMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Pet; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface PetMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionItemMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionItemMapper.java new file mode 100644 index 0000000..f79b744 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionItemMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.PrescriptionItem; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface PrescriptionItemMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionMapper.java new file mode 100644 index 0000000..338ea17 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Prescription; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface PrescriptionMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/ReportMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/ReportMapper.java new file mode 100644 index 0000000..8ab6391 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/ReportMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Report; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ReportMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/StockInMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/StockInMapper.java new file mode 100644 index 0000000..ac6b989 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/StockInMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.StockIn; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StockInMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/StockOutMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/StockOutMapper.java new file mode 100644 index 0000000..236b8d2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/StockOutMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.StockOut; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StockOutMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/UserMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/UserMapper.java new file mode 100644 index 0000000..c00a316 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/UserMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.User; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface UserMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/VaccineRecordMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/VaccineRecordMapper.java new file mode 100644 index 0000000..841579c --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/VaccineRecordMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.VaccineRecord; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface VaccineRecordMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/mapper/VisitMapper.java b/backend/src/main/java/com/gpf/pethospital/mapper/VisitMapper.java new file mode 100644 index 0000000..1d6f7af --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/mapper/VisitMapper.java @@ -0,0 +1,9 @@ +package com.gpf.pethospital.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gpf.pethospital.entity.Visit; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface VisitMapper extends BaseMapper { +} diff --git a/backend/src/main/java/com/gpf/pethospital/security/AuthUser.java b/backend/src/main/java/com/gpf/pethospital/security/AuthUser.java new file mode 100644 index 0000000..978ea46 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/security/AuthUser.java @@ -0,0 +1,25 @@ +package com.gpf.pethospital.security; + +public class AuthUser { + private final Long id; + private final String username; + private final String role; + + public AuthUser(Long id, String username, String role) { + this.id = id; + this.username = username; + this.role = role; + } + + public Long getId() { + return id; + } + + public String getUsername() { + return username; + } + + public String getRole() { + return role; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/security/JwtAuthenticationFilter.java b/backend/src/main/java/com/gpf/pethospital/security/JwtAuthenticationFilter.java new file mode 100644 index 0000000..985a125 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/security/JwtAuthenticationFilter.java @@ -0,0 +1,55 @@ +package com.gpf.pethospital.security; + +import com.gpf.pethospital.util.JwtUtil; +import io.jsonwebtoken.Claims; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.util.StringUtils; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import java.io.IOException; +import java.util.Collections; + +public class JwtAuthenticationFilter extends OncePerRequestFilter { + private final JwtUtil jwtUtil; + + public JwtAuthenticationFilter(JwtUtil jwtUtil) { + this.jwtUtil = jwtUtil; + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) + throws ServletException, IOException { + String token = resolveToken(request); + if (StringUtils.hasText(token)) { + try { + Claims claims = jwtUtil.parseToken(token); + String username = claims.get("username", String.class); + String role = claims.get("role", String.class); + Number uid = claims.get("uid", Number.class); + Long userId = uid == null ? null : uid.longValue(); + SimpleGrantedAuthority authority = new SimpleGrantedAuthority("ROLE_" + role); + AuthUser principal = new AuthUser(userId, username, role); + Authentication auth = new UsernamePasswordAuthenticationToken(principal, null, Collections.singleton(authority)); + SecurityContextHolder.getContext().setAuthentication(auth); + } catch (Exception ignored) { + } + } + filterChain.doFilter(request, response); + } + + private String resolveToken(HttpServletRequest request) { + String bearer = request.getHeader("Authorization"); + if (StringUtils.hasText(bearer) && bearer.startsWith("Bearer ")) { + return bearer.substring(7); + } + return null; + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/AppointmentService.java b/backend/src/main/java/com/gpf/pethospital/service/AppointmentService.java new file mode 100644 index 0000000..cb2f685 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/AppointmentService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Appointment; + +public interface AppointmentService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/DrugService.java b/backend/src/main/java/com/gpf/pethospital/service/DrugService.java new file mode 100644 index 0000000..355c484 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/DrugService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Drug; + +public interface DrugService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/MedicalRecordService.java b/backend/src/main/java/com/gpf/pethospital/service/MedicalRecordService.java new file mode 100644 index 0000000..a51ea41 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/MedicalRecordService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.MedicalRecord; + +public interface MedicalRecordService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/MessageService.java b/backend/src/main/java/com/gpf/pethospital/service/MessageService.java new file mode 100644 index 0000000..2f1a84a --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/MessageService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Message; + +public interface MessageService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/NoticeService.java b/backend/src/main/java/com/gpf/pethospital/service/NoticeService.java new file mode 100644 index 0000000..23c344b --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/NoticeService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Notice; + +public interface NoticeService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/OrderService.java b/backend/src/main/java/com/gpf/pethospital/service/OrderService.java new file mode 100644 index 0000000..cd85d8f --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/OrderService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Order; + +public interface OrderService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/PetService.java b/backend/src/main/java/com/gpf/pethospital/service/PetService.java new file mode 100644 index 0000000..88e08d5 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/PetService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Pet; + +public interface PetService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/PrescriptionItemService.java b/backend/src/main/java/com/gpf/pethospital/service/PrescriptionItemService.java new file mode 100644 index 0000000..05a4e64 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/PrescriptionItemService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.PrescriptionItem; + +public interface PrescriptionItemService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/PrescriptionService.java b/backend/src/main/java/com/gpf/pethospital/service/PrescriptionService.java new file mode 100644 index 0000000..beb7dc1 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/PrescriptionService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Prescription; + +public interface PrescriptionService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/ReportService.java b/backend/src/main/java/com/gpf/pethospital/service/ReportService.java new file mode 100644 index 0000000..dfaf158 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/ReportService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Report; + +public interface ReportService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/StockInService.java b/backend/src/main/java/com/gpf/pethospital/service/StockInService.java new file mode 100644 index 0000000..e2ac014 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/StockInService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.StockIn; + +public interface StockInService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/StockOutService.java b/backend/src/main/java/com/gpf/pethospital/service/StockOutService.java new file mode 100644 index 0000000..f944f89 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/StockOutService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.StockOut; + +public interface StockOutService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/UserService.java b/backend/src/main/java/com/gpf/pethospital/service/UserService.java new file mode 100644 index 0000000..2fb9f1d --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/UserService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.User; + +public interface UserService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/VaccineRecordService.java b/backend/src/main/java/com/gpf/pethospital/service/VaccineRecordService.java new file mode 100644 index 0000000..14d67bf --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/VaccineRecordService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.VaccineRecord; + +public interface VaccineRecordService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/VisitService.java b/backend/src/main/java/com/gpf/pethospital/service/VisitService.java new file mode 100644 index 0000000..d02b870 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/VisitService.java @@ -0,0 +1,7 @@ +package com.gpf.pethospital.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gpf.pethospital.entity.Visit; + +public interface VisitService extends IService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/AppointmentServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/AppointmentServiceImpl.java new file mode 100644 index 0000000..d5e1e05 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/AppointmentServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Appointment; +import com.gpf.pethospital.mapper.AppointmentMapper; +import com.gpf.pethospital.service.AppointmentService; +import org.springframework.stereotype.Service; + +@Service +public class AppointmentServiceImpl extends ServiceImpl implements AppointmentService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/DrugServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/DrugServiceImpl.java new file mode 100644 index 0000000..eaf4429 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/DrugServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Drug; +import com.gpf.pethospital.mapper.DrugMapper; +import com.gpf.pethospital.service.DrugService; +import org.springframework.stereotype.Service; + +@Service +public class DrugServiceImpl extends ServiceImpl implements DrugService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.java new file mode 100644 index 0000000..da636a5 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.MedicalRecord; +import com.gpf.pethospital.mapper.MedicalRecordMapper; +import com.gpf.pethospital.service.MedicalRecordService; +import org.springframework.stereotype.Service; + +@Service +public class MedicalRecordServiceImpl extends ServiceImpl implements MedicalRecordService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/MessageServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/MessageServiceImpl.java new file mode 100644 index 0000000..30daa34 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/MessageServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Message; +import com.gpf.pethospital.mapper.MessageMapper; +import com.gpf.pethospital.service.MessageService; +import org.springframework.stereotype.Service; + +@Service +public class MessageServiceImpl extends ServiceImpl implements MessageService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/NoticeServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/NoticeServiceImpl.java new file mode 100644 index 0000000..07b7dbc --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/NoticeServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Notice; +import com.gpf.pethospital.mapper.NoticeMapper; +import com.gpf.pethospital.service.NoticeService; +import org.springframework.stereotype.Service; + +@Service +public class NoticeServiceImpl extends ServiceImpl implements NoticeService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/OrderServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/OrderServiceImpl.java new file mode 100644 index 0000000..916bbaf --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/OrderServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Order; +import com.gpf.pethospital.mapper.OrderMapper; +import com.gpf.pethospital.service.OrderService; +import org.springframework.stereotype.Service; + +@Service +public class OrderServiceImpl extends ServiceImpl implements OrderService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/PetServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/PetServiceImpl.java new file mode 100644 index 0000000..2ce7f8f --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/PetServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Pet; +import com.gpf.pethospital.mapper.PetMapper; +import com.gpf.pethospital.service.PetService; +import org.springframework.stereotype.Service; + +@Service +public class PetServiceImpl extends ServiceImpl implements PetService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.java new file mode 100644 index 0000000..3a94ca2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.PrescriptionItem; +import com.gpf.pethospital.mapper.PrescriptionItemMapper; +import com.gpf.pethospital.service.PrescriptionItemService; +import org.springframework.stereotype.Service; + +@Service +public class PrescriptionItemServiceImpl extends ServiceImpl implements PrescriptionItemService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.java new file mode 100644 index 0000000..bb56ef7 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Prescription; +import com.gpf.pethospital.mapper.PrescriptionMapper; +import com.gpf.pethospital.service.PrescriptionService; +import org.springframework.stereotype.Service; + +@Service +public class PrescriptionServiceImpl extends ServiceImpl implements PrescriptionService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/ReportServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/ReportServiceImpl.java new file mode 100644 index 0000000..392a44c --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/ReportServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Report; +import com.gpf.pethospital.mapper.ReportMapper; +import com.gpf.pethospital.service.ReportService; +import org.springframework.stereotype.Service; + +@Service +public class ReportServiceImpl extends ServiceImpl implements ReportService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/StockInServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/StockInServiceImpl.java new file mode 100644 index 0000000..b7b307c --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/StockInServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.StockIn; +import com.gpf.pethospital.mapper.StockInMapper; +import com.gpf.pethospital.service.StockInService; +import org.springframework.stereotype.Service; + +@Service +public class StockInServiceImpl extends ServiceImpl implements StockInService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/StockOutServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/StockOutServiceImpl.java new file mode 100644 index 0000000..8102a8e --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/StockOutServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.StockOut; +import com.gpf.pethospital.mapper.StockOutMapper; +import com.gpf.pethospital.service.StockOutService; +import org.springframework.stereotype.Service; + +@Service +public class StockOutServiceImpl extends ServiceImpl implements StockOutService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/UserServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..b8d7c0e --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/UserServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.User; +import com.gpf.pethospital.mapper.UserMapper; +import com.gpf.pethospital.service.UserService; +import org.springframework.stereotype.Service; + +@Service +public class UserServiceImpl extends ServiceImpl implements UserService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.java new file mode 100644 index 0000000..4297287 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.VaccineRecord; +import com.gpf.pethospital.mapper.VaccineRecordMapper; +import com.gpf.pethospital.service.VaccineRecordService; +import org.springframework.stereotype.Service; + +@Service +public class VaccineRecordServiceImpl extends ServiceImpl implements VaccineRecordService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/service/impl/VisitServiceImpl.java b/backend/src/main/java/com/gpf/pethospital/service/impl/VisitServiceImpl.java new file mode 100644 index 0000000..7d0f8a2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/service/impl/VisitServiceImpl.java @@ -0,0 +1,11 @@ +package com.gpf.pethospital.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gpf.pethospital.entity.Visit; +import com.gpf.pethospital.mapper.VisitMapper; +import com.gpf.pethospital.service.VisitService; +import org.springframework.stereotype.Service; + +@Service +public class VisitServiceImpl extends ServiceImpl implements VisitService { +} diff --git a/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java b/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java new file mode 100644 index 0000000..a9e4ee2 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java @@ -0,0 +1,41 @@ +package com.gpf.pethospital.util; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class JwtUtil { + private final String secret; + private final long expirationMs; + + public JwtUtil(String secret, long expirationMs) { + this.secret = secret; + this.expirationMs = expirationMs; + } + + public String generateToken(Long userId, String role, String username) { + Map claims = new HashMap<>(); + claims.put("uid", userId); + claims.put("role", role); + claims.put("username", username); + Date now = new Date(); + Date exp = new Date(now.getTime() + expirationMs); + return Jwts.builder() + .setClaims(claims) + .setIssuedAt(now) + .setExpiration(exp) + .signWith(SignatureAlgorithm.HS256, secret) + .compact(); + } + + public Claims parseToken(String token) { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } +} diff --git a/backend/src/main/java/com/gpf/pethospital/util/SecurityUtils.java b/backend/src/main/java/com/gpf/pethospital/util/SecurityUtils.java new file mode 100644 index 0000000..9d27588 --- /dev/null +++ b/backend/src/main/java/com/gpf/pethospital/util/SecurityUtils.java @@ -0,0 +1,15 @@ +package com.gpf.pethospital.util; + +import com.gpf.pethospital.security.AuthUser; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +public class SecurityUtils { + public static AuthUser currentUser() { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication != null && authentication.getPrincipal() instanceof AuthUser) { + return (AuthUser) authentication.getPrincipal(); + } + return null; + } +} diff --git a/backend/src/main/resources/application-dev.yml b/backend/src/main/resources/application-dev.yml new file mode 100644 index 0000000..366ffe9 --- /dev/null +++ b/backend/src/main/resources/application-dev.yml @@ -0,0 +1,61 @@ +server: + port: 8081 + servlet: + context-path: /api + +spring: + application: + name: pet-hospital + + datasource: + driver-class-name: org.h2.Driver + url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL; + username: sa + password: password + hikari: + maximum-pool-size: 10 + minimum-idle: 5 + connection-timeout: 30000 + + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + + h2: + console: + enabled: true + path: /h2-console + + jpa: + hibernate: + ddl-auto: create-drop + show-sql: true + + sql: + init: + mode: always + schema-locations: classpath*:schema-h2.sql + data-locations: classpath*:data.sql + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + id-type: auto + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + mapper-locations: classpath*:mapper/**/*.xml + ddl-auto: create-drop + +# JWT配置 +jwt: + secret: petHospitalSecretKey2024GuanPengFeiGraduateDesign + expiration: 86400000 # 24小时 + +# 文件上传配置 +file: + upload-path: /tmp/pet-hospital/uploads/ + max-size: 10MB \ No newline at end of file diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml new file mode 100644 index 0000000..b83f286 --- /dev/null +++ b/backend/src/main/resources/application.yml @@ -0,0 +1,36 @@ +server: + port: 8080 + servlet: + context-path: /api + +spring: + profiles: + active: dev + application: + name: pet-hospital + + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + id-type: auto + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + mapper-locations: classpath*:mapper/**/*.xml + +# JWT配置 +jwt: + secret: pet-hospital-secret-key-2024-guanpengfei-graduate-design + expiration: 86400000 # 24小时 + +# 文件上传配置 +file: + upload-path: /tmp/pet-hospital/uploads/ + max-size: 10MB diff --git a/backend/src/main/resources/data.sql b/backend/src/main/resources/data.sql new file mode 100644 index 0000000..1f3337f --- /dev/null +++ b/backend/src/main/resources/data.sql @@ -0,0 +1,17 @@ +-- 插入初始管理员用户 +INSERT INTO `user` (username, password, phone, email, role, status) VALUES ('admin', '$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13800138000', 'admin@example.com', 'ADMIN', 1); + +-- 插入初始医生用户 +INSERT INTO `user` (username, password, phone, email, role, status) VALUES ('doctor', '$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13700137000', 'doctor@example.com', 'DOCTOR', 1); + +-- 插入初始顾客用户 +INSERT INTO `user` (username, password, phone, email, role, status) VALUES ('customer', '$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13900139000', 'customer@example.com', 'CUSTOMER', 1); + +-- 插入示例宠物 +INSERT INTO pet (name, species, breed, gender, birthday, owner_id) VALUES ('小白', '狗', '金毛', 'MALE', '2023-01-01', 3); + +-- 插入示例医生 +INSERT INTO doctor (name, department, title, phone, email, status) VALUES ('张医生', '内科', '主治医师', '13600136000', 'zhang@hospital.com', 1); + +-- 插入示例药品 +INSERT INTO drug (name, category, manufacturer, specification, unit_price, stock_quantity, unit, status) VALUES ('阿莫西林', '抗生素', '制药厂A', '0.25g*24粒', 25.50, 100, '盒', 1); \ No newline at end of file diff --git a/backend/src/main/resources/schema-h2.sql b/backend/src/main/resources/schema-h2.sql new file mode 100644 index 0000000..22298e9 --- /dev/null +++ b/backend/src/main/resources/schema-h2.sql @@ -0,0 +1,242 @@ +-- 如果表不存在则创建表,如果存在则添加缺失的列 + +-- 检查并创建appointment表或添加缺失列 +CREATE TABLE IF NOT EXISTS appointment ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + customer_id BIGINT NOT NULL, + pet_id BIGINT NOT NULL, + doctor_id BIGINT, + department VARCHAR(50), + appointment_date DATE, + time_slot VARCHAR(20), -- 添加这个缺失的列 + status VARCHAR(20) DEFAULT 'PENDING', + remark TEXT, + cancel_time TIMESTAMP NULL, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建visit表 +CREATE TABLE IF NOT EXISTS visit ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + appointment_id BIGINT, + customer_id BIGINT NOT NULL, + pet_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + symptoms TEXT, + diagnosis TEXT, + treatment_plan TEXT, + status VARCHAR(20) DEFAULT 'PENDING', + total_amount DECIMAL(10,2), + payment_status VARCHAR(20) DEFAULT 'UNPAID', + payment_method VARCHAR(20), + payment_time TIMESTAMP NULL, + start_time TIMESTAMP, + end_time TIMESTAMP, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建prescription表 +CREATE TABLE IF NOT EXISTS prescription ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT, + doctor_id BIGINT, + customer_id BIGINT, + total_amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'DRAFT', + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建prescription_item表 +CREATE TABLE IF NOT EXISTS prescription_item ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + prescription_id BIGINT NOT NULL, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + dosage VARCHAR(100), + frequency VARCHAR(50), + duration VARCHAR(50), + usage_instructions TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建order_info表 +CREATE TABLE IF NOT EXISTS order_info ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT, + customer_id BIGINT NOT NULL, + amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'UNPAID', + payment_method VARCHAR(20), + payment_time TIMESTAMP NULL, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建drug表 +CREATE TABLE IF NOT EXISTS drug ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + category VARCHAR(50), + manufacturer VARCHAR(100), + specification VARCHAR(100), + unit_price DECIMAL(10,2), + stock_quantity INT DEFAULT 0, + unit VARCHAR(20), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建pet表 +CREATE TABLE IF NOT EXISTS pet ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + owner_id BIGINT NOT NULL, + name VARCHAR(50) NOT NULL, + species VARCHAR(50), + breed VARCHAR(100), + gender VARCHAR(10), -- 修改为VARCHAR以支持MALE/FEMALE + birthday DATE, -- 添加birthday字段而不是age + weight DOUBLE, -- 添加weight字段 + photo VARCHAR(255), -- 添加photo字段 + remark TEXT, -- 添加remark字段 + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建doctor表 +CREATE TABLE IF NOT EXISTS doctor ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + department VARCHAR(50), + title VARCHAR(50), + phone VARCHAR(20), + email VARCHAR(100), + avatar VARCHAR(255), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建user表 +CREATE TABLE IF NOT EXISTS `user` ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + phone VARCHAR(20), + email VARCHAR(100), + password VARCHAR(255) NOT NULL, + role VARCHAR(20) DEFAULT 'CUSTOMER', + status INT DEFAULT 1, + avatar VARCHAR(255), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建medical_record表 +CREATE TABLE IF NOT EXISTS medical_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT NOT NULL, + record_type VARCHAR(50), -- CHECKUP体检, DIAGNOSIS诊断, TREATMENT治疗 + content TEXT, + attachment_urls TEXT, + doctor_id BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建message表 +CREATE TABLE IF NOT EXISTS message ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + sender_id BIGINT, + receiver_id BIGINT NOT NULL, + content TEXT NOT NULL, + type VARCHAR(20) DEFAULT 'NOTICE', -- NOTICE通知, CHAT聊天 + status VARCHAR(20) DEFAULT 'UNREAD', -- UNREAD未读, READ已读 + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建notice表 +CREATE TABLE IF NOT EXISTS notice ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(200) NOT NULL, + content TEXT NOT NULL, + publisher_id BIGINT NOT NULL, + publish_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建report表 +CREATE TABLE IF NOT EXISTS report ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + report_type VARCHAR(50) NOT NULL, -- REVENUE收入, CUSTOMER客户, PET宠物, DRUG药品 + report_data JSON, + period_start DATE, + period_end DATE, + generated_by BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建stock_in表 +CREATE TABLE IF NOT EXISTS stock_in ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + supplier VARCHAR(100), + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建stock_out表 +CREATE TABLE IF NOT EXISTS stock_out ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + purpose VARCHAR(100), -- 用途:销售、损耗等 + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建vaccine_record表 +CREATE TABLE IF NOT EXISTS vaccine_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + vaccine_name VARCHAR(100) NOT NULL, + dose_number INT, + injection_date DATE, + next_appointment_date DATE, + doctor_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); \ No newline at end of file diff --git a/backend/src/main/resources/schema.sql b/backend/src/main/resources/schema.sql new file mode 100644 index 0000000..c28ec10 --- /dev/null +++ b/backend/src/main/resources/schema.sql @@ -0,0 +1,230 @@ +-- 用户表 +CREATE TABLE IF NOT EXISTS `user` ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + phone VARCHAR(20), + email VARCHAR(100), + password VARCHAR(255) NOT NULL, + role VARCHAR(20) DEFAULT 'CUSTOMER', + status INT DEFAULT 1, + avatar VARCHAR(255), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 宠物表 +CREATE TABLE IF NOT EXISTS pet ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + species VARCHAR(50), + breed VARCHAR(100), + gender CHAR(1), + age INT, + owner_id BIGINT NOT NULL, + health_status VARCHAR(100), + vaccination_status VARCHAR(100), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 医生表 +CREATE TABLE IF NOT EXISTS doctor ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + department VARCHAR(50), + title VARCHAR(50), + phone VARCHAR(20), + email VARCHAR(100), + avatar VARCHAR(255), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 就诊记录表 +CREATE TABLE IF NOT EXISTS visit ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + customer_id BIGINT NOT NULL, + symptoms TEXT, + diagnosis TEXT, + treatment_plan TEXT, + visit_date DATE, + status VARCHAR(20) DEFAULT 'PENDING', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 处方表 +CREATE TABLE IF NOT EXISTS prescription ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + customer_id BIGINT NOT NULL, + total_amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'ACTIVE', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 处方明细表 +CREATE TABLE IF NOT EXISTS prescription_item ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + prescription_id BIGINT NOT NULL, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + dosage VARCHAR(100), + frequency VARCHAR(50), + duration VARCHAR(50), + usage_instructions TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 药品表 +CREATE TABLE IF NOT EXISTS drug ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + category VARCHAR(50), + manufacturer VARCHAR(100), + specification VARCHAR(100), + unit_price DECIMAL(10,2), + stock_quantity INT DEFAULT 0, + unit VARCHAR(20), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 订单表 +CREATE TABLE IF NOT EXISTS order_info ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT, + customer_id BIGINT NOT NULL, + amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'UNPAID', + payment_method VARCHAR(20), + payment_time TIMESTAMP NULL, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 预约表 +CREATE TABLE IF NOT EXISTS appointment ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + customer_id BIGINT NOT NULL, + appointment_date DATE NOT NULL, + appointment_time TIME NOT NULL, + reason TEXT, + status VARCHAR(20) DEFAULT 'PENDING', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 疫苗接种记录表 +CREATE TABLE IF NOT EXISTS vaccine_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + vaccine_name VARCHAR(100) NOT NULL, + dose_number INT, + injection_date DATE, + next_appointment_date DATE, + doctor_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 库存入库表 +CREATE TABLE IF NOT EXISTS stock_in ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + supplier VARCHAR(100), + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 库存出库表 +CREATE TABLE IF NOT EXISTS stock_out ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + purpose VARCHAR(100), -- 用途:销售、损耗等 + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 消息表 +CREATE TABLE IF NOT EXISTS message ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + sender_id BIGINT, + receiver_id BIGINT NOT NULL, + content TEXT NOT NULL, + type VARCHAR(20) DEFAULT 'NOTICE', -- NOTICE通知, CHAT聊天 + status VARCHAR(20) DEFAULT 'UNREAD', -- UNREAD未读, READ已读 + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 公告表 +CREATE TABLE IF NOT EXISTS notice ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(200) NOT NULL, + content TEXT NOT NULL, + publisher_id BIGINT NOT NULL, + publish_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 医疗记录表 +CREATE TABLE IF NOT EXISTS medical_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT NOT NULL, + record_type VARCHAR(50), -- CHECKUP体检, DIAGNOSIS诊断, TREATMENT治疗 + content TEXT, + attachment_urls TEXT, + doctor_id BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 报表统计表 +CREATE TABLE IF NOT EXISTS report ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + report_type VARCHAR(50) NOT NULL, -- REVENUE收入, CUSTOMER客户, PET宠物, DRUG药品 + report_data JSON, + period_start DATE, + period_end DATE, + generated_by BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); \ No newline at end of file diff --git a/backend/target/classes/application-dev.yml b/backend/target/classes/application-dev.yml new file mode 100644 index 0000000..366ffe9 --- /dev/null +++ b/backend/target/classes/application-dev.yml @@ -0,0 +1,61 @@ +server: + port: 8081 + servlet: + context-path: /api + +spring: + application: + name: pet-hospital + + datasource: + driver-class-name: org.h2.Driver + url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL; + username: sa + password: password + hikari: + maximum-pool-size: 10 + minimum-idle: 5 + connection-timeout: 30000 + + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + + h2: + console: + enabled: true + path: /h2-console + + jpa: + hibernate: + ddl-auto: create-drop + show-sql: true + + sql: + init: + mode: always + schema-locations: classpath*:schema-h2.sql + data-locations: classpath*:data.sql + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + id-type: auto + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + mapper-locations: classpath*:mapper/**/*.xml + ddl-auto: create-drop + +# JWT配置 +jwt: + secret: petHospitalSecretKey2024GuanPengFeiGraduateDesign + expiration: 86400000 # 24小时 + +# 文件上传配置 +file: + upload-path: /tmp/pet-hospital/uploads/ + max-size: 10MB \ No newline at end of file diff --git a/backend/target/classes/application.yml b/backend/target/classes/application.yml new file mode 100644 index 0000000..b83f286 --- /dev/null +++ b/backend/target/classes/application.yml @@ -0,0 +1,36 @@ +server: + port: 8080 + servlet: + context-path: /api + +spring: + profiles: + active: dev + application: + name: pet-hospital + + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + id-type: auto + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + mapper-locations: classpath*:mapper/**/*.xml + +# JWT配置 +jwt: + secret: pet-hospital-secret-key-2024-guanpengfei-graduate-design + expiration: 86400000 # 24小时 + +# 文件上传配置 +file: + upload-path: /tmp/pet-hospital/uploads/ + max-size: 10MB diff --git a/backend/target/classes/com/gpf/pethospital/PetHospitalApplication.class b/backend/target/classes/com/gpf/pethospital/PetHospitalApplication.class new file mode 100644 index 0000000..9e827cb Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/PetHospitalApplication.class differ diff --git a/backend/target/classes/com/gpf/pethospital/common/ApiResponse.class b/backend/target/classes/com/gpf/pethospital/common/ApiResponse.class new file mode 100644 index 0000000..219a61c Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/common/ApiResponse.class differ diff --git a/backend/target/classes/com/gpf/pethospital/config/MybatisPlusConfig$1.class b/backend/target/classes/com/gpf/pethospital/config/MybatisPlusConfig$1.class new file mode 100644 index 0000000..eda7e88 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/config/MybatisPlusConfig$1.class differ diff --git a/backend/target/classes/com/gpf/pethospital/config/MybatisPlusConfig.class b/backend/target/classes/com/gpf/pethospital/config/MybatisPlusConfig.class new file mode 100644 index 0000000..7246fa0 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/config/MybatisPlusConfig.class differ diff --git a/backend/target/classes/com/gpf/pethospital/config/SecurityConfig.class b/backend/target/classes/com/gpf/pethospital/config/SecurityConfig.class new file mode 100644 index 0000000..3bcda2c Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/config/SecurityConfig.class differ diff --git a/backend/target/classes/com/gpf/pethospital/config/WebConfig.class b/backend/target/classes/com/gpf/pethospital/config/WebConfig.class new file mode 100644 index 0000000..df949d9 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/config/WebConfig.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/AppointmentController.class b/backend/target/classes/com/gpf/pethospital/controller/AppointmentController.class new file mode 100644 index 0000000..2f5d222 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/AppointmentController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/AuthController.class b/backend/target/classes/com/gpf/pethospital/controller/AuthController.class new file mode 100644 index 0000000..89512d1 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/AuthController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/DrugController.class b/backend/target/classes/com/gpf/pethospital/controller/DrugController.class new file mode 100644 index 0000000..7325f82 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/DrugController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/MedicalRecordController.class b/backend/target/classes/com/gpf/pethospital/controller/MedicalRecordController.class new file mode 100644 index 0000000..55506c5 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/MedicalRecordController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/MessageController.class b/backend/target/classes/com/gpf/pethospital/controller/MessageController.class new file mode 100644 index 0000000..fcadbbd Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/MessageController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/NoticeController.class b/backend/target/classes/com/gpf/pethospital/controller/NoticeController.class new file mode 100644 index 0000000..6826327 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/NoticeController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/OrderController.class b/backend/target/classes/com/gpf/pethospital/controller/OrderController.class new file mode 100644 index 0000000..62be403 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/OrderController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/PetController.class b/backend/target/classes/com/gpf/pethospital/controller/PetController.class new file mode 100644 index 0000000..00e9bfc Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/PetController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/PrescriptionController.class b/backend/target/classes/com/gpf/pethospital/controller/PrescriptionController.class new file mode 100644 index 0000000..099af9c Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/PrescriptionController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/PrescriptionItemController.class b/backend/target/classes/com/gpf/pethospital/controller/PrescriptionItemController.class new file mode 100644 index 0000000..6bc4f56 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/PrescriptionItemController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/ReportController.class b/backend/target/classes/com/gpf/pethospital/controller/ReportController.class new file mode 100644 index 0000000..651f1e7 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/ReportController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/StatsController.class b/backend/target/classes/com/gpf/pethospital/controller/StatsController.class new file mode 100644 index 0000000..9467636 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/StatsController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/StockInController.class b/backend/target/classes/com/gpf/pethospital/controller/StockInController.class new file mode 100644 index 0000000..4c98751 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/StockInController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/StockOutController.class b/backend/target/classes/com/gpf/pethospital/controller/StockOutController.class new file mode 100644 index 0000000..31ce38d Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/StockOutController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/UserController.class b/backend/target/classes/com/gpf/pethospital/controller/UserController.class new file mode 100644 index 0000000..553d540 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/UserController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/VaccineRecordController.class b/backend/target/classes/com/gpf/pethospital/controller/VaccineRecordController.class new file mode 100644 index 0000000..82c8cb8 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/VaccineRecordController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/controller/VisitController.class b/backend/target/classes/com/gpf/pethospital/controller/VisitController.class new file mode 100644 index 0000000..58799db Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/controller/VisitController.class differ diff --git a/backend/target/classes/com/gpf/pethospital/dto/LoginRequest.class b/backend/target/classes/com/gpf/pethospital/dto/LoginRequest.class new file mode 100644 index 0000000..6e46c2e Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/dto/LoginRequest.class differ diff --git a/backend/target/classes/com/gpf/pethospital/dto/RegisterRequest.class b/backend/target/classes/com/gpf/pethospital/dto/RegisterRequest.class new file mode 100644 index 0000000..f5fc98f Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/dto/RegisterRequest.class differ diff --git a/backend/target/classes/com/gpf/pethospital/dto/ReplyRequest.class b/backend/target/classes/com/gpf/pethospital/dto/ReplyRequest.class new file mode 100644 index 0000000..8e0ddc3 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/dto/ReplyRequest.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Appointment.class b/backend/target/classes/com/gpf/pethospital/entity/Appointment.class new file mode 100644 index 0000000..1307be2 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Appointment.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Drug.class b/backend/target/classes/com/gpf/pethospital/entity/Drug.class new file mode 100644 index 0000000..8c234ab Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Drug.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/MedicalRecord.class b/backend/target/classes/com/gpf/pethospital/entity/MedicalRecord.class new file mode 100644 index 0000000..bc2be25 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/MedicalRecord.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Message.class b/backend/target/classes/com/gpf/pethospital/entity/Message.class new file mode 100644 index 0000000..d3643a8 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Message.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Notice.class b/backend/target/classes/com/gpf/pethospital/entity/Notice.class new file mode 100644 index 0000000..732eff4 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Notice.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Order.class b/backend/target/classes/com/gpf/pethospital/entity/Order.class new file mode 100644 index 0000000..f5423b2 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Order.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Pet.class b/backend/target/classes/com/gpf/pethospital/entity/Pet.class new file mode 100644 index 0000000..0b9c42e Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Pet.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Prescription.class b/backend/target/classes/com/gpf/pethospital/entity/Prescription.class new file mode 100644 index 0000000..8d9d19c Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Prescription.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/PrescriptionItem.class b/backend/target/classes/com/gpf/pethospital/entity/PrescriptionItem.class new file mode 100644 index 0000000..ef73a02 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/PrescriptionItem.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Report.class b/backend/target/classes/com/gpf/pethospital/entity/Report.class new file mode 100644 index 0000000..7cd0c10 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Report.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/StockIn.class b/backend/target/classes/com/gpf/pethospital/entity/StockIn.class new file mode 100644 index 0000000..d5e471b Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/StockIn.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/StockOut.class b/backend/target/classes/com/gpf/pethospital/entity/StockOut.class new file mode 100644 index 0000000..008ae89 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/StockOut.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/User.class b/backend/target/classes/com/gpf/pethospital/entity/User.class new file mode 100644 index 0000000..e7728c4 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/User.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/VaccineRecord.class b/backend/target/classes/com/gpf/pethospital/entity/VaccineRecord.class new file mode 100644 index 0000000..50b2b02 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/VaccineRecord.class differ diff --git a/backend/target/classes/com/gpf/pethospital/entity/Visit.class b/backend/target/classes/com/gpf/pethospital/entity/Visit.class new file mode 100644 index 0000000..875d7cc Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/entity/Visit.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class new file mode 100644 index 0000000..9d9471b Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/AppointmentMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/DrugMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/DrugMapper.class new file mode 100644 index 0000000..95de6cd Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/DrugMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/MedicalRecordMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/MedicalRecordMapper.class new file mode 100644 index 0000000..b87250b Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/MedicalRecordMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/MessageMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/MessageMapper.class new file mode 100644 index 0000000..47b6f6f Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/MessageMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/NoticeMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/NoticeMapper.class new file mode 100644 index 0000000..150fe7a Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/NoticeMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/OrderMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/OrderMapper.class new file mode 100644 index 0000000..47f3775 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/OrderMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/PetMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/PetMapper.class new file mode 100644 index 0000000..cd12a16 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/PetMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/PrescriptionItemMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/PrescriptionItemMapper.class new file mode 100644 index 0000000..5c7fe9c Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/PrescriptionItemMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/PrescriptionMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/PrescriptionMapper.class new file mode 100644 index 0000000..f528465 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/PrescriptionMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/ReportMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/ReportMapper.class new file mode 100644 index 0000000..f8a339b Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/ReportMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/StockInMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/StockInMapper.class new file mode 100644 index 0000000..d20d2e6 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/StockInMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/StockOutMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/StockOutMapper.class new file mode 100644 index 0000000..755994b Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/StockOutMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/UserMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/UserMapper.class new file mode 100644 index 0000000..de4e5e8 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/UserMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/VaccineRecordMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/VaccineRecordMapper.class new file mode 100644 index 0000000..f62be06 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/VaccineRecordMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/mapper/VisitMapper.class b/backend/target/classes/com/gpf/pethospital/mapper/VisitMapper.class new file mode 100644 index 0000000..0b09196 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/mapper/VisitMapper.class differ diff --git a/backend/target/classes/com/gpf/pethospital/security/AuthUser.class b/backend/target/classes/com/gpf/pethospital/security/AuthUser.class new file mode 100644 index 0000000..9b34430 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/security/AuthUser.class differ diff --git a/backend/target/classes/com/gpf/pethospital/security/JwtAuthenticationFilter.class b/backend/target/classes/com/gpf/pethospital/security/JwtAuthenticationFilter.class new file mode 100644 index 0000000..edef585 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/security/JwtAuthenticationFilter.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/AppointmentService.class b/backend/target/classes/com/gpf/pethospital/service/AppointmentService.class new file mode 100644 index 0000000..fe1e871 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/AppointmentService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/DrugService.class b/backend/target/classes/com/gpf/pethospital/service/DrugService.class new file mode 100644 index 0000000..4d9b08a Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/DrugService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/MedicalRecordService.class b/backend/target/classes/com/gpf/pethospital/service/MedicalRecordService.class new file mode 100644 index 0000000..efe2ebe Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/MedicalRecordService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/MessageService.class b/backend/target/classes/com/gpf/pethospital/service/MessageService.class new file mode 100644 index 0000000..77343c5 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/MessageService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/NoticeService.class b/backend/target/classes/com/gpf/pethospital/service/NoticeService.class new file mode 100644 index 0000000..444dfc8 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/NoticeService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/OrderService.class b/backend/target/classes/com/gpf/pethospital/service/OrderService.class new file mode 100644 index 0000000..245d543 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/OrderService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/PetService.class b/backend/target/classes/com/gpf/pethospital/service/PetService.class new file mode 100644 index 0000000..c99cc22 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/PetService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/PrescriptionItemService.class b/backend/target/classes/com/gpf/pethospital/service/PrescriptionItemService.class new file mode 100644 index 0000000..464a50a Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/PrescriptionItemService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/PrescriptionService.class b/backend/target/classes/com/gpf/pethospital/service/PrescriptionService.class new file mode 100644 index 0000000..85563d1 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/PrescriptionService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/ReportService.class b/backend/target/classes/com/gpf/pethospital/service/ReportService.class new file mode 100644 index 0000000..d1ee4be Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/ReportService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/StockInService.class b/backend/target/classes/com/gpf/pethospital/service/StockInService.class new file mode 100644 index 0000000..fe2cff3 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/StockInService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/StockOutService.class b/backend/target/classes/com/gpf/pethospital/service/StockOutService.class new file mode 100644 index 0000000..c1b27f5 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/StockOutService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/UserService.class b/backend/target/classes/com/gpf/pethospital/service/UserService.class new file mode 100644 index 0000000..690cfd8 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/UserService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/VaccineRecordService.class b/backend/target/classes/com/gpf/pethospital/service/VaccineRecordService.class new file mode 100644 index 0000000..58d7e29 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/VaccineRecordService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/VisitService.class b/backend/target/classes/com/gpf/pethospital/service/VisitService.class new file mode 100644 index 0000000..6e0c300 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/VisitService.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/AppointmentServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/AppointmentServiceImpl.class new file mode 100644 index 0000000..dd4145a Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/AppointmentServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/DrugServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/DrugServiceImpl.class new file mode 100644 index 0000000..4130050 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/DrugServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.class new file mode 100644 index 0000000..3361bcb Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/MessageServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/MessageServiceImpl.class new file mode 100644 index 0000000..4471d60 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/MessageServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/NoticeServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/NoticeServiceImpl.class new file mode 100644 index 0000000..018721c Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/NoticeServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/OrderServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/OrderServiceImpl.class new file mode 100644 index 0000000..317f9d0 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/OrderServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/PetServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/PetServiceImpl.class new file mode 100644 index 0000000..75bb8fd Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/PetServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.class new file mode 100644 index 0000000..f6a859a Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.class new file mode 100644 index 0000000..c7d1fa7 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/ReportServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/ReportServiceImpl.class new file mode 100644 index 0000000..7d9c641 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/ReportServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/StockInServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/StockInServiceImpl.class new file mode 100644 index 0000000..929a44f Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/StockInServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/StockOutServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/StockOutServiceImpl.class new file mode 100644 index 0000000..31971ad Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/StockOutServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/UserServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/UserServiceImpl.class new file mode 100644 index 0000000..dba3363 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/UserServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.class new file mode 100644 index 0000000..5fbce54 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/service/impl/VisitServiceImpl.class b/backend/target/classes/com/gpf/pethospital/service/impl/VisitServiceImpl.class new file mode 100644 index 0000000..bb66179 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/service/impl/VisitServiceImpl.class differ diff --git a/backend/target/classes/com/gpf/pethospital/util/JwtUtil.class b/backend/target/classes/com/gpf/pethospital/util/JwtUtil.class new file mode 100644 index 0000000..569f5cc Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/util/JwtUtil.class differ diff --git a/backend/target/classes/com/gpf/pethospital/util/SecurityUtils.class b/backend/target/classes/com/gpf/pethospital/util/SecurityUtils.class new file mode 100644 index 0000000..adf6516 Binary files /dev/null and b/backend/target/classes/com/gpf/pethospital/util/SecurityUtils.class differ diff --git a/backend/target/classes/data.sql b/backend/target/classes/data.sql new file mode 100644 index 0000000..1f3337f --- /dev/null +++ b/backend/target/classes/data.sql @@ -0,0 +1,17 @@ +-- 插入初始管理员用户 +INSERT INTO `user` (username, password, phone, email, role, status) VALUES ('admin', '$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13800138000', 'admin@example.com', 'ADMIN', 1); + +-- 插入初始医生用户 +INSERT INTO `user` (username, password, phone, email, role, status) VALUES ('doctor', '$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13700137000', 'doctor@example.com', 'DOCTOR', 1); + +-- 插入初始顾客用户 +INSERT INTO `user` (username, password, phone, email, role, status) VALUES ('customer', '$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13900139000', 'customer@example.com', 'CUSTOMER', 1); + +-- 插入示例宠物 +INSERT INTO pet (name, species, breed, gender, birthday, owner_id) VALUES ('小白', '狗', '金毛', 'MALE', '2023-01-01', 3); + +-- 插入示例医生 +INSERT INTO doctor (name, department, title, phone, email, status) VALUES ('张医生', '内科', '主治医师', '13600136000', 'zhang@hospital.com', 1); + +-- 插入示例药品 +INSERT INTO drug (name, category, manufacturer, specification, unit_price, stock_quantity, unit, status) VALUES ('阿莫西林', '抗生素', '制药厂A', '0.25g*24粒', 25.50, 100, '盒', 1); \ No newline at end of file diff --git a/backend/target/classes/schema-h2.sql b/backend/target/classes/schema-h2.sql new file mode 100644 index 0000000..22298e9 --- /dev/null +++ b/backend/target/classes/schema-h2.sql @@ -0,0 +1,242 @@ +-- 如果表不存在则创建表,如果存在则添加缺失的列 + +-- 检查并创建appointment表或添加缺失列 +CREATE TABLE IF NOT EXISTS appointment ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + customer_id BIGINT NOT NULL, + pet_id BIGINT NOT NULL, + doctor_id BIGINT, + department VARCHAR(50), + appointment_date DATE, + time_slot VARCHAR(20), -- 添加这个缺失的列 + status VARCHAR(20) DEFAULT 'PENDING', + remark TEXT, + cancel_time TIMESTAMP NULL, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建visit表 +CREATE TABLE IF NOT EXISTS visit ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + appointment_id BIGINT, + customer_id BIGINT NOT NULL, + pet_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + symptoms TEXT, + diagnosis TEXT, + treatment_plan TEXT, + status VARCHAR(20) DEFAULT 'PENDING', + total_amount DECIMAL(10,2), + payment_status VARCHAR(20) DEFAULT 'UNPAID', + payment_method VARCHAR(20), + payment_time TIMESTAMP NULL, + start_time TIMESTAMP, + end_time TIMESTAMP, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建prescription表 +CREATE TABLE IF NOT EXISTS prescription ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT, + doctor_id BIGINT, + customer_id BIGINT, + total_amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'DRAFT', + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建prescription_item表 +CREATE TABLE IF NOT EXISTS prescription_item ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + prescription_id BIGINT NOT NULL, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + dosage VARCHAR(100), + frequency VARCHAR(50), + duration VARCHAR(50), + usage_instructions TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建order_info表 +CREATE TABLE IF NOT EXISTS order_info ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT, + customer_id BIGINT NOT NULL, + amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'UNPAID', + payment_method VARCHAR(20), + payment_time TIMESTAMP NULL, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建drug表 +CREATE TABLE IF NOT EXISTS drug ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + category VARCHAR(50), + manufacturer VARCHAR(100), + specification VARCHAR(100), + unit_price DECIMAL(10,2), + stock_quantity INT DEFAULT 0, + unit VARCHAR(20), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建pet表 +CREATE TABLE IF NOT EXISTS pet ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + owner_id BIGINT NOT NULL, + name VARCHAR(50) NOT NULL, + species VARCHAR(50), + breed VARCHAR(100), + gender VARCHAR(10), -- 修改为VARCHAR以支持MALE/FEMALE + birthday DATE, -- 添加birthday字段而不是age + weight DOUBLE, -- 添加weight字段 + photo VARCHAR(255), -- 添加photo字段 + remark TEXT, -- 添加remark字段 + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建doctor表 +CREATE TABLE IF NOT EXISTS doctor ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + department VARCHAR(50), + title VARCHAR(50), + phone VARCHAR(20), + email VARCHAR(100), + avatar VARCHAR(255), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建user表 +CREATE TABLE IF NOT EXISTS `user` ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + phone VARCHAR(20), + email VARCHAR(100), + password VARCHAR(255) NOT NULL, + role VARCHAR(20) DEFAULT 'CUSTOMER', + status INT DEFAULT 1, + avatar VARCHAR(255), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建medical_record表 +CREATE TABLE IF NOT EXISTS medical_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT NOT NULL, + record_type VARCHAR(50), -- CHECKUP体检, DIAGNOSIS诊断, TREATMENT治疗 + content TEXT, + attachment_urls TEXT, + doctor_id BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建message表 +CREATE TABLE IF NOT EXISTS message ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + sender_id BIGINT, + receiver_id BIGINT NOT NULL, + content TEXT NOT NULL, + type VARCHAR(20) DEFAULT 'NOTICE', -- NOTICE通知, CHAT聊天 + status VARCHAR(20) DEFAULT 'UNREAD', -- UNREAD未读, READ已读 + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建notice表 +CREATE TABLE IF NOT EXISTS notice ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(200) NOT NULL, + content TEXT NOT NULL, + publisher_id BIGINT NOT NULL, + publish_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建report表 +CREATE TABLE IF NOT EXISTS report ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + report_type VARCHAR(50) NOT NULL, -- REVENUE收入, CUSTOMER客户, PET宠物, DRUG药品 + report_data JSON, + period_start DATE, + period_end DATE, + generated_by BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建stock_in表 +CREATE TABLE IF NOT EXISTS stock_in ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + supplier VARCHAR(100), + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建stock_out表 +CREATE TABLE IF NOT EXISTS stock_out ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + purpose VARCHAR(100), -- 用途:销售、损耗等 + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 检查并创建vaccine_record表 +CREATE TABLE IF NOT EXISTS vaccine_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + vaccine_name VARCHAR(100) NOT NULL, + dose_number INT, + injection_date DATE, + next_appointment_date DATE, + doctor_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); \ No newline at end of file diff --git a/backend/target/classes/schema.sql b/backend/target/classes/schema.sql new file mode 100644 index 0000000..c28ec10 --- /dev/null +++ b/backend/target/classes/schema.sql @@ -0,0 +1,230 @@ +-- 用户表 +CREATE TABLE IF NOT EXISTS `user` ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + phone VARCHAR(20), + email VARCHAR(100), + password VARCHAR(255) NOT NULL, + role VARCHAR(20) DEFAULT 'CUSTOMER', + status INT DEFAULT 1, + avatar VARCHAR(255), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 宠物表 +CREATE TABLE IF NOT EXISTS pet ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + species VARCHAR(50), + breed VARCHAR(100), + gender CHAR(1), + age INT, + owner_id BIGINT NOT NULL, + health_status VARCHAR(100), + vaccination_status VARCHAR(100), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 医生表 +CREATE TABLE IF NOT EXISTS doctor ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + department VARCHAR(50), + title VARCHAR(50), + phone VARCHAR(20), + email VARCHAR(100), + avatar VARCHAR(255), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 就诊记录表 +CREATE TABLE IF NOT EXISTS visit ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + customer_id BIGINT NOT NULL, + symptoms TEXT, + diagnosis TEXT, + treatment_plan TEXT, + visit_date DATE, + status VARCHAR(20) DEFAULT 'PENDING', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 处方表 +CREATE TABLE IF NOT EXISTS prescription ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + customer_id BIGINT NOT NULL, + total_amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'ACTIVE', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 处方明细表 +CREATE TABLE IF NOT EXISTS prescription_item ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + prescription_id BIGINT NOT NULL, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + dosage VARCHAR(100), + frequency VARCHAR(50), + duration VARCHAR(50), + usage_instructions TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 药品表 +CREATE TABLE IF NOT EXISTS drug ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + category VARCHAR(50), + manufacturer VARCHAR(100), + specification VARCHAR(100), + unit_price DECIMAL(10,2), + stock_quantity INT DEFAULT 0, + unit VARCHAR(20), + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 订单表 +CREATE TABLE IF NOT EXISTS order_info ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT, + customer_id BIGINT NOT NULL, + amount DECIMAL(10,2), + status VARCHAR(20) DEFAULT 'UNPAID', + payment_method VARCHAR(20), + payment_time TIMESTAMP NULL, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 预约表 +CREATE TABLE IF NOT EXISTS appointment ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + doctor_id BIGINT NOT NULL, + customer_id BIGINT NOT NULL, + appointment_date DATE NOT NULL, + appointment_time TIME NOT NULL, + reason TEXT, + status VARCHAR(20) DEFAULT 'PENDING', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 疫苗接种记录表 +CREATE TABLE IF NOT EXISTS vaccine_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + pet_id BIGINT NOT NULL, + vaccine_name VARCHAR(100) NOT NULL, + dose_number INT, + injection_date DATE, + next_appointment_date DATE, + doctor_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 库存入库表 +CREATE TABLE IF NOT EXISTS stock_in ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + supplier VARCHAR(100), + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 库存出库表 +CREATE TABLE IF NOT EXISTS stock_out ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + drug_id BIGINT NOT NULL, + quantity INT NOT NULL, + unit_price DECIMAL(10,2), + purpose VARCHAR(100), -- 用途:销售、损耗等 + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 消息表 +CREATE TABLE IF NOT EXISTS message ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + sender_id BIGINT, + receiver_id BIGINT NOT NULL, + content TEXT NOT NULL, + type VARCHAR(20) DEFAULT 'NOTICE', -- NOTICE通知, CHAT聊天 + status VARCHAR(20) DEFAULT 'UNREAD', -- UNREAD未读, READ已读 + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 公告表 +CREATE TABLE IF NOT EXISTS notice ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(200) NOT NULL, + content TEXT NOT NULL, + publisher_id BIGINT NOT NULL, + publish_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + status INT DEFAULT 1, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 医疗记录表 +CREATE TABLE IF NOT EXISTS medical_record ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + visit_id BIGINT NOT NULL, + record_type VARCHAR(50), -- CHECKUP体检, DIAGNOSIS诊断, TREATMENT治疗 + content TEXT, + attachment_urls TEXT, + doctor_id BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); + +-- 报表统计表 +CREATE TABLE IF NOT EXISTS report ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + report_type VARCHAR(50) NOT NULL, -- REVENUE收入, CUSTOMER客户, PET宠物, DRUG药品 + report_data JSON, + period_start DATE, + period_end DATE, + generated_by BIGINT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted INT DEFAULT 0 +); \ No newline at end of file diff --git a/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..aed6c1f --- /dev/null +++ b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,90 @@ +com/gpf/pethospital/controller/MessageController.class +com/gpf/pethospital/controller/PetController.class +com/gpf/pethospital/mapper/UserMapper.class +com/gpf/pethospital/entity/Order.class +com/gpf/pethospital/controller/NoticeController.class +com/gpf/pethospital/mapper/StockInMapper.class +com/gpf/pethospital/service/PrescriptionItemService.class +com/gpf/pethospital/service/PetService.class +com/gpf/pethospital/entity/Drug.class +com/gpf/pethospital/util/JwtUtil.class +com/gpf/pethospital/dto/LoginRequest.class +com/gpf/pethospital/controller/OrderController.class +com/gpf/pethospital/mapper/NoticeMapper.class +com/gpf/pethospital/controller/VaccineRecordController.class +com/gpf/pethospital/mapper/MedicalRecordMapper.class +com/gpf/pethospital/config/WebConfig.class +com/gpf/pethospital/service/MedicalRecordService.class +com/gpf/pethospital/entity/Notice.class +com/gpf/pethospital/controller/StatsController.class +com/gpf/pethospital/entity/Prescription.class +com/gpf/pethospital/mapper/PrescriptionItemMapper.class +com/gpf/pethospital/entity/Appointment.class +com/gpf/pethospital/security/AuthUser.class +com/gpf/pethospital/util/SecurityUtils.class +com/gpf/pethospital/entity/VaccineRecord.class +com/gpf/pethospital/service/impl/StockInServiceImpl.class +com/gpf/pethospital/service/OrderService.class +com/gpf/pethospital/config/SecurityConfig.class +com/gpf/pethospital/mapper/VisitMapper.class +com/gpf/pethospital/config/MybatisPlusConfig$1.class +com/gpf/pethospital/mapper/MessageMapper.class +com/gpf/pethospital/service/impl/PetServiceImpl.class +com/gpf/pethospital/dto/RegisterRequest.class +com/gpf/pethospital/entity/StockIn.class +com/gpf/pethospital/service/VaccineRecordService.class +com/gpf/pethospital/entity/MedicalRecord.class +com/gpf/pethospital/service/ReportService.class +com/gpf/pethospital/controller/StockInController.class +com/gpf/pethospital/service/impl/OrderServiceImpl.class +com/gpf/pethospital/service/impl/StockOutServiceImpl.class +com/gpf/pethospital/entity/Report.class +com/gpf/pethospital/service/impl/MessageServiceImpl.class +com/gpf/pethospital/service/MessageService.class +com/gpf/pethospital/controller/DrugController.class +com/gpf/pethospital/entity/Visit.class +com/gpf/pethospital/mapper/PetMapper.class +com/gpf/pethospital/controller/StockOutController.class +com/gpf/pethospital/service/impl/VisitServiceImpl.class +com/gpf/pethospital/config/MybatisPlusConfig.class +com/gpf/pethospital/PetHospitalApplication.class +com/gpf/pethospital/controller/ReportController.class +com/gpf/pethospital/mapper/VaccineRecordMapper.class +com/gpf/pethospital/common/ApiResponse.class +com/gpf/pethospital/controller/MedicalRecordController.class +com/gpf/pethospital/controller/PrescriptionItemController.class +com/gpf/pethospital/security/JwtAuthenticationFilter.class +com/gpf/pethospital/service/impl/ReportServiceImpl.class +com/gpf/pethospital/service/impl/AppointmentServiceImpl.class +com/gpf/pethospital/controller/AppointmentController.class +com/gpf/pethospital/service/UserService.class +com/gpf/pethospital/entity/Message.class +com/gpf/pethospital/mapper/AppointmentMapper.class +com/gpf/pethospital/service/impl/PrescriptionServiceImpl.class +com/gpf/pethospital/mapper/DrugMapper.class +com/gpf/pethospital/controller/AuthController.class +com/gpf/pethospital/service/NoticeService.class +com/gpf/pethospital/service/DrugService.class +com/gpf/pethospital/service/impl/UserServiceImpl.class +com/gpf/pethospital/service/StockOutService.class +com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.class +com/gpf/pethospital/entity/User.class +com/gpf/pethospital/mapper/StockOutMapper.class +com/gpf/pethospital/dto/ReplyRequest.class +com/gpf/pethospital/entity/Pet.class +com/gpf/pethospital/service/impl/NoticeServiceImpl.class +com/gpf/pethospital/entity/PrescriptionItem.class +com/gpf/pethospital/entity/StockOut.class +com/gpf/pethospital/service/impl/DrugServiceImpl.class +com/gpf/pethospital/service/StockInService.class +com/gpf/pethospital/service/AppointmentService.class +com/gpf/pethospital/mapper/PrescriptionMapper.class +com/gpf/pethospital/mapper/ReportMapper.class +com/gpf/pethospital/service/PrescriptionService.class +com/gpf/pethospital/mapper/OrderMapper.class +com/gpf/pethospital/controller/VisitController.class +com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.class +com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.class +com/gpf/pethospital/service/VisitService.class +com/gpf/pethospital/controller/PrescriptionController.class +com/gpf/pethospital/controller/UserController.class diff --git a/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..2a926c0 --- /dev/null +++ b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,89 @@ +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/common/ApiResponse.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/PetService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/AppointmentServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionItemController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/VaccineRecordController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/ReportController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/MessageMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/VisitMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/AuthController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Visit.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/StockOutMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/PrescriptionItemServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/VisitController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/ReportServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/MessageService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Drug.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/ReportMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/MedicalRecordController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/NoticeMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/VaccineRecord.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/MessageServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionItemMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/NoticeService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/StockOutService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/ReportService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/MessageController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/StockInController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/DrugService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/PrescriptionService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/dto/LoginRequest.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/UserService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/DrugServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/PetMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Pet.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/PetServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/config/WebConfig.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/DrugController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/UserController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Message.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/OrderController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/UserMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/StockIn.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/StockOutServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Order.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/MedicalRecordService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/MedicalRecord.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/PrescriptionItemService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/PrescriptionController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/PetHospitalApplication.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/config/MybatisPlusConfig.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Prescription.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/StockInMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/security/JwtAuthenticationFilter.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/UserServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Appointment.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/VaccineRecordServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/OrderMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/DrugMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/AppointmentService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/VisitService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/NoticeController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/NoticeServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/StockInService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/User.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Notice.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/AppointmentController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/util/SecurityUtils.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/PrescriptionMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/config/SecurityConfig.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/StockOut.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/util/JwtUtil.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/MedicalRecordMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/VaccineRecordMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/security/AuthUser.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/dto/RegisterRequest.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/PrescriptionItem.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/StockOutController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/OrderService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/mapper/AppointmentMapper.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/StockInServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/VaccineRecordService.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/OrderServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/dto/ReplyRequest.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/PetController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/VisitServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/controller/StatsController.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/service/impl/MedicalRecordServiceImpl.java +/mnt/d/bs/gpf_pet_hospital/backend/src/main/java/com/gpf/pethospital/entity/Report.java diff --git a/database_er_diagram.mmd b/database_er_diagram.mmd new file mode 100644 index 0000000..d80d147 --- /dev/null +++ b/database_er_diagram.mmd @@ -0,0 +1,107 @@ +graph TD + subgraph "用户管理模块" + User((User)) + Doctor((Doctor)) + end + + subgraph "宠物管理模块" + Pet((Pet)) + end + + subgraph "预约管理模块" + Appointment((Appointment)) + end + + subgraph "就诊管理模块" + Visit((Visit)) + end + + subgraph "处方管理模块" + Prescription((Prescription)) + PrescriptionItem((PrescriptionItem)) + end + + subgraph "药品管理模块" + Drug((Drug)) + end + + subgraph "订单管理模块" + Order((Order)) + end + + subgraph "库存管理模块" + StockIn((StockIn)) + StockOut((StockOut)) + end + + subgraph "病历管理模块" + MedicalRecord((MedicalRecord)) + end + + subgraph "消息通知模块" + Message((Message)) + Notice((Notice)) + end + + subgraph "报表管理模块" + Report((Report)) + end + + subgraph "疫苗管理模块" + VaccineRecord((VaccineRecord)) + end + + %% 用户关系 + User --> Pet : 拥有(ownerId) + User --> Appointment : 创建(customerId) + User --> Visit : 就诊(customerId) + User --> Prescription : 处方(customerId) + User --> Order : 订单(customerId) + User --> Message : 发送/接收(senderId/receiverId) + User --> Notice : 发布(publisherId) + User --> Report : 生成(generatedBy) + User --> StockIn : 入库(operatorId) + User --> StockOut : 出库(operatorId) + + %% 医生关系 + Doctor --> Appointment : 接诊(doctorId) + Doctor --> Visit : 诊治(doctorId) + Doctor --> Prescription : 开具(doctorId) + Doctor --> MedicalRecord : 记录(doctorId) + Doctor --> VaccineRecord : 注射(doctorId) + + %% 宠物关系 + Pet --> Appointment : 预约(petId) + Pet --> Visit : 就诊(petId) + Pet --> VaccineRecord : 接种(petId) + + %% 预约关系 + Appointment --> Visit : 关联(appointmentId) + + %% 就诊关系 + Visit --> Prescription : 对应(visitId) + Visit --> Order : 产生(visitId) + Visit --> MedicalRecord : 记录(visitId) + + %% 处方关系 + Prescription --> PrescriptionItem : 包含(prescriptionId) + + %% 药品关系 + Drug --> PrescriptionItem : 包含(drugId) + Drug --> StockIn : 入库(drugId) + Drug --> StockOut : 出库(drugId) + + %% 报表关系 + Report --> Appointment : 统计 + Report --> Visit : 统计 + Report --> Order : 统计 + Report --> Prescription : 统计 + + style User fill:#e1f5fe + style Doctor fill:#e8f5e8 + style Pet fill:#fff3e0 + style Appointment fill:#f3e5f5 + style Visit fill:#e0f2f1 + style Prescription fill:#ede7f6 + style Drug fill:#e0f7fa + style Order fill:#fff8e1 \ No newline at end of file diff --git a/database_schema_documentation.md b/database_schema_documentation.md new file mode 100644 index 0000000..83e47c3 --- /dev/null +++ b/database_schema_documentation.md @@ -0,0 +1,283 @@ +# 宠物医院管理系统 - 数据库表结构文档 + +## 1. 用户表 (user) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| username | VARCHAR(50) | 用户名,唯一 | +| phone | VARCHAR(20) | 手机号 | +| email | VARCHAR(100) | 邮箱 | +| password | VARCHAR(255) | 密码(加密存储) | +| role | VARCHAR(20) | 角色(ADMIN/DOCTOR/CUSTOMER) | +| status | INT | 状态(1-启用,0-禁用) | +| avatar | VARCHAR(255) | 头像URL | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记(0-未删除,1-已删除) | + +## 2. 医生表 (doctor) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| name | VARCHAR(50) | 医生姓名 | +| department | VARCHAR(50) | 所属科室 | +| title | VARCHAR(50) | 职称 | +| phone | VARCHAR(20) | 联系电话 | +| email | VARCHAR(100) | 邮箱 | +| avatar | VARCHAR(255) | 头像URL | +| status | INT | 状态(1-启用,0-禁用) | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 3. 宠物表 (pet) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| owner_id | BIGINT | 主人ID(外键关联user表) | +| name | VARCHAR(50) | 宠物名称 | +| species | VARCHAR(50) | 物种(猫/狗等) | +| breed | VARCHAR(100) | 品种 | +| gender | VARCHAR(10) | 性别(MALE/FEMALE) | +| birthday | DATE | 生日 | +| weight | DOUBLE | 体重 | +| photo | VARCHAR(255) | 照片URL | +| remark | TEXT | 备注 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 4. 预约表 (appointment) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| customer_id | BIGINT | 顾客ID(外键关联user表) | +| pet_id | BIGINT | 宠物ID(外键关联pet表) | +| doctor_id | BIGINT | 医生ID(外键关联doctor表,可空) | +| department | VARCHAR(50) | 科室 | +| appointment_date | DATE | 预约日期 | +| time_slot | VARCHAR(20) | 预约时段(如:09:00-10:00) | +| status | VARCHAR(20) | 状态(PENDING/CONFIRMED/ARRIVED/CANCELLED/NO_SHOW) | +| remark | TEXT | 备注 | +| cancel_time | TIMESTAMP | 取消时间 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 5. 就诊记录表 (visit) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| appointment_id | BIGINT | 预约ID(外键关联appointment表,可空) | +| customer_id | BIGINT | 顾客ID(外键关联user表) | +| pet_id | BIGINT | 宠物ID(外键关联pet表) | +| doctor_id | BIGINT | 医生ID(外键关联doctor表) | +| symptoms | TEXT | 症状描述 | +| diagnosis | TEXT | 诊断结果 | +| treatment_plan | TEXT | 治疗方案 | +| status | VARCHAR(20) | 状态(IN_PROGRESS/COMPLETED/CANCELLED) | +| total_amount | DECIMAL(10,2) | 总金额 | +| payment_status | VARCHAR(20) | 支付状态(UNPAID/PAID/REFUNDING/REFUNDED) | +| payment_method | VARCHAR(20) | 支付方式(OFFLINE/ALIPAY/WECHAT) | +| payment_time | TIMESTAMP | 支付时间 | +| start_time | TIMESTAMP | 开始时间 | +| end_time | TIMESTAMP | 结束时间 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 6. 处方表 (prescription) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| visit_id | BIGINT | 就诊ID(外键关联visit表) | +| doctor_id | BIGINT | 医生ID(外键关联doctor表) | +| customer_id | BIGINT | 顾客ID(外键关联user表) | +| total_amount | DECIMAL(10,2) | 总金额 | +| status | VARCHAR(20) | 状态(DRAFT/SUBMITTED/ISSUED/VOIDED) | +| remark | TEXT | 备注 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 7. 处方明细表 (prescription_item) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| prescription_id | BIGINT | 处方ID(外键关联prescription表) | +| drug_id | BIGINT | 药品ID(外键关联drug表) | +| quantity | INT | 数量 | +| dosage | VARCHAR(100) | 用量 | +| frequency | VARCHAR(50) | 频次 | +| duration | VARCHAR(50) | 疗程 | +| usage_instructions | TEXT | 用法说明 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 8. 药品表 (drug) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| name | VARCHAR(100) | 药品名称 | +| category | VARCHAR(50) | 分类 | +| manufacturer | VARCHAR(100) | 生产厂家 | +| specification | VARCHAR(100) | 规格 | +| unit_price | DECIMAL(10,2) | 单价 | +| stock_quantity | INT | 库存数量 | +| unit | VARCHAR(20) | 单位 | +| status | INT | 状态(1-启用,0-禁用) | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 9. 订单表 (order_info) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| visit_id | BIGINT | 就诊ID(外键关联visit表,可空) | +| customer_id | BIGINT | 顾客ID(外键关联user表) | +| amount | DECIMAL(10,2) | 金额 | +| status | VARCHAR(20) | 状态(UNPAID/PAID/CANCELLED/REFUNDING/REFUNDED) | +| payment_method | VARCHAR(20) | 支付方式(OFFLINE/ALIPAY/WECHAT) | +| payment_time | TIMESTAMP | 支付时间 | +| remark | TEXT | 备注 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 10. 病历表 (medical_record) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| visit_id | BIGINT | 就诊ID(外键关联visit表) | +| record_type | VARCHAR(50) | 记录类型(CHECKUP/EXAMINATION/DIAGNOSIS/TREATMENT) | +| content | TEXT | 内容 | +| attachment_urls | TEXT | 附件URL(JSON格式) | +| doctor_id | BIGINT | 医生ID(外键关联doctor表) | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 11. 消息表 (message) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| sender_id | BIGINT | 发送者ID(外键关联user表,可空) | +| receiver_id | BIGINT | 接收者ID(外键关联user表) | +| content | TEXT | 消息内容 | +| type | VARCHAR(20) | 类型(NOTICE/CHAT) | +| status | VARCHAR(20) | 状态(UNREAD/READ) | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 12. 公告表 (notice) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| title | VARCHAR(200) | 标题 | +| content | TEXT | 内容 | +| publisher_id | BIGINT | 发布者ID(外键关联user表) | +| publish_time | TIMESTAMP | 发布时间 | +| status | INT | 状态(1-发布,0-撤销) | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 13. 报表表 (report) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| report_type | VARCHAR(50) | 报表类型(REVENUE/CUSTOMER/PET/DRUG) | +| report_data | JSON | 报表数据(JSON格式) | +| period_start | DATE | 统计周期开始 | +| period_end | DATE | 统计周期结束 | +| generated_by | BIGINT | 生成者ID(外键关联user表) | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 14. 入库记录表 (stock_in) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| drug_id | BIGINT | 药品ID(外键关联drug表) | +| quantity | INT | 数量 | +| unit_price | DECIMAL(10,2) | 单价 | +| supplier | VARCHAR(100) | 供应商 | +| operator_id | BIGINT | 操作员ID(外键关联user表) | +| remark | TEXT | 备注 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 15. 出库记录表 (stock_out) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| drug_id | BIGINT | 药品ID(外键关联drug表) | +| quantity | INT | 数量 | +| unit_price | DECIMAL(10,2) | 单价 | +| purpose | VARCHAR(100) | 用途(销售/损耗等) | +| operator_id | BIGINT | 操作员ID(外键关联user表) | +| remark | TEXT | 备注 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 16. 疫苗接种记录表 (vaccine_record) + +| 字段名 | 类型 | 说明 | +|--------|------|------| +| id | BIGINT | 主键,自增长 | +| pet_id | BIGINT | 宠物ID(外键关联pet表) | +| vaccine_name | VARCHAR(100) | 疫苗名称 | +| dose_number | INT | 剂次 | +| injection_date | DATE | 接种日期 | +| next_appointment_date | DATE | 下次预约日期 | +| doctor_id | BIGINT | 医生ID(外键关联doctor表) | +| remark | TEXT | 备注 | +| create_time | TIMESTAMP | 创建时间 | +| update_time | TIMESTAMP | 更新时间 | +| deleted | INT | 删除标记 | + +## 主要业务流程关系 + +### 1. 预约流程 +Customer → Appointment → Visit → Prescription → Order + +### 2. 库存管理 +Drug ↔ StockIn/StockOut + +### 3. 病历管理 +Visit → MedicalRecord + +### 4. 疫苗管理 +Pet → VaccineRecord + +### 5. 消息通知 +User ↔ Message/Notice + +## 数据完整性约束 + +1. **外键约束**:确保所有外键引用的有效性 +2. **软删除**:使用deleted字段实现软删除,保留历史数据 +3. **时间戳**:所有表都有create_time和update_time字段 +4. **默认值**:合理设置字段默认值(如status默认为1) +5. **枚举约束**:状态字段使用预定义的枚举值 \ No newline at end of file diff --git a/frp_setup_guide.md b/frp_setup_guide.md new file mode 100644 index 0000000..5f0eb68 --- /dev/null +++ b/frp_setup_guide.md @@ -0,0 +1,144 @@ +# FRP 内网穿透工具安装指南 + +## 当前状态 +- 已安装: frps (服务器端) - 位于 `/mnt/d/bs/gpf_pet_hospital/frp/frps` +- 已安装: frpc (客户端) - 位于 `/mnt/d/bs/gpf_pet_hospital/frp/frpc` +- 版本: FRP 0.66.0 for Linux AMD64 + +## 方法一:手动下载 (推荐) + +### 1. 下载最新版本的FRP +```bash +# 进入项目目录 +cd /mnt/d/bs/gpf_pet_hospital + +# 下载最新版本的FRP +wget https://github.com/fatedier/frp/releases/download/v0.66.0/frp_0.66.0_linux_amd64.tar.gz + +# 解压 +tar -xzf frp_0.66.0_linux_amd64.tar.gz + +# 将frpc移动到frp目录 +mv frp_0.66.0_linux_amd64/frpc frp/ + +# 清理 +rm -rf frp_0.66.0_linux_amd64 frp_0.66.0_linux_amd64.tar.gz +``` + +### 2. 配置FRPC +创建配置文件 `/mnt/d/bs/gpf_pet_hospital/frp/frpc.ini`: + +```ini +[common] +server_addr = 你的公网IP或域名 +server_port = 7000 + +[web] +type = http +local_port = 5173 +custom_domains = your-domain.com + +[backend] +type = tcp +local_port = 8081 +remote_port = 8081 +``` + +## 方法二:使用Docker (如果可用) + +```bash +# 启动FRPS服务器 +docker run -d --name frps \ + -p 7000:7000 \ + -p 7500:7500 \ + -p 8080:80 \ + --restart=always \ + snowdreamtech/frps:0.50.0 + +# 启动FRPC客户端 +docker run -d --name frpc \ + --restart=always \ + -v /mnt/d/bs/gpf_pet_hospital/frp/frpc.ini:/etc/frp/frpc.ini \ + snowdreamtech/frpc:0.50.0 +``` + +## 方法三:编译安装 (如果有Go环境) + +```bash +# 安装Go (如果未安装) +# Ubuntu/Debian: sudo apt-get install golang-go + +# 克隆仓库 +git clone https://github.com/fatedier/frp.git +cd frp +git checkout v0.66.0 + +# 编译 +make frpc + +# 复制到目标位置 +cp bin/frpc /mnt/d/bs/gpf_pet_hospital/frp/ +``` + +## 用于宠物医院管理系统的典型配置 + +### FRPS 服务器配置 (frps.ini) +```ini +[common] +bind_port = 7000 +dashboard_port = 7500 +dashboard_user = admin +dashboard_pwd = admin +vhost_http_port = 80 +vhost_https_port = 443 +token = your_token_here +``` + +### FRPC 客户端配置 (frpc.ini) +```ini +[common] +server_addr = 你的公网服务器IP +server_port = 7000 +token = your_token_here + +[pet-hospital-frontend] +type = http +local_port = 5173 +custom_domains = hospital.yourdomain.com + +[pet-hospital-backend] +type = tcp +local_port = 8081 +remote_port = 8081 + +[pet-hospital-admin] +type = http +local_port = 5173 +custom_domains = admin.yourdomain.com +``` + +## 启动服务 + +### 启动FRPS服务器 (在公网服务器) +```bash +cd /mnt/d/bs/gpf_pet_hospital/frp +./frps -c frps.ini +``` + +### 启动FRPC客户端 (在本地机器) +```bash +cd /mnt/d/bs/gpf_pet_hospital/frp +./frpc -c frpc.ini +``` + +## 注意事项 +1. 确保防火墙开放相应端口 (7000, 80, 443等) +2. 在生产环境中使用强密码和密钥 +3. 定期更新FRP版本以获得安全补丁 +4. 监控FRP服务的运行状态 + +## 故障排除 +- 检查网络连接 +- 确认端口未被占用 +- 查看FRP日志文件 +- 验证配置文件语法 \ No newline at end of file diff --git a/simple_er_diagram.txt b/simple_er_diagram.txt new file mode 100644 index 0000000..7da863e --- /dev/null +++ b/simple_er_diagram.txt @@ -0,0 +1,142 @@ +============================================================ + 宠物医院管理系统 - 实体关系图 +============================================================ + +┌─────────────┐ ┌─────────────┐ +│ User │◄────────┤ Pet │ +│─────────────│ │─────────────│ +│ id (PK) │ │ id (PK) │ +│ username │ │ owner_id (FK)│ +│ phone │ │ name │ +│ email │ │ species │ +│ password │ │ breed │ +│ role │ │ gender │ +│ status │ │ birthday │ +│ ... │ │ ... │ +└─────────────┘ └─────────────┘ + │ │ + │ │ + │ 1 │ 1..* + │ │ + ▼ ▼ +┌─────────────┐ ┌─────────────┐ +│ Appointment │◄────────┤ Visit │ +│─────────────│ │─────────────│ +│ id (PK) │ │ id (PK) │ +│ customer_id │ │ appointment │ +│ pet_id (FK) │ │ _id (FK) │ +│ doctor_id │ │ customer_id │ +│ date │ │ pet_id (FK) │ +│ time_slot │ │ doctor_id │ +│ status │ │ symptoms │ +│ ... │ │ diagnosis │ +└─────────────┘ │ ... │ + └─────────────┘ + │ + │ + │ 1 + │ + ▼ +┌─────────────┐ ┌─────────────┐ +│ Doctor │ │Prescription │ +│─────────────│ │─────────────│ +│ id (PK) │◄────────┤ id (PK) │ +│ name │ │ visit_id (FK)│ +│ department │ │ doctor_id │ +│ title │ │ customer_id │ +│ ... │ │ total_amount│ +└─────────────┘ │ status │ + │ ... │ + └─────────────┘ + │ + │ 1 + │ + ▼ + ┌─────────────┐ + │Prescription │ + │ Item │ + │─────────────│ + │ id (PK) │ + │ prescr_id │ + │ (FK) │ + │ drug_id (FK)│ + │ quantity │ + │ ... │ + └─────────────┘ + │ + │ + │ 1 + │ + ▼ + ┌─────────────┐ + │ Drug │ + │─────────────│ + │ id (PK) │ + │ name │ + │ category │ + │ price │ + │ stock_qty │ + │ ... │ + └─────────────┘ + │ + ┌──────────┼──────────┐ + │ │ │ + ▼ ▼ ▼ + ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ + │ Stock In │ │ Stock Out │ │ Order │ + │─────────────│ │─────────────│ │─────────────│ + │ drug_id (FK)│ │ drug_id (FK)│ │ visit_id │ + │ quantity │ │ quantity │ │ (FK) │ + │ ... │ │ ... │ │ amount │ + └─────────────┘ └─────────────┘ │ status │ + │ ... │ + └─────────────┘ + +============================================================ + 关系说明 +============================================================ + +1. User (1) ───── (0..*) Pet + - 一个用户可以拥有零个或多个宠物 + +2. User (1) ───── (0..*) Appointment + - 一个用户可以创建零个或多个预约 + +3. Pet (1) ───── (0..*) Appointment + - 一个宠物可以有零个或多个预约 + +4. Doctor (1) ──── (0..*) Appointment + - 一个医生可以接收零个或多个预约 + +5. Appointment (0..1) ──── (0..1) Visit + - 一个预约最多对应一个就诊记录 + +6. Visit (1) ───── (0..*) Prescription + - 一个就诊可以开具零个或多个处方 + +7. Prescription (1) ──── (1..*) PrescriptionItem + - 一个处方包含一个或多个处方明细 + +8. Drug (1) ───── (0..*) PrescriptionItem + - 一种药品可以在零个或多个处方中出现 + +9. Visit (1) ───── (0..*) Order + - 一次就诊可以产生零个或多个订单 + +10. Drug (1) ───── (0..*) StockIn/StockOut + - 一种药品可以有零个或多个出入库记录 + +============================================================ + 业务流程 +============================================================ + +顾客 (User) → 预约 (Appointment) → 就诊 (Visit) → +处方 (Prescription) → 订单 (Order) → 支付 + +医生 (User) → 诊断 (Visit) → 开具处方 (Prescription) → +用药指导 (PrescriptionItem) + +药品 (Drug) ←→ 库存管理 (StockIn/StockOut) → +成本控制 (Order) + +============================================================ \ No newline at end of file diff --git a/start_frp.sh b/start_frp.sh new file mode 100644 index 0000000..cbcf30d --- /dev/null +++ b/start_frp.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# 宠物医院管理系统 - FRP内网穿透启动脚本 + +echo "===========================================" +echo " 宠物医院管理系统 - FRP内网穿透启动脚本" +echo "===========================================" + +# 检查frpc是否存在 +if [ ! -f "./frp/frpc" ]; then + echo "错误: 未找到frpc客户端程序" + echo "请先按照frp_setup_guide.md中的说明下载并安装frpc" + echo "" + echo "快速安装命令:" + echo "cd /mnt/d/bs/gpf_pet_hospital" + echo "wget https://github.com/fatedier/frp/releases/download/v0.66.0/frp_0.66.0_linux_amd64.tar.gz" + echo "tar -xzf frp_0.66.0_linux_amd64.tar.gz" + echo "mv frp_0.66.0_linux_amd64/frpc frp/" + echo "rm -rf frp_0.66.0_linux_amd64 frp_0.66.0_linux_amd64.tar.gz" + exit 1 +fi + +# 检查配置文件是否存在 +if [ ! -f "./frp/frpc.ini" ]; then + echo "错误: 未找到frpc配置文件" + echo "请确保 ./frp/frpc.ini 存在" + exit 1 +fi + +echo "检查本地服务状态..." +# 检查前端服务 +if netstat -tuln | grep -q ":5173 "; then + echo "✓ 前端服务 (Vue) 正在运行" +else + echo "✗ 前端服务 (Vue) 未检测到,请确保已启动: npx vite --host 0.0.0.0 --port 5173" +fi + +# 检查后端服务 +if netstat -tuln | grep -q ":8081 "; then + echo "✓ 后端服务 (Spring Boot) 正在运行" +else + echo "✗ 后端服务 (Spring Boot) 未检测到,请确保已启动: cd backend && mvn spring-boot:run" +fi + +echo "" +echo "启动FRP客户端..." +echo "注意: 请确保FRP服务器端已在公网服务器上启动" + +# 启动frpc +cd ./frp +chmod +x frpc +./frpc -c frpc.ini & + +FRP_PID=$! +echo "FRP客户端已启动 (PID: $FRP_PID)" + +echo "" +echo "===========================================" +echo " FRP内网穿透已启动" +echo "===========================================" +echo "服务映射:" +echo " 本地:5173 -> 公网:HTTP (通过域名访问)" +echo " 本地:8081 -> 公网:8081 (TCP)" +echo "" +echo "要停止FRP客户端,请运行: kill $FRP_PID" +echo "===========================================" + +# 显示FRP进程 +ps aux | grep frpc | grep -v grep \ No newline at end of file