package com.jjt.biz.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.jjt.common.core.controller.BaseController;
import com.jjt.common.core.domain.R;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * swagger 用户测试方法
 *
 * @author ruoyi
 */
@Api("数据接口")
@RestController
@Slf4j
public class DemoController extends BaseController {
    private R<Map> json(String data) {
        try {
            ObjectMapper mapper = new ObjectMapper();
            Map<String, Object> result = mapper.readValue(data, Map.class);
            return R.ok(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return R.fail();
    }


}
