package com.chenyang.nse.bussiness.kms.controller;

import com.chenyang.nse.bussiness.kms.service.KmsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"kms"})
public class AccessTokenController {
   protected Logger logger = LoggerFactory.getLogger(this.getClass());
   @Autowired
   protected KmsService kmsService;

   @RequestMapping({"accesstoken"})
   public String accessToken() throws Exception {
      return this.kmsService.obtainAccessToken(this.kmsService.obtainChallengeCode());
   }
}
