Все точно работает
This commit is contained in:
parent
121b19f8bc
commit
456ede8f32
@ -27,7 +27,7 @@ public class TaskCloseChange extends TaskChange {
|
|||||||
@Override
|
@Override
|
||||||
public String generateMessage() {
|
public String generateMessage() {
|
||||||
return MessageFormat.format(
|
return MessageFormat.format(
|
||||||
"{0} Задача выполнена* | [ПР]({1}){2}" +
|
"{0} *Задача выполнена* | [ПР]({1}){2}" +
|
||||||
"{3}: {4}",
|
"{3}: {4}",
|
||||||
Smile.TASK, url, Smile.HR, authorName, messageTask
|
Smile.TASK, url, Smile.HR, authorName, messageTask
|
||||||
);
|
);
|
||||||
|
@ -61,9 +61,7 @@ public class SchedulerPushMessageSend {
|
|||||||
if (!pushMessage.isEmpty()) {
|
if (!pushMessage.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
final String json = objectMapper.writeValueAsString(pushMessage);
|
final String json = objectMapper.writeValueAsString(pushMessage);
|
||||||
// sendMessage(json);
|
sendMessage(json);
|
||||||
System.out.println(json);
|
|
||||||
System.out.println("\n\n");
|
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,7 @@ public class PersonScheduler {
|
|||||||
|
|
||||||
private final PersonBitbucketParser personParser;
|
private final PersonBitbucketParser personParser;
|
||||||
|
|
||||||
// @Scheduled(cron = "0 0 0 */1 * *")
|
@Scheduled(cron = "${bitbucketbot.scheduler.person:0 0 0 */1 * *}")
|
||||||
@Scheduled(cron = "0 */1 * * * *")
|
|
||||||
public void scanPersons() {
|
public void scanPersons() {
|
||||||
personParser.scanNewPerson();
|
personParser.scanNewPerson();
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,10 @@ public class TaskServiceImpl extends AbstractSimpleManagerService<Task, Long> im
|
|||||||
changeService.save(
|
changeService.save(
|
||||||
TaskNewChange.builder()
|
TaskNewChange.builder()
|
||||||
.messageTask(task.getDescription())
|
.messageTask(task.getDescription())
|
||||||
.authorName(task.getAuthor())
|
.authorName(oldTask.getAuthor())
|
||||||
.url(task.getUrl())
|
.url(oldTask.getUrl())
|
||||||
.telegramIds(
|
.telegramIds(
|
||||||
personService.getAllTelegramIdByLogin(Collections.singleton(task.getResponsible()))
|
personService.getAllTelegramIdByLogin(Collections.singleton(oldTask.getResponsible()))
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
@ -107,11 +107,11 @@ public class TaskServiceImpl extends AbstractSimpleManagerService<Task, Long> im
|
|||||||
case RESOLVED:
|
case RESOLVED:
|
||||||
changeService.save(
|
changeService.save(
|
||||||
TaskCloseChange.builder()
|
TaskCloseChange.builder()
|
||||||
.messageTask(task.getDescription())
|
.messageTask(oldTask.getDescription())
|
||||||
.authorName(task.getAuthor())
|
.authorName(oldTask.getAuthor())
|
||||||
.url(task.getUrl())
|
.url(oldTask.getUrl())
|
||||||
.telegramIds(
|
.telegramIds(
|
||||||
personService.getAllTelegramIdByLogin(Collections.singleton(task.getAuthor()))
|
personService.getAllTelegramIdByLogin(Collections.singleton(oldTask.getAuthor()))
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
@ -136,7 +136,7 @@ public class CommentAndTaskParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String generateUrl(@NonNull Long id, @NonNull String pullRequestUrl) {
|
private String generateUrl(@NonNull Long id, @NonNull String pullRequestUrl) {
|
||||||
return MessageFormat.format("{0}/overview?commentId={1}", pullRequestUrl, id).replaceAll(" ", "");
|
return MessageFormat.format("{0}/overview?commentId={1}", pullRequestUrl, Long.toString(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCommentUrl(long commentId, PullRequest pullRequest) {
|
private String getCommentUrl(long commentId, PullRequest pullRequest) {
|
||||||
|
@ -18,13 +18,14 @@ spring:
|
|||||||
non_contextual_creation: true
|
non_contextual_creation: true
|
||||||
bitbucketbot:
|
bitbucketbot:
|
||||||
scheduler:
|
scheduler:
|
||||||
|
person: 0 */1 * * * *
|
||||||
comment:
|
comment:
|
||||||
settings:
|
settings:
|
||||||
no-comment-count: 20
|
no-comment-count: 20
|
||||||
comment-count: 100
|
comment-count: 100
|
||||||
init:
|
init:
|
||||||
start-comment-id: 7807
|
start-comment-id: 7807
|
||||||
use: false
|
use: true
|
||||||
server-send:
|
server-send:
|
||||||
url: http://188.225.35.149:8080/api/send
|
url: http://188.225.35.149:8080/api/send
|
||||||
bitbucket:
|
bitbucket:
|
||||||
|
@ -17,8 +17,15 @@ spring:
|
|||||||
lob:
|
lob:
|
||||||
non_contextual_creation: true
|
non_contextual_creation: true
|
||||||
bitbucketbot:
|
bitbucketbot:
|
||||||
|
scheduler:
|
||||||
|
person: 0 */1 * * * *
|
||||||
|
comment:
|
||||||
|
settings:
|
||||||
|
no-comment-count: 20
|
||||||
|
comment-count: 100
|
||||||
init:
|
init:
|
||||||
start-comment-id:
|
start-comment-id: 7807
|
||||||
|
use: true
|
||||||
server-send:
|
server-send:
|
||||||
url: http://188.225.35.149:8080/api/send
|
url: http://188.225.35.149:8080/api/send
|
||||||
bitbucket:
|
bitbucket:
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="STDOUT"/>
|
<appender-ref ref="FILE"/>
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
Loading…
Reference in New Issue
Block a user