@RestController使用 接收jso參數 將參數轉換為對象


package com.monitor.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.monitor.param.VersionParam;

import esign.utils.bean.Result;

/***
 * 類名:VersionController.java <br/>
 * 功能說明:后台接口配置版本 <br/>
 * 修改歷史: <br/>
 * 1.[2016年8月1日上午10:08:13]創建類 by pxh
 */

@RestController
@RequestMapping(path = "/ version")
public class VersionController {

    @RequestMapping(path = "/getInterfaceVersion")
    // 使用@RequestBody注解將json參數轉換為對象
    public ResponseEntity<Result> getInterfaceVersion(
            @RequestBody VersionParam param) {
        Result result = new Result();

        return ResponseEntity.ok().body(result);
    }

}

postMa測試

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM