如何从Slack交互式按钮获取数据

问题描述

我正在尝试使用Java SpringBoot和BlockKit创建我的第一个Slack应用,并且不确定如何响应交互性。

当我启动Slack时,SlackAppServer的启动如下:

@Bean
public CommandLineRunner commandLineRunner() {
    App app = new App();
    app.command("/example",(req,ctx) -> {
        /// Send a button back to the user
        return ctx.ack();
    });

    SlackAppServer server = new SlackAppServer(app);
    server.start(); // http://localhost:3000/slack/event
}

用户与此应用进行交互时,将使用BlockKit发送回一个按钮。我已经确认用户单击此按钮时,请求将返回到我的SpringBoot应用程序:

@RequestMapping(value = "/interactive",method = RequestMethod.POST)
public void findById() {
    System.out.println("What do I do here?");
}

在这一点上,我不确定我应该做什么,我想应该有一些JSON数据可用,但是我不确定如何访问它。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)