feat(sdk): 升级HaveADrink SDK并集成邀请系统
- 将HaveADrink依赖从1.0.8升级至1.0.12版本 - 集成邀请码功能,新增common/invite.js处理邀请链路 - 实现发送好友请求返回邀请码的新流程 - 添加删除动态功能,新增DeleteFeed接口 - 集成UniAppWebSocket适配器,重构WebSocket连接管理 - 优化好友请求支持关键词搜索功能 - 在FeedCard组件中添加删除按钮和分享按钮 - 更新SDK类型定义文件以匹配新接口规范
This commit is contained in:
+257
-13
@@ -17,6 +17,15 @@ export declare interface option {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface WebsocketInterface {
|
||||
close: ((this: WebsocketInterface, ev: CloseEvent) => any) | null;
|
||||
onopen: ((this: WebsocketInterface, ev: Event) => any) | null;
|
||||
onmessage: ((this: WebsocketInterface, ev: MessageEvent) => any) | null;
|
||||
onclose(event: CloseEvent): void;
|
||||
onerror(event: ErrorEvent): void;
|
||||
send(data: string | BufferSource | Blob): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* 枚举类型基类
|
||||
*/
|
||||
@@ -2934,6 +2943,52 @@ export declare class PublishFeedResp {
|
||||
static fromObject(o: Object): PublishFeedResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除动态请求(路径参数)
|
||||
*/
|
||||
export declare class DeleteFeedReq {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 动态ID
|
||||
*/
|
||||
id: string|number;
|
||||
|
||||
/**
|
||||
* @param id string|number 动态ID
|
||||
*/
|
||||
constructor(id: string|number,);
|
||||
/**
|
||||
* 从对象创建 DeleteFeedReq
|
||||
*
|
||||
* @param o Object
|
||||
* - id: string|number, // 动态ID
|
||||
*/
|
||||
static fromObject(o: Object): DeleteFeedReq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除动态响应
|
||||
*/
|
||||
export declare class DeleteFeedResp {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
ok: boolean;
|
||||
|
||||
/**
|
||||
* @param ok boolean 是否成功
|
||||
*/
|
||||
constructor(ok: boolean,);
|
||||
/**
|
||||
* 从对象创建 DeleteFeedResp
|
||||
*
|
||||
* @param o Object
|
||||
* - ok: boolean, // 是否成功
|
||||
*/
|
||||
static fromObject(o: Object): DeleteFeedResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞请求(路径参数)
|
||||
*/
|
||||
@@ -3265,14 +3320,20 @@ export declare class Friend {
|
||||
*/
|
||||
export declare class GetFriendRequestsReq {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 搜索关键词
|
||||
*/
|
||||
keyword: string;
|
||||
|
||||
/**
|
||||
* @param keyword string 搜索关键词
|
||||
*/
|
||||
constructor();
|
||||
constructor(keyword: string,);
|
||||
/**
|
||||
* 从对象创建 GetFriendRequestsReq
|
||||
*
|
||||
* @param o Object
|
||||
* - keyword: string, // 搜索关键词
|
||||
*/
|
||||
static fromObject(o: Object): GetFriendRequestsReq;
|
||||
}
|
||||
@@ -3405,24 +3466,18 @@ export declare class FriendRequestListData {
|
||||
export declare class SendFriendRequestReq {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 酒友ID
|
||||
*/
|
||||
userId: string|number;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* @param userId string|number 酒友ID
|
||||
* @param message string 消息
|
||||
*/
|
||||
constructor(userId: string|number,message: string,);
|
||||
constructor(message: string,);
|
||||
/**
|
||||
* 从对象创建 SendFriendRequestReq
|
||||
*
|
||||
* @param o Object
|
||||
* - userId: string|number, // 酒友ID
|
||||
* - message: string, // 消息
|
||||
*/
|
||||
static fromObject(o: Object): SendFriendRequestReq;
|
||||
@@ -3433,14 +3488,20 @@ export declare class SendFriendRequestReq {
|
||||
*/
|
||||
export declare class SendFriendRequestResp {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 好友请求ID
|
||||
*/
|
||||
inviteCode: string|number;
|
||||
|
||||
/**
|
||||
* @param inviteCode string|number 好友请求ID
|
||||
*/
|
||||
constructor();
|
||||
constructor(inviteCode: string|number,);
|
||||
/**
|
||||
* 从对象创建 SendFriendRequestResp
|
||||
*
|
||||
* @param o Object
|
||||
* - inviteCode: string|number, // 好友请求ID
|
||||
*/
|
||||
static fromObject(o: Object): SendFriendRequestResp;
|
||||
}
|
||||
@@ -3788,6 +3849,134 @@ export declare class CreateEventResp {
|
||||
static fromObject(o: Object): CreateEventResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改酒局请求
|
||||
*/
|
||||
export declare class UpdateEventReq {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 酒局ID
|
||||
*/
|
||||
id: string|number;
|
||||
/**
|
||||
* 酒局标题
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* 酒局时间
|
||||
*/
|
||||
time: string;
|
||||
/**
|
||||
* 酒局地点
|
||||
*/
|
||||
location: string;
|
||||
/**
|
||||
* 最大人数
|
||||
*/
|
||||
maxPeople: number;
|
||||
/**
|
||||
* 坐标信息
|
||||
*/
|
||||
geo: GeoPoint;
|
||||
/**
|
||||
* 酒局备注
|
||||
*/
|
||||
note: string;
|
||||
|
||||
/**
|
||||
* @param id string|number 酒局ID
|
||||
* @param title string 酒局标题
|
||||
* @param time string 酒局时间
|
||||
* @param location string 酒局地点
|
||||
* @param maxPeople number 最大人数
|
||||
* @param geo GeoPoint 坐标信息
|
||||
* @param note string 酒局备注
|
||||
*/
|
||||
constructor(id: string|number,title: string,time: string,location: string,maxPeople: number,geo: GeoPoint,note: string,);
|
||||
/**
|
||||
* 从对象创建 UpdateEventReq
|
||||
*
|
||||
* @param o Object
|
||||
* - id: string|number, // 酒局ID
|
||||
* - title: string, // 酒局标题
|
||||
* - time: string, // 酒局时间
|
||||
* - location: string, // 酒局地点
|
||||
* - maxPeople: number, // 最大人数
|
||||
* - geo: GeoPoint, // 坐标信息
|
||||
* - note: string, // 酒局备注
|
||||
*/
|
||||
static fromObject(o: Object): UpdateEventReq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改酒局响应
|
||||
*/
|
||||
export declare class UpdateEventResp {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
ok: boolean;
|
||||
|
||||
/**
|
||||
* @param ok boolean 是否成功
|
||||
*/
|
||||
constructor(ok: boolean,);
|
||||
/**
|
||||
* 从对象创建 UpdateEventResp
|
||||
*
|
||||
* @param o Object
|
||||
* - ok: boolean, // 是否成功
|
||||
*/
|
||||
static fromObject(o: Object): UpdateEventResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除酒局请求
|
||||
*/
|
||||
export declare class DeleteEventReq {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 酒局ID
|
||||
*/
|
||||
id: string|number;
|
||||
|
||||
/**
|
||||
* @param id string|number 酒局ID
|
||||
*/
|
||||
constructor(id: string|number,);
|
||||
/**
|
||||
* 从对象创建 DeleteEventReq
|
||||
*
|
||||
* @param o Object
|
||||
* - id: string|number, // 酒局ID
|
||||
*/
|
||||
static fromObject(o: Object): DeleteEventReq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除酒局响应
|
||||
*/
|
||||
export declare class DeleteEventResp {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
ok: boolean;
|
||||
|
||||
/**
|
||||
* @param ok boolean 是否成功
|
||||
*/
|
||||
constructor(ok: boolean,);
|
||||
/**
|
||||
* 从对象创建 DeleteEventResp
|
||||
*
|
||||
* @param o Object
|
||||
* - ok: boolean, // 是否成功
|
||||
*/
|
||||
static fromObject(o: Object): DeleteEventResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报名/取消/签到请求(路径参数)
|
||||
*/
|
||||
@@ -4617,6 +4806,29 @@ export declare class ChatWebSocketResp {
|
||||
static fromObject(o: Object): ChatWebSocketResp;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export declare class ChatWebSocketReq {
|
||||
[key: string]: any;
|
||||
/**
|
||||
* 连接 token
|
||||
*/
|
||||
token: string;
|
||||
|
||||
/**
|
||||
* @param token string 连接 token
|
||||
*/
|
||||
constructor(token: string,);
|
||||
/**
|
||||
* 从对象创建 ChatWebSocketReq
|
||||
*
|
||||
* @param o Object
|
||||
* - token: string, // 连接 token
|
||||
*/
|
||||
static fromObject(o: Object): ChatWebSocketReq;
|
||||
}
|
||||
|
||||
export type ClientMessage = ClientChatData | ClientTypingData | ClientReadData | ClientPingData | null
|
||||
export type ServerMessage = ServerChatData | ServerTypingData | ServerReadData | ServerAckData | ServerPongData | ServerConnectedData | ServerKickedData | null
|
||||
|
||||
@@ -4645,6 +4857,12 @@ export class ChatWebSocketConn {
|
||||
public close(): void;
|
||||
}
|
||||
|
||||
export class Config {
|
||||
host: string;
|
||||
http_request: (url: string, params: any) => Promise<any>;
|
||||
upload: (url: string, params: any) => Promise<any>;
|
||||
websocket: WebsocketInterface | undefined;
|
||||
}
|
||||
/**
|
||||
* * 喝酒了么 - 后端接口 API
|
||||
* 小程序:喝酒了么(uni-app 微信小程序)
|
||||
@@ -4660,9 +4878,9 @@ export class ChatWebSocketConn {
|
||||
*/
|
||||
export default class HaveADrink {
|
||||
host: string;
|
||||
http_request: any;
|
||||
upload: any;
|
||||
constructor(conf: any);
|
||||
http_request: (url: string, params: any) => Promise<any>;
|
||||
upload: (url: string, params: any) => Promise<any>;
|
||||
constructor(conf: Config);
|
||||
|
||||
/**
|
||||
* 设置 token
|
||||
@@ -4682,6 +4900,7 @@ export default class HaveADrink {
|
||||
/**
|
||||
* 获取微信手机号
|
||||
*
|
||||
* @deprecated 未使用
|
||||
* @param req WechatGetPhoneNumberReq 获取微信手机号
|
||||
* @return WechatGetPhoneNumberResp 获取微信手机号返回值
|
||||
*/
|
||||
@@ -4706,6 +4925,7 @@ export default class HaveADrink {
|
||||
/**
|
||||
* 获取朋友圈动态
|
||||
*
|
||||
* @deprecated 不使用,待移除
|
||||
* @param req GetFeedReq 获取朋友圈动态请求
|
||||
* @return GetFeedResp 获取朋友圈动态响应
|
||||
*/
|
||||
@@ -4831,6 +5051,14 @@ export default class HaveADrink {
|
||||
*/
|
||||
public PublishFeed(req: PublishFeedReq) : Promise<PublishFeedResp>;
|
||||
|
||||
/**
|
||||
* 删除动态
|
||||
*
|
||||
* @param req DeleteFeedReq 删除动态请求(路径参数)
|
||||
* @return DeleteFeedResp 删除动态响应
|
||||
*/
|
||||
public DeleteFeed(req: DeleteFeedReq) : Promise<DeleteFeedResp>;
|
||||
|
||||
/**
|
||||
* 点赞
|
||||
*
|
||||
@@ -4927,6 +5155,22 @@ export default class HaveADrink {
|
||||
*/
|
||||
public CreateEvent(req: CreateEventReq) : Promise<CreateEventResp>;
|
||||
|
||||
/**
|
||||
* 修改酒局
|
||||
*
|
||||
* @param req UpdateEventReq 修改酒局请求
|
||||
* @return UpdateEventResp 修改酒局响应
|
||||
*/
|
||||
public UpdateEvent(req: UpdateEventReq) : Promise<UpdateEventResp>;
|
||||
|
||||
/**
|
||||
* 删除酒局
|
||||
*
|
||||
* @param req DeleteEventReq 删除酒局请求
|
||||
* @return DeleteEventResp 删除酒局响应
|
||||
*/
|
||||
public DeleteEvent(req: DeleteEventReq) : Promise<DeleteEventResp>;
|
||||
|
||||
/**
|
||||
* 报名酒局
|
||||
*
|
||||
@@ -4989,6 +5233,6 @@ export default class HaveADrink {
|
||||
* @param req ChatWebSocket
|
||||
* @return ChatWebSocketConn
|
||||
*/
|
||||
public ChatWebSocket() : ChatWebSocketConn;
|
||||
public ChatWebSocket(input: ChatWebSocketReq) : ChatWebSocketConn;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user