Добавил вывод 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")
|
||||
private String webUrl;
|
||||
|
||||
@Column(name = "ssh_url_to_repo")
|
||||
private String sshUrlToRepo;
|
||||
|
||||
@Column(name = "http_url_to_repo")
|
||||
private String httpUrlToRepo;
|
||||
|
||||
@Column(name = "notification")
|
||||
private boolean notification;
|
||||
|
||||
|
@ -21,6 +21,8 @@ public final class NewProjectNotify implements Notify {
|
||||
private final String projectUrl;
|
||||
private final String projectDescription;
|
||||
private final String authorName;
|
||||
private final String sshUrlToRepo;
|
||||
private final String httpUrlToRepo;
|
||||
|
||||
@Builder
|
||||
public NewProjectNotify(
|
||||
@ -28,13 +30,17 @@ public final class NewProjectNotify implements Notify {
|
||||
String projectName,
|
||||
String projectUrl,
|
||||
String projectDescription,
|
||||
String authorName
|
||||
String authorName,
|
||||
String sshUrlToRepo,
|
||||
String httpUrlToRepo
|
||||
) {
|
||||
this.projectId = projectId;
|
||||
this.projectName = projectName;
|
||||
this.projectUrl = projectUrl;
|
||||
this.projectDescription = projectDescription;
|
||||
this.authorName = authorName;
|
||||
this.sshUrlToRepo = sshUrlToRepo;
|
||||
this.httpUrlToRepo = httpUrlToRepo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +22,8 @@ public class ProjectJsonConverter implements Converter<ProjectJson, Project> {
|
||||
project.setDescription(source.getDescription());
|
||||
project.setName(source.getName());
|
||||
project.setWebUrl(source.getWebUrl());
|
||||
project.setHttpUrlToRepo(source.getHttpUrlToRepo());
|
||||
project.setSshUrlToRepo(source.getSshUrlToRepo());
|
||||
return project;
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,8 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
.projectDescription(newProject.getDescription())
|
||||
.projectName(newProject.getName())
|
||||
.projectUrl(newProject.getWebUrl())
|
||||
.sshUrlToRepo(newProject.getSshUrlToRepo())
|
||||
.httpUrlToRepo(newProject.getHttpUrlToRepo())
|
||||
.authorName(authorName)
|
||||
.build()
|
||||
);
|
||||
|
@ -45,6 +45,8 @@
|
||||
<column name="web_url" type="varchar(300)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="ssh_url_to_repo" type="varchar(300)"/>
|
||||
<column name="http_url_to_repo" type="varchar(300)"/>
|
||||
<column name="notification" type="boolean">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
|
@ -27,6 +27,12 @@ public class ProjectJson {
|
||||
@JsonProperty("web_url")
|
||||
private String webUrl;
|
||||
|
||||
@JsonProperty("ssh_url_to_repo")
|
||||
private String sshUrlToRepo;
|
||||
|
||||
@JsonProperty("http_url_to_repo")
|
||||
private String httpUrlToRepo;
|
||||
|
||||
@JsonProperty("creator_id")
|
||||
private Long creatorId;
|
||||
|
||||
|
@ -38,6 +38,10 @@ public class NewProjectNotifyGenerator implements NotifyBoxAnswerGenerator<NewPr
|
||||
.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()));
|
||||
|
||||
final String notifyMessage = builder.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user