Commit 87224ea1 by zhaolianjie

卡片流程 - 删除群组

1 parent b0cdd4c0
...@@ -29,6 +29,7 @@ import com.pipihelper.project.feishu.service.massage.MassageService; ...@@ -29,6 +29,7 @@ import com.pipihelper.project.feishu.service.massage.MassageService;
import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter; import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter;
import com.pipihelper.project.utils.CacheUtil; import com.pipihelper.project.utils.CacheUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -92,12 +93,16 @@ public class FeiShuEventController { ...@@ -92,12 +93,16 @@ public class FeiShuEventController {
if (encryptJsonObject.containsKey("challenge")) { if (encryptJsonObject.containsKey("challenge")) {
return encryptJsonObject; return encryptJsonObject;
} }
String chatId = (String) CacheUtil.get("chatId");
log.info("删除群组id:{}", chatId);
feiShuApiService.deleteChatList("oc_a1df7014af5a345204e36f8f01bba574");
FeiShuEventDTO feiShuEventDTO = encryptJsonObject.toJavaObject(FeiShuEventDTO.class); FeiShuEventDTO feiShuEventDTO = encryptJsonObject.toJavaObject(FeiShuEventDTO.class);
if (!feiShuEventDTO.getHeader().getToken().equalsIgnoreCase(feiShuConfig.getVerificationToken())) { if (!feiShuEventDTO.getHeader().getToken().equalsIgnoreCase(feiShuConfig.getVerificationToken())) {
return null; return null;
} }
if ("im.message.receive_v1".equalsIgnoreCase(feiShuEventDTO.getHeader().getEvent_type())) { if ("im.message.receive_v1".equalsIgnoreCase(feiShuEventDTO.getHeader().getEvent_type())) {
log.info("处理单聊事件:{}",feiShuEventDTO); log.info("处理单聊事件:{}", feiShuEventDTO);
feiShuEventService.imMessageReceiveV1(feiShuEventDTO); feiShuEventService.imMessageReceiveV1(feiShuEventDTO);
} }
return null; return null;
...@@ -182,7 +187,7 @@ public class FeiShuEventController { ...@@ -182,7 +187,7 @@ public class FeiShuEventController {
String robUserId = feiShuMsgCardEventDTO.getOpen_id(); String robUserId = feiShuMsgCardEventDTO.getOpen_id();
Employee employee = employeeService.findByOpenId(robUserId); Employee employee = employeeService.findByOpenId(robUserId);
massageService.robSingle(robUserId,oldUserId,employee.getName()); massageService.robSingle(robUserId, oldUserId, employee.getName());
String fileName1 = String.format("/templates/massage-msg-card-rob-end.json"); String fileName1 = String.format("/templates/massage-msg-card-rob-end.json");
return getInteractiveCardStr(fileName1, "已经被" + employee.getName() + "抢啦,啦啦~"); return getInteractiveCardStr(fileName1, "已经被" + employee.getName() + "抢啦,啦啦~");
} }
...@@ -208,8 +213,10 @@ public class FeiShuEventController { ...@@ -208,8 +213,10 @@ public class FeiShuEventController {
} }
@PostMapping("/delete-chat-list") @PostMapping("/delete-chat-list")
public Object deleteChat() { public Object deleteChat(String chatId) {
String chatId = (String) CacheUtil.get("chatId"); if (StringUtils.isBlank(chatId)) {
chatId = (String) CacheUtil.get("chatId");
}
log.info("删除群组id:{}", chatId); log.info("删除群组id:{}", chatId);
feiShuApiService.deleteChatList(chatId); feiShuApiService.deleteChatList(chatId);
return null; return null;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!