esoe
1 month ago
17 changed files with 221 additions and 97 deletions
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
# Архитектура платформы teh |
||||
## диаграмма компонентов |
||||
![диаграмма компонентов](architecture.png) |
After Width: | Height: | Size: 46 KiB |
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
@startuml |
||||
title "Архитектура платформы : teh" |
||||
skinparam componentStyle rectangle |
||||
allowmixing |
||||
left to right direction |
||||
|
||||
component docker { |
||||
component environment { |
||||
component jvm |
||||
component maven |
||||
component git |
||||
} |
||||
|
||||
component teh { |
||||
|
||||
component source { |
||||
portin in81 |
||||
portout out81 |
||||
} |
||||
component storage { |
||||
portin in82 |
||||
portout out82 |
||||
} |
||||
component face { |
||||
portin in83 |
||||
portout out83 |
||||
} |
||||
component logger { |
||||
portin in85 |
||||
portout out85 |
||||
} |
||||
component base { |
||||
portout out5432 |
||||
portin in5432 |
||||
} |
||||
|
||||
portin env |
||||
|
||||
out81 --> in83 : "Данные СУБД\n в json-формате" |
||||
out82 --> in83 : "Данные файловой системы\n в json-формате" |
||||
out5432 --> in81 : "данные СУБД\n в виде персистентных объектов" |
||||
out81 --> in85 : "Логи исполнения\n кода приложения" |
||||
out82 --> in85 : "Логи исполнения\n кода приложения" |
||||
out83 --> in85 : "Логи исполнения\n кода приложения" |
||||
} |
||||
jvm --> env |
||||
maven --> env |
||||
git --> env |
||||
} |
||||
|
||||
|
||||
@enduml |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
@startuml |
||||
title "usecase: teh" |
||||
left to right direction |
||||
|
||||
actor "Пользователь" as user |
||||
|
||||
package "mainframe" { |
||||
frame "Статистика файлообменника (storage-stat)" { |
||||
usecase "Данные по видам и количеству размещенных на сервере документов" |
||||
usecase "Переход: к файлообменнику (storage)" |
||||
} |
||||
frame "Статистика хранилища данных (base-stat)" { |
||||
usecase "Просмотр данных реестра обученных" |
||||
usecase "Переход: к формированию отчетов" |
||||
} |
||||
} |
||||
|
||||
package "storage" { |
||||
usecase "Переход: к mainframe" |
||||
usecase "Размещение в хранилище файлов" as upload |
||||
usecase "Скачивание файла с сервера" as download |
||||
usecase "Удаление файлов из хранилища" as delete |
||||
usecase "Просмотр списка файлов в хранилище" as list |
||||
usecase "Просмотр/получение сведений о файле" as info |
||||
usecase "Переход: к просмотру содержимого файла" |
||||
usecase "Переход: к формам экспорта данных" |
||||
} |
||||
|
||||
package "view-xlsx" as viewXlsx{ |
||||
usecase "Просмотр/получение содержимого файла (xlsx)" as view |
||||
usecase "Навигация по файлу" |
||||
usecase "Переход: к mainframe" |
||||
usecase "Переход: к storage" |
||||
} |
||||
|
||||
user --> mainframe |
||||
user --> storage |
||||
user --> viewXlsx |
||||
@enduml |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
@startuml |
||||
title "USECASE: teh.storage" |
||||
allowmixing |
||||
left to right direction |
||||
' пользователи |
||||
actor "Пользователь" as user |
||||
actor "Стороний сервис" as service |
||||
|
||||
' возможности использования |
||||
usecase "получение сведений о корневой директории" as getRoot |
||||
usecase "Загрузка файла на сервер" as upload |
||||
usecase "Загрузка файлов на сервер пакетом" as uploads |
||||
usecase "Скачивание файла с сервера" as download |
||||
usecase "Удаление файла с сервера" as delete |
||||
usecase "Просмотр/получение перечня файлов на сервере" as list |
||||
usecase "Просмотр/получение сведений о файле" as fileInfo |
||||
usecase "Настройка параметров просмотра файла (xlsx)" as setParams |
||||
usecase "Просмотр/получение содержимого файла (xlsx)" as viewXlsx |
||||
|
||||
' FACE |
||||
user --> upload |
||||
user --> uploads |
||||
user --> download |
||||
user --> delete |
||||
user --> list |
||||
user --> fileInfo |
||||
user --> setParams |
||||
user --> viewXlsx |
||||
|
||||
' REST API |
||||
upload <-- service : "POST /api/v1/files/store" |
||||
uploads <-- service : "POST /api/v1/files/store-multiple" |
||||
download <-- service : "GET /api/v1/files/download" |
||||
delete <-- service : "DELETE /api/v1/files/delete" |
||||
list <-- service : "GET /api/v1/files" |
||||
fileInfo <-- service : "получаем с пусой страницей xlsxPage" |
||||
viewXlsx <-- service : "GET /api/v1/files/xlsx" |
||||
getRoot <-- service : "GET /api/v1/root" |
||||
|
||||
json "Сведения о файле" as fileMetadata { |
||||
"name":"наименование файла", |
||||
"extension":["xlsx", "pdf", "..."], |
||||
"rootPath": "/app/storage/uploads", |
||||
"relativePath":"/filename.xlsx", |
||||
"absolutePath":"/app/storage/uploads/filename.xlsx", |
||||
"size":"размер файла в байтах", |
||||
"createdDate":"время создания файла", |
||||
"lastModifiedDate":"время последнего изменения файла", |
||||
"owner":"пользователь - владелец файла", |
||||
"type": "файл или директория", |
||||
"permissions": "права, установленные файлу на сервере" |
||||
} |
||||
|
||||
json "Содержимое файла" as page { |
||||
"content":"выборка данных xlsx", |
||||
"metadata":"FileMetadata", |
||||
"pageSize": "размер страницы", |
||||
"pageNumber": "номер страницы", |
||||
"offset": "смещение", |
||||
"headerLine": "номер строки с заголовками", |
||||
"last": "является ли последней страницей", |
||||
"first": "является ли первой страницей", |
||||
"hasNext": "имеется ли следующая страница", |
||||
"hasPrevious": "имеется ли предыдущая страница", |
||||
"totalLines": "всего строк в xlsx-файле", |
||||
"totalColumns": "всего столбцов", |
||||
"totalPages": "всего страниц" |
||||
} |
||||
|
||||
fileInfo --{ fileMetadata |
||||
viewXlsx --{ page |
||||
|
||||
@enduml |
@ -1,12 +1,12 @@
@@ -1,12 +1,12 @@
|
||||
{"@timestamp":"2024-10-10T05:48:48.071013600Z","log.level":"INFO","process.pid":5360,"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 5360 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-10T05:48:48.083108600Z","log.level":"INFO","process.pid":5360,"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-10T05:48:49.021430Z","log.level":"INFO","process.pid":5360,"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-10T05:48:49.895543100Z","log.level":"INFO","process.pid":5360,"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.251 seconds (process running for 3.281)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-10T06:10:14.369765600Z","log.level":"INFO","process.pid":5140,"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 5140 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-10T06:10:14.376062200Z","log.level":"INFO","process.pid":5140,"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-10T06:10:15.441671200Z","log.level":"INFO","process.pid":5140,"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-10T06:10:16.498992600Z","log.level":"INFO","process.pid":5140,"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.565 seconds (process running for 3.659)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-10T06:16:30.410659500Z","log.level":"INFO","process.pid":16080,"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 16080 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-10T06:16:30.416388500Z","log.level":"INFO","process.pid":16080,"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-10T06:16:31.402964900Z","log.level":"INFO","process.pid":16080,"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-10T06:16:32.211194900Z","log.level":"INFO","process.pid":16080,"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.244 seconds (process running for 3.327)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-11T06:10:07.994244Z","log.level":"INFO","process.pid":13084,"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 13084 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-11T06:10:08.012254100Z","log.level":"INFO","process.pid":13084,"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-11T06:10:08.913700800Z","log.level":"INFO","process.pid":13084,"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-11T06:10:09.780682400Z","log.level":"INFO","process.pid":13084,"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.237 seconds (process running for 3.3)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-11T06:35:21.950719700Z","log.level":"INFO","process.pid":8196,"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 8196 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-11T06:35:21.956727800Z","log.level":"INFO","process.pid":8196,"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-11T06:35:22.854946600Z","log.level":"INFO","process.pid":8196,"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-11T06:35:23.702006500Z","log.level":"INFO","process.pid":8196,"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.194 seconds (process running for 3.32)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-11T07:10:32.899864600Z","log.level":"INFO","process.pid":6096,"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 6096 (started by devuser in C:\\Users\\devuser\\Documents\\code\\teh\\storage)","ecs.version":"8.11"} |
||||
{"@timestamp":"2024-10-11T07:10:32.906864100Z","log.level":"INFO","process.pid":6096,"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-11T07:10:33.959310800Z","log.level":"INFO","process.pid":6096,"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-11T07:10:34.884139900Z","log.level":"INFO","process.pid":6096,"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.442 seconds (process running for 3.562)","ecs.version":"8.11"} |
||||
|
Binary file not shown.
@ -1,52 +1,20 @@
@@ -1,52 +1,20 @@
|
||||
package gsp.technologies.storage.controllers.hello; |
||||
|
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
||||
// import ru.molokoin.storagers.model.Document;
|
||||
// import ru.molokoin.storagers.model.XlsxCell;
|
||||
// import ru.molokoin.storagers.model.XlsxMultipartDocument;
|
||||
// import ru.molokoin.storagers.service.StorageServiceFace;
|
||||
|
||||
/** |
||||
* контроллер, для отрабтки тестов, |
||||
* выводит страницу с информацией о сервисе пользователю |
||||
*/ |
||||
@Controller |
||||
public class HelloController { |
||||
/** |
||||
* получаем в переменную root |
||||
* значение свойства storage.location |
||||
* из файла application.yaml |
||||
*/ |
||||
// private StorageServiceFace storage;
|
||||
|
||||
/** |
||||
* Конструктор контроллера, дня инициализации объекта хранилища |
||||
* - передается интерфейс |
||||
* @param storage |
||||
*/ |
||||
// public HelloController(StorageServiceFace storage){
|
||||
// this.storage = storage;
|
||||
// }
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(HelloController.class); |
||||
@GetMapping("/hello") |
||||
public String hello(){ |
||||
// System.out.println("storageRS/hello-controller# " + "передача пользователю шаблона hello.html");
|
||||
// System.out.println("storageRS/hello-controller#(из config): " + storage.root());
|
||||
// System.out.println("Загружено документов: " + storage.list().size());
|
||||
System.out.println("Перечень загруженных документов:"); |
||||
// int i = 1;
|
||||
// for (Document doc : storage.list()) {
|
||||
// XlsxMultipartDocument parts = new XlsxMultipartDocument(doc);
|
||||
// System.out.println("Document#" + i + ": " + doc.getPath() + "(size#" + doc.getSize() + ")" + " ### lines: " + parts.getLineCount());
|
||||
// for (XlsxCell c: parts.line(i-1)) {
|
||||
// System.out.println(c.getContent());
|
||||
// }
|
||||
// parts.close();
|
||||
// System.out.println("---------------------");
|
||||
// i++;
|
||||
// }
|
||||
log.info("GET /hello"); |
||||
return "hello"; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue