mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
新增 微信第三方平台 使用授权码获取授权信息接口
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user