Commit f8f0ee1e by CaIon

feat: initialize channel metadata in mjproxy and relay processing

parent f6ee0b97
......@@ -318,8 +318,6 @@ func RelayMidjourney(c *gin.Context) {
return
}
relayInfo.InitChannelMeta(c)
var mjErr *dto.MidjourneyResponse
switch relayInfo.RelayMode {
case relayconstant.RelayModeMidjourneyNotify:
......
......@@ -176,6 +176,9 @@ func RelaySwapFace(c *gin.Context, info *relaycommon.RelayInfo) *dto.MidjourneyR
if err != nil {
return service.MidjourneyErrorWrapper(constant.MjRequestError, "bind_request_body_failed")
}
info.InitChannelMeta(c)
if swapFaceRequest.SourceBase64 == "" || swapFaceRequest.TargetBase64 == "" {
return service.MidjourneyErrorWrapper(constant.MjRequestError, "sour_base64_and_target_base64_is_required")
}
......@@ -370,6 +373,8 @@ func RelayMidjourneySubmit(c *gin.Context, relayInfo *relaycommon.RelayInfo) *dt
return service.MidjourneyErrorWrapper(constant.MjRequestError, "bind_request_body_failed")
}
relayInfo.InitChannelMeta(c)
if relayInfo.RelayMode == relayconstant.RelayModeMidjourneyAction { // midjourney plus,需要从customId中获取任务信息
mjErr := service.CoverPlusActionToNormalAction(&midjRequest)
if mjErr != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment