aix
2024-07-23 8b14209e043b037f8e7a5a18138fdf2140885bdb
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
package com.dji.sample.component.mqtt.handler;
 
import com.dji.sample.component.mqtt.model.CommonTopicReceiver;
import com.dji.sample.component.redis.RedisOpsUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
 
import java.util.Map;
 
/**
 * @author sean
 * @version 0.3
 * @date 2022/2/21
 */
public abstract class AbstractStateTopicHandler {
 
    protected AbstractStateTopicHandler handler;
 
    @Autowired
    protected ObjectMapper mapper;
 
    @Autowired
    protected RedisOpsUtils redisOps;
 
    protected AbstractStateTopicHandler(AbstractStateTopicHandler handler) {
        this.handler = handler;
    }
 
    /**
     * Passing dataNode data, using different processing methods depending on the data selection.
     * @param dataNode
     * @param stateReceiver
     * @param sn
     * @return
     * @throws JsonProcessingException
     */
    public abstract CommonTopicReceiver handleState(Map<String, Object> dataNode, CommonTopicReceiver stateReceiver, String sn) throws JsonProcessingException;
}