package cn.datax.service.data.market.mapping.controller;

import cn.datax.common.base.BaseController;
import cn.datax.common.core.R;
import cn.datax.service.data.market.mapping.service.ApiExecuteService;
import cn.datax.service.data.market.api.vo.ApiHeader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/apis")
public class ApiExecuteController extends BaseController {

    @Autowired
    private ApiExecuteService apiExecuteService;

    @GetMapping(value = "/{id}/header")
    public R getApiHeader(@PathVariable String id){
        ApiHeader apiHeader = apiExecuteService.getApiHeader(id);
        return R.ok().setData(apiHeader);
    }
}
