Browse Source

face.storage-frag in action

master
esoe 1 month ago
parent
commit
993dfac89d
  1. 99
      face/logs/teh.log
  2. BIN
      face/logs/teh.log.2024-10-16.0.gz
  3. BIN
      face/logs/teh.log.2024-10-17.0.gz
  4. 4
      face/pom.xml
  5. 86
      face/src/main/java/gsp/technologies/face/controllers/api/v1/ApiController.java
  6. 100
      face/src/main/java/gsp/technologies/face/controllers/face/v1/MainframeController.java
  7. 99
      face/src/main/java/gsp/technologies/face/controllers/face/v1/StorageController.java
  8. 92
      face/src/main/java/gsp/technologies/face/models/Content.java
  9. 114
      face/src/main/java/gsp/technologies/face/models/ContentPage.java
  10. 14
      face/src/main/java/gsp/technologies/face/models/ContentRequest.java
  11. 26
      face/src/main/java/gsp/technologies/face/teh/pagination/Page.java
  12. 17
      face/src/main/java/gsp/technologies/face/teh/pagination/Pageable.java
  13. 14
      face/src/main/java/gsp/technologies/face/teh/pagination/Sort.java
  14. 2
      face/src/main/resources/templates/fragments/common/footer.html
  15. 63
      face/src/main/resources/templates/fragments/storage.html
  16. 78
      face/src/main/resources/templates/mainframe.html
  17. 60
      face/src/main/resources/templates/storage.html
  18. 12
      source/src/main/java/gsp/technologies/source/controllers/api/v1/StorageController.java
  19. 8
      source/src/main/java/gsp/technologies/source/repositories/PostRepository.java
  20. 32
      storage/logs/teh.log
  21. BIN
      storage/logs/teh.log.2024-10-09.0.gz
  22. BIN
      storage/logs/teh.log.2024-10-16.0.gz
  23. 2
      storage/src/main/java/gsp/technologies/storage/controllers/face/FaceController.java
  24. 2
      storage/src/main/java/gsp/technologies/storage/services/FileService.java

99
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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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"}

BIN
face/logs/teh.log.2024-10-16.0.gz

Binary file not shown.

BIN
face/logs/teh.log.2024-10-17.0.gz

Binary file not shown.

4
face/pom.xml

@ -45,6 +45,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> </dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>

86
face/src/main/java/gsp/technologies/face/controllers/face/v1/mainframe/MainframeController.java → 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.net.URI;
import java.time.Duration; import java.time.Duration;
@ -13,6 +13,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; 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.models.Post;
import gsp.technologies.face.teh.fs.Filer; import gsp.technologies.face.teh.fs.Filer;
import gsp.technologies.face.teh.fs.MpFile; import gsp.technologies.face.teh.fs.MpFile;
import jakarta.servlet.http.HttpServletRequest;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
/**
* Контроллер для работы с API
* обработка запросов к http api:
* - загрузка файла на сервер
*/
@Controller @Controller
@RequestMapping(path = "/face/v1") @RequestMapping(path = "/api/v1")
public class MainframeController { public class ApiController {
private static final Logger log = LoggerFactory.getLogger(MainframeController.class); private static final Logger log = LoggerFactory.getLogger(ApiController.class);
@Autowired @Autowired
private WebClient client; 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 * @param file
* @return * @return
*/ */
@PostMapping("/document/upload") @PostMapping("/upload")
public String upload(@RequestParam("file") MultipartFile file, Model model, @ModelAttribute("post") Post post) { public String upload(@RequestParam("file") MultipartFile file,
log.info("POST /face/v1/document/upload, file: {}, type: {}", file.getOriginalFilename(), post.getType()); 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(); FileMetadata metadata = new FileMetadata();
metadata.setName(file.getOriginalFilename());
//запоминаем оригинальное наименование файла
String name = file.getOriginalFilename();
metadata.setName(name);
metadata.setExtension(Filer.extension(file.getOriginalFilename())); metadata.setExtension(Filer.extension(file.getOriginalFilename()));
metadata.setSize(file.getSize()); metadata.setSize(file.getSize());
// получаем объект метаданных с id // получаем объект метаданных с id
try { try {
metadata = client.post() metadata = client.post()
@ -131,6 +117,8 @@ public class MainframeController {
.build(); .build();
URI uri = uriComponents.toUri(); URI uri = uriComponents.toUri();
metadata.setName(name);
metadata = client.put() metadata = client.put()
.uri(uri) .uri(uri)
.body(Mono.just(metadata), FileMetadata.class) .body(Mono.just(metadata), FileMetadata.class)
@ -167,6 +155,28 @@ public class MainframeController {
log.info("Пост создан: {}", post); 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 <Void>(){})
.block();
//переход на исходную страницу
String referer = request.getHeader("Referer");
return "redirect:"+ referer;
} }
} }

100
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<Post> 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<Post> page = client.get()
.uri(uriComponents.toUri())
.retrieve()
.bodyToMono(new ParameterizedTypeReference<Page<Post>>() {})
.timeout(Duration.ofSeconds(1))
.block();
Content<Post> content = new Content<Post>(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<Post> page = client.get()
.uri(uriComponents.toUri())
.retrieve()
.bodyToMono(new ParameterizedTypeReference<Page<Post>>() {})
.timeout(Duration.ofSeconds(1))
.block();
Content<Post> content = new Content<Post>(page.getContent());
postContentPage = content.page(page);
postContentPage.setSortBy(req.getSortBy());
}
//добавляем контент со списком документов
model.addAttribute("postContentPage", postContentPage);
//добавляем объект Post хранения сведений о новом документе в представлении и последующей отправки на сервер
model.addAttribute("newPost", new Post());
return "mainframe";
}
}

99
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<Post> 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<Post> page = client.get()
.uri(uriComponents.toUri())
.retrieve()
.bodyToMono(new ParameterizedTypeReference<Page<Post>>() {})
.timeout(Duration.ofSeconds(1))
.block();
Content<Post> content = new Content<Post>(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<Post> page = client.get()
.uri(uriComponents.toUri())
.retrieve()
.bodyToMono(new ParameterizedTypeReference<Page<Post>>() {})
.timeout(Duration.ofSeconds(1))
.block();
Content<Post> content = new Content<Post>(page.getContent());
postContentPage = content.page(page);
postContentPage.setSortBy(req.getSortBy());
}
//добавляем контент со списком документов
model.addAttribute("postContentPage", postContentPage);
//добавляем объект Post хранения сведений о новом документе в представлении и последующей отправки на сервер
model.addAttribute("newPost", new Post());
return "storage";
}
}

92
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<T> {
private List<T> content;
private static final Logger log = LoggerFactory.getLogger(Content.class);
public Content(List<T> content) {
this.content = content;
}
public ContentPage<T> page(int pageSize, int pageNumber, String sortBy) {
log.info("Создание объекта Page, pageSize: {}, pageNumber: {}, sortBy: {}", pageSize, pageNumber, sortBy);
ContentPage<T> out = null;
out = ContentPage.<T>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<T> page(Page <T> page) {
ContentPage<T> out = null;
out = ContentPage.<T>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<T> 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;
}
}

114
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 <T> implements Serializable {
private List<T> 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<T> 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 <T> ContentPageBuilder<T> builder() {
return new ContentPageBuilder<T>();
}
public static class ContentPageBuilder <T>{
private List<T> 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<T> content(List<T> content2) {
this.content = content2;
return this;
}
public ContentPageBuilder<T> pageSize(int pageSize) {
this.pageSize = pageSize;
return this;
}
public ContentPageBuilder<T> pageNumber(int pageNumber) {
this.pageNumber = pageNumber;
return this;
}
public ContentPageBuilder<T> sortBy(String sortBy) {
this.sortBy = sortBy;
return this;
}
public ContentPageBuilder<T> last(boolean last) {
this.last = last;
return this;
}
public ContentPageBuilder<T> first(boolean first) {
this.first = first;
return this;
}
public ContentPageBuilder<T> hasNext(boolean hasNext) {
this.hasNext = hasNext;
return this;
}
public ContentPageBuilder<T> hasPrevious(boolean hasPrevious) {
this.hasPrevious = hasPrevious;
return this;
}
public ContentPageBuilder<T> totalLines(long totalLines) {
this.totalLines = totalLines;
return this;
}
public ContentPageBuilder<T> totalPages(int totalPages) {
this.totalPages = totalPages;
return this;
}
public ContentPage<T> build() {
return new ContentPage<T>(this);
}
}
}

14
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;
}

26
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 <T> {
List<T> content;
Pageable pageable;
int totalPages;
int totalElements;
boolean last;
int size;
int number;
Sort sort;
int numberOfElements;
boolean first;
boolean empty;
}

17
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;
}

14
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;
}

2
face/src/main/resources/templates/fragments/common/footer.html

@ -3,7 +3,7 @@
<body> <body>
<div th:fragment="copy"> <div th:fragment="copy">
<hr> <hr>
© 2024 ООО "ГСП-Технологии" © 2024 ООО "ГСП-Технологии" : gsp.technologies.teh.services { face, storage, sources, base, logger }
</div> </div>
<div th:fragment="info"> <div th:fragment="info">
<hr> <hr>

63
face/src/main/resources/templates/fragments/storage.html

@ -6,9 +6,8 @@
отправляет данные о виде документа и файл отправляет данные о виде документа и файл
--> -->
<div th:fragment="upload (post)"> <div th:fragment="upload (post)">
<hr>
<h2>Добавление пакетов:</h2> <h2>Добавление пакетов:</h2>
<form th:method="post" th:action="@{/face/v1/document/upload}" enctype="multipart/form-data" th:object="${post}"> <form th:method="post" th:action="@{/api/v1/upload}" enctype="multipart/form-data" th:object="${post}">
<!-- <p th:text="${post}"></p> --> <!-- <p th:text="${post}"></p> -->
<!-- <input type="text" id="type" name="type" th:value="*{type}"> --> <!-- <input type="text" id="type" name="type" th:value="*{type}"> -->
<select id="type" name="type" th:value="*{type}"> <select id="type" name="type" th:value="*{type}">
@ -22,25 +21,57 @@
<input type="file" name="file"> <input type="file" name="file">
<button type="submit">Загрузить пакет</button> <button type="submit">Загрузить пакет</button>
</form> </form>
<hr>
</div> </div>
<!-- <div th:fragment="postContentPageInfo(postContentPage)">
Отображение перечня документов (постов) размещенных на сервере <h2>Параметры страницы:</h2>
по данным из базы <ul>
--> <li>pageSize: <span th:text="${postContentPage.pageSize}"></span></li>
<div th:fragment="posts (posts)"> <li>pageNumber: <span th:text="${postContentPage.pageNumber}"></span></li>
<li>totalPages: <span th:text="${postContentPage.totalPages}"></span></li>
<li>totalLines: <span th:text="${postContentPage.totalLines}"></span></li>
<li>hasPrevious: <span th:text="${postContentPage.hasPrevious}"></span></li>
<li>hasNext: <span th:text="${postContentPage.hasNext}"></span></li>
<li>first: <span th:text="${postContentPage.first}"></span></li>
<li>last: <span th:text="${postContentPage.last}"></span></li>
</ul>
<hr> <hr>
<h2>Перечень документов: <span th:text="${#lists.size(posts)}"></span></h2>
<div th:each="post : ${posts}">
<p th:text="${post}"></p>
</div>
</div> </div>
<div th:fragment="posts (postsPage)">
<div th:fragment="postContent(postContentPage)">
<hr> <hr>
<h2>Перечень документов: <span th:text="${#lists.size(postsPage.content)}"></span></h2> <h2>Последние добавленные документы:</h2>
<div th:each="post : ${postsPage.content}"> <table>
<p th:text="${post}"></p> <thead>
</div> <th>post.id</th>
<th>post.type</th>
<th>metadata.name</th>
<!-- <th>metadata.extension</th> -->
<th>metadata.createdDate</th>
<th>-</th>
<th>view</th>
<th>get</th>
<th>check</th>
</thead>
<tbody>
<tr th:each="post : ${postContentPage.content}">
<td th:text="${post.id}"></td>
<td th:text="${post.type}"></td>
<td th:text="${post.metadata.name}"></td>
<td th:text="${post.metadata.createdDate}"></td>
<td><!-- Удаление документа -->
<form th:action="@{/api/v1/delete/{id}(id=${post.id})}" th:method="get">
<input type="submit" value="X"/>
</form>
</td>
<td>view</td>
<td>get</td>
<td>check</td>
</tr>
</tbody>
</table>
</div> </div>
</body> </body>
</html> </html>

78
face/src/main/resources/templates/mainframe.html

@ -11,6 +11,25 @@ xmlns:th="http://www.thymeleaf.org">
<title>teh-mainframe</title> <title>teh-mainframe</title>
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-loader.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-loader.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@1/src/zero-md.min.js"></script> <script type="module" src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@1/src/zero-md.min.js"></script>
<style>
table {
width: 100%; /* Ширина таблицы */
border: 2px solid black; /* Рамка вокруг таблицы */
border-radius: 10px; /* Скругление углов */
}
tr {
border: 1px solid black; /* Рамка вокруг ячеек */
border-radius: 10px; /* Скругление углов */
}
td {
padding: 5px; /* Поля вокруг ячеек */
text-align: left; /* Выравнивание по леву */
border: 1px solid black; /* Рамка вокруг ячеек */
border-radius: 10px; /* Скругление углов */
}
</style>
</head> </head>
<body> <body>
<header> <header>
@ -21,7 +40,7 @@ xmlns:th="http://www.thymeleaf.org">
<main> <main>
<!-- Хранилище данных --> <!-- Хранилище данных -->
<h1>Хранилище данных</h1> <h1>Хранилище данных</h1>
<table rules="all"> <table>
<thead></thead> <thead></thead>
<tbody> <tbody>
<tr> <tr>
@ -86,60 +105,15 @@ xmlns:th="http://www.thymeleaf.org">
</table> </table>
<hr> <hr>
<!-- Импорт данных в базу --> <!-- Импорт данных в базу -->
<h1>Импорт данных в базу</h1> <h1>
<a th:href="@{/face/v1/storage}">Импорт данных в базу</a>
</h1>
<hr>
<!-- Добавление пакетов --> <!-- Добавление пакетов -->
<div th:insert="~{fragments/storage :: upload(post=${newPost})}"></div> <div th:insert="~{fragments/storage :: upload(post=${newPost})}"></div>
<!-- Вывести по три документа каждого типа --> <!-- Вывести ContentPage -->
<div th:insert="~{fragments/storage :: posts(posts=${posts})}"></div> <div th:insert="~{fragments/storage :: postContent(postContentPage=${postContentPage})}"></div>
<!-- Вывести постранично -->
<div th:insert="~{fragments/storage :: posts(postsPage=${postsPage})}"></div>
<h2>Последние загруженные документы: COUNT</h2>
<!-- <table rules="all">
<thead>
<tr>
<th>Вид документа</th>
<th>Наименование</th>
<th>Время загрузки</th>
<th>Статус</th>
</tr>
</thead>
<tbody>
<tr>
<td>Реестр обученных</td>
<td>Наименование.xlsx</td>
<td>дата</td>
<td>обработан/не обработан</td>
</tr>
<tr>
<td>Реестр обученных</td>
<td>Наименование.xlsx</td>
<td>дата</td>
<td>обработан/не обработан</td>
</tr>
<tr>
<td>Реестр обученных</td>
<td>Наименование.xlsx</td>
<td>дата</td>
<td>обработан/не обработан</td>
</tr>
<tr>
<td>Реестр обученных</td>
<td>Наименование.xlsx</td>
<td>дата</td>
<td>обработан/не обработан</td>
</tr>
<tr>
<td>Реестр обученных</td>
<td>Наименование.xlsx</td>
<td>дата</td>
<td>обработан/не обработан</td>
</tr>
</tbody>
</table> -->
</main> </main>
<!-- подвал --> <!-- подвал -->
<footer> <footer>

60
face/src/main/resources/templates/storage.html

@ -0,0 +1,60 @@
<!-- mainframe.html
th-шаблон, для предоставления доступа к функционалу сервиса
-->
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>teh-storage</title>
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-loader.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@1/src/zero-md.min.js"></script>
<style>
table {
width: 100%; /* Ширина таблицы */
border: 2px solid black; /* Рамка вокруг таблицы */
border-radius: 10px; /* Скругление углов */
}
tr {
border: 1px solid black; /* Рамка вокруг ячеек */
border-radius: 10px; /* Скругление углов */
}
td {
padding: 5px; /* Поля вокруг ячеек */
text-align: left; /* Выравнивание по леву */
border: 1px solid black; /* Рамка вокруг ячеек */
border-radius: 10px; /* Скругление углов */
}
</style>
</head>
<body>
<header>
<h1>teh-storage</h1>
<hr>
</header>
<main>
<!-- Импорт данных в базу -->
<h1>Импорт данных в базу</h1>
<hr>
<!-- Добавление пакетов -->
<div th:insert="~{fragments/storage :: upload(post=${newPost})}"></div>
<!-- Параметры отображения контента -->
<div th:insert="~{fragments/storage :: postContentPageInfo(postContentPage=${postContentPage})}"></div>
<!-- Вывести ContentPage -->
<div th:insert="~{fragments/storage :: postContent(postContentPage=${postContentPage})}"></div>
</main>
<!-- подвал -->
<footer>
<!-- <div th:insert="~{fragments/common/footer :: info}"></div> -->
<div th:insert="~{fragments/common/footer :: copy}"></div>
</footer>
</body>
</html>

12
source/src/main/java/gsp/technologies/source/controllers/api/v1/StorageController.java

@ -6,6 +6,8 @@ import java.util.Optional;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -58,6 +60,16 @@ public class StorageController {
return new ResponseEntity<>(postRepo.findAll(PageRequest.of(number, size, Sort.by(sortBy))), HttpStatus.OK); return new ResponseEntity<>(postRepo.findAll(PageRequest.of(number, size, Sort.by(sortBy))), HttpStatus.OK);
} }
@GetMapping("/post/page/distinct")
public ResponseEntity<?> getPostPageDistinct(@RequestParam("number") int number, @RequestParam("size") int size, @RequestParam("sortBy") String sortBy) {
log.info("GET /post/page/distinct, number: {}, size: {}, sortBy: {}", number, size, sortBy);
Page<Post> result = postRepo.FindAllPostsDistinctById(PageRequest.of(number, size, Sort.by(sortBy)));
return new ResponseEntity<>(result, HttpStatus.OK);
}
// @GetMapping("/metadata/{id}") // @GetMapping("/metadata/{id}")
// public ResponseEntity<?> getStorageEntryByID(@PathVariable Integer id){ // public ResponseEntity<?> getStorageEntryByID(@PathVariable Integer id){
// return new ResponseEntity<>(metaRepo.findById(id), HttpStatus.OK); // return new ResponseEntity<>(metaRepo.findById(id), HttpStatus.OK);

8
source/src/main/java/gsp/technologies/source/repositories/PostRepository.java

@ -1,10 +1,18 @@
package gsp.technologies.source.repositories; package gsp.technologies.source.repositories;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import gsp.technologies.source.models.Post; import gsp.technologies.source.models.Post;
@Repository @Repository
public interface PostRepository extends JpaRepository<Post, Long> { public interface PostRepository extends JpaRepository<Post, Long> {
// Получение перечня объектов Post, отсортированных по убыванию id
@Query("select p from Post p order by p.id desc")
Page<Post> FindAllPostsDistinctById(Pageable pageable);
} }

32
storage/logs/teh.log

@ -1,28 +1,4 @@
{"@timestamp":"2024-10-16T08:21:13.742106500Z","log.level":"INFO","process.pid":21856,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 21856 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} {"@timestamp":"2024-10-17T14:49:02.026961900Z","log.level":"INFO","process.pid":7852,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 7852 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:21:13.758258200Z","log.level":"INFO","process.pid":21856,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"} {"@timestamp":"2024-10-17T14:49:02.043599900Z","log.level":"INFO","process.pid":7852,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:21:14.725419100Z","log.level":"INFO","process.pid":21856,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"} {"@timestamp":"2024-10-17T14:49:03.350823600Z","log.level":"INFO","process.pid":7852,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:21:15.571617100Z","log.level":"INFO","process.pid":21856,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.287 seconds (process running for 3.355)","ecs.version":"8.11"} {"@timestamp":"2024-10-17T14:49:04.356311800Z","log.level":"INFO","process.pid":7852,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.809 seconds (process running for 3.955)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:23:14.946336Z","log.level":"INFO","process.pid":21912,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 21912 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:23:14.951982200Z","log.level":"INFO","process.pid":21912,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:23:15.867421800Z","log.level":"INFO","process.pid":21912,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T08:23:16.800341300Z","log.level":"INFO","process.pid":21912,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.321 seconds (process running for 3.429)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:23:37.404441200Z","log.level":"INFO","process.pid":18104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 18104 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:23:37.409409500Z","log.level":"INFO","process.pid":18104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:23:38.350424Z","log.level":"INFO","process.pid":18104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:23:39.216589900Z","log.level":"INFO","process.pid":18104,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.247 seconds (process running for 3.373)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:28:35.119081100Z","log.level":"INFO","process.pid":18248,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 18248 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:28:35.128050900Z","log.level":"INFO","process.pid":18248,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:28:36.181410500Z","log.level":"INFO","process.pid":18248,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:28:37.101191800Z","log.level":"INFO","process.pid":18248,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.512 seconds (process running for 3.595)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:32:24.309421200Z","log.level":"INFO","process.pid":19076,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 19076 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:32:24.318421400Z","log.level":"INFO","process.pid":19076,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:32:25.250442400Z","log.level":"INFO","process.pid":19076,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:32:26.081411600Z","log.level":"INFO","process.pid":19076,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.202 seconds (process running for 3.248)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:34:18.194683100Z","log.level":"INFO","process.pid":23484,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 23484 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:34:18.202687300Z","log.level":"INFO","process.pid":23484,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:34:19.175960300Z","log.level":"INFO","process.pid":23484,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:34:19.983861300Z","log.level":"INFO","process.pid":23484,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.235 seconds (process running for 3.356)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:59:36.870769800Z","log.level":"INFO","process.pid":23472,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Starting StorageApplicationTests using Java 17.0.7 with PID 23472 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:59:36.877780500Z","log.level":"INFO","process.pid":23472,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:59:37.800457400Z","log.level":"INFO","process.pid":23472,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.services.FileServiceImpl","message":"Создание директории root(), для хранения файлов: C:\\Users\\devuser\\Documents\\code\\teh\\storage\\uploads","ecs.version":"8.11"}
{"@timestamp":"2024-10-16T11:59:38.727703800Z","log.level":"INFO","process.pid":23472,"process.thread.name":"main","service.name":"face","service.version":"1","service.environment":"Production","service.node.name":"Primary","log.logger":"gsp.technologies.storage.StorageApplicationTests","message":"Started StorageApplicationTests in 2.319 seconds (process running for 3.408)","ecs.version":"8.11"}

BIN
storage/logs/teh.log.2024-10-09.0.gz

Binary file not shown.

BIN
storage/logs/teh.log.2024-10-16.0.gz

Binary file not shown.

2
storage/src/main/java/gsp/technologies/storage/controllers/face/FaceController.java

@ -1,7 +1,5 @@
package gsp.technologies.storage.controllers.face; package gsp.technologies.storage.controllers.face;
import java.io.File;
import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.List; import java.util.List;

2
storage/src/main/java/gsp/technologies/storage/services/FileService.java

@ -13,8 +13,6 @@ import gsp.technologies.storage.models.FileMetadata;
import gsp.technologies.storage.models.xlsx.Xlsx; import gsp.technologies.storage.models.xlsx.Xlsx;
public interface FileService { public interface FileService {
// List<FileMetadata> listFiles(String path, Boolean recursive);
// List<FileMetadata> listFiles(Path path, Boolean recursive);
List<FileMetadata> listFiles(String path); List<FileMetadata> listFiles(String path);
List<FileMetadata> listFiles(Path path); List<FileMetadata> listFiles(Path path);
String uploadFile(String filename, byte[] content); String uploadFile(String filename, byte[] content);

Loading…
Cancel
Save