新增 微信第三方平台 使用授权码获取授权信息接口

This commit is contained in:
Lemon
2023-07-29 11:42:01 +08:00
parent d4723d9274
commit 13b7a1f9a6
6 changed files with 148 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.domain.AuthorizationEventResult;
import com.jsowell.pile.dto.GetComponentTokenDTO;
import com.jsowell.pile.vo.agentDev.AuthInfo;
import com.jsowell.service.AgentDevService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +29,7 @@ public class AgentDevController extends BaseController {
private AgentDevService agentDevService;
/**
* 授权事件接收URL,验证票据、
* 授权事件接收URL,验证票据、授权事件
*
* @param timestamp
* @param nonce
@@ -82,4 +83,24 @@ public class AgentDevController extends BaseController {
return response;
}
/**
* 使用授权码获取授权信息
* @param authorizationCode
* @return
*/
@GetMapping("/getAuthInfo/{authorizationCode}")
public RestApiResponse<?> getAuthInfo(@PathVariable("authorizationCode") String authorizationCode) {
logger.info("使用授权码获取授权信息 params:{}", authorizationCode);
RestApiResponse<?> response = null;
try {
AuthInfo authInfo = agentDevService.getAuthInfoByAuthCode(authorizationCode);
response = new RestApiResponse<>(authInfo);
} catch (Exception e) {
logger.error("使用授权码获取授权信息 error,", e);
response = new RestApiResponse<>(e);
}
logger.info("使用授权码获取授权信息 result:{}", response);
return response;
}
}