From 92d3067dd3e24cf41af0475d82eaa0c067b6aea0 Mon Sep 17 00:00:00 2001 From: Alyona Date: Tue, 30 Oct 2018 23:59:42 +0400 Subject: [PATCH 1/6] added event status --- .../java/ru/ulstu/timeline/model/Event.java | 32 +++++++++++++++---- .../ru/ulstu/timeline/model/EventDto.java | 6 ++++ .../ulstu/timeline/model/EventStatusDto.java | 19 +++++++++++ .../ulstu/timeline/service/EventService.java | 1 + 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 src/main/java/ru/ulstu/timeline/model/EventStatusDto.java diff --git a/src/main/java/ru/ulstu/timeline/model/Event.java b/src/main/java/ru/ulstu/timeline/model/Event.java index 404025a..7a0117c 100644 --- a/src/main/java/ru/ulstu/timeline/model/Event.java +++ b/src/main/java/ru/ulstu/timeline/model/Event.java @@ -4,20 +4,32 @@ import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; import ru.ulstu.user.model.User; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.ManyToMany; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import javax.persistence.*; import java.util.Date; import java.util.List; @Entity public class Event extends BaseEntity { + public enum EventStatus { + POSSIBLE("Возможное"), NEW("Новое"), IN_PROGRESS("В процессе"), COMPLETED("Завершено"); + + private String name; + + EventStatus(String name) { + this.name = name; + } + + public String getName() { + return name; + } + } + @NotBlank private String title; + @Enumerated(value = EnumType.STRING) + private EventStatus status; + @Column(name = "execute_date") @Temporal(TemporalType.TIMESTAMP) private Date executeDate; @@ -43,6 +55,14 @@ public class Event extends BaseEntity { this.title = title; } + public EventStatus getStatus() { + return status; + } + + public void setStatus(EventStatus status) { + this.status = status; + } + public Date getCreateDate() { return createDate; } diff --git a/src/main/java/ru/ulstu/timeline/model/EventDto.java b/src/main/java/ru/ulstu/timeline/model/EventDto.java index 59cef34..b409ce8 100644 --- a/src/main/java/ru/ulstu/timeline/model/EventDto.java +++ b/src/main/java/ru/ulstu/timeline/model/EventDto.java @@ -12,6 +12,7 @@ import static ru.ulstu.core.util.StreamApiUtils.convert; public class EventDto { private final Integer id; private final String title; + private final Event.EventStatus status; private final Date executeDate; private final Date createDate; private final Date updateDate; @@ -21,6 +22,7 @@ public class EventDto { @JsonCreator public EventDto(@JsonProperty("id") Integer id, @JsonProperty("title") String title, + @JsonProperty("status") Event.EventStatus status, @JsonProperty("executeDate") Date executeDate, @JsonProperty("createDate") Date createDate, @JsonProperty("updateDate") Date updateDate, @@ -28,6 +30,7 @@ public class EventDto { @JsonProperty("recipients") List recipients) { this.id = id; this.title = title; + this.status = status; this.executeDate = executeDate; this.createDate = createDate; this.updateDate = updateDate; @@ -38,6 +41,7 @@ public class EventDto { public EventDto(Event event) { this.id = event.getId(); this.title = event.getTitle(); + this.status = event.getStatus(); this.executeDate = event.getExecuteDate(); this.createDate = event.getCreateDate(); this.updateDate = event.getUpdateDate(); @@ -53,6 +57,8 @@ public class EventDto { return title; } + public Event.EventStatus getStatus() { return status; } + public Date getCreateDate() { return createDate; } diff --git a/src/main/java/ru/ulstu/timeline/model/EventStatusDto.java b/src/main/java/ru/ulstu/timeline/model/EventStatusDto.java new file mode 100644 index 0000000..6bb4bbc --- /dev/null +++ b/src/main/java/ru/ulstu/timeline/model/EventStatusDto.java @@ -0,0 +1,19 @@ +package ru.ulstu.timeline.model; + +public class EventStatusDto { + private final String id; + private final String name; + + public EventStatusDto(Event.EventStatus status) { + this.id = status.name(); + this.name = status.getName(); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } +} diff --git a/src/main/java/ru/ulstu/timeline/service/EventService.java b/src/main/java/ru/ulstu/timeline/service/EventService.java index 0c1cf6c..8d8189d 100644 --- a/src/main/java/ru/ulstu/timeline/service/EventService.java +++ b/src/main/java/ru/ulstu/timeline/service/EventService.java @@ -46,6 +46,7 @@ public class EventService { event.setDescription(eventDto.getDescription()); event.setRecipients(userService.findByIds(convert(eventDto.getRecipients(), UserDto::getId))); event.setTitle(eventDto.getTitle()); + event.setStatus(eventDto.getStatus()); event.setUpdateDate(eventDto.getUpdateDate()); return event; } From 8fe9f6625ca2fe4f98b895f0521665055b1b4e13 Mon Sep 17 00:00:00 2001 From: Alyona Date: Wed, 31 Oct 2018 20:06:27 +0400 Subject: [PATCH 2/6] changelog --- .../db/changelog-20181031_000000-schema.xml | 13 +++++++++++++ src/main/resources/db/changelog-master.xml | 1 + 2 files changed, 14 insertions(+) create mode 100644 src/main/resources/db/changelog-20181031_000000-schema.xml diff --git a/src/main/resources/db/changelog-20181031_000000-schema.xml b/src/main/resources/db/changelog-20181031_000000-schema.xml new file mode 100644 index 0000000..7a727fc --- /dev/null +++ b/src/main/resources/db/changelog-20181031_000000-schema.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/db/changelog-master.xml b/src/main/resources/db/changelog-master.xml index bd52f71..d2de71d 100644 --- a/src/main/resources/db/changelog-master.xml +++ b/src/main/resources/db/changelog-master.xml @@ -13,4 +13,5 @@ + \ No newline at end of file From 42fb1a15374a27d1a8ab14d3d87244a3bccf74d8 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 1 Nov 2018 12:53:19 +0400 Subject: [PATCH 3/6] fix imports --- src/main/java/ru/ulstu/timeline/model/Event.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/ulstu/timeline/model/Event.java b/src/main/java/ru/ulstu/timeline/model/Event.java index 7a0117c..89ff4cd 100644 --- a/src/main/java/ru/ulstu/timeline/model/Event.java +++ b/src/main/java/ru/ulstu/timeline/model/Event.java @@ -4,7 +4,14 @@ import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; import ru.ulstu.user.model.User; -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.ManyToMany; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; import java.util.Date; import java.util.List; From 1211b0db2975992911cd3b9788a46a9e714bb098 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 9 Nov 2018 14:53:24 +0400 Subject: [PATCH 4/6] add styles in email templates --- deploy/gdccloud/deploy.sh | 2 +- src/main/resources/application.properties | 2 +- .../paperCreateNotification.html | 25 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/deploy/gdccloud/deploy.sh b/deploy/gdccloud/deploy.sh index 5429a76..26604b7 100644 --- a/deploy/gdccloud/deploy.sh +++ b/deploy/gdccloud/deploy.sh @@ -18,6 +18,6 @@ fi ssh $USERSERVER "cd /tmp && rm -rf $ARTIFACT_NAME*.jar && echo `date` 'killed' >> log_$ARTIFACT_NAME" scp build/libs/$ARTIFACT_NAME-0.1.0-SNAPSHOT.jar $USERSERVER:/tmp/$ARTIFACT_NAME-0.1.0-SNAPSHOT.jar -ssh $USERSERVER -f "cd /tmp/ && /opt/jdk1.8.0_192/bin/java -jar $ARTIFACT_NAME-0.1.0-SNAPSHOT.jar -Xms 512m -Xmx 1024m --server.port=8443 --server.http.port=8080 >> /home/user/logfile_$ARTIFACT_NAME" & +ssh $USERSERVER -f "cd /tmp/ && /opt/jdk1.8.0_192/bin/java -jar $ARTIFACT_NAME-0.1.0-SNAPSHOT.jar -Xms 512m -Xmx 1024m --server.port=8443 --server.http.port=8080 --ng-tracker.base-url=http://193.110.3.124:8080 >> /home/user/logfile_$ARTIFACT_NAME" & sleep 10 echo "is deployed" \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e696ccd..fb1b116 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -32,7 +32,7 @@ liquibase.drop-first=false liquibase.enabled=true liquibase.change-log=classpath:db/changelog-master.xml # Application Settings -ng-tracker.base-url=https://127.0.0.1:8443 +ng-tracker.base-url=http://127.0.0.1:8080 ng-tracker.undead-user-login=admin ng-tracker.dev-mode=true ng-tracker.use-https=false \ No newline at end of file diff --git a/src/main/resources/mail_templates/paperCreateNotification.html b/src/main/resources/mail_templates/paperCreateNotification.html index 3e71ce9..0d80bf9 100644 --- a/src/main/resources/mail_templates/paperCreateNotification.html +++ b/src/main/resources/mail_templates/paperCreateNotification.html @@ -4,8 +4,33 @@ Уведомление о создании статьи + + + + + + + + + + + + + + +

Уважаемый(ая) Ivan Ivanov

From 5c54817fc62a2358a2dbd9d2564d95eeda3cc2cb Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 9 Nov 2018 15:05:39 +0400 Subject: [PATCH 5/6] fix styles --- .../mail_templates/paperCreateNotification.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/mail_templates/paperCreateNotification.html b/src/main/resources/mail_templates/paperCreateNotification.html index 0d80bf9..a0aa43f 100644 --- a/src/main/resources/mail_templates/paperCreateNotification.html +++ b/src/main/resources/mail_templates/paperCreateNotification.html @@ -5,17 +5,17 @@ - - + + - - - - + + + + - + From 6aa5f807b705793e650d5b1ce3f883f78a30b807 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 9 Nov 2018 15:21:03 +0400 Subject: [PATCH 6/6] move styles to body --- .../paperCreateNotification.html | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/main/resources/mail_templates/paperCreateNotification.html b/src/main/resources/mail_templates/paperCreateNotification.html index a0aa43f..8b4ded9 100644 --- a/src/main/resources/mail_templates/paperCreateNotification.html +++ b/src/main/resources/mail_templates/paperCreateNotification.html @@ -4,22 +4,20 @@ Уведомление о создании статьи - - - - - - - - - - - - - + + + + + + + + + + +