diff --git a/face/logs/teh.log b/face/logs/teh.log index e5f0232..57255db 100644 --- a/face/logs/teh.log +++ b/face/logs/teh.log @@ -1,45 +1,54 @@ -{"@timestamp":"2024-10-16T08:19:50.298664400Z","log.level":"INFO","process.pid":22936,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 22936 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:19:50.312664900Z","log.level":"INFO","process.pid":22936,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:19:51.978499800Z","log.level":"INFO","process.pid":22936,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.113 seconds (process running for 3.187)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:36:08.490006Z","log.level":"INFO","process.pid":21192,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 21192 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:36:08.495127200Z","log.level":"INFO","process.pid":21192,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:36:10.152771300Z","log.level":"INFO","process.pid":21192,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.142 seconds (process running for 3.162)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:51:34.169354200Z","log.level":"INFO","process.pid":21680,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 21680 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:51:34.176895Z","log.level":"INFO","process.pid":21680,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T08:51:35.803573100Z","log.level":"INFO","process.pid":21680,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.098 seconds (process running for 3.121)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:00:34.009199400Z","log.level":"INFO","process.pid":19236,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 19236 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:00:34.018196900Z","log.level":"INFO","process.pid":19236,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:00:35.757171600Z","log.level":"INFO","process.pid":19236,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.222 seconds (process running for 3.305)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:12:59.217794600Z","log.level":"INFO","process.pid":19048,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 19048 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:12:59.226801600Z","log.level":"INFO","process.pid":19048,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:13:00.848360500Z","log.level":"INFO","process.pid":19048,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.141 seconds (process running for 3.288)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:28:29.545567700Z","log.level":"INFO","process.pid":6392,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 6392 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:28:29.551565700Z","log.level":"INFO","process.pid":6392,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:28:31.212379500Z","log.level":"INFO","process.pid":6392,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.11 seconds (process running for 3.286)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:35:44.627998200Z","log.level":"INFO","process.pid":22096,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 22096 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:35:44.633768700Z","log.level":"INFO","process.pid":22096,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:35:46.519486Z","log.level":"INFO","process.pid":22096,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.323 seconds (process running for 3.517)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:47:44.789767100Z","log.level":"INFO","process.pid":18288,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 18288 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:47:44.800769500Z","log.level":"INFO","process.pid":18288,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T09:47:46.571588500Z","log.level":"INFO","process.pid":18288,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.253 seconds (process running for 3.297)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T10:40:27.202561600Z","log.level":"INFO","process.pid":19860,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 19860 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T10:40:27.211564500Z","log.level":"INFO","process.pid":19860,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T10:40:29.057472100Z","log.level":"INFO","process.pid":19860,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.362 seconds (process running for 3.454)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T11:26:03.516908900Z","log.level":"INFO","process.pid":10500,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 10500 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T11:26:03.522740200Z","log.level":"INFO","process.pid":10500,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T11:26:05.232217400Z","log.level":"INFO","process.pid":10500,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.164 seconds (process running for 3.238)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T11:51:51.806918300Z","log.level":"INFO","process.pid":22676,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 22676 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T11:51:51.812494100Z","log.level":"INFO","process.pid":22676,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T11:51:53.664451Z","log.level":"INFO","process.pid":22676,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.322 seconds (process running for 3.401)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:00:46.366691600Z","log.level":"INFO","process.pid":19280,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 19280 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:00:46.375652400Z","log.level":"INFO","process.pid":19280,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:00:48.312538100Z","log.level":"INFO","process.pid":19280,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.434 seconds (process running for 3.71)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:26:42.224225600Z","log.level":"INFO","process.pid":22704,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 22704 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:26:42.232225100Z","log.level":"INFO","process.pid":22704,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:26:44.059990300Z","log.level":"INFO","process.pid":22704,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.344 seconds (process running for 3.455)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:47:39.395017900Z","log.level":"INFO","process.pid":20920,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 20920 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:47:39.405018700Z","log.level":"INFO","process.pid":20920,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T12:47:41.156694200Z","log.level":"INFO","process.pid":20920,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.235 seconds (process running for 3.366)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T13:51:56.918722400Z","log.level":"INFO","process.pid":21056,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 21056 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T13:51:56.928945Z","log.level":"INFO","process.pid":21056,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} -{"@timestamp":"2024-10-16T13:51:58.766500Z","log.level":"INFO","process.pid":21056,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.295 seconds (process running for 3.414)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:16:46.079309500Z","log.level":"INFO","process.pid":24296,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 24296 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:16:46.095064500Z","log.level":"INFO","process.pid":24296,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:16:48.100768Z","log.level":"INFO","process.pid":24296,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.472 seconds (process running for 3.708)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:23:17.232261800Z","log.level":"INFO","process.pid":22552,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 22552 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:23:17.241804600Z","log.level":"INFO","process.pid":22552,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:23:19.245705100Z","log.level":"INFO","process.pid":22552,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.487 seconds (process running for 3.573)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:24:54.040883Z","log.level":"INFO","process.pid":22820,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 22820 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:24:54.049883800Z","log.level":"INFO","process.pid":22820,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:24:55.785223400Z","log.level":"INFO","process.pid":22820,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.175 seconds (process running for 3.348)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:27:38.324585800Z","log.level":"INFO","process.pid":14936,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 14936 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:27:38.331601700Z","log.level":"INFO","process.pid":14936,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:27:39.959435200Z","log.level":"INFO","process.pid":14936,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.056 seconds (process running for 3.197)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:29:41.171170700Z","log.level":"INFO","process.pid":24428,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 24428 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:29:41.185144600Z","log.level":"INFO","process.pid":24428,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:29:43.101572Z","log.level":"INFO","process.pid":24428,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.44 seconds (process running for 3.641)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:37:45.231688200Z","log.level":"INFO","process.pid":20796,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 20796 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:37:45.241253300Z","log.level":"INFO","process.pid":20796,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:37:47.130034600Z","log.level":"INFO","process.pid":20796,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.401 seconds (process running for 3.54)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:46:16.639952800Z","log.level":"INFO","process.pid":3112,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 3112 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:46:16.646668300Z","log.level":"INFO","process.pid":3112,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:46:18.478662500Z","log.level":"INFO","process.pid":3112,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.318 seconds (process running for 3.426)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:49:57.548313200Z","log.level":"INFO","process.pid":2688,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 2688 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:49:57.553365Z","log.level":"INFO","process.pid":2688,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:49:59.314861100Z","log.level":"INFO","process.pid":2688,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.196 seconds (process running for 3.339)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:53:14.621045400Z","log.level":"INFO","process.pid":11700,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 11700 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:53:14.628042300Z","log.level":"INFO","process.pid":11700,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T10:53:16.288819300Z","log.level":"INFO","process.pid":11700,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.122 seconds (process running for 3.288)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:15:36.217426Z","log.level":"INFO","process.pid":24292,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 24292 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:15:36.223457100Z","log.level":"INFO","process.pid":24292,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:15:38.093703900Z","log.level":"INFO","process.pid":24292,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.338 seconds (process running for 3.64)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:18:44.330707900Z","log.level":"INFO","process.pid":19940,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 19940 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:18:44.335751200Z","log.level":"INFO","process.pid":19940,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:18:46.201905900Z","log.level":"INFO","process.pid":19940,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.361 seconds (process running for 3.457)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:24:01.555947800Z","log.level":"INFO","process.pid":25132,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 25132 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:24:01.561978Z","log.level":"INFO","process.pid":25132,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:24:03.331856200Z","log.level":"INFO","process.pid":25132,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.201 seconds (process running for 3.372)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:25:53.499215500Z","log.level":"INFO","process.pid":7500,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 7500 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:25:53.506194700Z","log.level":"INFO","process.pid":7500,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:25:55.229347800Z","log.level":"INFO","process.pid":7500,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.17 seconds (process running for 3.249)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:37:05.138747500Z","log.level":"INFO","process.pid":8564,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 8564 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:37:05.142751600Z","log.level":"INFO","process.pid":8564,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:37:06.798824Z","log.level":"INFO","process.pid":8564,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.127 seconds (process running for 3.224)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:57:48.016430900Z","log.level":"INFO","process.pid":6544,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 6544 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:57:48.025399700Z","log.level":"INFO","process.pid":6544,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T11:57:49.794494700Z","log.level":"INFO","process.pid":6544,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.253 seconds (process running for 3.358)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:01:35.344508100Z","log.level":"INFO","process.pid":19712,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 19712 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:01:35.351512800Z","log.level":"INFO","process.pid":19712,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:01:37.452723400Z","log.level":"INFO","process.pid":19712,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.633 seconds (process running for 4.064)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:38:18.522022200Z","log.level":"INFO","process.pid":12104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 12104 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:38:18.531028500Z","log.level":"INFO","process.pid":12104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:38:20.392866200Z","log.level":"INFO","process.pid":12104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.353 seconds (process running for 3.458)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:58:33.374123Z","log.level":"INFO","process.pid":1008,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Starting FaceApplicationTests using Java 17.0.7 with PID 1008 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\face)","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:58:33.380123900Z","log.level":"INFO","process.pid":1008,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} +{"@timestamp":"2024-10-18T12:58:35.283274400Z","log.level":"INFO","process.pid":1008,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.face.FaceApplicationTests","message":"Started FaceApplicationTests in 2.376 seconds (process running for 3.481)","ecs.version":"8.11"} diff --git a/face/logs/teh.log.2024-10-16.0.gz b/face/logs/teh.log.2024-10-16.0.gz new file mode 100644 index 0000000..5966bcf Binary files /dev/null and b/face/logs/teh.log.2024-10-16.0.gz differ diff --git a/face/logs/teh.log.2024-10-17.0.gz b/face/logs/teh.log.2024-10-17.0.gz new file mode 100644 index 0000000..7ba777a Binary files /dev/null and b/face/logs/teh.log.2024-10-17.0.gz differ diff --git a/face/pom.xml b/face/pom.xml index a06e5b5..6c6e8c4 100644 --- a/face/pom.xml +++ b/face/pom.xml @@ -45,6 +45,10 @@ org.springframework.boot spring-boot-starter-thymeleaf + org.springframework.boot spring-boot-starter-web diff --git a/face/src/main/java/gsp/technologies/face/controllers/face/v1/mainframe/MainframeController.java b/face/src/main/java/gsp/technologies/face/controllers/api/v1/ApiController.java similarity index 76% rename from face/src/main/java/gsp/technologies/face/controllers/face/v1/mainframe/MainframeController.java rename to face/src/main/java/gsp/technologies/face/controllers/api/v1/ApiController.java index c70205b..1048052 100644 --- a/face/src/main/java/gsp/technologies/face/controllers/face/v1/mainframe/MainframeController.java +++ b/face/src/main/java/gsp/technologies/face/controllers/api/v1/ApiController.java @@ -1,4 +1,4 @@ -package gsp.technologies.face.controllers.face.v1.mainframe; +package gsp.technologies.face.controllers.api.v1; import java.net.URI; import java.time.Duration; @@ -13,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -26,45 +27,22 @@ import gsp.technologies.face.models.FileMetadata; import gsp.technologies.face.models.Post; import gsp.technologies.face.teh.fs.Filer; import gsp.technologies.face.teh.fs.MpFile; +import jakarta.servlet.http.HttpServletRequest; import reactor.core.publisher.Mono; +/** + * Контроллер для работы с API + * обработка запросов к http api: + * - загрузка файла на сервер + */ @Controller -@RequestMapping(path = "/face/v1") -public class MainframeController { - private static final Logger log = LoggerFactory.getLogger(MainframeController.class); +@RequestMapping(path = "/api/v1") +public class ApiController { + private static final Logger log = LoggerFactory.getLogger(ApiController.class); @Autowired private WebClient client; - // @Autowired - // private Storage storage; - - @GetMapping("/mainframe") - public String mainframe(Model model) { - log.info("GET /face/v1/mainframe"); - - //передаем страницу с перечнем постов в модель - model.addAttribute("postsPage", client.get() - .uri("http://source:8181/api/v1/storage/post/page?number=0&size=10&sortBy=id") - .retrieve() - .bodyToMono(Post.class) - .block()); - - - //передаем перечень постов в модель - model.addAttribute("posts", client.get() - .uri("http://source:8181/api/v1/storage/post/list") - .retrieve() - .bodyToFlux(Post.class) - .collectList() - .block()); - - //добавляем объект Post хранения сведений о новом документе в представлении и последующей отправки на сервер - model.addAttribute("newPost", new Post()); - - return "mainframe"; - } - /** * Загрузка файла на сервер, * @@ -75,16 +53,24 @@ public class MainframeController { * @param file * @return */ - @PostMapping("/document/upload") - public String upload(@RequestParam("file") MultipartFile file, Model model, @ModelAttribute("post") Post post) { - log.info("POST /face/v1/document/upload, file: {}, type: {}", file.getOriginalFilename(), post.getType()); + @PostMapping("/upload") + public String upload(@RequestParam("file") MultipartFile file, + Model model, + @ModelAttribute("post") Post post, + HttpServletRequest request) { + log.info("POST /face/v1/storage/upload, file: {}, type: {}", file.getOriginalFilename(), post.getType()); //подготавливаем объект метаданных FileMetadata metadata = new FileMetadata(); - metadata.setName(file.getOriginalFilename()); + + //запоминаем оригинальное наименование файла + String name = file.getOriginalFilename(); + metadata.setName(name); metadata.setExtension(Filer.extension(file.getOriginalFilename())); metadata.setSize(file.getSize()); + + // получаем объект метаданных с id try { metadata = client.post() @@ -131,6 +117,8 @@ public class MainframeController { .build(); URI uri = uriComponents.toUri(); + metadata.setName(name); + metadata = client.put() .uri(uri) .body(Mono.just(metadata), FileMetadata.class) @@ -167,6 +155,28 @@ public class MainframeController { log.info("Пост создан: {}", post); //переход на страницу импорта данных из документа - return "redirect:/face/v1/mainframe"; + String referer = request.getHeader("Referer"); + return "redirect:"+ referer; } + + @GetMapping("/delete{id}") + public String delete(@PathVariable Long id, + HttpServletRequest request) { + //удаление поста + //удаление метаданных + //удаление файла + client.delete() + .uri("http://source:8181/api/v1/storage/post/delete/" + id) + .retrieve() + .bodyToMono(new ParameterizedTypeReference (){}) + .block(); + + //переход на исходную страницу + String referer = request.getHeader("Referer"); + return "redirect:"+ referer; + } + + + + } diff --git a/face/src/main/java/gsp/technologies/face/controllers/face/v1/MainframeController.java b/face/src/main/java/gsp/technologies/face/controllers/face/v1/MainframeController.java new file mode 100644 index 0000000..8a535b7 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/controllers/face/v1/MainframeController.java @@ -0,0 +1,100 @@ +package gsp.technologies.face.controllers.face.v1; + +import java.net.URI; +import java.time.Duration; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; + +import gsp.technologies.face.models.Content; +import gsp.technologies.face.models.ContentPage; +import gsp.technologies.face.models.ContentRequest; +import gsp.technologies.face.models.Post; +import gsp.technologies.face.teh.pagination.Page; + + +@Controller +@RequestMapping(path = "/face/v1/mainframe") +public class MainframeController { + private static final Logger log = LoggerFactory.getLogger(MainframeController.class); + + @Autowired + private WebClient client; + + // @Autowired + // private Storage storage; + + @GetMapping("") + public String mainframe(Model model, @RequestParam(name = "postContentPage", required = false) ContentPage postContentPage) { + log.info("GET /face/v1/mainframe"); + + if (postContentPage == null) { + //подготовка параметров запроса + ContentRequest req = new ContentRequest(); + req.setPageNumber(0); + req.setPageSize(5); + req.setSortBy("id"); + + //подготовка URI + UriComponents uriComponents = UriComponentsBuilder + .fromUri(URI.create("http://source:8181/api/v1/storage/post/page/distinct")) + .queryParam("number", req.getPageNumber()) + .queryParam("size", req.getPageSize()) + .queryParam("sortBy", req.getSortBy()) + .encode() + .build(); + //получаем страницу со списком документов + Page page = client.get() + .uri(uriComponents.toUri()) + .retrieve() + .bodyToMono(new ParameterizedTypeReference>() {}) + .timeout(Duration.ofSeconds(1)) + .block(); + Content content = new Content(page.getContent()); + postContentPage = content.page(page); + postContentPage.setSortBy("id"); + } else { + //подготовка параметров запроса + ContentRequest req = new ContentRequest(); + req.setPageNumber(postContentPage.getPageNumber()); + req.setPageSize(postContentPage.getPageSize()); + req.setSortBy(postContentPage.getSortBy()); + + //подготовка URI + UriComponents uriComponents = UriComponentsBuilder + .fromUri(URI.create("http://source:8181/api/v1/storage/post/page/distinct")) + .queryParam("number", req.getPageNumber()) + .queryParam("size", req.getPageSize()) + .queryParam("sortBy", req.getSortBy()) + .encode() + .build(); + //получаем страницу со списком документов + Page page = client.get() + .uri(uriComponents.toUri()) + .retrieve() + .bodyToMono(new ParameterizedTypeReference>() {}) + .timeout(Duration.ofSeconds(1)) + .block(); + Content content = new Content(page.getContent()); + postContentPage = content.page(page); + postContentPage.setSortBy(req.getSortBy()); + } + //добавляем контент со списком документов + model.addAttribute("postContentPage", postContentPage); + + //добавляем объект Post хранения сведений о новом документе в представлении и последующей отправки на сервер + model.addAttribute("newPost", new Post()); + + return "mainframe"; + } +} diff --git a/face/src/main/java/gsp/technologies/face/controllers/face/v1/StorageController.java b/face/src/main/java/gsp/technologies/face/controllers/face/v1/StorageController.java new file mode 100644 index 0000000..0afdf26 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/controllers/face/v1/StorageController.java @@ -0,0 +1,99 @@ +package gsp.technologies.face.controllers.face.v1; + +import java.net.URI; +import java.time.Duration; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; + +import gsp.technologies.face.models.Content; +import gsp.technologies.face.models.ContentPage; +import gsp.technologies.face.models.ContentRequest; +import gsp.technologies.face.models.Post; +import gsp.technologies.face.teh.pagination.Page; + +@Controller +@RequestMapping(path = "/face/v1/storage") +public class StorageController { + private static final Logger log = LoggerFactory.getLogger(StorageController.class); + + @Autowired + private WebClient client; + + @GetMapping("") + public String storage(Model model, + @RequestParam(name = "postContentPage", required = false) ContentPage postContentPage) { + log.info("GET /face/v1/storage"); + + if (postContentPage == null) { + //подготовка параметров запроса + ContentRequest req = new ContentRequest(); + req.setPageNumber(0); + req.setPageSize(30); + req.setSortBy("id"); + + //подготовка URI + UriComponents uriComponents = UriComponentsBuilder + .fromUri(URI.create("http://source:8181/api/v1/storage/post/page/distinct")) + .queryParam("number", req.getPageNumber()) + .queryParam("size", req.getPageSize()) + .queryParam("sortBy", req.getSortBy()) + .encode() + .build(); + //получаем страницу со списком документов + Page page = client.get() + .uri(uriComponents.toUri()) + .retrieve() + .bodyToMono(new ParameterizedTypeReference>() {}) + .timeout(Duration.ofSeconds(1)) + .block(); + Content content = new Content(page.getContent()); + postContentPage = content.page(page); + postContentPage.setSortBy("id"); + } else { + //подготовка параметров запроса + ContentRequest req = new ContentRequest(); + req.setPageNumber(postContentPage.getPageNumber()); + req.setPageSize(postContentPage.getPageSize()); + req.setSortBy(postContentPage.getSortBy()); + + //подготовка URI + UriComponents uriComponents = UriComponentsBuilder + .fromUri(URI.create("http://source:8181/api/v1/storage/post/page/distinct")) + .queryParam("number", req.getPageNumber()) + .queryParam("size", req.getPageSize()) + .queryParam("sortBy", req.getSortBy()) + .encode() + .build(); + //получаем страницу со списком документов + Page page = client.get() + .uri(uriComponents.toUri()) + .retrieve() + .bodyToMono(new ParameterizedTypeReference>() {}) + .timeout(Duration.ofSeconds(1)) + .block(); + Content content = new Content(page.getContent()); + postContentPage = content.page(page); + postContentPage.setSortBy(req.getSortBy()); + } + //добавляем контент со списком документов + model.addAttribute("postContentPage", postContentPage); + + //добавляем объект Post хранения сведений о новом документе в представлении и последующей отправки на сервер + model.addAttribute("newPost", new Post()); + + return "storage"; + } + + +} diff --git a/face/src/main/java/gsp/technologies/face/models/Content.java b/face/src/main/java/gsp/technologies/face/models/Content.java new file mode 100644 index 0000000..90ef5cd --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/models/Content.java @@ -0,0 +1,92 @@ +package gsp.technologies.face.models; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import gsp.technologies.face.teh.pagination.Page; + +public class Content { + private List content; + private static final Logger log = LoggerFactory.getLogger(Content.class); + + public Content(List content) { + this.content = content; + } + + public ContentPage page(int pageSize, int pageNumber, String sortBy) { + log.info("Создание объекта Page, pageSize: {}, pageNumber: {}, sortBy: {}", pageSize, pageNumber, sortBy); + ContentPage out = null; + out = ContentPage.builder() + .pageSize(pageSize) + .pageNumber(pageNumber) + .sortBy(sortBy) + .content(content()) + .totalLines(totalLines()) + .totalPages(totalPages(pageSize)) + .first(isFirst(pageSize, pageNumber)) + .last(isLast(pageSize, pageNumber)) + .hasNext(hasNext(pageSize, pageNumber)) + .hasPrevious(hasPrevious(pageSize, pageNumber)) + .build(); + return out; + } + + public ContentPage page(Page page) { + ContentPage out = null; + out = ContentPage.builder() + .pageSize(page.getSize()) + .pageNumber(page.getNumber()) + .sortBy("") + .content(page.getContent()) + .totalLines(page.getTotalElements()) + .totalPages(page.getTotalPages()) + .first(page.isFirst()) + .last(page.isLast()) + .hasNext(hasNext(page.getSize(), page.getNumber())) + .hasPrevious(hasPrevious(page.getSize(), page.getNumber())) + .build(); + return out; + } + + public List content() { + return this.content; + } + + public int totalLines() { + return this.content.size(); + } + + public int totalPages(int pageSize) { + return (int) Math.ceil((double) totalLines() / pageSize); + } + + public boolean isFirst(int pageSize, int pageNumber) { + if (pageNumber == 0) { + return true; + } + return false; + } + + public boolean hasNext(int pageSize, int pageNumber) { + if (pageNumber < totalPages(pageSize)) { + return true; + } + return false; + } + + public boolean isLast(int pageSize, int pageNumber) { + if (pageNumber == totalPages(pageSize) - 1) { + return true; + } + return false; + } + + public boolean hasPrevious(int pageSize, int pageNumber) { + if (pageNumber > 0) { + return true; + } + return false; + } +} diff --git a/face/src/main/java/gsp/technologies/face/models/ContentPage.java b/face/src/main/java/gsp/technologies/face/models/ContentPage.java new file mode 100644 index 0000000..ec62842 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/models/ContentPage.java @@ -0,0 +1,114 @@ +package gsp.technologies.face.models; + +import java.io.Serializable; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ContentPage implements Serializable { + private List content;//содержимое страницы + //информация о странице + private int pageSize;//размер страницы, количество строк на странице + private int pageNumber;//номер текущей страницы + private String sortBy;//сортировка по полю + + //сведения о положении страницы среди общей выборки страниц + private boolean last;//последняя страница + private boolean first;//первая страница + private boolean hasNext;//есть ли следующая страница + private boolean hasPrevious;//есть ли предыдущая страница + + //общая информация о списке + private long totalLines;//общее количество строк + private int totalPages;//общее количество страниц + + public ContentPage(ContentPageBuilder builder) { + this.content = builder.content; + this.pageSize = builder.pageSize; + this.pageNumber = builder.pageNumber; + this.sortBy = builder.sortBy; + this.last = builder.last; + this.first = builder.first; + this.hasNext = builder.hasNext; + this.hasPrevious = builder.hasPrevious; + this.totalLines = builder.totalLines; + this.totalPages = builder.totalPages; + } + + public static ContentPageBuilder builder() { + return new ContentPageBuilder(); + } + + public static class ContentPageBuilder { + private List content; + private int pageSize; + private int pageNumber; + private String sortBy; + private boolean last; + private boolean first; + private boolean hasNext; + private boolean hasPrevious; + private long totalLines; + private int totalPages; + + public ContentPageBuilder(){} + + public ContentPageBuilder content(List content2) { + this.content = content2; + return this; + } + + public ContentPageBuilder pageSize(int pageSize) { + this.pageSize = pageSize; + return this; + } + + public ContentPageBuilder pageNumber(int pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + public ContentPageBuilder sortBy(String sortBy) { + this.sortBy = sortBy; + return this; + } + + public ContentPageBuilder last(boolean last) { + this.last = last; + return this; + } + + public ContentPageBuilder first(boolean first) { + this.first = first; + return this; + } + + public ContentPageBuilder hasNext(boolean hasNext) { + this.hasNext = hasNext; + return this; + } + + public ContentPageBuilder hasPrevious(boolean hasPrevious) { + this.hasPrevious = hasPrevious; + return this; + } + + public ContentPageBuilder totalLines(long totalLines) { + this.totalLines = totalLines; + return this; + } + + public ContentPageBuilder totalPages(int totalPages) { + this.totalPages = totalPages; + return this; + } + + public ContentPage build() { + return new ContentPage(this); + } + } +} diff --git a/face/src/main/java/gsp/technologies/face/models/ContentRequest.java b/face/src/main/java/gsp/technologies/face/models/ContentRequest.java new file mode 100644 index 0000000..fd214c3 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/models/ContentRequest.java @@ -0,0 +1,14 @@ +package gsp.technologies.face.models; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +@Data +public class ContentRequest { + int pageNumber; + int pageSize; + String sortBy; +} diff --git a/face/src/main/java/gsp/technologies/face/teh/pagination/Page.java b/face/src/main/java/gsp/technologies/face/teh/pagination/Page.java new file mode 100644 index 0000000..a97f938 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/teh/pagination/Page.java @@ -0,0 +1,26 @@ +package gsp.technologies.face.teh.pagination; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +@Data +public class Page { + List content; + Pageable pageable; + + int totalPages; + int totalElements; + boolean last; + int size; + int number; + Sort sort; + int numberOfElements; + boolean first; + boolean empty; +} + diff --git a/face/src/main/java/gsp/technologies/face/teh/pagination/Pageable.java b/face/src/main/java/gsp/technologies/face/teh/pagination/Pageable.java new file mode 100644 index 0000000..b8e11d0 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/teh/pagination/Pageable.java @@ -0,0 +1,17 @@ +package gsp.technologies.face.teh.pagination; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +@Data +public class Pageable { + private int pageNumber; + private int pageSize; + private Sort sort; + private int offset; + private Boolean unpaged; + private Boolean paged; +} diff --git a/face/src/main/java/gsp/technologies/face/teh/pagination/Sort.java b/face/src/main/java/gsp/technologies/face/teh/pagination/Sort.java new file mode 100644 index 0000000..efcae91 --- /dev/null +++ b/face/src/main/java/gsp/technologies/face/teh/pagination/Sort.java @@ -0,0 +1,14 @@ +package gsp.technologies.face.teh.pagination; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +@Data +public class Sort { + private Boolean empty; + private Boolean unsorted; + private Boolean sorted; +} diff --git a/face/src/main/resources/templates/fragments/common/footer.html b/face/src/main/resources/templates/fragments/common/footer.html index 51062d3..454db40 100644 --- a/face/src/main/resources/templates/fragments/common/footer.html +++ b/face/src/main/resources/templates/fragments/common/footer.html @@ -3,11 +3,11 @@

- © 2024 ООО "ГСП-Технологии" + © 2024 ООО "ГСП-Технологии" : gsp.technologies.teh.services { face, storage, sources, base, logger }

- +
\ No newline at end of file diff --git a/face/src/main/resources/templates/fragments/storage.html b/face/src/main/resources/templates/fragments/storage.html index 0cd1b84..07e553f 100644 --- a/face/src/main/resources/templates/fragments/storage.html +++ b/face/src/main/resources/templates/fragments/storage.html @@ -6,9 +6,8 @@ отправляет данные о виде документа и файл -->
-

Добавление пакетов:

-
+
+
- -
+
+

Параметры страницы:

+
    +
  • pageSize:
  • +
  • pageNumber:
  • +
  • totalPages:
  • +
  • totalLines:
  • +
  • hasPrevious:
  • +
  • hasNext:
  • +
  • first:
  • +
  • last:
  • +

-

Перечень документов:

-
-

-
-
+ +

-

Перечень документов:

-
-

-
+

Последние добавленные документы:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
post.idpost.typemetadata.namemetadata.createdDate-viewgetcheck
+
+ +
+
viewgetcheck
\ No newline at end of file diff --git a/face/src/main/resources/templates/mainframe.html b/face/src/main/resources/templates/mainframe.html index 8a14d4d..f0ebb94 100644 --- a/face/src/main/resources/templates/mainframe.html +++ b/face/src/main/resources/templates/mainframe.html @@ -11,6 +11,25 @@ xmlns:th="http://www.thymeleaf.org"> teh-mainframe +
@@ -21,7 +40,7 @@ xmlns:th="http://www.thymeleaf.org">

Хранилище данных

- +
@@ -86,60 +105,15 @@ xmlns:th="http://www.thymeleaf.org">

-

Импорт данных в базу

- +

+ Импорт данных в базу +

+
- -
- - -
- -

Последние загруженные документы: COUNT

- + +