Merge branch 'dev' of http://git.legu.cc/qixin/HJ_Server into dev
This commit is contained in:
commit
e0c0d03f4e
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,3 +3,5 @@
|
|||||||
/.vscode
|
/.vscode
|
||||||
/dist
|
/dist
|
||||||
/doc
|
/doc
|
||||||
|
|
||||||
|
/src/config.json
|
20
src/api_s2c/event/zhoumolibao/ApiOpen.ts
Normal file
20
src/api_s2c/event/zhoumolibao/ApiOpen.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {ApiCall} from "tsrpc";
|
||||||
|
import {ReqOpen, ResOpen} from "../../../shared/protocols/event/zhoumolibao/PtlOpen";
|
||||||
|
import {PayFun} from "../../../public/pay";
|
||||||
|
import {HuoDongFun} from "../../../public/huodongfun";
|
||||||
|
|
||||||
|
|
||||||
|
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||||
|
|
||||||
|
let data = await G.mongodb.cEvent('zhoumolibao').findOne({uid: call.uid, type: 'zhoumolibao'})
|
||||||
|
|
||||||
|
let _hd = (await HuoDongFun.gethdList(call, 9))[0]
|
||||||
|
|
||||||
|
let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId)
|
||||||
|
|
||||||
|
call.succ({
|
||||||
|
record: data.record,
|
||||||
|
buyLog: await PayFun.getPayLogs(call.uid, payIds)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
25
src/api_s2c/event/zhoumolibao/ApiReceive.ts
Normal file
25
src/api_s2c/event/zhoumolibao/ApiReceive.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import {ApiCall} from "tsrpc";
|
||||||
|
import {ReqReceive, ResReceive} from "../../../shared/protocols/event/zhoumolibao/PtlReceive";
|
||||||
|
import {HuoDongFun} from "../../../public/huodongfun";
|
||||||
|
import {PlayerFun} from "../../../public/player";
|
||||||
|
|
||||||
|
export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
||||||
|
// 查询活动是否有当前领奖的免费选项
|
||||||
|
let _hd = (await HuoDongFun.gethdList(call, 9))[0]
|
||||||
|
let gift = _hd?.data?.gift?.find(i => i.free && i.id == call.req.id)
|
||||||
|
if (!gift) return call.errorCode(-1)
|
||||||
|
|
||||||
|
// 取奖励列表,判断是否有可领取奖励
|
||||||
|
let data = await G.mongodb.cEvent('zhoumolibao').findOne({uid: call.uid, type: 'zhoumolibao'})
|
||||||
|
let rec = data.record[call.req.id]
|
||||||
|
if (rec && rec >= gift?.buyNum) return call.errorCode(-2)
|
||||||
|
|
||||||
|
await PlayerFun.sendPrize(call, gift.prize);
|
||||||
|
|
||||||
|
await G.mongodb.cEvent('zhoumolibao').updateOne({uid: call.uid, type: 'zhoumolibao'}, {
|
||||||
|
$inc: {[`record.${gift.id}`]: 1}
|
||||||
|
},{ upsert: true })
|
||||||
|
|
||||||
|
call.succ({})
|
||||||
|
|
||||||
|
}
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"msgPort": 8100,
|
|
||||||
"openTime": "2023-12-01 00:00:02",
|
|
||||||
"httpPort": 8101,
|
|
||||||
"redisUrl": "redis://:lyMaple525458@10.0.1.20:6379/0",
|
|
||||||
"crossRedisUrl": "redis://:lyMaple525458@10.0.1.20:6379/1"
|
|
||||||
}
|
|
@ -3293,7 +3293,8 @@
|
|||||||
//礼包
|
//礼包
|
||||||
gift: [
|
gift: [
|
||||||
{
|
{
|
||||||
name: 'wkdtips_4',
|
id: '1',
|
||||||
|
name: 'wkdtips_4',
|
||||||
need: [],
|
need: [],
|
||||||
free: true,
|
free: true,
|
||||||
payId: '',
|
payId: '',
|
||||||
@ -3301,6 +3302,7 @@
|
|||||||
prize: [{'a': 'item', 't': '13', 'n': 600}]
|
prize: [{'a': 'item', 't': '13', 'n': 600}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: '2',
|
||||||
name: 'wkdtips_5',
|
name: 'wkdtips_5',
|
||||||
need: [],
|
need: [],
|
||||||
free: false,
|
free: false,
|
||||||
@ -3309,6 +3311,7 @@
|
|||||||
prize: [{'a': 'item', 't': '4', 'n': 1},{'a': 'item', 't': '13', 'n': 800},{'a': 'item', 't': '2', 'n': 1000},{'a': 'item', 't': '1', 'n': 1000}]
|
prize: [{'a': 'item', 't': '4', 'n': 1},{'a': 'item', 't': '13', 'n': 800},{'a': 'item', 't': '2', 'n': 1000},{'a': 'item', 't': '1', 'n': 1000}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: '3',
|
||||||
name: 'wkdtips_6',
|
name: 'wkdtips_6',
|
||||||
need: [],
|
need: [],
|
||||||
free: false,
|
free: false,
|
||||||
@ -3317,6 +3320,7 @@
|
|||||||
prize: [{'a': 'item', 't': '4', 'n': 2},{'a': 'item', 't': '13', 'n': 1000},{'a': 'item', 't': '2', 'n': 1200},{'a': 'item', 't': '1', 'n': 1200}]
|
prize: [{'a': 'item', 't': '4', 'n': 2},{'a': 'item', 't': '13', 'n': 1000},{'a': 'item', 't': '2', 'n': 1200},{'a': 'item', 't': '1', 'n': 1200}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: '4',
|
||||||
name: 'wkdtips_7',
|
name: 'wkdtips_7',
|
||||||
need: [],
|
need: [],
|
||||||
free: false,
|
free: false,
|
||||||
|
@ -1300,5 +1300,18 @@
|
|||||||
"display": {
|
"display": {
|
||||||
"lv": 20
|
"lv": 20
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"zhoumolibao": {
|
||||||
|
"name": "zhoumolibao",
|
||||||
|
"undefined": "周末礼包",
|
||||||
|
"and": {
|
||||||
|
"lv": 15
|
||||||
|
},
|
||||||
|
"or": {},
|
||||||
|
"time": 0,
|
||||||
|
"tips": "openCond_tips_96",
|
||||||
|
"display": {
|
||||||
|
"lv": 15
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,6 +20,7 @@ import {ResOpen as ResOpenZhanLing} from '../shared/protocols/event/zhanling/Ptl
|
|||||||
import {ResOpen as ResOpenZhoulibao} from '../shared/protocols/event/zhoulibao/PtlOpen';
|
import {ResOpen as ResOpenZhoulibao} from '../shared/protocols/event/zhoulibao/PtlOpen';
|
||||||
import {ResOpen as ResOpenZixuanlibao} from '../shared/protocols/event/zixuanlibao/PtlOpen';
|
import {ResOpen as ResOpenZixuanlibao} from '../shared/protocols/event/zixuanlibao/PtlOpen';
|
||||||
import {ResOpen as ResOpenKaifujingsai} from '../shared/protocols/kaifujingsai/PtlOpen';
|
import {ResOpen as ResOpenKaifujingsai} from '../shared/protocols/kaifujingsai/PtlOpen';
|
||||||
|
import {ResOpen as ResOpenZhoumolibao} from '../shared/protocols/event/zhoumolibao/PtlOpen';
|
||||||
|
|
||||||
export type eventType = {
|
export type eventType = {
|
||||||
shouchong: {
|
shouchong: {
|
||||||
@ -46,6 +47,7 @@ export type eventType = {
|
|||||||
qirichongzhi: Omit<ResOpenQirichongzhi, 'finished'>;
|
qirichongzhi: Omit<ResOpenQirichongzhi, 'finished'>;
|
||||||
jierihuodong: Omit<ResOpenJierihuodong, 'taskFinish'> & { refreshTime: number; };
|
jierihuodong: Omit<ResOpenJierihuodong, 'taskFinish'> & { refreshTime: number; };
|
||||||
kaifujingsai: ResOpenKaifujingsai
|
kaifujingsai: ResOpenKaifujingsai
|
||||||
|
zhoumolibao: ResOpenZhoumolibao
|
||||||
} & {
|
} & {
|
||||||
[k: `${number}jijin`]: ResOpenYuedujijin;
|
[k: `${number}jijin`]: ResOpenYuedujijin;
|
||||||
[k: `yangchengmubiao${number}`]: yangchengmubiao;
|
[k: `yangchengmubiao${number}`]: yangchengmubiao;
|
||||||
|
@ -37,6 +37,7 @@ export class HuoDongFun {
|
|||||||
let openTime = PublicShared.getToDayZeroTime(G.openTime)
|
let openTime = PublicShared.getToDayZeroTime(G.openTime)
|
||||||
let _sDay = Number((G.time - openTime) / 86400)
|
let _sDay = Number((G.time - openTime) / 86400)
|
||||||
|
|
||||||
|
// ttype为0 根据开服时间计算,ttype为1,根据用户注册时间计算
|
||||||
let _where = {
|
let _where = {
|
||||||
$or: [
|
$or: [
|
||||||
{
|
{
|
||||||
|
16
src/shared/protocols/event/zhoumolibao/PtlOpen.ts
Normal file
16
src/shared/protocols/event/zhoumolibao/PtlOpen.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* 周末礼包
|
||||||
|
*/
|
||||||
|
export type ReqOpen = {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ResOpen = {
|
||||||
|
record:{
|
||||||
|
[k: string]: number;
|
||||||
|
}
|
||||||
|
buyLog:{
|
||||||
|
[k: string]: number;
|
||||||
|
}
|
||||||
|
};
|
10
src/shared/protocols/event/zhoumolibao/PtlReceive.ts
Normal file
10
src/shared/protocols/event/zhoumolibao/PtlReceive.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* 周末礼包领奖
|
||||||
|
*/
|
||||||
|
export interface ReqReceive {
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResReceive {
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user