ApiServiceImpl.java 857 Bytes
package com.huaheng.control.management.service.impl;

import java.util.Map;
import java.util.Set;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.huaheng.control.management.dto.TaskStatus;
import com.huaheng.control.management.service.ApiService;
import com.huaheng.control.management.utils.HuahengRedisUtils;

@Service
public class ApiServiceImpl implements ApiService {

    @Resource
    private HuahengRedisUtils huahengRedisUtils;

    @Override
    public void saveTaskStatus(TaskStatus taskStatus) {
        huahengRedisUtils.saveTaskStatus(taskStatus.getTaskId(), taskStatus.getStatus(), taskStatus.getData());
    }

    @Override
    public Map<String, Map<Object, Object>> queryAllTaskInfo() {
        return huahengRedisUtils.getTaskDetailsWithTaskKeys(huahengRedisUtils.getAllTaskKeys());
    }
}