| 1234567891011121314151617181920212223242526272829303132 |
- package cn.com.goldenwater.dcproj.controller;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.AgoraToken;
- import cn.com.goldenwater.dcproj.service.AgoraTokenService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.springframework.beans.factory.annotation.Autowired;
- 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;
- import java.security.NoSuchAlgorithmException;
- @Api(value = "声网Agora Token", tags = "声网Agora Token")
- @RestController
- @RequestMapping("/agora")
- public class AgoraTokenController extends BaseController {
- @Autowired
- private AgoraTokenService agoraTokenService;
- @ApiOperation(value = "获取Token")
- @PostMapping("/token")
- public BaseResponse getToken(@ApiParam("agoraToken")
- @RequestBody AgoraToken agoraToken) throws Exception {
- return buildSuccessResponse(agoraTokenService.createToken(agoraToken));
- }
- }
|