mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
【增加】增加 MidjourneyNotifyReqVO.Button 类型转换器
This commit is contained in:
parent
2b3593dfe0
commit
513ded4f61
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.ai.dal.dataobject.image;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.ai.client.vo.MidjourneyNotifyReqVO;
|
||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO;
|
||||
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.Data;
|
||||
import org.springframework.ai.openai.OpenAiImageOptions;
|
||||
@ -108,7 +110,7 @@ public class AiImageDO extends BaseDO {
|
||||
/**
|
||||
* mj buttons 按钮
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
@TableField(typeHandler = ButtonTypeHandler.class)
|
||||
private List<MidjourneyNotifyReqVO.Button> buttons;
|
||||
|
||||
/**
|
||||
@ -121,5 +123,18 @@ public class AiImageDO extends BaseDO {
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
public static class ButtonTypeHandler extends AbstractJsonTypeHandler<Object> {
|
||||
|
||||
@Override
|
||||
protected Object parse(String json) {
|
||||
return JsonUtils.parseArray(json, MidjourneyNotifyReqVO.Button.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String toJson(Object obj) {
|
||||
return JsonUtils.toJsonString(obj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user