diff --git a/logs/food-hub-service/log_error.log b/logs/food-hub-service/log_error.log new file mode 100644 index 0000000..e69de29 diff --git a/logs/food-hub-service/log_info.log b/logs/food-hub-service/log_info.log new file mode 100644 index 0000000..f85f69a --- /dev/null +++ b/logs/food-hub-service/log_info.log @@ -0,0 +1,57 @@ +2025-07-31 22:25:37 |INFO |background-preinit |Version.java:21 |org.hibernate.validator.internal.util.Version |HV000001: Hibernate Validator 8.0.2.Final +2025-07-31 22:25:37 |INFO |main |StartupInfoLogger.java:53 |com.cxx.food.FoodHubServiceApplicationTests |Starting FoodHubServiceApplicationTests v0.0.1 using Java 17.0.15 with PID 29876 (started by Administrator in D:\Projects\GithubProjects\food-hub-service) +2025-07-31 22:25:37 |INFO |main |SpringApplication.java:658 |com.cxx.food.FoodHubServiceApplicationTests |The following 1 profile is active: "prod" +2025-07-31 22:25:39 |INFO |main |MybatisPlusApplicationContextAware.java:40 |com.baomidou.mybatisplus.extension.spring.MybatisPlusApplicationContextAware |Register ApplicationContext instances org.springframework.web.context.support.GenericWebApplicationContext@16a9a4f1 +2025-07-31 22:25:39 |INFO |main |StdSchedulerFactory.java:1222 |org.quartz.impl.StdSchedulerFactory |Using default implementation for ThreadExecutor +2025-07-31 22:25:39 |INFO |main |SchedulerSignalerImpl.java:62 |org.quartz.core.SchedulerSignalerImpl |Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl +2025-07-31 22:25:39 |INFO |main |QuartzScheduler.java:224 |org.quartz.core.QuartzScheduler |Quartz Scheduler v2.5.0 created. +2025-07-31 22:25:39 |INFO |main |RAMJobStore.java:152 |org.quartz.simpl.RAMJobStore |RAMJobStore initialized. +2025-07-31 22:25:39 |INFO |main |QuartzScheduler.java:289 |org.quartz.core.QuartzScheduler |Scheduler meta-data: Quartz Scheduler (v2.5.0) 'quartzScheduler' with instanceId 'NON_CLUSTERED' + Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. + NOT STARTED. + Currently in standby mode. + Number of jobs executed: 0 + Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads. + Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered. + +2025-07-31 22:25:39 |INFO |main |StdSchedulerFactory.java:1376 |org.quartz.impl.StdSchedulerFactory |Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance. +2025-07-31 22:25:39 |INFO |main |StdSchedulerFactory.java:1378 |org.quartz.impl.StdSchedulerFactory |Quartz scheduler version: 2.5.0 +2025-07-31 22:25:39 |INFO |main |QuartzScheduler.java:2240 |org.quartz.core.QuartzScheduler |JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@560d6d2 +2025-07-31 22:25:39 |INFO |main |EndpointLinksResolver.java:60 |org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver |Exposing 1 endpoint beneath base path '/actuator' +2025-07-31 22:25:39 |INFO |main |SchedulerFactoryBean.java:730 |org.springframework.scheduling.quartz.SchedulerFactoryBean |Starting Quartz Scheduler now +2025-07-31 22:25:39 |INFO |main |QuartzScheduler.java:541 |org.quartz.core.QuartzScheduler |Scheduler quartzScheduler_$_NON_CLUSTERED started. +2025-07-31 22:25:39 |INFO |main |StartupInfoLogger.java:59 |com.cxx.food.FoodHubServiceApplicationTests |Started FoodHubServiceApplicationTests in 2.023 seconds (process running for 2.671) +2025-07-31 22:25:40 |INFO |SpringApplicationShutdownHook |QuartzScheduler.java:576 |org.quartz.core.QuartzScheduler |Scheduler quartzScheduler_$_NON_CLUSTERED paused. +2025-07-31 22:25:40 |INFO |SpringApplicationShutdownHook |SchedulerFactoryBean.java:845 |org.springframework.scheduling.quartz.SchedulerFactoryBean |Shutting down Quartz Scheduler +2025-07-31 22:25:40 |INFO |SpringApplicationShutdownHook |QuartzScheduler.java:656 |org.quartz.core.QuartzScheduler |Scheduler quartzScheduler_$_NON_CLUSTERED shutting down. +2025-07-31 22:25:40 |INFO |SpringApplicationShutdownHook |QuartzScheduler.java:576 |org.quartz.core.QuartzScheduler |Scheduler quartzScheduler_$_NON_CLUSTERED paused. +2025-07-31 22:25:40 |INFO |SpringApplicationShutdownHook |QuartzScheduler.java:728 |org.quartz.core.QuartzScheduler |Scheduler quartzScheduler_$_NON_CLUSTERED shutdown complete. +2025-07-31 22:25:42 |INFO |background-preinit |Version.java:21 |org.hibernate.validator.internal.util.Version |HV000001: Hibernate Validator 8.0.2.Final +2025-07-31 22:25:42 |INFO |main |StartupInfoLogger.java:53 |com.cxx.food.FoodHubServiceApplication |Starting FoodHubServiceApplication v0.0.1 using Java 17.0.15 with PID 14260 (D:\Projects\GithubProjects\food-hub-service\target\classes started by Administrator in D:\Projects\GithubProjects\food-hub-service) +2025-07-31 22:25:42 |INFO |main |SpringApplication.java:658 |com.cxx.food.FoodHubServiceApplication |The following 1 profile is active: "prod" +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.dao.FoodDao +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/FoodDao.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.dao.MomentDao +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/MomentDao.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.CommentRecordMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/CommentRecordMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.FavouriteRecordMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/FavouriteRecordMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.FileRecordMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/FileRecordMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.LikeRecordMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/LikeRecordMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.MaterialMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/MaterialMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.MomentImageMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/MomentImageMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.MomentMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/MomentMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.RecipeMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/RecipeMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.RecordMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/RecordMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.StepMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/StepMapper.xml +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:204 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper interface: com.cxx.food.mapper.UserMapper +2025-07-31 22:25:43 |INFO |main |MyBatisNativeConfiguration.java:210 |com.cxx.autoconfigure.data.MyBatisNativeConfiguration$MyBatisBeanFactoryInitializationAotProcessor |Registering MyBatis mapper xml: mapper/UserMapper.xml diff --git a/logs/food-hub-service/log_warn.log b/logs/food-hub-service/log_warn.log new file mode 100644 index 0000000..2c2b63e --- /dev/null +++ b/logs/food-hub-service/log_warn.log @@ -0,0 +1 @@ +2025-07-31 22:25:39 |WARN |main |DefaultSqlInjector.java:56 |com.baomidou.mybatisplus.core.injector.DefaultSqlInjector |class com.cxx.food.entity.MomentImage ,Not found @TableId annotation, Cannot use Mybatis-Plus 'xxById' Method. diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9c560d5..cc9b1df 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -6,7 +6,7 @@ spring: name: @project.artifactId@ version: @project.version@ profiles: - active: dev + active: prod # mybatis plus mapper路径 mybatis-plus: diff --git a/src/main/resources/mapper/FoodMapper.xml b/src/main/resources/mapper/FoodMapper.xml index 386a9ce..c8d4860 100644 --- a/src/main/resources/mapper/FoodMapper.xml +++ b/src/main/resources/mapper/FoodMapper.xml @@ -162,7 +162,7 @@ a.name AS name, a.category AS category, a.recommend_rate AS recommendRate, - a.remark AS remake, + a.remark AS remark, a.is_share AS isShare, b.id AS userId, b.username AS username, @@ -245,10 +245,10 @@ SELECT a.id AS id, - a.name AS name, - a.category AS category, - a.recommend_rate AS recommendRate, - a.is_share AS isShare, - u.id AS userId, - u.username AS username, - u.avatar AS avatar, - b.person AS person, - b.date AS date, - b.image_url AS imageUrl, - COALESCE(c.like_count, 0) AS likeCount, - COALESCE(d.comment_count, 0) AS commentCount, - COALESCE(e.favourite_count, 0) AS favouriteCount + a.name AS name, + a.category AS category, + a.recommend_rate AS recommendRate, + a.is_share AS isShare, + u.id AS userId, + u.username AS username, + u.avatar AS avatar, + b.person AS person, + b.date AS date, + b.image_url AS imageUrl, + COALESCE(c.like_count, 0) AS likeCount, + COALESCE(d.comment_count, 0) AS commentCount, + COALESCE(e.favourite_count, 0) AS favouriteCount FROM recipe a LEFT JOIN record b ON a.id = b.food_id LEFT JOIN user u ON a.create_by = u.id LEFT JOIN ( - SELECT subject_id, COUNT(id) AS like_count - FROM like_record - WHERE type = 'recipe' - GROUP BY subject_id + SELECT subject_id, COUNT(id) AS like_count + FROM like_record + WHERE type = 'recipe' + GROUP BY subject_id ) c ON a.id = c.subject_id LEFT JOIN ( - SELECT subject_id, COUNT(id) AS comment_count - FROM comment_record - WHERE type = 'recipe' - GROUP BY subject_id + SELECT subject_id, COUNT(id) AS comment_count + FROM comment_record + WHERE type = 'recipe' + GROUP BY subject_id ) d ON a.id = d.subject_id LEFT JOIN (SELECT subject_id, COUNT(id) AS favourite_count - FROM favourite_record - WHERE type = 'recipe' - GROUP BY subject_id + FROM favourite_record + WHERE type = 'recipe' + GROUP BY subject_id ) e ON a.id = e.subject_id