diff --git a/src/api_s2c/event/yuandan/ApiDMOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts similarity index 54% rename from src/api_s2c/event/yuandan/ApiDMOpen.ts rename to src/api_s2c/event/yuandan/ApiOpen.ts index c0c659a..a22e2cc 100644 --- a/src/api_s2c/event/yuandan/ApiDMOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -2,15 +2,12 @@ import {ApiCall} from "tsrpc"; import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen"; import {HuoDongFun} from "../../../public/huodongfun"; import {PayFun} from "../../../public/pay"; +import {Yuandanfun} from "./fun"; export default async function (call: ApiCall) { - let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) - - let _hd = (await HuoDongFun.gethdList(call, 14))[0] - - let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) + let _hd = await Yuandanfun.getCon(call) call.succ({ - record: data?.record || {} + data: (await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: 'yuandandamo'})) || {} }) } \ No newline at end of file diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index 7ac4168..7612211 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -8,14 +8,9 @@ import {PlayerFun} from "../../../public/player"; export class Yuandanfun { /**配置 */ static async getCon(call: ApiCall) { - let _con: { [id: string]: ReqAddHuoDong } = {} - let _hd = await HuoDongFun.gethdList(call, 8) - for (let index = 0; index < _hd.length; index++) { - const element = _hd[index]; - if (element && element._id) delete element._id - _con[element.hdid] = element - } - return _con + let _hd = (await HuoDongFun.gethdList(call, 14))[0] + if (!_hd) return call.errorCode(-1) + return _hd } /**获取所有符合时间的活动 */ diff --git a/src/shared/protocols/event/yuandan/PtlDMOpen.ts b/src/shared/protocols/event/yuandan/PtlDMOpen.ts index 0724ba5..d4f06ef 100644 --- a/src/shared/protocols/event/yuandan/PtlDMOpen.ts +++ b/src/shared/protocols/event/yuandan/PtlDMOpen.ts @@ -7,7 +7,7 @@ export type ReqDMOpen = { }; export type ResDMOpen = { - record:{ + data:{ [k: string]: any; } }; \ No newline at end of file diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 9d4a22e..e6a6bff 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -11426,7 +11426,7 @@ export const serviceProto: ServiceProto = { "properties": [ { "id": 0, - "name": "record", + "name": "myData", "type": { "type": "Interface", "indexSignature": {