81 lines
1.9 KiB
Java
81 lines
1.9 KiB
Java
package com.yutou.napcat.http;
|
|
|
|
import com.yutou.napcat.model.*;
|
|
import com.yutou.okhttp.BaseBean;
|
|
import com.yutou.okhttp.HttpBody;
|
|
import retrofit2.Call;
|
|
import retrofit2.http.Field;
|
|
import retrofit2.http.FormUrlEncoded;
|
|
import retrofit2.http.POST;
|
|
|
|
public interface UtilsApi {
|
|
/**
|
|
* 获取语音
|
|
*
|
|
* @param fileId 收到的语音文件名(消息段的 file 参数),如 0B38145AA44505000B38145AA4450500.silk
|
|
* @param format 要转换到的格式,目前支持 mp3、amr、wma、m4a、spx、ogg、wav、flac {@link com.yutou.napcat.enums.RecordFormatEnum}
|
|
* @return 转换后的语音文件路径
|
|
*/
|
|
@FormUrlEncoded
|
|
@POST("/get_record")
|
|
Call<HttpBody<String>> getMessageRecord(
|
|
@Field("file") String fileId,
|
|
@Field("out_format") String format
|
|
);
|
|
|
|
/**
|
|
* 获取图片
|
|
*
|
|
* @param fileId 收到的图片文件名(消息段的 file 参数)
|
|
* @return 下载后的图片文件路径
|
|
*/
|
|
@FormUrlEncoded
|
|
@POST("/get_image")
|
|
Call<HttpBody<String>> getMessageImage(
|
|
@Field("file") String fileId
|
|
);
|
|
|
|
/**
|
|
* 检查是否可以发送图片
|
|
*/
|
|
@POST("/can_send_image")
|
|
Call<HttpBody<CheckSendImageBean>> checkSendImage(
|
|
);
|
|
|
|
/**
|
|
* 检查是否可以发送语音
|
|
*/
|
|
@POST("/can_send_record")
|
|
Call<HttpBody<CheckSendRecordBean>> checkSendRecord(
|
|
);
|
|
|
|
/**
|
|
* 获取机器人状态
|
|
*/
|
|
@POST("/get_status")
|
|
Call<HttpBody<QQBotStatusBean>> checkQQBotStatus(
|
|
);
|
|
|
|
/**
|
|
* 获取机器人版本信息
|
|
*/
|
|
@POST("/get_version_info")
|
|
Call<HttpBody<QQBotVersionBean>> checkQQBotVersion(
|
|
);
|
|
|
|
/**
|
|
* 清理缓存
|
|
*/
|
|
@POST("/clean_cache")
|
|
Call<HttpBody<BaseBean>> cleanCache(
|
|
);
|
|
|
|
/**
|
|
* 获取登录信息
|
|
*/
|
|
@POST("/get_login_info")
|
|
Call<HttpBody<FriendBean>> getLoginInfo(
|
|
);
|
|
|
|
}
|