Skip to content

Commit e5ebf85

Browse files
authored
fix: update ai server api result format & extend room list api about isAI key (#868)
* feat: add timber_type and config product AI server * fix: update ai server api result format
1 parent 99ec1d3 commit e5ebf85

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

src/v1/controller/agora/ai/ping.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ax } from "../../../utils/Axios";
33
import { AbstractController } from "../../../../abstract/controller";
44
import { Controller } from "../../../../decorator/Controller";
55
import { AI_SERVER_URL_CN, AI_SERVER_URL_EN } from "./const";
6+
import { Status } from "constants/Project";
67

78
@Controller<RequestType, any>({
89
method: "post",
@@ -41,7 +42,10 @@ export class AgoraAIPing extends AbstractController<RequestType, any> {
4142
}
4243
}
4344
)
44-
return res;
45+
return {
46+
status: Status.Success,
47+
data: res,
48+
}
4549

4650
}
4751

src/v1/controller/agora/ai/start.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ax } from "../../../utils/Axios";
33
import { AbstractController } from "../../../../abstract/controller";
44
import { Controller } from "../../../../decorator/Controller";
55
import { AI_SERVER_URL_CN, AI_SERVER_URL_EN } from "./const";
6+
import { Status } from "constants/Project";
67

78
@Controller<RequestType, any>({
89
method: "post",
@@ -52,7 +53,11 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
5253
}
5354
}
5455
)
55-
return res;
56+
57+
return {
58+
status: Status.Success,
59+
data: res,
60+
}
5661
}
5762

5863
public errorHandler(error: Error): ResponseError {

src/v1/controller/agora/ai/stop.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ax } from "../../../utils/Axios";
33
import { AbstractController } from "../../../../abstract/controller";
44
import { Controller } from "../../../../decorator/Controller";
55
import { AI_SERVER_URL_CN, AI_SERVER_URL_EN } from "./const";
6+
import { Status } from "constants/Project";
67

78
@Controller<RequestType, any>({
89
method: "post",
@@ -41,7 +42,10 @@ export class AgoraAIStop extends AbstractController<RequestType, any> {
4142
}
4243
}
4344
)
44-
return res;
45+
return {
46+
status: Status.Success,
47+
data: res,
48+
}
4549
}
4650

4751
public errorHandler(error: Error): ResponseError {

src/v1/controller/room/list/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class List extends AbstractController<RequestType, ResponseType> {
6868
hasRecord: !!room.hasRecord,
6969
inviteCode: inviteCodes[index] || room.periodicUUID || room.roomUUID,
7070
isPmi: false,
71+
isAI: room.isAI
7172
};
7273
});
7374

@@ -102,6 +103,7 @@ export class List extends AbstractController<RequestType, ResponseType> {
102103
.addSelect("r.owner_uuid", "ownerUUID")
103104
.addSelect("r.room_status", "roomStatus")
104105
.addSelect("r.region", "region")
106+
.addSelect("r.is_ai", "isAI")
105107
.addSelect("u.user_name", "ownerName")
106108
.addSelect("u.avatar_url", "ownerAvatarURL")
107109
.andWhere("ru.user_uuid = :userUUID", {
@@ -182,4 +184,5 @@ export type ResponseType = Array<{
182184
region: Region;
183185
inviteCode: string;
184186
isPmi: boolean;
187+
isAI: boolean;
185188
}>;

0 commit comments

Comments
 (0)