// json 代码
{ /*用户信息*/
user: {
username: '{$user.username}',
headImg: '{$user.headImg}',
targetId: '{$user.targetId}',
openid: '{$user.openid}'
}, /* 产品信息 */
productUrl: '',
productImg: '',
productPrice: ''
}

// 后台代码

class ConnController {
/**
* 普通用户初始连接时请求。
*/
class UserInitReq {
var user: User = User()
} @Autowired
lateinit var connService: ConnService @PostMapping("/userToKfConn")
@ResponseBody
fun userToKfConn(@RequestBody userInitReq: UserInitReq,
req: HttpServletRequest,
resp: HttpServletResponse): Map<String, Any?> { return connService.handlerUserToKfConn(req, resp, userInitReq.user) }
}

前台发送 post (json)请求,后台是用这个方法接收

kotlin spring mvc request json 请求的更多相关文章

  1. spring mvc返回json字符串的方式

    spring mvc返回json字符串的方式 方案一:使用@ResponseBody 注解返回响应体 直接将返回值序列化json            优点:不需要自己再处理 步骤一:在spring- ...

  2. ajax使用向Spring MVC发送JSON数据出现 org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported错误

    ajax使用向Spring MVC发送JSON数据时,后端Controller在接受JSON数据时报org.springframework.web.HttpMediaTypeNotSupportedE ...

  3. Spring MVC的映射请求

    一.SpringMVC常用注解 @Controller 声明Action组件 @Service    声明Service组件    @Service("myMovieLister" ...

  4. Spring MVC 异步处理请求,提高程序性能

    原文:http://blog.csdn.net/he90227/article/details/52262163 什么是异步模式 如何在Spring MVC中使用异步提高性能? 一个普通 Servle ...

  5. Spring mvc 启动 和 请求分发

    Spring mvc 启动 和 请求分发 启动加载: abstract class HttpServletBean extends HttpServlet void init() initServle ...

  6. Spring MVC 处理一个请求的流程分析

    Spring MVC是Spring系列框架中使用频率最高的部分.不管是Spring Boot还是传统的Spring项目,只要是Web项目都会使用到Spring MVC部分.因此程序员一定要熟练掌握MV ...

  7. spring mvc返回json字符串数据,只需要返回一个java bean对象就行,只要这个java bean 对象实现了序列化serializeable

    1.spring mvc返回json数据,只需要返回一个java bean对象就行,只要这个java bean 对象实现了序列化serializeable 2. @RequestMapping(val ...

  8. An overview of the Spring MVC request flow

    The Spring MVC request flow in short: When we enter a URL in the browser, the request comes to the d ...

  9. Spring Mvc 输出Json(iwantmoon.com出品)

    原文:http://iwantmoon.com/Post/f94e49caf9b6455db7158474bab4c4dd 因为工作需要,现在要去做开放平台,考虑了多种方案之后,基本确定 下来,Htt ...

随机推荐

  1. 分布式缓存产品Redis和memcached比较区别(图)

  2. ubuntu 环境变量设置

    一:用于当前终端:在当前终端中输入:export PATH=$PATH:<你的要加入的路径>不过上面的方法只适用于当前终端,一旦当前终端关闭或在另一个终端中,则无效.export NDK_ ...

  3. 各种RNAseq原理

    RNA Sequencing Methods Low-Level RNA Detection CEL-Seq CirSeq CLaP CytoSeq Digital RNA Sequencing DP ...

  4. Azure 网站、云服务和虚拟机比较

    最后更新时间(英文版):09/24/2014 最后更新时间(中文版):04/11/2015 Azure 提供几种方式托管 web 应用程序,如 Azure 网站.云服务和虚拟机.查看这些不同的选项后, ...

  5. backquote

    character (`) A backquote or backtick. echo 'date' date echo `date` 2015年 07月 03日 星期五 16:11:13 CST j ...

  6. 使用Adobe Illustrator + ArcGIS绘制地图 | Map Design Using ArcGIS + Adobe Illustrator

    国内GIS/Cartography同行大部分使用CorelDraw绘制地图.相比之下,国外同行则更多使用Adobe Illustrator绘制地图.CorelDraw和Illustrator两个软件均 ...

  7. 下载特定区域内街景照片数据 | Download Street View Photos within Selected Region

    作者:姜虹,刘子煜,王玥瑶,杨安琪,天靖居士 街景图片可以通过api下载,但需要提供参数,参数中的poiid.panoid.location可以用来确定位置或全景图片的ID以确定对应的街景图片.优先级 ...

  8. 在MYSQL中运用全文索引(FULLTEXT index)

    在MYSQL中使用全文索引(FULLTEXT index) MYSQL的一个很有用的特性是使用全文索引(FULLTEXT index)查找文本的能力.目前只有使用MyISAM类型表的时候有效(MyIS ...

  9. Linq to SQL Like Operator

    As a response for customer's question, I decided to write about using Like Operator in Linq to SQL q ...

  10. MongoDB整理笔记の高级查询

    1.条件操作符 <, <=, >, >= 这个操作符就不用多解释了,最常用也是最简单的    db.collection.find({ "field" : ...