no message
This commit is contained in:
@ -1,23 +0,0 @@
|
|||||||
package com.sczx.order.controller;
|
|
||||||
|
|
||||||
import com.sczx.order.common.Result;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
public class MeiTuanController {
|
|
||||||
|
|
||||||
@ApiOperation(value = "接收需同步数据接口")
|
|
||||||
@GetMapping("/authorization")
|
|
||||||
public Result authorization(@RequestParam("code") String code, @RequestParam("sign") String sign, @RequestParam("developerId") Long developerId, @RequestParam("businessId") int businessId,
|
|
||||||
@RequestParam("state") String state){
|
|
||||||
|
|
||||||
log.info("接收美团授权数据 - code: {}, sign: {}, developerId: {}, businessId: {}, state: {}",
|
|
||||||
code, sign, developerId, businessId, state);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
package com.sczx.order.controller;
|
||||||
|
|
||||||
|
import com.sczx.order.common.Result;
|
||||||
|
import com.sczx.order.service.DouyinService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/verify")
|
||||||
|
public class VerifyController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DouyinService douyinService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "接收需同步数据接口")
|
||||||
|
@GetMapping("/authorization")
|
||||||
|
public Result authorization(@RequestParam("code") String code, @RequestParam("sign") String sign, @RequestParam("developerId") Long developerId, @RequestParam("businessId") int businessId,
|
||||||
|
@RequestParam("state") String state){
|
||||||
|
|
||||||
|
log.info("接收美团授权数据 - code: {}, sign: {}, developerId: {}, businessId: {}, state: {}",
|
||||||
|
code, sign, developerId, businessId, state);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "接收需据接口")
|
||||||
|
@GetMapping("/Prepare")
|
||||||
|
public Result prepare(@RequestParam("code") String code, @RequestParam("sign") String sign, @RequestParam("developerId") Long developerId, @RequestParam("businessId") int businessId,
|
||||||
|
@RequestParam("state") String state) throws Exception {
|
||||||
|
|
||||||
|
log.info("接收美团授权数据 - code: {}, sign: {}, developerId: {}, businessId: {}, state: {}",
|
||||||
|
code, sign, developerId, businessId, state);
|
||||||
|
|
||||||
|
douyinService.prepare( null);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,8 +1,11 @@
|
|||||||
package com.sczx.order.service;
|
package com.sczx.order.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface DouyinService {
|
public interface DouyinService {
|
||||||
|
|
||||||
String resolveShortUrlToGetObjectId(String shortUrl) throws Exception;
|
String resolveShortUrlToGetObjectId(String shortUrl) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
void prepare(List<String> orderIds) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,8 @@ public class DouyinServiceImpl implements DouyinService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Prepare(List<String> orderIds) throws Exception {
|
@Override
|
||||||
|
public void prepare(List<String> orderIds) throws Exception {
|
||||||
// 获取当前有效的access_token
|
// 获取当前有效的access_token
|
||||||
String accessToken = DouyinTokenManager.getCurrentToken();
|
String accessToken = DouyinTokenManager.getCurrentToken();
|
||||||
|
|
||||||
@ -89,9 +90,9 @@ public class DouyinServiceImpl implements DouyinService {
|
|||||||
CertificatePrepareRequest sdkRequest = new CertificatePrepareRequest();
|
CertificatePrepareRequest sdkRequest = new CertificatePrepareRequest();
|
||||||
sdkRequest.setAccessToken(accessToken);
|
sdkRequest.setAccessToken(accessToken);
|
||||||
sdkRequest.setAccountId(ACCOUNT_ID);
|
sdkRequest.setAccountId(ACCOUNT_ID);
|
||||||
sdkRequest.setCode("GB3ChSgXHc");
|
sdkRequest.setCode("");
|
||||||
sdkRequest.setEncryptedData("9Q28CnUoEX");
|
sdkRequest.setEncryptedData("");
|
||||||
sdkRequest.setPoiId("KY9n9WUFKe");
|
sdkRequest.setPoiId("");
|
||||||
CertificatePrepareResponse sdkResponse = client.CertificatePrepare(sdkRequest);
|
CertificatePrepareResponse sdkResponse = client.CertificatePrepare(sdkRequest);
|
||||||
processCertificatePrepareResponse(sdkResponse);
|
processCertificatePrepareResponse(sdkResponse);
|
||||||
} catch (TeaException e) {
|
} catch (TeaException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user