package com.ruoyi.interfaces.controller;

import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.interfaces.service.InterfaceTokenService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by xujingfeng on 2017/4/1.
 */
@RestController
@RequestMapping("/service/token")
public class TokenController {

    @Autowired
    private InterfaceTokenService tokenService;

//    @Value("${shenyu.client.props.contextPath}")
//    private String gatewayContextPath;

    @GetMapping("")
    public Map<String, Object> token(String grant_type, String appId, String secret) {
        return tokenService.token(grant_type, appId, secret);
    }

}
