FeiShuEventService.java
1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.pipihelper.project.feishu.service;
import com.pipihelper.project.feishu.dto.FeiShuConfig;
import com.pipihelper.project.feishu.dto.FeiShuEventDTO;
import com.pipihelper.project.feishu.dto.FeiShuEventHeaderDTO;
import com.pipihelper.project.feishu.dto.FeiShuEventReceiveMessageDTO;
import com.pipihelper.project.tx.dto.TxConfig;
import com.pipihelper.project.tx.service.TxApiService;
import com.pipitest.project.feishu.dto.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @Description: TODO
* @author: charles
* @date: 2022年04月11日 17:01
*/
@Service
public class FeiShuEventService {
@Resource
private FeiShuConfig feiShuConfig;
@Resource
private FeiShuApiService feiShuApiService;
@Autowired
private TxApiService txApiService;
@Autowired
private TxConfig txConfig;
@Async
public void imMessageReceiveV1(FeiShuEventDTO feiShuEventDTO){
FeiShuEventHeaderDTO feiShuEventHeaderDTO = feiShuEventDTO.getHeader();
FeiShuEventReceiveMessageDTO feiShuEventReceiveMessageDTO = feiShuEventDTO.getEvent().toJavaObject(FeiShuEventReceiveMessageDTO.class);
FeiShuEventReceiveMessageDTO.Sender sender= feiShuEventReceiveMessageDTO.getSender();
FeiShuEventReceiveMessageDTO.Message message= feiShuEventReceiveMessageDTO.getMessage();
//单独处理群消息
if (message.getChat_id().equals(feiShuConfig.getAppConfigMap().get(feiShuConfig.getTestHelperApp()).getFkChatId())
|| message.getChat_id().equals(feiShuConfig.getAppConfigMap().get(feiShuConfig.getTestHelperApp()).getFkChatIdTest())) { //判断是否为指定群消息
return;
}
else {
//如果是单聊
if(message.getChat_type().equals("p2p")) {
// robotTalk(feiShuEventDTO);
}
}
}
}