use of org.finos.symphony.toolkit.workflow.annotations.ChatRequest in project spring-bot by finos.
the class HelpController method initExposedHandlers.
@SuppressWarnings("unchecked")
public void initExposedHandlers() {
if (exposedHandlers == null) {
ResolvableType rt = ResolvableType.forClassWithGenerics(ChatHandlerMapping.class, ChatRequest.class);
exposedHandlers = Arrays.stream(ctx.getBeanNamesForType(rt)).map(bn -> (ChatHandlerMapping<ChatRequest>) ctx.getBean(bn)).collect(Collectors.toList());
}
}
use of org.finos.symphony.toolkit.workflow.annotations.ChatRequest in project spring-bot by finos.
the class HelpController method convertToCommandDescriptions.
private CommandDescription convertToCommandDescriptions(ChatMapping<ChatRequest> hm) {
ChatRequest e = hm.getMapping();
ChatHandlerMethod m = hm.getHandlerMethod();
String d = StringUtils.hasText(e.description()) ? e.description() : defaultDescription(m.getMethod());
return new CommandDescription(e.isButtonOnHelpPage(), e.value()[0], d, Arrays.asList(e.value()));
}
use of org.finos.symphony.toolkit.workflow.annotations.ChatRequest in project spring-bot by finos.
the class ToDoController method complete.
@ChatRequest(value = "complete {items} {by}", description = "Complete items, e.g. \"/complete 1 3 5 @Suresh Rupnar\"")
public ToDoList complete(@ChatVariable("items") List<Word> words, @ChatVariable("by") Optional<User> by, User a, Optional<ToDoList> toDo) {
ToDoList out = toDo.orElse(new ToDoList());
User u = by.orElse(a);
changeStatus(out, words, u, Status.COMPLETE);
return out;
}
use of org.finos.symphony.toolkit.workflow.annotations.ChatRequest in project spring-bot by finos.
the class ToDoController method assign.
@ChatRequest(value = "assign {items} {by}", description = "Assign items, e.g. \"/assign 1 3 5 @Suresh Rupnar\"")
public ToDoList assign(@ChatVariable("items") List<Word> words, @ChatVariable("by") Optional<User> by, User a, Optional<ToDoList> toDo) {
ToDoList out = toDo.orElse(new ToDoList());
User u = by.orElse(a);
changeStatus(out, words, u, Status.OPEN);
return out;
}
use of org.finos.symphony.toolkit.workflow.annotations.ChatRequest in project spring-bot by finos.
the class OurController method form1.
@ChatRequest(description = "Do blah with a form", value = "form1")
public WorkResponse form1(Addressable a) {
ButtonList bl = new ButtonList();
bl.add(new Button("go", Type.ACTION, "Do The Thing"));
return new WorkResponse(a, new TestObject(), WorkMode.EDIT, bl, null);
}
Aggregations