Добавил вывод ssh и http для уведомления о новом репозитории
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6dcd68655a
commit
244902d788
@ -39,6 +39,12 @@ public class Project {
|
|||||||
@Column(name = "web_url")
|
@Column(name = "web_url")
|
||||||
private String webUrl;
|
private String webUrl;
|
||||||
|
|
||||||
|
@Column(name = "ssh_url_to_repo")
|
||||||
|
private String sshUrlToRepo;
|
||||||
|
|
||||||
|
@Column(name = "http_url_to_repo")
|
||||||
|
private String httpUrlToRepo;
|
||||||
|
|
||||||
@Column(name = "notification")
|
@Column(name = "notification")
|
||||||
private boolean notification;
|
private boolean notification;
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ public final class NewProjectNotify implements Notify {
|
|||||||
private final String projectUrl;
|
private final String projectUrl;
|
||||||
private final String projectDescription;
|
private final String projectDescription;
|
||||||
private final String authorName;
|
private final String authorName;
|
||||||
|
private final String sshUrlToRepo;
|
||||||
|
private final String httpUrlToRepo;
|
||||||
|
|
||||||
@Builder
|
@Builder
|
||||||
public NewProjectNotify(
|
public NewProjectNotify(
|
||||||
@ -28,13 +30,17 @@ public final class NewProjectNotify implements Notify {
|
|||||||
String projectName,
|
String projectName,
|
||||||
String projectUrl,
|
String projectUrl,
|
||||||
String projectDescription,
|
String projectDescription,
|
||||||
String authorName
|
String authorName,
|
||||||
|
String sshUrlToRepo,
|
||||||
|
String httpUrlToRepo
|
||||||
) {
|
) {
|
||||||
this.projectId = projectId;
|
this.projectId = projectId;
|
||||||
this.projectName = projectName;
|
this.projectName = projectName;
|
||||||
this.projectUrl = projectUrl;
|
this.projectUrl = projectUrl;
|
||||||
this.projectDescription = projectDescription;
|
this.projectDescription = projectDescription;
|
||||||
this.authorName = authorName;
|
this.authorName = authorName;
|
||||||
|
this.sshUrlToRepo = sshUrlToRepo;
|
||||||
|
this.httpUrlToRepo = httpUrlToRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -22,6 +22,8 @@ public class ProjectJsonConverter implements Converter<ProjectJson, Project> {
|
|||||||
project.setDescription(source.getDescription());
|
project.setDescription(source.getDescription());
|
||||||
project.setName(source.getName());
|
project.setName(source.getName());
|
||||||
project.setWebUrl(source.getWebUrl());
|
project.setWebUrl(source.getWebUrl());
|
||||||
|
project.setHttpUrlToRepo(source.getHttpUrlToRepo());
|
||||||
|
project.setSshUrlToRepo(source.getSshUrlToRepo());
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +118,8 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
.projectDescription(newProject.getDescription())
|
.projectDescription(newProject.getDescription())
|
||||||
.projectName(newProject.getName())
|
.projectName(newProject.getName())
|
||||||
.projectUrl(newProject.getWebUrl())
|
.projectUrl(newProject.getWebUrl())
|
||||||
|
.sshUrlToRepo(newProject.getSshUrlToRepo())
|
||||||
|
.httpUrlToRepo(newProject.getHttpUrlToRepo())
|
||||||
.authorName(authorName)
|
.authorName(authorName)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
@ -45,6 +45,8 @@
|
|||||||
<column name="web_url" type="varchar(300)">
|
<column name="web_url" type="varchar(300)">
|
||||||
<constraints nullable="false"/>
|
<constraints nullable="false"/>
|
||||||
</column>
|
</column>
|
||||||
|
<column name="ssh_url_to_repo" type="varchar(300)"/>
|
||||||
|
<column name="http_url_to_repo" type="varchar(300)"/>
|
||||||
<column name="notification" type="boolean">
|
<column name="notification" type="boolean">
|
||||||
<constraints nullable="false"/>
|
<constraints nullable="false"/>
|
||||||
</column>
|
</column>
|
||||||
|
@ -27,6 +27,12 @@ public class ProjectJson {
|
|||||||
@JsonProperty("web_url")
|
@JsonProperty("web_url")
|
||||||
private String webUrl;
|
private String webUrl;
|
||||||
|
|
||||||
|
@JsonProperty("ssh_url_to_repo")
|
||||||
|
private String sshUrlToRepo;
|
||||||
|
|
||||||
|
@JsonProperty("http_url_to_repo")
|
||||||
|
private String httpUrlToRepo;
|
||||||
|
|
||||||
@JsonProperty("creator_id")
|
@JsonProperty("creator_id")
|
||||||
private Long creatorId;
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ -38,6 +38,10 @@ public class NewProjectNotifyGenerator implements NotifyBoxAnswerGenerator<NewPr
|
|||||||
.append(Icons.HR);
|
.append(Icons.HR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.append("ssh: ").append("`").append(notify.getSshUrlToRepo()).append("`\n\n")
|
||||||
|
.append("http: ").append("`").append(notify.getHttpUrlToRepo()).append("`")
|
||||||
|
.append(Icons.HR);
|
||||||
|
|
||||||
builder.append(Icons.AUTHOR).append(": ").append(escapeMarkdown(notify.getAuthorName()));
|
builder.append(Icons.AUTHOR).append(": ").append(escapeMarkdown(notify.getAuthorName()));
|
||||||
|
|
||||||
final String notifyMessage = builder.toString();
|
final String notifyMessage = builder.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user