|
|
|
@ -10,8 +10,12 @@ import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 巨量广告投放
|
|
|
|
|
*
|
|
|
|
|
* @author Enzo
|
|
|
|
|
* @date : 2022/9/14
|
|
|
|
|
*/
|
|
|
|
@ -28,20 +32,21 @@ public class OceanEngineController {
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取投放请求")
|
|
|
|
|
@GetMapping(value = "/{id}")
|
|
|
|
|
public ResponseEntity<String> query(@PathVariable Long id){
|
|
|
|
|
public ResponseEntity<String> query(@PathVariable Long id) {
|
|
|
|
|
return new ResponseEntity<>(oceanEngineService.buildAuthorizationUrl(id), HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取回调请求")
|
|
|
|
|
@GetMapping(value = "/callback")
|
|
|
|
|
public ResponseEntity<Void> callback(@RequestParam("state") String state,@RequestParam("auth_code") String authCode){
|
|
|
|
|
public ResponseEntity<Void> callback(@RequestParam("state") String state,
|
|
|
|
|
@RequestParam("auth_code") String authCode,
|
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
|
log.info("================== the state as {},authCode as {} ================", state, authCode);
|
|
|
|
|
oceanEngineService.processRequest(state, authCode);
|
|
|
|
|
response.sendRedirect("https://baiyee.vip/dashboard");
|
|
|
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|