perf(修改): 使用Redis登录、修改Redis存入和未找到用户提示
This commit is contained in:
parent
1354d10622
commit
46c5eade72
|
@ -7,9 +7,8 @@
|
||||||
<option value="$PROJECT_DIR$/pom.xml" />
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
<option name="workspaceImportForciblyTurnedOn" value="true" />
|
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -0,0 +1,168 @@
|
||||||
|
20:07:50:028 INFO 4012 --- [main] com.sky.SkyApplication : Starting SkyApplication using Java 17.0.9 on bunny with PID 4012 (G:\File\Java\sky\dev-sky-serve-redis\sky-server\target\classes started by 13199 in G:\File\Java\sky\dev-sky-serve-redis)
|
||||||
|
20:07:50:028 INFO 4012 --- [main] com.sky.SkyApplication : The following 1 profile is active: "dev"
|
||||||
|
20:07:50:397 INFO 4012 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
|
||||||
|
20:07:50:398 INFO 4012 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||||
|
20:07:50:413 INFO 4012 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 Redis repository interfaces.
|
||||||
|
20:07:50:728 INFO 4012 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
|
||||||
|
20:07:50:732 INFO 4012 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
|
||||||
|
20:07:50:732 INFO 4012 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65]
|
||||||
|
20:07:50:786 INFO 4012 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
|
||||||
|
20:07:50:787 INFO 4012 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 738 ms
|
||||||
|
20:07:50:842 INFO 4012 --- [main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
|
||||||
|
20:07:50:892 INFO 4012 --- [main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
|
||||||
|
20:07:51:289 INFO 4012 --- [main] c.s.c.config.RestTemplateConfiguration : 注入restTemplate
|
||||||
|
20:07:51:370 INFO 4012 --- [main] c.sky.common.config.WebMvcConfiguration : 开始注册自定义拦截器...
|
||||||
|
20:07:51:415 INFO 4012 --- [main] c.s.common.config.Knife4jConfiguration : A管理端接口
|
||||||
|
20:07:51:417 INFO 4012 --- [main] c.s.common.config.Knife4jConfiguration : B用户端接口
|
||||||
|
20:07:51:418 INFO 4012 --- [main] c.s.common.config.Knife4jConfiguration : Pay支付接口
|
||||||
|
20:07:51:438 INFO 4012 --- [main] c.sky.common.config.WebMvcConfiguration : 扩展消息转换器...
|
||||||
|
20:07:51:441 INFO 4012 --- [main] c.s.common.config.ResourceConfiguration : 设置静态资源映射
|
||||||
|
20:07:51:482 INFO 4012 --- [main] c.s.c.config.WebSocketConfiguration : WebSocket配置类,用于注册WebSocket的Bean
|
||||||
|
20:07:51:647 INFO 4012 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
|
||||||
|
20:07:51:909 INFO 4012 --- [main] com.sky.SkyApplication : Started SkyApplication in 2.064 seconds (JVM running for 4.815)
|
||||||
|
20:08:00:005 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:08:00.005316300
|
||||||
|
20:08:00:217 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:08:00:228 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:53:00.006335900(LocalDateTime)
|
||||||
|
20:08:00:257 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:09:00:011 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:09:00.011285800
|
||||||
|
20:09:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:09:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:54:00.011285800(LocalDateTime)
|
||||||
|
20:09:00:030 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:10:00:012 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:10:00.012449100
|
||||||
|
20:10:00:012 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:10:00:012 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:55:00.012449100(LocalDateTime)
|
||||||
|
20:10:00:031 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:11:00:011 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:11:00.011231700
|
||||||
|
20:11:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:11:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:56:00.011231700(LocalDateTime)
|
||||||
|
20:11:00:029 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:12:00:007 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:12:00.007093300
|
||||||
|
20:12:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:12:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:57:00.007093300(LocalDateTime)
|
||||||
|
20:12:00:025 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:13:00:005 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:13:00.005966400
|
||||||
|
20:13:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:13:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:58:00.005966400(LocalDateTime)
|
||||||
|
20:13:00:024 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:14:00:015 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:14:00.015365500
|
||||||
|
20:14:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:14:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T19:59:00.015365500(LocalDateTime)
|
||||||
|
20:14:00:034 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:15:00:008 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:15:00.008461900
|
||||||
|
20:15:00:008 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:15:00:008 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:00:00.008461900(LocalDateTime)
|
||||||
|
20:15:00:027 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:16:00:009 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:16:00.009138
|
||||||
|
20:16:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:16:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:01:00.009138(LocalDateTime)
|
||||||
|
20:16:00:028 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:17:00:009 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:17:00.009477200
|
||||||
|
20:17:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:17:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:02:00.009477200(LocalDateTime)
|
||||||
|
20:17:00:028 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:18:00:010 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:18:00.010387100
|
||||||
|
20:18:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:18:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:03:00.010387100(LocalDateTime)
|
||||||
|
20:18:00:029 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:19:00:009 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:19:00.009303
|
||||||
|
20:19:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:19:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:04:00.009303(LocalDateTime)
|
||||||
|
20:19:00:028 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:20:00:010 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:20:00.010432700
|
||||||
|
20:20:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:20:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:05:00.010432700(LocalDateTime)
|
||||||
|
20:20:00:029 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:21:00:007 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:21:00.007943700
|
||||||
|
20:21:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:21:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:06:00.007943700(LocalDateTime)
|
||||||
|
20:21:00:026 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:22:00:010 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:22:00.010535
|
||||||
|
20:22:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:22:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:07:00.010535(LocalDateTime)
|
||||||
|
20:22:00:029 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:23:00:009 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:23:00.009473500
|
||||||
|
20:23:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:23:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:08:00.009473500(LocalDateTime)
|
||||||
|
20:23:00:030 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:24:00:013 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:24:00.013380300
|
||||||
|
20:24:00:013 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:24:00:013 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:09:00.013380300(LocalDateTime)
|
||||||
|
20:24:00:032 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:25:00:011 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:25:00.011129600
|
||||||
|
20:25:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:25:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:10:00.011129600(LocalDateTime)
|
||||||
|
20:25:00:031 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:26:00:009 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:26:00.009704600
|
||||||
|
20:26:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:26:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:11:00.009704600(LocalDateTime)
|
||||||
|
20:26:00:028 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:27:00:007 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:27:00.007626700
|
||||||
|
20:27:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:27:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:12:00.007626700(LocalDateTime)
|
||||||
|
20:27:00:025 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:28:00:011 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:28:00.011912600
|
||||||
|
20:28:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:28:00:011 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:13:00.011912600(LocalDateTime)
|
||||||
|
20:28:00:031 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:29:00:010 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:29:00.010434600
|
||||||
|
20:29:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:29:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:14:00.010434600(LocalDateTime)
|
||||||
|
20:29:00:028 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:30:00:009 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:30:00.009411800
|
||||||
|
20:30:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:30:00:009 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:15:00.009411800(LocalDateTime)
|
||||||
|
20:30:00:028 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:31:00:007 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:31:00.007487200
|
||||||
|
20:31:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:31:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:16:00.007487200(LocalDateTime)
|
||||||
|
20:31:00:026 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:32:00:006 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:32:00.006591100
|
||||||
|
20:32:00:006 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:32:00:007 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:17:00.006591100(LocalDateTime)
|
||||||
|
20:32:00:027 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:33:00:010 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:33:00.010864700
|
||||||
|
20:33:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:33:00:010 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:18:00.010864700(LocalDateTime)
|
||||||
|
20:33:00:029 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:34:00:005 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:34:00.005313700
|
||||||
|
20:34:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:34:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:19:00.005313700(LocalDateTime)
|
||||||
|
20:34:00:024 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:35:00:015 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:35:00.015687700
|
||||||
|
20:35:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:35:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:20:00.015687700(LocalDateTime)
|
||||||
|
20:35:00:034 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:36:00:003 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:36:00.003420100
|
||||||
|
20:36:00:003 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:36:00:003 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:21:00.003420100(LocalDateTime)
|
||||||
|
20:36:00:022 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:37:00:008 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:37:00.008997600
|
||||||
|
20:37:00:008 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:37:00:008 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:22:00.008997600(LocalDateTime)
|
||||||
|
20:37:00:027 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:38:00:015 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:38:00.015576700
|
||||||
|
20:38:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:38:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:23:00.015576700(LocalDateTime)
|
||||||
|
20:38:00:033 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:39:00:001 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:39:00.001910700
|
||||||
|
20:39:00:001 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:39:00:001 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:24:00.001910700(LocalDateTime)
|
||||||
|
20:39:00:019 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:40:00:013 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:40:00.013081700
|
||||||
|
20:40:00:013 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:40:00:013 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:25:00.013081700(LocalDateTime)
|
||||||
|
20:40:00:048 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:41:00:005 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:41:00.005481400
|
||||||
|
20:41:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:41:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:26:00.005481400(LocalDateTime)
|
||||||
|
20:41:00:024 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:42:00:015 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:42:00.015343500
|
||||||
|
20:42:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:42:00:015 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:27:00.015343500(LocalDateTime)
|
||||||
|
20:42:00:034 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:43:00:005 INFO 4012 --- [scheduling-1] com.sky.task.OrderTask : 定时处理超时订单:2024-03-18T20:43:00.005726200
|
||||||
|
20:43:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Preparing: select * from orders where status = ? and order_time < ?;
|
||||||
|
20:43:00:005 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : ==> Parameters: 1(Integer), 2024-03-18T20:28:00.005726200(LocalDateTime)
|
||||||
|
20:43:00:024 DEBUG 4012 --- [scheduling-1] c.s.m.O.getByStatusAndOrderTime : <== Total: 0
|
||||||
|
20:43:27:844 INFO 4012 --- [SpringApplicationShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closing ...
|
||||||
|
20:43:27:847 INFO 4012 --- [SpringApplicationShutdownHook] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed
|
5
pom.xml
5
pom.xml
|
@ -17,12 +17,11 @@
|
||||||
<module>sky-common</module>
|
<module>sky-common</module>
|
||||||
<module>sky-pojo</module>
|
<module>sky-pojo</module>
|
||||||
<module>sky-server</module>
|
<module>sky-server</module>
|
||||||
<module>sky-server</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<mybatis.spring>2.2.0</mybatis.spring>
|
<mybatis.spring>2.2.0</mybatis.spring>
|
||||||
<lombok>1.18.20</lombok>
|
<lombok>1.18.20</lombok>
|
||||||
<fastjson>1.2.76</fastjson>
|
<fastjson>1.2.76</fastjson>
|
||||||
|
|
|
@ -35,8 +35,8 @@ public class RedisConfiguration {
|
||||||
* 使用StringRedisSerializer序列化为字符串
|
* 使用StringRedisSerializer序列化为字符串
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public RedisTemplate redisTemplate(LettuceConnectionFactory connectionFactory) {
|
public RedisTemplate<String, Object> redisTemplate(LettuceConnectionFactory connectionFactory) {
|
||||||
RedisTemplate redisTemplate = new RedisTemplate();
|
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||||
redisTemplate.setConnectionFactory(connectionFactory);
|
redisTemplate.setConnectionFactory(connectionFactory);
|
||||||
// 设置key序列化为string
|
// 设置key序列化为string
|
||||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.sky.common.config;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class ResourceConfiguration extends WebMvcConfiguration {
|
||||||
|
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
log.info("设置静态资源映射");
|
||||||
|
registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||||
|
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,14 @@
|
||||||
package com.sky.common.config;
|
package com.sky.common.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.sky.common.interceptor.JwtTokenUserInterceptor;
|
import com.sky.common.interceptor.JwtTokenUserInterceptor;
|
||||||
import com.sky.common.interceptor.RedisTokenAdminInterceptor;
|
import com.sky.common.interceptor.RedisTokenAdminInterceptor;
|
||||||
|
import com.sky.common.json.JacksonObjectMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.converter.HttpMessageConverter;
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -46,14 +45,8 @@ public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
||||||
// 创建一个消息转换器对象
|
// 创建一个消息转换器对象
|
||||||
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
||||||
// 需要为消息转换器设置一个对象转换器,对象转换器可以将Java对象序列化为json数据
|
// 需要为消息转换器设置一个对象转换器,对象转换器可以将Java对象序列化为json数据
|
||||||
converter.setObjectMapper(new ObjectMapper());
|
converter.setObjectMapper(new JacksonObjectMapper());
|
||||||
// 将自己的消息转化器加入容器中
|
// 将自己的消息转化器加入容器中
|
||||||
converters.add(0, converter);
|
converters.add(0, converter);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
||||||
log.info("设置静态资源映射");
|
|
||||||
registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
|
||||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ public class MessageConstant {
|
||||||
public static final String ACCOUNT_LOCKED = "账号被锁定";
|
public static final String ACCOUNT_LOCKED = "账号被锁定";
|
||||||
public static final String UNKNOWN_ERROR = "未知错误";
|
public static final String UNKNOWN_ERROR = "未知错误";
|
||||||
public static final String USER_NOT_LOGIN = "用户未登录";
|
public static final String USER_NOT_LOGIN = "用户未登录";
|
||||||
|
public static final String USER_TOKEN_OUT_OF_DATE = "用户登录过期";
|
||||||
public static final String CATEGORY_BE_RELATED_BY_SETMEAL = "当前分类关联了套餐,不能删除";
|
public static final String CATEGORY_BE_RELATED_BY_SETMEAL = "当前分类关联了套餐,不能删除";
|
||||||
public static final String CATEGORY_BE_RELATED_BY_DISH = "当前分类关联了菜品,不能删除";
|
public static final String CATEGORY_BE_RELATED_BY_DISH = "当前分类关联了菜品,不能删除";
|
||||||
public static final String SHOPPING_CART_IS_NULL = "购物车数据为空,不能下单";
|
public static final String SHOPPING_CART_IS_NULL = "购物车数据为空,不能下单";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.sky.common.interceptor;
|
package com.sky.common.interceptor;
|
||||||
|
|
||||||
|
import com.sky.common.constant.MessageConstant;
|
||||||
import com.sky.common.context.BaseContext;
|
import com.sky.common.context.BaseContext;
|
||||||
import com.sky.common.properties.RedisTokenProperties;
|
import com.sky.common.properties.RedisTokenProperties;
|
||||||
import com.sky.common.utils.InterceptorUtil;
|
import com.sky.common.utils.InterceptorUtil;
|
||||||
|
@ -11,7 +12,6 @@ import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.HandlerInterceptor;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
import javax.security.auth.login.LoginException;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -24,7 +24,7 @@ public class RedisTokenAdminInterceptor implements HandlerInterceptor {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisTemplate<String, Object> redisTemplate;
|
private RedisTemplate<String, Object> redisTemplate;
|
||||||
|
|
||||||
public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, @NotNull Object handler) throws IOException, LoginException {
|
public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, @NotNull Object handler) throws IOException {
|
||||||
// 判断当前兰街道的是Controller的方法还是其它资源 拦截到的不是动态方法,直接放行
|
// 判断当前兰街道的是Controller的方法还是其它资源 拦截到的不是动态方法,直接放行
|
||||||
if (!(handler instanceof HandlerMethod)) return true;
|
if (!(handler instanceof HandlerMethod)) return true;
|
||||||
|
|
||||||
|
@ -37,12 +37,17 @@ public class RedisTokenAdminInterceptor implements HandlerInterceptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Long empId = (Long) redisTemplate.opsForValue().get(token);
|
Object empId = redisTemplate.opsForValue().get(token);
|
||||||
log.info("当前员工ID:{}", empId);
|
log.info("当前员工ID:{}", empId);
|
||||||
|
if (empId == null) {
|
||||||
|
InterceptorUtil.customLoginInterceptor(response, MessageConstant.USER_TOKEN_OUT_OF_DATE, "");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// 3. 通过放行
|
// 3. 通过放行
|
||||||
BaseContext.setUserId(empId);
|
BaseContext.setUserId(Long.valueOf(empId.toString()));
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
InterceptorUtil.customLoginInterceptor(response, exception.getMessage(), "");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.sky.common.utils;
|
package com.sky.common.utils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.sky.common.constant.MessageConstant;
|
||||||
import com.sky.common.result.Result;
|
import com.sky.common.result.Result;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ -16,26 +17,24 @@ public class InterceptorUtil {
|
||||||
*/
|
*/
|
||||||
public static void unLoginInterceptor(HttpServletResponse response) throws IOException {
|
public static void unLoginInterceptor(HttpServletResponse response) throws IOException {
|
||||||
log.info("用户未登录");
|
log.info("用户未登录");
|
||||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
customLoginInterceptor(response, MessageConstant.USER_NOT_LOGIN, "");
|
||||||
response.setContentType("application/json");
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
Result<String> result = new Result<>();
|
|
||||||
result.setCode(HttpServletResponse.SC_UNAUTHORIZED);
|
|
||||||
result.setData("未登录");
|
|
||||||
result.setMessage("请先登录");
|
|
||||||
// 将消息写入响应体
|
|
||||||
response.getWriter().write(JSON.toJSONString(result));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void otherLoginInterceptor(HttpServletResponse response) throws IOException {
|
/**
|
||||||
log.info("其它异常");
|
* 构建用户登录失败
|
||||||
|
*
|
||||||
|
* @param response HttpServletResponse
|
||||||
|
* @param message 消息
|
||||||
|
* @param data 内容
|
||||||
|
*/
|
||||||
|
public static void customLoginInterceptor(HttpServletResponse response, String message, String data) throws IOException {
|
||||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||||
response.setContentType("application/json");
|
response.setContentType("application/json");
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
||||||
Result<String> result = new Result<>();
|
Result<String> result = new Result<>();
|
||||||
result.setCode(HttpServletResponse.SC_UNAUTHORIZED);
|
result.setCode(HttpServletResponse.SC_UNAUTHORIZED);
|
||||||
result.setData("未登录");
|
result.setData(data);
|
||||||
result.setMessage("请先登录");
|
result.setMessage(message);
|
||||||
// 将消息写入响应体
|
// 将消息写入响应体
|
||||||
response.getWriter().write(JSON.toJSONString(result));
|
response.getWriter().write(JSON.toJSONString(result));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
<artifactId>sky-server</artifactId>
|
<artifactId>sky-server</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -132,21 +130,4 @@
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>15</source>
|
|
||||||
<target>15</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
|
@ -4,19 +4,19 @@ import com.sky.common.constant.MessageConstant;
|
||||||
import com.sky.common.result.Result;
|
import com.sky.common.result.Result;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@RestController("adminShopController")
|
@RestController("adminShopController")
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RequestMapping("/admin/shop")
|
@RequestMapping("/admin/shop")
|
||||||
@Api(tags = "店铺相关接口")
|
@Api(tags = "店铺相关接口")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ShopController {
|
public class ShopController {
|
||||||
public static final String KEY = "SHOP_STATUS";
|
public static final String KEY = "SHOP_STATUS";
|
||||||
private final RedisTemplate<Object, Object> redisTemplate;
|
@Autowired
|
||||||
|
private RedisTemplate<String, Object> redisTemplate;
|
||||||
|
|
||||||
@PutMapping("/{status}")
|
@PutMapping("/{status}")
|
||||||
@ApiOperation("设置店铺的营业状态")
|
@ApiOperation("设置店铺的营业状态")
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(tags = "C端-菜品浏览接口")
|
@Api(tags = "C端-菜品浏览接口")
|
||||||
public class DishController {
|
public class DishController {
|
||||||
private final RedisTemplate<Object, Object> redisTemplate;
|
private final RedisTemplate redisTemplate;
|
||||||
DishService dishService;
|
DishService dishService;
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
|
@ -33,7 +33,8 @@ public class DishController {
|
||||||
// 构造redis中的key,规则dish_分类id
|
// 构造redis中的key,规则dish_分类id
|
||||||
String key = "dish_" + categoryId;
|
String key = "dish_" + categoryId;
|
||||||
// 查询redis中是否存在菜品数据
|
// 查询redis中是否存在菜品数据
|
||||||
List<DishVO> list = (List<DishVO>) redisTemplate.opsForValue().get(key);
|
String object = redisTemplate.opsForValue().get(key) + "";
|
||||||
|
List<DishVO> list = JSON.parseArray(object, DishVO.class);
|
||||||
// 如果存在返回,无需查询数据库
|
// 如果存在返回,无需查询数据库
|
||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
|
|
|
@ -28,13 +28,14 @@ import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class EmployeeServiceImpl implements EmployeeService {
|
public class EmployeeServiceImpl implements EmployeeService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmployeeMapper employeeMapper;
|
private EmployeeMapper employeeMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisTemplate<Object, Long> redisTemplate;
|
private RedisTemplate<String, Object> redisTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工登录
|
* 员工登录
|
||||||
|
@ -45,7 +46,7 @@ public class EmployeeServiceImpl implements EmployeeService {
|
||||||
public EmployeeLoginVO login(EmployeeLoginDTO employeeLoginDTO) {
|
public EmployeeLoginVO login(EmployeeLoginDTO employeeLoginDTO) {
|
||||||
String username = employeeLoginDTO.getUsername();
|
String username = employeeLoginDTO.getUsername();
|
||||||
String password = employeeLoginDTO.getPassword();
|
String password = employeeLoginDTO.getPassword();
|
||||||
|
String token = UUID.randomUUID().toString();
|
||||||
// 1、根据用户名查询数据库中的数据
|
// 1、根据用户名查询数据库中的数据
|
||||||
Employee employee = employeeMapper.getByUsername(username);
|
Employee employee = employeeMapper.getByUsername(username);
|
||||||
|
|
||||||
|
@ -54,7 +55,6 @@ public class EmployeeServiceImpl implements EmployeeService {
|
||||||
// 账号不存在
|
// 账号不存在
|
||||||
throw new AccountNotFoundException(MessageConstant.ACCOUNT_NOT_FOUND);
|
throw new AccountNotFoundException(MessageConstant.ACCOUNT_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 密码比对
|
// 密码比对
|
||||||
// 后期需要进行md5加密,然后再进行比对
|
// 后期需要进行md5加密,然后再进行比对
|
||||||
password = DigestUtils.md5DigestAsHex(password.getBytes());
|
password = DigestUtils.md5DigestAsHex(password.getBytes());
|
||||||
|
@ -62,16 +62,13 @@ public class EmployeeServiceImpl implements EmployeeService {
|
||||||
// 密码错误
|
// 密码错误
|
||||||
throw new PasswordErrorException(MessageConstant.PASSWORD_ERROR);
|
throw new PasswordErrorException(MessageConstant.PASSWORD_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 账号被锁定
|
// 账号被锁定
|
||||||
if (Objects.equals(employee.getStatus(), StatusConstant.DISABLE)) {
|
if (Objects.equals(employee.getStatus(), StatusConstant.DISABLE)) {
|
||||||
throw new AccountLockedException(MessageConstant.ACCOUNT_LOCKED);
|
throw new AccountLockedException(MessageConstant.ACCOUNT_LOCKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 生成token,使用userId存入登录信息
|
// 使用userId存入登录信息
|
||||||
String token = UUID.randomUUID().toString();
|
redisTemplate.opsForValue().set(token, employee.getId(), 7, TimeUnit.DAYS);
|
||||||
String userId = employee.getId().toString();
|
|
||||||
redisTemplate.opsForValue().set(token, Long.valueOf(userId));
|
|
||||||
// 3、返回实体对象
|
// 3、返回实体对象
|
||||||
return EmployeeLoginVO.builder()
|
return EmployeeLoginVO.builder()
|
||||||
.id(employee.getId())
|
.id(employee.getId())
|
||||||
|
|
|
@ -2,6 +2,8 @@ server:
|
||||||
port: 8080
|
port: 8080
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
application:
|
||||||
|
name: dev-sky-serve-redis
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
# mvc:
|
# mvc:
|
||||||
|
@ -35,6 +37,10 @@ logging:
|
||||||
mapper: debug
|
mapper: debug
|
||||||
service: info
|
service: info
|
||||||
controller: info
|
controller: info
|
||||||
|
pattern:
|
||||||
|
dateformat: HH:mm:ss:SSS
|
||||||
|
file:
|
||||||
|
path: "logs/${spring.application.name}"
|
||||||
|
|
||||||
sky:
|
sky:
|
||||||
redisToken:
|
redisToken:
|
||||||
|
|
Loading…
Reference in New Issue