xiaoyang0346 2 days ago
parent
commit
c10de84c97

+ 135 - 38
s_to_proto/docs/openapi.json

@@ -1180,6 +1180,53 @@
         }
       }
     },
+    "/fight/FightHc": {
+      "post": {
+        "tags": [
+          "fight"
+        ],
+        "operationId": "fight/FightHc",
+        "requestBody": {
+          "description": "Req<FightHc>",
+          "content": {
+            "application/json": {
+              "schema": {
+                "$ref": "#/components/schemas/fight_PtlFightHc_ReqFightHc"
+              }
+            }
+          }
+        },
+        "responses": {
+          "200": {
+            "description": "Success",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "type": "object",
+                  "description": "ApiReturn<ResFightHc>",
+                  "properties": {
+                    "isSucc": {
+                      "type": "boolean",
+                      "enum": [
+                        true
+                      ],
+                      "default": true
+                    },
+                    "res": {
+                      "$ref": "#/components/schemas/fight_PtlFightHc_ResFightHc"
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "default": {
+            "description": "Error",
+            "$ref": "#/components/responses/error"
+          }
+        }
+      }
+    },
     "/fight/FightTest": {
       "post": {
         "tags": [
@@ -2639,7 +2686,10 @@
           "items": {
             "type": "array",
             "items": {
-              "type": "number"
+              "type": "array",
+              "items": {
+                "type": "number"
+              }
             }
           }
         },
@@ -2681,16 +2731,46 @@
         },
         "description": "属性变化"
       },
-      "fight_PtlFightTest_ReqFightTest": {
+      "fight_PtlFightHc_ReqFightHc": {
         "type": "object",
-        "properties": {},
-        "description": "请求接口"
+        "properties": {
+          "gzid": {
+            "type": "string"
+          }
+        },
+        "required": [
+          "gzid"
+        ],
+        "description": "请求接口 合成战斗"
       },
-      "fight_PtlFightTest_ResFightTest": {
+      "fight_PtlFightHc_ResFightHc": {
+        "allOf": [
+          {
+            "$ref": "#/components/schemas/base_FightBase"
+          },
+          {
+            "type": "object",
+            "properties": {
+              "list": {
+                "type": "object",
+                "properties": {},
+                "additionalProperties": {
+                  "$ref": "#/components/schemas/hc_PtlHcInfo_HcInfoGeziInfo"
+                }
+              }
+            },
+            "required": [
+              "list"
+            ]
+          }
+        ],
+        "description": "返回信息"
+      },
+      "base_FightBase": {
         "type": "object",
         "properties": {
           "fightStart": {
-            "$ref": "#/components/schemas/fight_PtlFightTest_FightStart"
+            "$ref": "#/components/schemas/base_FightStart"
           },
           "win": {
             "type": "number"
@@ -2701,7 +2781,7 @@
             "additionalProperties": {
               "type": "array",
               "items": {
-                "$ref": "#/components/schemas/fight_PtlFightTest_fightLogOne"
+                "$ref": "#/components/schemas/base_fightLogOne"
               }
             }
           }
@@ -2713,7 +2793,7 @@
         ],
         "description": "返回信息"
       },
-      "fight_PtlFightTest_FightStart": {
+      "base_FightStart": {
         "type": "object",
         "properties": {
           "from": {
@@ -2726,7 +2806,7 @@
             "type": "object",
             "properties": {},
             "additionalProperties": {
-              "$ref": "#/components/schemas/fight_PtlFightTest_FightTeam"
+              "$ref": "#/components/schemas/base_FightTeam"
             }
           }
         },
@@ -2737,7 +2817,7 @@
         ],
         "description": "战斗初始阵容"
       },
-      "fight_PtlFightTest_FightTeam": {
+      "base_FightTeam": {
         "type": "object",
         "properties": {
           "fid": {
@@ -2761,22 +2841,22 @@
         ],
         "description": "单个阵容信息"
       },
-      "fight_PtlFightTest_fightLogOne": {
+      "base_fightLogOne": {
         "type": "object",
         "properties": {
           "aType": {
-            "$ref": "#/components/schemas/fight_PtlFightTest_ActionType"
+            "$ref": "#/components/schemas/base_ActionType"
           },
           "seat": {
             "type": "number"
           },
           "atker": {
-            "$ref": "#/components/schemas/fight_PtlFightTest_fightLogOneData"
+            "$ref": "#/components/schemas/base_fightLogOneData"
           },
           "target": {
             "type": "array",
             "items": {
-              "$ref": "#/components/schemas/fight_PtlFightTest_fightLogOneData"
+              "$ref": "#/components/schemas/base_fightLogOneData"
             }
           }
         },
@@ -2787,7 +2867,7 @@
           "target"
         ]
       },
-      "fight_PtlFightTest_ActionType": {
+      "base_ActionType": {
         "type": "string",
         "enum": [
           "wu",
@@ -2799,7 +2879,7 @@
         ],
         "description": "战斗动作类型"
       },
-      "fight_PtlFightTest_fightLogOneData": {
+      "base_fightLogOneData": {
         "type": "object",
         "properties": {
           "iid": {
@@ -2845,26 +2925,6 @@
         ],
         "description": "日志格式"
       },
-      "hc_PtlHcEmit_ReqHcEmit": {
-        "type": "object",
-        "properties": {
-          "gzid": {
-            "type": "string"
-          }
-        },
-        "required": [
-          "gzid"
-        ],
-        "description": "请求接口 点击发射器"
-      },
-      "hc_PtlHcEmit_ResHcEmit": {
-        "type": "object",
-        "properties": {},
-        "additionalProperties": {
-          "$ref": "#/components/schemas/hc_PtlHcInfo_HcInfoGeziInfo"
-        },
-        "description": "返回信息"
-      },
       "hc_PtlHcInfo_HcInfoGeziInfo": {
         "type": "object",
         "properties": {
@@ -2898,10 +2958,47 @@
       "hc_PtlHcInfo_HcUnlock": {
         "type": "number",
         "enum": [
-          0,
-          1
+          1,
+          0
         ]
       },
+      "fight_PtlFightTest_ReqFightTest": {
+        "type": "object",
+        "properties": {},
+        "description": "请求接口"
+      },
+      "fight_PtlFightTest_ResFightTest": {
+        "allOf": [
+          {
+            "$ref": "#/components/schemas/base_FightBase"
+          },
+          {
+            "type": "object",
+            "properties": {}
+          }
+        ],
+        "description": "返回信息"
+      },
+      "hc_PtlHcEmit_ReqHcEmit": {
+        "type": "object",
+        "properties": {
+          "gzid": {
+            "type": "string"
+          }
+        },
+        "required": [
+          "gzid"
+        ],
+        "description": "请求接口 点击发射器"
+      },
+      "hc_PtlHcEmit_ResHcEmit": {
+        "type": "object",
+        "properties": {},
+        "additionalProperties": {
+          "$ref": "#/components/schemas/hc_PtlHcInfo_HcInfoGeziInfo"
+        },
+        "description": "返回信息"
+      },
       "hc_PtlHcInfo_ReqHcInfo": {
         "type": "object",
         "properties": {},

+ 71 - 3
s_to_proto/docs/tsapi.md

@@ -38,6 +38,7 @@
 - eps
     - [获取属性信息](#/eps/EpsInfo)
 - fight
+    - [请求接口 合成战斗](#/fight/FightHc)
     - [请求接口](#/fight/FightTest)
 - hc
     - [请求接口 点击发射器](#/hc/HcEmit)
@@ -799,6 +800,73 @@ interface ResEpsInfo {
 
 ## fight
 
+### 请求接口 合成战斗 <a id="/fight/FightHc"></a>
+
+**路径**
+- POST `/fight/FightHc`
+
+**请求**
+```ts
+interface ReqFightHc {
+    gzid: string
+}
+```
+
+**响应**
+```ts
+interface ResFightHc {
+    list: {
+        [key: string]: {
+            type: 0 | 2 | 3 | 4 | 50 | 51,
+            unlock: 1 | 0,
+            correlationId: number
+        }
+    },
+    /** 战斗初始阵容 */
+    fightStart: {
+        from: string,
+        seed: number,
+        teams: {
+            [key: string]: {
+                fid: string,
+                seat: number,
+                eps: { [key: string]: number }
+            }
+        }
+    },
+    win: number,
+    log: {
+        [key: string]: {
+            /** 战斗动作类型 */
+            aType: "wu" | "0" | "1" | "2" | "3" | "999",
+            seat: number,
+            /** 日志格式 */
+            atker: {
+                iid: string,
+                hp: number,
+                buff: [string, number][],
+                effect: [string, number][]
+            },
+            target: {
+                iid: string,
+                hp: number,
+                buff: [string, number][],
+                effect: [string, number][]
+            }[]
+        }[]
+    }
+}
+```
+
+**配置**
+```ts
+{
+  "connet": "ws"
+}
+```
+
+---
+
 ### 请求接口 <a id="/fight/FightTest"></a>
 
 **路径**
@@ -878,7 +946,7 @@ interface ReqHcEmit {
 interface ResHcEmit {
     [key: string]: {
         type: 0 | 2 | 3 | 4 | 50 | 51,
-        unlock: 0 | 1,
+        unlock: 1 | 0,
         correlationId: number
     }
 }
@@ -914,7 +982,7 @@ interface ResHcInfo {
     list: {
         [key: string]: {
             type: 0 | 2 | 3 | 4 | 50 | 51,
-            unlock: 0 | 1,
+            unlock: 1 | 0,
             correlationId: number
         }
     }
@@ -949,7 +1017,7 @@ interface ResHcMerge {
     list: {
         [key: string]: {
             type: 0 | 2 | 3 | 4 | 50 | 51,
-            unlock: 0 | 1,
+            unlock: 1 | 0,
             correlationId: number
         }
     },

+ 60 - 0
s_to_proto/shared/base.ts

@@ -10,6 +10,66 @@ export interface BaseMessage {
 
 }
 
+/**
+* 返回信息
+*/
+export interface FightBase {
+    fightStart:FightStart; //战斗阵容
+    win: number; //0失败 1胜利
+    log: {
+        //战斗日志列表
+        //回合ID:单回合内战斗日志
+        [huihe: string]: fightLogOne[];
+    };
+}
+
+
+/**
+ * 战斗初始阵容
+ */
+export interface FightStart {
+    from: string; //战斗类型
+    seed: number; //随机种子
+    teams: {
+        [iid: string]: FightTeam;
+    };
+}
+/**
+ * 单个阵容信息
+ */
+export interface FightTeam {
+    fid: string; //业务中身份
+    seat: number //位置
+    eps: {[id:string]:number}; //属性
+}
+
+//单回合内战斗日志
+export interface fightLogOne {
+    aType: ActionType; //战斗动作类型
+    seat:number, //位置
+    atker: fightLogOneData; //出手方
+    target: fightLogOneData[]; //目标
+}
+/**
+ * 战斗动作类型
+ */
+export enum ActionType {
+    wu = "wu", //默认没有 不处理
+    round = "0", //回合开始 玩家出手前
+    buff = "1", //buff
+    atk = "2", //普通攻击
+    wxsk = "3", //技能
+    over = "999", //回合结束
+}
+/**
+ * 日志格式
+ */
+export interface fightLogOneData {
+    iid: string; //阵容下标
+    hp: number; //剩余血量
+    buff: [string, number][]; //上BUFF [ [BuffID,回合数]]
+    effect: [string, number][]; //触发效果 [ [属性key,数值]]
+}
 
 
 //查看他人角色基础信息

+ 26 - 0
s_to_proto/shared/fight/PtlFightHc.ts

@@ -0,0 +1,26 @@
+import { FightBase } from "../base"
+import { HcInfoGeziInfo } from "../hc/PtlHcInfo";
+
+
+/**
+* 请求接口 合成战斗
+*/
+export interface ReqFightHc {
+    gzid:string
+}
+
+/**
+* 返回信息
+*/
+export interface ResFightHc extends FightBase  {
+    list:{
+        [gzid: string]: HcInfoGeziInfo;
+    },
+}
+
+export const conf = {
+    connet: "ws"
+}
+
+
+

+ 3 - 54
s_to_proto/shared/fight/PtlFightTest.ts

@@ -1,3 +1,4 @@
+import { FightBase, fightLogOne, FightStart } from "../base";
 
 
 /**
@@ -10,60 +11,8 @@ export interface ReqFightTest {
 /**
 * 返回信息
 */
-export interface ResFightTest {
-    fightStart:FightStart; //战斗阵容
-    win: number; //0失败 1胜利
-    log: {
-        //战斗日志列表
-        //回合ID:单回合内战斗日志
-        [huihe: string]: fightLogOne[];
-    };
-}
-/**
- * 战斗初始阵容
- */
-export interface FightStart {
-    from: string; //战斗类型
-    seed: number; //随机种子
-    teams: {
-        [iid: string]: FightTeam;
-    };
-}
-/**
- * 单个阵容信息
- */
-export interface FightTeam {
-    fid: string; //业务中身份
-    seat: number //位置
-    eps: {[id:string]:number}; //属性
-}
-
-//单回合内战斗日志
-export interface fightLogOne {
-    aType: ActionType; //战斗动作类型
-    seat:number, //位置
-    atker: fightLogOneData; //出手方
-    target: fightLogOneData[]; //目标
-}
-/**
- * 战斗动作类型
- */
-export enum ActionType {
-    wu = "wu", //默认没有 不处理
-    round = "0", //回合开始 玩家出手前
-    buff = "1", //buff
-    atk = "2", //普通攻击
-    wxsk = "3", //技能
-    over = "999", //回合结束
-}
-/**
- * 日志格式
- */
-export interface fightLogOneData {
-    iid: string; //阵容下标
-    hp: number; //剩余血量
-    buff: [string, number][]; //上BUFF [ [BuffID,回合数]]
-    effect: [string, number][]; //触发效果 [ [属性key,数值]]
+export interface ResFightTest extends FightBase {
+    
 }
 
 export const conf = {

+ 109 - 41
s_to_proto/shared/serviceProto.ts

@@ -28,6 +28,7 @@ import { MsgItems } from './common/MsgItems';
 import { MsgMessage } from './common/MsgMessage';
 import { ReqEpsInfo, ResEpsInfo } from './eps/PtlEpsInfo';
 import { MsgEpsChange_s } from './eps/server/MsgEpsChange_s';
+import { ReqFightHc, ResFightHc } from './fight/PtlFightHc';
 import { ReqFightTest, ResFightTest } from './fight/PtlFightTest';
 import { ReqHcEmit, ResHcEmit } from './hc/PtlHcEmit';
 import { ReqHcInfo, ResHcInfo } from './hc/PtlHcInfo';
@@ -153,6 +154,10 @@ export interface ServiceType {
             req: ReqEpsInfo,
             res: ResEpsInfo
         },
+        "fight/FightHc": {
+            req: ReqFightHc,
+            res: ResFightHc
+        },
         "fight/FightTest": {
             req: ReqFightTest,
             res: ResFightTest
@@ -239,7 +244,7 @@ export interface ServiceType {
 }
 
 export const serviceProto: ServiceProto<ServiceType> = {
-    "version": 61,
+    "version": 62,
     "services": [
         {
             "id": 39,
@@ -462,6 +467,14 @@ export const serviceProto: ServiceProto<ServiceType> = {
             "type": "msg"
         },
         {
+            "id": 90,
+            "name": "fight/FightHc",
+            "type": "api",
+            "conf": {
+                "connet": "ws"
+            }
+        },
+        {
             "id": 86,
             "name": "fight/FightTest",
             "type": "api",
@@ -1357,7 +1370,10 @@ export const serviceProto: ServiceProto<ServiceType> = {
                     "type": {
                         "type": "Array",
                         "elementType": {
-                            "type": "Number"
+                            "type": "Array",
+                            "elementType": {
+                                "type": "Number"
+                            }
                         }
                     }
                 }
@@ -1396,10 +1412,47 @@ export const serviceProto: ServiceProto<ServiceType> = {
                 }
             }
         },
-        "fight/PtlFightTest/ReqFightTest": {
-            "type": "Interface"
+        "fight/PtlFightHc/ReqFightHc": {
+            "type": "Interface",
+            "properties": [
+                {
+                    "id": 0,
+                    "name": "gzid",
+                    "type": {
+                        "type": "String"
+                    }
+                }
+            ]
         },
-        "fight/PtlFightTest/ResFightTest": {
+        "fight/PtlFightHc/ResFightHc": {
+            "type": "Interface",
+            "extends": [
+                {
+                    "id": 0,
+                    "type": {
+                        "type": "Reference",
+                        "target": "base/FightBase"
+                    }
+                }
+            ],
+            "properties": [
+                {
+                    "id": 0,
+                    "name": "list",
+                    "type": {
+                        "type": "Interface",
+                        "indexSignature": {
+                            "keyType": "String",
+                            "type": {
+                                "type": "Reference",
+                                "target": "hc/PtlHcInfo/HcInfoGeziInfo"
+                            }
+                        }
+                    }
+                }
+            ]
+        },
+        "base/FightBase": {
             "type": "Interface",
             "properties": [
                 {
@@ -1407,7 +1460,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                     "name": "fightStart",
                     "type": {
                         "type": "Reference",
-                        "target": "fight/PtlFightTest/FightStart"
+                        "target": "base/FightStart"
                     }
                 },
                 {
@@ -1428,7 +1481,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                                 "type": "Array",
                                 "elementType": {
                                     "type": "Reference",
-                                    "target": "fight/PtlFightTest/fightLogOne"
+                                    "target": "base/fightLogOne"
                                 }
                             }
                         }
@@ -1436,7 +1489,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                 }
             ]
         },
-        "fight/PtlFightTest/FightStart": {
+        "base/FightStart": {
             "type": "Interface",
             "properties": [
                 {
@@ -1462,14 +1515,14 @@ export const serviceProto: ServiceProto<ServiceType> = {
                             "keyType": "String",
                             "type": {
                                 "type": "Reference",
-                                "target": "fight/PtlFightTest/FightTeam"
+                                "target": "base/FightTeam"
                             }
                         }
                     }
                 }
             ]
         },
-        "fight/PtlFightTest/FightTeam": {
+        "base/FightTeam": {
             "type": "Interface",
             "properties": [
                 {
@@ -1501,7 +1554,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                 }
             ]
         },
-        "fight/PtlFightTest/fightLogOne": {
+        "base/fightLogOne": {
             "type": "Interface",
             "properties": [
                 {
@@ -1509,7 +1562,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                     "name": "aType",
                     "type": {
                         "type": "Reference",
-                        "target": "fight/PtlFightTest/ActionType"
+                        "target": "base/ActionType"
                     }
                 },
                 {
@@ -1524,7 +1577,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                     "name": "atker",
                     "type": {
                         "type": "Reference",
-                        "target": "fight/PtlFightTest/fightLogOneData"
+                        "target": "base/fightLogOneData"
                     }
                 },
                 {
@@ -1534,13 +1587,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
                         "type": "Array",
                         "elementType": {
                             "type": "Reference",
-                            "target": "fight/PtlFightTest/fightLogOneData"
+                            "target": "base/fightLogOneData"
                         }
                     }
                 }
             ]
         },
-        "fight/PtlFightTest/ActionType": {
+        "base/ActionType": {
             "type": "Enum",
             "members": [
                 {
@@ -1569,7 +1622,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
                 }
             ]
         },
-        "fight/PtlFightTest/fightLogOneData": {
+        "base/fightLogOneData": {
             "type": "Interface",
             "properties": [
                 {
@@ -1624,28 +1677,6 @@ export const serviceProto: ServiceProto<ServiceType> = {
                 }
             ]
         },
-        "hc/PtlHcEmit/ReqHcEmit": {
-            "type": "Interface",
-            "properties": [
-                {
-                    "id": 0,
-                    "name": "gzid",
-                    "type": {
-                        "type": "String"
-                    }
-                }
-            ]
-        },
-        "hc/PtlHcEmit/ResHcEmit": {
-            "type": "Interface",
-            "indexSignature": {
-                "keyType": "String",
-                "type": {
-                    "type": "Reference",
-                    "target": "hc/PtlHcInfo/HcInfoGeziInfo"
-                }
-            }
-        },
         "hc/PtlHcInfo/HcInfoGeziInfo": {
             "type": "Interface",
             "properties": [
@@ -1707,15 +1738,52 @@ export const serviceProto: ServiceProto<ServiceType> = {
             "type": "Enum",
             "members": [
                 {
+                    "id": 1,
+                    "value": 1
+                },
+                {
                     "id": 0,
                     "value": 0
-                },
+                }
+            ]
+        },
+        "fight/PtlFightTest/ReqFightTest": {
+            "type": "Interface"
+        },
+        "fight/PtlFightTest/ResFightTest": {
+            "type": "Interface",
+            "extends": [
                 {
-                    "id": 1,
-                    "value": 1
+                    "id": 0,
+                    "type": {
+                        "type": "Reference",
+                        "target": "base/FightBase"
+                    }
                 }
             ]
         },
+        "hc/PtlHcEmit/ReqHcEmit": {
+            "type": "Interface",
+            "properties": [
+                {
+                    "id": 0,
+                    "name": "gzid",
+                    "type": {
+                        "type": "String"
+                    }
+                }
+            ]
+        },
+        "hc/PtlHcEmit/ResHcEmit": {
+            "type": "Interface",
+            "indexSignature": {
+                "keyType": "String",
+                "type": {
+                    "type": "Reference",
+                    "target": "hc/PtlHcInfo/HcInfoGeziInfo"
+                }
+            }
+        },
         "hc/PtlHcInfo/ReqHcInfo": {
             "type": "Interface"
         },