Commit 87224ea1 by zhaolianjie

卡片流程 - 删除群组

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