Commit e74b9e39 by zhaolianjie

卡片流程

1 parent ad390268
......@@ -8,9 +8,11 @@ import com.pipihelper.project.feishu.dto.FeiShuEventDTO;
import com.pipihelper.project.feishu.dto.FeiShuMsgCardEventDTO;
import com.pipihelper.project.feishu.dto.chat.FeiShuChatDTO;
import com.pipihelper.project.feishu.dto.employee.FeiShuEmployeeDTO;
import com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO;
import com.pipihelper.project.feishu.service.EmployeeService;
import com.pipihelper.project.feishu.service.FeiShuApiService;
import com.pipihelper.project.feishu.service.FeiShuEventService;
import com.pipihelper.project.feishu.service.massage.MassageMsgCardSerivce;
import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -44,8 +46,8 @@ public class FeiShuEventController {
@Autowired
private FeiShuApiService feiShuApiService;
@Autowired
private MassageMsgCardSerivce massageMsgCardSerivce;
@Autowired
private EmployeeService employeeService;
......@@ -88,17 +90,23 @@ public class FeiShuEventController {
// 都需要返回 不能点击的卡片json
if ("revice".equals(actionTypeSecond)) {
// 接受按摩
return getInteractiveCardStr("感谢支持");
} else if ("giveUp".equals(actionTypeSecond)) {
// 放弃 - 往大群中发送抢按摩机会卡片
FeiShuMsgDTO feiShuMsgDTO = new FeiShuMsgDTO();
feiShuMsgDTO.setMsgType("interactive");
feiShuMsgDTO.setReceiveId(feiShuConfig.getChatId());
String fileName = String.format("/templates/massage-msg-card-rob.json.json");
String msgCardContent = String.format(massageMsgCardSerivce.getInteractiveCardStr(fileName), feiShuMsgCardEventDTO.getOpen_id());
feiShuMsgDTO.setContent(msgCardContent);
feiShuApiService.sendMsg(feiShuMsgDTO, "chat_id");
return getInteractiveCardStr("遗憾放弃");
} else if ("wait".equals(actionTypeSecond)) {
// 推迟 将当前用户放到队列最后 - 给下一个用户发送按摩卡片
// 推迟 将当前用户放到队列最后 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片
return getInteractiveCardStr("已推迟到最后");
return getInteractiveCardStr("已为你推迟到最后");
}
default:
}
......
{
"config": {
"wide_screen_mode": true,
"update_multi": true
},
"elements": [
{
"tag": "div",
"text": {
"content": "当前空余一个名额",
"tag": "lark_md"
}
},
{
"actions": [
{
"tag": "button",
"text": {
"content": "😁 我抢",
"tag": "plain_text"
},
"type": "default",
"value": {
"key1": "massage-singel.rob.%s"
}
}
],
"tag": "action"
}
],
"header": {
"template": "turquoise",
"title": {
"content": "👻 按摩提醒请查收!",
"tag": "plain_text"
}
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!