- 新增 textToImage 和 imageToText 功能,实现文本与图片的相互转换 - 优化日志系统,使用 log4j2 实现动态日志记录- 重构 BaiduGPTManager 类,增加多线程支持和错误处理 - 更新 MessageHandleBuild 类,支持 message_id 参数 - 修复部分功能的逻辑错误,提高系统稳定性
53 lines
1.3 KiB
Java
53 lines
1.3 KiB
Java
package com.yutou.napcat.http;
|
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.yutou.napcat.handle.BaseHandle;
|
|
import com.yutou.napcat.model.MessageBean;
|
|
import com.yutou.napcat.model.SendMessageResponse;
|
|
import com.yutou.okhttp.BaseBean;
|
|
import com.yutou.okhttp.HttpBody;
|
|
import kotlin.jvm.JvmSuppressWildcards;
|
|
import retrofit2.Call;
|
|
import retrofit2.http.*;
|
|
|
|
import java.util.List;
|
|
|
|
public interface MessageAPI {
|
|
/**
|
|
* 发送私聊消息
|
|
* @param message {@link com.yutou.napcat.handle.MessageHandleBuild}
|
|
* @return 消息id
|
|
*/
|
|
@POST("/send_private_msg")
|
|
Call<HttpBody<SendMessageResponse>> sendPrivateMsg(
|
|
@Body
|
|
JSONObject message);
|
|
/**
|
|
* 发送群聊消息
|
|
* @param message 消息内容
|
|
* @return 消息id
|
|
*/
|
|
@POST("/send_group_msg")
|
|
Call<HttpBody<SendMessageResponse>> sendGroupMsg(
|
|
@Body
|
|
JSONObject message
|
|
);
|
|
|
|
/**
|
|
* 撤回消息
|
|
* @param messageId 消息id
|
|
*/
|
|
@FormUrlEncoded
|
|
@POST("/delete_msg")
|
|
Call<HttpBody<BaseBean>> delMsg(
|
|
@Field("message_id") long messageId
|
|
);
|
|
|
|
@POST("/get_msg")
|
|
Call<HttpBody<MessageBean>> getMessage(
|
|
@Body
|
|
JSONObject message
|
|
);
|
|
}
|