25afe3a5e181d1bba8ea130d032251888007c0e6.svn-base 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. package cn.com.goldenwater.dcproj.controller;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AgoraToken;
  5. import cn.com.goldenwater.dcproj.service.AgoraTokenService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import java.security.NoSuchAlgorithmException;
  15. @Api(value = "声网Agora Token", tags = "声网Agora Token")
  16. @RestController
  17. @RequestMapping("/agora")
  18. public class AgoraTokenController extends BaseController {
  19. @Autowired
  20. private AgoraTokenService agoraTokenService;
  21. @ApiOperation(value = "获取Token")
  22. @PostMapping("/token")
  23. public BaseResponse getToken(@ApiParam("agoraToken")
  24. @RequestBody AgoraToken agoraToken) throws Exception {
  25. return buildSuccessResponse(agoraTokenService.createToken(agoraToken));
  26. }
  27. }