chen_xi
2023-06-29 213b9ff531e42119f0346c5a3e7279798e089d86
screen-api/src/main/java/com/moral/api/controller/HistoryFiveMinutelyController.java
@@ -6,15 +6,21 @@
import com.moral.api.service.HistoryFiveMinutelyService;
import com.moral.constant.ResponseCodeEnum;
import com.moral.constant.ResultMessage;
import com.moral.util.WebUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
 * @ClassName HistoryFiveMinutely
@@ -65,8 +71,13 @@
            * @Date: 2022/3/10
            */
    @GetMapping("queryPopDataByMac")
    public ResultMessage queryPopDataByMac(String mac){
        return  ResultMessage.ok(historyFiveMinutelyService.getPopDataByMac(mac));
    public ResultMessage queryPopDataByMac(HttpServletRequest request){
        Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
        Map<String, Object> popDataByMac = historyFiveMinutelyService.getPopDataByMac(params);
        if (popDataByMac==null){
            return ResultMessage.fail(ResponseCodeEnum.TARGET_IS_NULL.getCode(), ResponseCodeEnum.TARGET_IS_NULL.getMsg());
        }
        return  ResultMessage.ok(popDataByMac);
    }
}