对JSON数据的解析(数据推送接口)
package com.liuqi.www; import java.util.HashMap;
import java.util.Map; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; @Controller("TestController")
@RequestMapping(value = "/testController",method = RequestMethod.POST)
public class TestController{ @RequestMapping(value="/test",method = RequestMethod.POST)
@ResponseBody
public Map<String,Object> test(@RequestBody Map<String,Object> parameter){
//请求的数据相关信息
Map<String,String> head = (Map<String,String>)parameter.get("head"); //js端生成的请求流水号
String reqId = head.get("reqId"); //请求时间
String times = head.get("times"); //请求从哪个功能点过来的
String compId = head.get("compId"); //存放数据描述信息
Map<String,Object> info = (Map<String,Object>)parameter.get("info"); //数据类型
String dataType = (String)info.get("dataType"); //操作类型
String opType = (String)info.get("opType"); //存放数据的对象
Object date = info.get("date"); //做处理 //返回结果
Map<String,Object> result = new HashMap<>(); Map<String,Object> resultHead = new HashMap<>(); //给head里面放数据 Map<String,Object> resultInfo = new HashMap<>(); //给info里面放数据 result.put("head", resultHead);
result.put("info", resultInfo);
return result;
} }
将JSON数据解析成自己需要的对象,来进行相关的操作,通过参数接收操作后的数据,来进行返回码的判断,将返回码显示给上一级查看
对JSON数据的解析(数据推送接口)的更多相关文章
- 设备数据通过Azure Functions 推送到 Power BI 数据大屏进行展示(2.Azure Functions实战)
本案例适用于开发者入门理解Azure Functions/ IoT Hub / Service Bus / Power BI等几款产品. 主要实战的内容为: 将设备遥测数据上传到物联网中心, 将遥测数 ...
- 【NFS项目实战二】NFS共享数据的时时同步推送备份
[NFS项目实战二]NFS共享数据的时时同步推送备份 标签(空格分隔): Linux服务搭建-陈思齐 ---本教学笔记是本人学习和工作生涯中的摘记整理而成,此为初稿(尚有诸多不完善之处),为原创作品, ...
- python爬虫——爬取网页数据和解析数据
1.网络爬虫的基本概念 网络爬虫(又称网络蜘蛛,机器人),就是模拟客户端发送网络请求,接收请求响应,一种按照一定的规则,自动地抓取互联网信息的程序.只要浏览器能够做的事情,原则上,爬虫都能够做到. 2 ...
- 如何使用Postman调试HMS Core推送接口?
HMS Core推送服务支持开发者使用HTTPS协议接入Push服务端.Postman是一款接口测试工具,它可以模拟用户发起的各类HTTP请求,将请求数据发送至服务端,获取对应的响应结果.Postma ...
- 关于调用三方平台接口与推送接口的总结<二>(2020.7.27)
前言:本篇博客是接着上篇总结写的,想了解怎么对接第三方平台接口的同学可以看我上一篇博客,地址是 https://www.cnblogs.com/alanturingson/p/13377500.ht ...
- Android平台摄像头/屏幕/外部数据采集及RTMP推送接口设计描述
好多开发者提到,为什么大牛直播SDK的Android平台RTMP推送接口怎么这么多?不像一些开源或者商业RTMP推送一样,就几个接口,简单明了. 不解释,以Android平台RTMP推送模块常用接口, ...
- 设备数据通过Azure Functions 推送到 Power BI 数据大屏进行展示(1.准备工作)
本案例适用于开发者入门理解Azure Functions/ IoT Hub / Service Bus / Power BI等几款产品. 主要实战的内容为: 将设备遥测数据上传到物联网中心, 将遥测数 ...
- java推送数据到app--极光推送
之前项目有用到需要把数据推送到app端 采用的是极光推送 特此把工具类和pom.xml需要的jar整理如下 pom.xml需要jar如下 <!-- 极光推送 --> <depende ...
- 【Android应用开发】 推送原理解析 极光推送使用详解 (零基础精通推送)
作者 : octopus_truth 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/45046283 推送技术产生场景 : -- ...
- 企业微信人员日程推送接口(python版)
企业在使用企业微信中,有时想批量推送员工日程信息.这里写了个接口工具分享给大家,供交流学习. 主入口程序: # -*- coding: utf-8 -*-import time as time imp ...
随机推荐
- 670. Maximum Swap
Given a non-negative integer, you could swap two digits at most once to get the maximum valued numbe ...
- linux下tomcat运行war包常用命令
一.先是war包copy到 linux 的相关目录,我这的是/opt/soft/tomcat_ecp/webapps. 如果是老项目,在导入war的之前,习惯上是把之前的war备份一下, 如 mv p ...
- javaweb+spring 项目集成异常的处理
在web项目开发中,一个系统应该要考虑到异常情况的处理,并且应该当异常发生时应该需要记录相应的异常日志,对于用户而言则不能直接抛出异常,需要考虑到用户的体验: 以下就介绍基于spring框架的基础上的 ...
- CSS初窥
- OS之进程管理---实时CPU调度
引言 一般来说,我们将实时操作系统区分为软实时系统(soft real-time system)和硬实时系统(hard real-time system).软实时系统不保证会调度关键实时进程,而只保证 ...
- OpenRefine导入CSV文件,数据清理后导出JSON格式
第一步:选择要转换的CSV文件. 第二步:选择以逗号分割,并创建项目. 第三步:编辑,去掉特殊字符 Edit Cells > Transform... 第四步:导出文件,选择“Templatin ...
- 课程一(Neural Networks and Deep Learning),第一周(Introduction to Deep Learning)—— 1、经常提及的问题
Frequently Asked Questions Congratulations to be part of the first class of the Deep Learning Specia ...
- spring boot和mybatis集成分页插件
MyBatis提供了拦截器接口,我们可以实现自己的拦截器,将其作为一个plugin装入到SqlSessionFactory中. 首先要说的是,Spring在依赖注入bean的时候,会把所有实现MyBa ...
- 【数组】Search Insert Position
题目: Given a sorted array and a target value, return the index if the target is found. If not, return ...
- Maven 学习笔记(二)
项目最近开始使用maven去管理项目啦,说真的对于maven是一窍不通啊,今天和同事在回家的路上聊天的时候同事说他去第一家公司面试的时候人家问他 maven 怎么打包,当时我就懵逼了,因为我也不知道啊 ...