🔄Update: 卡片回调逻辑框架
This commit is contained in:
@@ -10,6 +10,10 @@ import cn.hezhaohui.lark.util.LarkUtil;
|
|||||||
import cn.hezhaohui.pojo.vo.MovieVO;
|
import cn.hezhaohui.pojo.vo.MovieVO;
|
||||||
import com.lark.oapi.core.utils.Jsons;
|
import com.lark.oapi.core.utils.Jsons;
|
||||||
import com.lark.oapi.event.EventDispatcher;
|
import com.lark.oapi.event.EventDispatcher;
|
||||||
|
import com.lark.oapi.event.cardcallback.P2CardActionTriggerHandler;
|
||||||
|
import com.lark.oapi.event.cardcallback.model.CallBackToast;
|
||||||
|
import com.lark.oapi.event.cardcallback.model.P2CardActionTrigger;
|
||||||
|
import com.lark.oapi.event.cardcallback.model.P2CardActionTriggerResponse;
|
||||||
import com.lark.oapi.service.application.ApplicationService;
|
import com.lark.oapi.service.application.ApplicationService;
|
||||||
import com.lark.oapi.service.application.v6.model.P2BotMenuV6;
|
import com.lark.oapi.service.application.v6.model.P2BotMenuV6;
|
||||||
import com.lark.oapi.service.im.ImService;
|
import com.lark.oapi.service.im.ImService;
|
||||||
@@ -55,6 +59,24 @@ public class EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.onP2CardActionTrigger(new P2CardActionTriggerHandler() {
|
||||||
|
@Override
|
||||||
|
public P2CardActionTriggerResponse handle(P2CardActionTrigger event) throws Exception {
|
||||||
|
System.out.printf("[ onP2CardActionTrigger access ], data: %s\n", Jsons.DEFAULT.toJson(event.getEvent()));
|
||||||
|
|
||||||
|
String input = event.getEvent().getAction().getFormValue().get("movie_name").toString();
|
||||||
|
System.out.println(input);
|
||||||
|
|
||||||
|
// TODO: 添加用户输入的电影
|
||||||
|
|
||||||
|
P2CardActionTriggerResponse response = new P2CardActionTriggerResponse();
|
||||||
|
CallBackToast toast = new CallBackToast();
|
||||||
|
toast.setType("success");
|
||||||
|
toast.setContent("Operation success!!!");
|
||||||
|
response.setToast(toast);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static void larkClientStart() {
|
public static void larkClientStart() {
|
||||||
|
|||||||
Reference in New Issue
Block a user