Conversation
CourseWork/Chart/build.gradle
Outdated
|
|
||
| group 'ru.otus' | ||
| version '1.0' | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 |
There was a problem hiding this comment.
стоит использовать более новую версию java
There was a problem hiding this comment.
Исправил. Тянется со времен попытки деплоя на Tomcat
CourseWork/Chart/build.gradle
Outdated
|
|
||
| dependencies { | ||
| compile project(':CourseWork:MessageSystem') | ||
| testCompile group: 'junit', name: 'junit', version: '4.12' |
| import java.io.Serializable; | ||
| import java.util.List; | ||
|
|
||
| public class OperationStatusMsgData extends ResultDataType implements Serializable { |
There was a problem hiding this comment.
ResultDataType уже
public class ResultDataType implements Serializable
надо ли наследников делать Serializable ?
| operationStatusMsgData = new OperationStatusMsgData(SUCCESS, new ArrayList<>()); | ||
|
|
||
| } catch (Exception e) { | ||
| System.out.println(e.getMessage()); |
| import java.util.Optional; | ||
|
|
||
| public class RegisterClientRequestHandler implements RequestHandler<OperationStatusMsgData> { | ||
| public static final String SUCCESS = "SUCCESS"; |
There was a problem hiding this comment.
в каких-то Handler-ах есть эти статусы, в каких-то нет (например, GetFilteredUserListDataRequestHandler)
хорошо бы вынести эти константы в enum и унифицировать работу.
There was a problem hiding this comment.
Константы перенес в enum.
Статусы возвращаются только там, где не надо возвращать данные.
Долго ломал голову как сделать лучше. Ничего не возвращать плохо. Возвращать статус только для части handlers, тоже плохо. Не придумал, как сделать лучше.
| // return new KafkaAdmin(configs); | ||
| // } | ||
|
|
||
| @Bean("DbServerListener") |
There was a problem hiding this comment.
бины традиционно с маленькой буквы называют.
| return toFrontendMsClient; | ||
| } | ||
|
|
||
| // @KafkaListener(topics="${front2db.topic}") |
There was a problem hiding this comment.
закоментированный код не стоит пушить в гит
|
|
||
| for(var opIdx = 0; opIdx < operationsData.length; opIdx++ ) { | ||
| console.log("opIdx = " + opIdx); | ||
| var colorName = colorNames[opIdx]; |
There was a problem hiding this comment.
почитайте про отличия var, let, const.
Если кратко, то стоит использовать let вместо var, а где возможно - const
There was a problem hiding this comment.
Прочитал, исправил на let
| let arr = new Array(barChartData.labels.length); | ||
| for(const [key, value] of Object.entries(operationsData[opIdx].chartData)) { | ||
| for (var index = 0; index < barChartData.labels.length; index++) { | ||
| if (barChartData.labels[index] == key) { |
There was a problem hiding this comment.
В JavaScript есть разница межу == и ===
| <button id="getData">Plan B</button> | ||
|
|
||
| <script> | ||
| var OPEARATIONS = ['RegisterClient','UserData','FilteredUsersData','SaveUser', 'DeleteUser', 'OperationStatus']; |
There was a problem hiding this comment.
скриптовую часть стоит вынести из html
No description provided.