|
|
@@ -3,6 +3,7 @@ package com.cyksj.web.controller.mirror;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
+import com.cyksj.common.util.IoKit;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.model.dto.*;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
@@ -20,6 +21,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -338,4 +341,16 @@ public class MidjourneyController {
|
|
|
redisService.del(RedisService.key.MIDJOURNEY_USER.getName() + midjourneyUser.getUserToken());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * midjourney 回调
|
|
|
+ */
|
|
|
+ @PostMapping("/notifyHook")
|
|
|
+ public void notifyHook(HttpServletRequest request) throws Exception {
|
|
|
+ InputStream inputStream = request.getInputStream();
|
|
|
+ byte[] bytes = IoKit.toBytes(inputStream);
|
|
|
+ String json = new String(bytes, StandardCharsets.UTF_8);
|
|
|
+ log.info("midjourney 回调:{}", json);
|
|
|
+ midjourneyService.notifyHook(json);
|
|
|
+ }
|
|
|
}
|