返回提交历史
Modified
src/controllers/api/sellController.ts
+27
-1
Deleted
src/types/sellTypes.ts
+0
-26
XFEstudio/SpaceNinjaServer
chore: move sell types to sellController (#731)
3a4eea37
代码差异
2 个文件
+27
-27
@@ -1,5 +1,4 @@
1
1
import { RequestHandler } from "express";
2
import { ISellRequest } from "@/src/types/sellTypes";
3
2
import { getAccountIdForRequest } from "@/src/services/loginService";
4
3
import { getInventory, addMods, addRecipes, addMiscItems, addConsumables } from "@/src/services/inventoryService";
5
4
@@ -100,3 +99,30 @@ export const sellController: RequestHandler = async (req, res) => {
100
99
await inventory.save();
101
100
res.json({});
102
101
};
102
103
interface ISellRequest {
104
Items: {
105
Suits?: ISellItem[];
106
LongGuns?: ISellItem[];
107
Pistols?: ISellItem[];
108
Melee?: ISellItem[];
109
Consumables?: ISellItem[];
110
Recipes?: ISellItem[];
111
Upgrades?: ISellItem[];
112
MiscItems?: ISellItem[];
113
};
114
SellPrice: number;
115
SellCurrency:
116
| "SC_RegularCredits"
117
| "SC_PrimeBucks"
118
| "SC_FusionPoints"
119
| "SC_DistillPoints"
120
| "SC_CrewShipFusionPoints"
121
| "SC_Resources";
122
buildLabel: string;
123
}
124
125
interface ISellItem {
126
String: string; // oid or uniqueName
127
Count: number;
128
}
@@ -1,26 +0,0 @@
1
export interface ISellRequest {
2
Items: {
3
Suits?: ISellItem[];
4
LongGuns?: ISellItem[];
5
Pistols?: ISellItem[];
6
Melee?: ISellItem[];
7
Consumables?: ISellItem[];
8
Recipes?: ISellItem[];
9
Upgrades?: ISellItem[];
10
MiscItems?: ISellItem[];
11
};
12
SellPrice: number;
13
SellCurrency:
14
| "SC_RegularCredits"
15
| "SC_PrimeBucks"
16
| "SC_FusionPoints"
17
| "SC_DistillPoints"
18
| "SC_CrewShipFusionPoints"
19
| "SC_Resources";
20
buildLabel: string;
21
}
22
23
export interface ISellItem {
24
String: string; // oid or uniqueName
25
Count: number;
26
}