package com.mortals.xhx.busiz.web;

import com.alibaba.fastjson.JSONObject;
import com.mortals.xhx.busiz.req.TestReq;
import lombok.extern.slf4j.Slf4j;
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.RestController;

/**
 * 设备
 *
 * @author: zxfei
 * @date: 2021/8/24 20:28
 */
@RestController
@Slf4j
@RequestMapping("test")
public class TestFormAndJsonController {

    /**
     * 测试form表单提交评价
     *
     * @param req
     * @return
     */
    @PostMapping("form")
    public String form(TestReq req) {
        log.info("【测试form】【请求体】-->  " + JSONObject.toJSONString(req));
        return "ok";
    }


    /**
     * 测试form表单提交评价
     *
     * @param req
     * @return
     */
    @PostMapping("json")
    public String json(@RequestBody TestReq req) {
        log.info("【测试json】【请求体】-->  " + JSONObject.toJSONString(req));
        return "ok";
    }


    public static void main(String[] args) {

    }


}
