From ca9e45c510b63e8cb0664d59f731e5b1f4ce07e8 Mon Sep 17 00:00:00 2001 From: 陆恒 Date: Tue, 18 Aug 2020 17:32:13 +0800 Subject: [PATCH] 大额提现改版 --- src/HttpServer/jsonconf/DailyTask.json | 445 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ src/HttpServer/jsonconf/RedConfig.json | 1202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/HttpServer/jsonconf/WithdrawConfig.json | 57 +++++++++++++++------------------------------------------ src/HttpServer/jsonconf/jsonconf.go | 34 ++++++++++++++++++++++++++++++++++ src/HttpServer/logic/constdef.go | 1 + src/HttpServer/logic/datadef.go | 24 +++++++++++++++++++++++- src/HttpServer/logic/function.go | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------- src/HttpServer/logic/httpserver.go | 26 ++++++++++++++++++++++++-- src/HttpServer/logic/logic.go | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 9 files changed, 1829 insertions(+), 107 deletions(-) create mode 100644 src/HttpServer/jsonconf/RedConfig.json diff --git a/src/HttpServer/jsonconf/DailyTask.json b/src/HttpServer/jsonconf/DailyTask.json index de70f5b..8df82cb 100644 --- a/src/HttpServer/jsonconf/DailyTask.json +++ b/src/HttpServer/jsonconf/DailyTask.json @@ -1,79 +1,452 @@ [ { "id": 1, - "task": "每日登录", - "num": 1, - "reward": [1,50], - "type": 1 + "task": "观看%d%条广告", + "num": 2, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 2, - "task": "试玩15s小游戏", - "num": 1, - "reward": [1,50], - "type": 2 + "task": "观看%d%条广告", + "num": 5, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 3, - "task": "今日通过%d%关", - "num": 3, - "reward": [5,30], - "type": 3 + "task": "观看%d%条广告", + "num": 7, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 4, - "task": "使用%d%次道具", - "num": 3, - "reward": [5,20], - "type": 4 + "task": "观看%d%条广告", + "num": 10, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 5, "task": "观看%d%条广告", - "num": 5, - "reward": [5,50], - "type": 5 + "num": 15, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 6, "task": "观看%d%条广告", - "num": 10, - "reward": [5,100], - "type": 5 + "num": 20, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 7, "task": "观看%d%条广告", - "num": 20, - "reward": [5,150], - "type": 5 + "num": 25, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" }, { "id": 8, + "task": "观看%d%条广告", + "num": 30, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" + }, + { + "id": 9, + "task": "观看%d%条广告", + "num": 35, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" + }, + { + "id": 10, + "task": "观看%d%条广告", + "num": 40, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" + }, + { + "id": 11, + "task": "观看%d%条广告", + "num": 45, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" + }, + { + "id": 12, + "task": "观看%d%条广告", + "num": 50, + "reward": "[8,1]", + "type": 5, + "Column5": "", + "Column6": "" + }, + { + "id": 13, + "task": "今日通过%d%关", + "num": 2, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 14, + "task": "今日通过%d%关", + "num": 4, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 15, + "task": "今日通过%d%关", + "num": 6, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 16, + "task": "今日通过%d%关", + "num": 8, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 17, + "task": "今日通过%d%关", + "num": 10, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 18, + "task": "今日通过%d%关", + "num": 15, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 19, + "task": "今日通过%d%关", + "num": 20, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 20, + "task": "今日通过%d%关", + "num": 25, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 21, + "task": "今日通过%d%关", + "num": 30, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 22, + "task": "今日通过%d%关", + "num": 40, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 23, + "task": "今日通过%d%关", + "num": 50, + "reward": "[8,1]", + "type": 3, + "Column5": "", + "Column6": "" + }, + { + "id": 24, + "task": "使用%d%次道具", + "num": 2, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 25, + "task": "使用%d%次道具", + "num": 4, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 26, + "task": "使用%d%次道具", + "num": 6, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 27, + "task": "使用%d%次道具", + "num": 8, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 28, + "task": "使用%d%次道具", + "num": 10, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 29, + "task": "使用%d%次道具", + "num": 15, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 30, + "task": "使用%d%次道具", + "num": 20, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 31, + "task": "使用%d%次道具", + "num": 25, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 32, + "task": "使用%d%次道具", + "num": 30, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 33, + "task": "使用%d%次道具", + "num": 40, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 34, + "task": "使用%d%次道具", + "num": 50, + "reward": "[8,1]", + "type": 4, + "Column5": "", + "Column6": "" + }, + { + "id": 35, "task": "累计在线%d%分钟", "num": 5, - "reward": [2,1], - "type": 6 + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" }, { - "id": 9, + "id": 36, "task": "累计在线%d%分钟", "num": 10, - "reward": [3,1], - "type": 6 + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" }, { - "id": 10, + "id": 37, "task": "累计在线%d%分钟", "num": 15, - "reward": [4,1], - "type": 6 + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" }, { - "id": 11, + "id": 38, "task": "累计在线%d%分钟", "num": 20, - "reward": [1,100], - "type": 6 + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 39, + "task": "累计在线%d%分钟", + "num": 25, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 40, + "task": "累计在线%d%分钟", + "num": 30, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 41, + "task": "累计在线%d%分钟", + "num": 35, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 42, + "task": "累计在线%d%分钟", + "num": 40, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 43, + "task": "累计在线%d%分钟", + "num": 45, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 44, + "task": "累计在线%d%分钟", + "num": 50, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 45, + "task": "累计在线%d%分钟", + "num": 55, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 46, + "task": "累计在线%d%分钟", + "num": 60, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 47, + "task": "累计在线%d%分钟", + "num": 70, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 48, + "task": "累计在线%d%分钟", + "num": 80, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 49, + "task": "累计在线%d%分钟", + "num": 90, + "reward": "[8,1]", + "type": 6, + "Column5": "", + "Column6": "" + }, + { + "id": 50, + "task": "每日登录", + "num": 1, + "reward": "[8,1]", + "type": 1, + "Column5": "", + "Column6": "" } ] \ No newline at end of file diff --git a/src/HttpServer/jsonconf/RedConfig.json b/src/HttpServer/jsonconf/RedConfig.json new file mode 100644 index 0000000..005177f --- /dev/null +++ b/src/HttpServer/jsonconf/RedConfig.json @@ -0,0 +1,1202 @@ +[ + { + "id": 1, + "cash": 500 + }, + { + "id": 2, + "cash": 113288 + }, + { + "id": 3, + "cash": 86032 + }, + { + "id": 4, + "cash": 67216 + }, + { + "id": 5, + "cash": 54329 + }, + { + "id": 6, + "cash": 64538 + }, + { + "id": 7, + "cash": 44198 + }, + { + "id": 8, + "cash": 60738 + }, + { + "id": 9, + "cash": 76891 + }, + { + "id": 10, + "cash": 41328 + }, + { + "id": 11, + "cash": 32807 + }, + { + "id": 12, + "cash": 21068 + }, + { + "id": 13, + "cash": 13288 + }, + { + "id": 14, + "cash": 9808 + }, + { + "id": 15, + "cash": 6798 + }, + { + "id": 16, + "cash": 7423 + }, + { + "id": 17, + "cash": 8617 + }, + { + "id": 18, + "cash": 6890 + }, + { + "id": 19, + "cash": 7127 + }, + { + "id": 20, + "cash": 5391 + }, + { + "id": 21, + "cash": 4748 + }, + { + "id": 22, + "cash": 3367 + }, + { + "id": 23, + "cash": 2576 + }, + { + "id": 24, + "cash": 3161 + }, + { + "id": 25, + "cash": 2842 + }, + { + "id": 26, + "cash": 2973 + }, + { + "id": 27, + "cash": 3104 + }, + { + "id": 28, + "cash": 2551 + }, + { + "id": 29, + "cash": 2591 + }, + { + "id": 30, + "cash": 2583 + }, + { + "id": 31, + "cash": 2140 + }, + { + "id": 32, + "cash": 2356 + }, + { + "id": 33, + "cash": 1966 + }, + { + "id": 34, + "cash": 2202 + }, + { + "id": 35, + "cash": 1807 + }, + { + "id": 36, + "cash": 1637 + }, + { + "id": 37, + "cash": 1683 + }, + { + "id": 38, + "cash": 1822 + }, + { + "id": 39, + "cash": 1667 + }, + { + "id": 40, + "cash": 1655 + }, + { + "id": 41, + "cash": 907 + }, + { + "id": 42, + "cash": 958 + }, + { + "id": 43, + "cash": 501 + }, + { + "id": 44, + "cash": 553 + }, + { + "id": 45, + "cash": 930 + }, + { + "id": 46, + "cash": 906 + }, + { + "id": 47, + "cash": 822 + }, + { + "id": 48, + "cash": 846 + }, + { + "id": 49, + "cash": 868 + }, + { + "id": 50, + "cash": 919 + }, + { + "id": 51, + "cash": 839 + }, + { + "id": 52, + "cash": 912 + }, + { + "id": 53, + "cash": 968 + }, + { + "id": 54, + "cash": 940 + }, + { + "id": 55, + "cash": 857 + }, + { + "id": 56, + "cash": 936 + }, + { + "id": 57, + "cash": 972 + }, + { + "id": 58, + "cash": 814 + }, + { + "id": 59, + "cash": 862 + }, + { + "id": 60, + "cash": 921 + }, + { + "id": 61, + "cash": 890 + }, + { + "id": 62, + "cash": 938 + }, + { + "id": 63, + "cash": 857 + }, + { + "id": 64, + "cash": 991 + }, + { + "id": 65, + "cash": 985 + }, + { + "id": 66, + "cash": 843 + }, + { + "id": 67, + "cash": 923 + }, + { + "id": 68, + "cash": 809 + }, + { + "id": 69, + "cash": 1005 + }, + { + "id": 70, + "cash": 858 + }, + { + "id": 71, + "cash": 1023 + }, + { + "id": 72, + "cash": 1003 + }, + { + "id": 73, + "cash": 937 + }, + { + "id": 74, + "cash": 898 + }, + { + "id": 75, + "cash": 985 + }, + { + "id": 76, + "cash": 1025 + }, + { + "id": 77, + "cash": 978 + }, + { + "id": 78, + "cash": 993 + }, + { + "id": 79, + "cash": 980 + }, + { + "id": 80, + "cash": 1034 + }, + { + "id": 81, + "cash": 939 + }, + { + "id": 82, + "cash": 972 + }, + { + "id": 83, + "cash": 886 + }, + { + "id": 84, + "cash": 856 + }, + { + "id": 85, + "cash": 879 + }, + { + "id": 86, + "cash": 999 + }, + { + "id": 87, + "cash": 877 + }, + { + "id": 88, + "cash": 1021 + }, + { + "id": 89, + "cash": 912 + }, + { + "id": 90, + "cash": 1028 + }, + { + "id": 91, + "cash": 878 + }, + { + "id": 92, + "cash": 874 + }, + { + "id": 93, + "cash": 1032 + }, + { + "id": 94, + "cash": 987 + }, + { + "id": 95, + "cash": 917 + }, + { + "id": 96, + "cash": 1008 + }, + { + "id": 97, + "cash": 916 + }, + { + "id": 98, + "cash": 837 + }, + { + "id": 99, + "cash": 896 + }, + { + "id": 100, + "cash": 840 + }, + { + "id": 101, + "cash": 572 + }, + { + "id": 102, + "cash": 595 + }, + { + "id": 103, + "cash": 547 + }, + { + "id": 104, + "cash": 520 + }, + { + "id": 105, + "cash": 526 + }, + { + "id": 106, + "cash": 602 + }, + { + "id": 107, + "cash": 599 + }, + { + "id": 108, + "cash": 577 + }, + { + "id": 109, + "cash": 539 + }, + { + "id": 110, + "cash": 569 + }, + { + "id": 111, + "cash": 558 + }, + { + "id": 112, + "cash": 535 + }, + { + "id": 113, + "cash": 565 + }, + { + "id": 114, + "cash": 566 + }, + { + "id": 115, + "cash": 567 + }, + { + "id": 116, + "cash": 543 + }, + { + "id": 117, + "cash": 616 + }, + { + "id": 118, + "cash": 576 + }, + { + "id": 119, + "cash": 633 + }, + { + "id": 120, + "cash": 573 + }, + { + "id": 121, + "cash": 629 + }, + { + "id": 122, + "cash": 628 + }, + { + "id": 123, + "cash": 626 + }, + { + "id": 124, + "cash": 528 + }, + { + "id": 125, + "cash": 538 + }, + { + "id": 126, + "cash": 616 + }, + { + "id": 127, + "cash": 562 + }, + { + "id": 128, + "cash": 521 + }, + { + "id": 129, + "cash": 522 + }, + { + "id": 130, + "cash": 633 + }, + { + "id": 131, + "cash": 569 + }, + { + "id": 132, + "cash": 527 + }, + { + "id": 133, + "cash": 526 + }, + { + "id": 134, + "cash": 607 + }, + { + "id": 135, + "cash": 528 + }, + { + "id": 136, + "cash": 547 + }, + { + "id": 137, + "cash": 622 + }, + { + "id": 138, + "cash": 527 + }, + { + "id": 139, + "cash": 530 + }, + { + "id": 140, + "cash": 553 + }, + { + "id": 141, + "cash": 631 + }, + { + "id": 142, + "cash": 605 + }, + { + "id": 143, + "cash": 576 + }, + { + "id": 144, + "cash": 524 + }, + { + "id": 145, + "cash": 611 + }, + { + "id": 146, + "cash": 581 + }, + { + "id": 147, + "cash": 558 + }, + { + "id": 148, + "cash": 537 + }, + { + "id": 149, + "cash": 568 + }, + { + "id": 150, + "cash": 625 + }, + { + "id": 151, + "cash": 625 + }, + { + "id": 152, + "cash": 581 + }, + { + "id": 153, + "cash": 562 + }, + { + "id": 154, + "cash": 541 + }, + { + "id": 155, + "cash": 531 + }, + { + "id": 156, + "cash": 576 + }, + { + "id": 157, + "cash": 610 + }, + { + "id": 158, + "cash": 539 + }, + { + "id": 159, + "cash": 528 + }, + { + "id": 160, + "cash": 530 + }, + { + "id": 161, + "cash": 542 + }, + { + "id": 162, + "cash": 525 + }, + { + "id": 163, + "cash": 579 + }, + { + "id": 164, + "cash": 533 + }, + { + "id": 165, + "cash": 577 + }, + { + "id": 166, + "cash": 573 + }, + { + "id": 167, + "cash": 619 + }, + { + "id": 168, + "cash": 535 + }, + { + "id": 169, + "cash": 560 + }, + { + "id": 170, + "cash": 626 + }, + { + "id": 171, + "cash": 521 + }, + { + "id": 172, + "cash": 583 + }, + { + "id": 173, + "cash": 601 + }, + { + "id": 174, + "cash": 549 + }, + { + "id": 175, + "cash": 574 + }, + { + "id": 176, + "cash": 632 + }, + { + "id": 177, + "cash": 614 + }, + { + "id": 178, + "cash": 598 + }, + { + "id": 179, + "cash": 538 + }, + { + "id": 180, + "cash": 529 + }, + { + "id": 181, + "cash": 559 + }, + { + "id": 182, + "cash": 626 + }, + { + "id": 183, + "cash": 581 + }, + { + "id": 184, + "cash": 522 + }, + { + "id": 185, + "cash": 565 + }, + { + "id": 186, + "cash": 535 + }, + { + "id": 187, + "cash": 598 + }, + { + "id": 188, + "cash": 628 + }, + { + "id": 189, + "cash": 617 + }, + { + "id": 190, + "cash": 615 + }, + { + "id": 191, + "cash": 604 + }, + { + "id": 192, + "cash": 537 + }, + { + "id": 193, + "cash": 564 + }, + { + "id": 194, + "cash": 582 + }, + { + "id": 195, + "cash": 551 + }, + { + "id": 196, + "cash": 618 + }, + { + "id": 197, + "cash": 614 + }, + { + "id": 198, + "cash": 594 + }, + { + "id": 199, + "cash": 566 + }, + { + "id": 200, + "cash": 527 + }, + { + "id": 201, + "cash": 616 + }, + { + "id": 202, + "cash": 588 + }, + { + "id": 203, + "cash": 530 + }, + { + "id": 204, + "cash": 628 + }, + { + "id": 205, + "cash": 597 + }, + { + "id": 206, + "cash": 587 + }, + { + "id": 207, + "cash": 550 + }, + { + "id": 208, + "cash": 627 + }, + { + "id": 209, + "cash": 587 + }, + { + "id": 210, + "cash": 622 + }, + { + "id": 211, + "cash": 613 + }, + { + "id": 212, + "cash": 587 + }, + { + "id": 213, + "cash": 557 + }, + { + "id": 214, + "cash": 538 + }, + { + "id": 215, + "cash": 557 + }, + { + "id": 216, + "cash": 623 + }, + { + "id": 217, + "cash": 565 + }, + { + "id": 218, + "cash": 528 + }, + { + "id": 219, + "cash": 621 + }, + { + "id": 220, + "cash": 545 + }, + { + "id": 221, + "cash": 534 + }, + { + "id": 222, + "cash": 546 + }, + { + "id": 223, + "cash": 539 + }, + { + "id": 224, + "cash": 526 + }, + { + "id": 225, + "cash": 603 + }, + { + "id": 226, + "cash": 527 + }, + { + "id": 227, + "cash": 545 + }, + { + "id": 228, + "cash": 583 + }, + { + "id": 229, + "cash": 607 + }, + { + "id": 230, + "cash": 569 + }, + { + "id": 231, + "cash": 526 + }, + { + "id": 232, + "cash": 620 + }, + { + "id": 233, + "cash": 588 + }, + { + "id": 234, + "cash": 586 + }, + { + "id": 235, + "cash": 600 + }, + { + "id": 236, + "cash": 632 + }, + { + "id": 237, + "cash": 581 + }, + { + "id": 238, + "cash": 550 + }, + { + "id": 239, + "cash": 579 + }, + { + "id": 240, + "cash": 559 + }, + { + "id": 241, + "cash": 539 + }, + { + "id": 242, + "cash": 608 + }, + { + "id": 243, + "cash": 534 + }, + { + "id": 244, + "cash": 570 + }, + { + "id": 245, + "cash": 583 + }, + { + "id": 246, + "cash": 600 + }, + { + "id": 247, + "cash": 559 + }, + { + "id": 248, + "cash": 625 + }, + { + "id": 249, + "cash": 568 + }, + { + "id": 250, + "cash": 592 + }, + { + "id": 251, + "cash": 533 + }, + { + "id": 252, + "cash": 596 + }, + { + "id": 253, + "cash": 595 + }, + { + "id": 254, + "cash": 621 + }, + { + "id": 255, + "cash": 575 + }, + { + "id": 256, + "cash": 526 + }, + { + "id": 257, + "cash": 622 + }, + { + "id": 258, + "cash": 630 + }, + { + "id": 259, + "cash": 585 + }, + { + "id": 260, + "cash": 543 + }, + { + "id": 261, + "cash": 550 + }, + { + "id": 262, + "cash": 519 + }, + { + "id": 263, + "cash": 522 + }, + { + "id": 264, + "cash": 563 + }, + { + "id": 265, + "cash": 544 + }, + { + "id": 266, + "cash": 630 + }, + { + "id": 267, + "cash": 544 + }, + { + "id": 268, + "cash": 607 + }, + { + "id": 269, + "cash": 592 + }, + { + "id": 270, + "cash": 558 + }, + { + "id": 271, + "cash": 593 + }, + { + "id": 272, + "cash": 608 + }, + { + "id": 273, + "cash": 520 + }, + { + "id": 274, + "cash": 578 + }, + { + "id": 275, + "cash": 613 + }, + { + "id": 276, + "cash": 614 + }, + { + "id": 277, + "cash": 580 + }, + { + "id": 278, + "cash": 552 + }, + { + "id": 279, + "cash": 590 + }, + { + "id": 280, + "cash": 567 + }, + { + "id": 281, + "cash": 561 + }, + { + "id": 282, + "cash": 631 + }, + { + "id": 283, + "cash": 599 + }, + { + "id": 284, + "cash": 519 + }, + { + "id": 285, + "cash": 549 + }, + { + "id": 286, + "cash": 588 + }, + { + "id": 287, + "cash": 607 + }, + { + "id": 288, + "cash": 611 + }, + { + "id": 289, + "cash": 629 + }, + { + "id": 290, + "cash": 570 + }, + { + "id": 291, + "cash": 579 + }, + { + "id": 292, + "cash": 602 + }, + { + "id": 293, + "cash": 534 + }, + { + "id": 294, + "cash": 521 + }, + { + "id": 295, + "cash": 586 + }, + { + "id": 296, + "cash": 604 + }, + { + "id": 297, + "cash": 561 + }, + { + "id": 298, + "cash": 550 + }, + { + "id": 299, + "cash": 522 + }, + { + "id": 300, + "cash": 518 + } +] \ No newline at end of file diff --git a/src/HttpServer/jsonconf/WithdrawConfig.json b/src/HttpServer/jsonconf/WithdrawConfig.json index 0952bb7..747f532 100644 --- a/src/HttpServer/jsonconf/WithdrawConfig.json +++ b/src/HttpServer/jsonconf/WithdrawConfig.json @@ -1,64 +1,37 @@ [ { - "id": 1, - "money": 0.3, - "coin": 3000, - "task": 0, - "level": 2, - "new": 0, - "day": 1 - }, - { - "id": 2, - "money": 0.5, - "coin": 5000, - "task": 1, - "level": 4, - "new": 0, - "day": 2 - }, - { "id": 3, - "money": 1, - "coin": 10000, + "money": 200, + "coin": 2000000, "task": 2, - "level": 7, + "level": 0, "new": 0, - "day": 5 + "day": 0 }, { "id": 4, - "money": 1.5, - "coin": 15000, + "money": 300, + "coin": 3000000, "task": 3, - "level": 9, + "level": 0, "new": 0, - "day": 8 + "day": 0 }, { "id": 5, - "money": 2, - "coin": 20000, + "money": 400, + "coin": 4000000, "task": 4, - "level": 12, + "level": 0, "new": 0, - "day": 15 + "day": 0 }, { "id": 6, - "money": 3, - "coin": 30000, + "money": 500, + "coin": 5000000, "task": 5, - "level": 15, - "new": 0, - "day": 20 - }, - { - "id": 7, - "money": 100, - "coin": 10000000, - "task": 6, - "level": 25, + "level": 0, "new": 0, "day": 0 } diff --git a/src/HttpServer/jsonconf/jsonconf.go b/src/HttpServer/jsonconf/jsonconf.go index 71c47c5..7a12448 100644 --- a/src/HttpServer/jsonconf/jsonconf.go +++ b/src/HttpServer/jsonconf/jsonconf.go @@ -77,6 +77,11 @@ type ActiveWithdrawConfigDesc struct { Day int `json:"day"` } +type RedpacketConfigDesc struct { + Id int `json:"id"` + Cash int `json:"cash"` +} + type GameConfig struct { AchieventConfig []AchieveDesc TaskConfig []AchieveDesc @@ -86,6 +91,7 @@ type GameConfig struct { WithDrawConfig []WithDrawDesc SignConfig SignConfigDesc ActiveWithdrawConfig []ActiveWithdrawConfigDesc + RedpacketConfig []RedpacketConfigDesc } func GetJsonConf() *GameConfig { @@ -241,6 +247,34 @@ func LoadJsonConf() error { return err } + path = "../jsonconf/RedConfig.json" + content, err = file_get_contents(path) + if err != nil { + logger.Info("loadJsonConf failed1,err=%v", err) + return err + } + + err = json.Unmarshal([]byte(content), &g_jsonconf.RedpacketConfig) + if err != nil { + logger.Info("loadJsonConf failed1,err=%v", err) + return err + } + logger.Info("loadJsonConf success pconf=%v,err=%v", *g_jsonconf, err) return err } + + +func GetRedpacketNum(id int) int { + if len(g_jsonconf.RedpacketConfig) == 0 { + logger.Error("GetRedpacketNum error") + return 0 + } + for _, val := range g_jsonconf.RedpacketConfig { + if val.Id == id { + return val.Cash + } + } + + return g_jsonconf.RedpacketConfig[len(g_jsonconf.RedpacketConfig)-1].Cash +} \ No newline at end of file diff --git a/src/HttpServer/logic/constdef.go b/src/HttpServer/logic/constdef.go index 54e0bb0..be8fcc7 100644 --- a/src/HttpServer/logic/constdef.go +++ b/src/HttpServer/logic/constdef.go @@ -46,6 +46,7 @@ const ( //REWARDTYPE_SWAP = 4 //经验 //REWARDTYPE_ELIMITE = 5 REWARDTYPE_EXP = 5 //经验 + REWARDTYPE_REDBAG = 8 //经验 ) diff --git a/src/HttpServer/logic/datadef.go b/src/HttpServer/logic/datadef.go index fb27bfc..c43751e 100644 --- a/src/HttpServer/logic/datadef.go +++ b/src/HttpServer/logic/datadef.go @@ -25,6 +25,7 @@ type UserLoginData struct { Userexp int `json:"userexp"` Sumloginday int `json:"sumloginday"` Shakeleftcnt int `json:"shakeleftcnt"` + IsNew int `json:"isnew"` } type UserLoginResp struct { @@ -109,6 +110,7 @@ type DrawguangoldData struct { Guangold int `json:"guangold"` Wallgold int `json:"wallgold"` Totalfetchcnt int `json:"totalfetchcnt"` + Getgoldnum int `json:"getgoldnum"` } type DrawguangoldResp struct { @@ -204,6 +206,7 @@ type GettaskrewardData struct { Swapitem int `json:"swapitem"` Eliminitem int `json:"eliminitem"` Goldnum int `json:"goldnum"` + Addgold int `json:"addgold"` } type GettaskrewardResp struct { Code int `json:"code"` @@ -286,6 +289,21 @@ type ReadNumUploadResp struct { Timestamp int `json:"timestamp"` } +type FetchredbagReq struct { + Gameid string `json:"gameid"` + Channel string `json:"channel"` +} + +type FetchredbagData struct { + Getgoldnum int `json:"getgoldnum"` + Walletgold int `json:"walletgold"` +} +type FetchredbagResp struct { + Code int `json:"code"` + Message string `json:"message"` + Data FetchredbagData `json:"data"` +} + //********************************************************************************************************** type TaskListDesc struct { @@ -296,6 +314,7 @@ type TaskListDesc struct { type TaskList struct { Taskdata []TaskListDesc `json:"taskdata"` + Fetchrdnum int `json:"fetchrdnum"` } //其中提取次数和当日登陆在userdata中记录 @@ -382,7 +401,10 @@ type UserData struct { UpLvCostTime int //上一个等级升级时间 UpLvCostTimeSec int //上一个等级升级的时间点时刻 ReadNum int //玩家微转发阅读量 - GetCashCnt int //当天提现次数 + GetCashCnt int //当天提 + FetchRedCnt int //领取红包次数计数 + IsNew int //新手状态// 现次数 + FetchRdBagNum int //当天已领的红包 ShakeTime int //摇一摇 WithDraw WithDrawInfo //提现记录信息 //SpecialWithDraw WithDrawInfo //活跃提现记录信息 diff --git a/src/HttpServer/logic/function.go b/src/HttpServer/logic/function.go index bd7d9e0..edfbc71 100644 --- a/src/HttpServer/logic/function.go +++ b/src/HttpServer/logic/function.go @@ -419,7 +419,7 @@ func (uinfo *UserData) HandleGetTaskReward(req *GettaskrewardReq, resp *Gettaskr for i := 0; i < sub; i++ { rtype := cfg.Reward[i*2] rnum := cfg.Reward[i*2+1] - r1, r2, r3, r4, r5, r6, r7 := uinfo.RewardUser(rtype, rnum, req.Gameid, req.Channel, uuid) + r1, r2, r3, r4, r5, r6, r7,r8 := uinfo.RewardUser(rtype, rnum, req.Gameid, req.Channel, uuid) if resp.Data.Lv != r1 { resp.Data.Lv = r1 resp.Data.Costtime = uinfo.UpLvCostTime / 3600 @@ -430,20 +430,41 @@ func (uinfo *UserData) HandleGetTaskReward(req *GettaskrewardReq, resp *Gettaskr resp.Data.Swapitem += r5 resp.Data.Eliminitem += r6 resp.Data.Goldnum = r7 + resp.Data.Goldnum = r8 } return nil } -func (uinfo *UserData) RewardUser(rtype int, num int, gameid string, channel string, uuid int) (int, int, int, int, int, int, int) { +//领取红包 按次数计算 +func (uinfo *UserData) FetchRedPacket(gameid string, channel string, uuid int) int { + uinfo.FetchRedCnt++ + addgold := jsonconf.GetRedpacketNum(uinfo.FetchRedCnt) + if addgold == 0 { + logger.Error("FetchRedPacket failed addgold=0") + return 0 + } + + goldnum, realaddnum, err := AddCoinToSdk(uuid, addgold, gameid, channel, 102) + if err != nil { + logger.Error("RewardUser failer err=%v", err) + } + uinfo.RealGold = goldnum + + uniqueid := strconv.Itoa(uuid) + channel + SaveUserInfo(uinfo, uniqueid) + return realaddnum +} + +func (uinfo *UserData) RewardUser(rtype int, num int, gameid string, channel string, uuid int) (int, int, int, int, int, int, int,int) { logger.Info("RewardUser rtype=%v,num=%v", rtype, num) switch rtype { case REWARDTYPE_STAR: - return 0, num, 0, 0, 0, 0, 0 + return 0, num, 0, 0, 0, 0, 0,0 case REWARDTYPE_CHUI: - return 0, 0, num, 0, 0, 0, 0 + return 0, 0, num, 0, 0, 0, 0,0 case REWARDTYPE_SHUA: - return 0, 0, 0, num, 0, 0, 0 + return 0, 0, 0, num, 0, 0, 0,0 /*case REWARDTYPE_SWAP: return 0, 0, 0, 0, num, 0, 0 case REWARDTYPE_ELIMITE: @@ -451,22 +472,24 @@ func (uinfo *UserData) RewardUser(rtype int, num int, gameid string, channel str case REWARDTYPE_EXP: isup := uinfo.AddUserExp(num) if isup { - return uinfo.Lv, 0, 0, 0, 0, 0, 0 + return uinfo.Lv, 0, 0, 0, 0, 0, 0,0 } else { - return 0, 0, 0, 0, 0, 0, 0 + return 0, 0, 0, 0, 0, 0, 0,0 } case REWARDTYPE_GOLD: - goldnum, err := AddCoinToSdk(uuid, num, gameid, channel, 102) + goldnum,readadd, err := AddCoinToSdk(uuid, num, gameid, channel, 102) if err != nil { logger.Error("RewardUser failer err=%v", err) } uinfo.RealGold = goldnum //uinfo.RealGold += num - return 0, 0, 0, 0, 0, 0, uinfo.RealGold + return 0, 0, 0, 0, 0, 0, uinfo.RealGold,readadd + case REWARDTYPE_REDBAG: + return 0, 0, 0, 0, 0, 0, 0, 0 default: - return 0, 0, 0, 0, 0, 0, 0 + return 0, 0, 0, 0, 0, 0, 0,0 } - return 0, 0, 0, 0, 0, 0, 0 + return 0, 0, 0, 0, 0, 0, 0,0 } func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid string) error { @@ -490,6 +513,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s initdata.UpLvCostTime = 0 initdata.UpLvCostTimeSec = int(time.Now().Unix()) initdata.ShakeTime = SHAKELIMIT + initdata.IsNew = 1 for _, val := range jsonconf.GetJsonConf().WithDrawConfig { var tmp WithDrawDesc @@ -534,6 +558,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s resp.Data.Userexp = initdata.Exp resp.Data.Sumloginday = initdata.SumLoginDay resp.Data.Shakeleftcnt = initdata.ShakeTime + resp.Data.IsNew = initdata.IsNew err := SaveUserInfo(&initdata, uniqueuid) if err != nil { @@ -705,6 +730,8 @@ func (u *UserData) HandlePassDay(uuid int, channel string) { u.Task.PassLevel = 0 u.Task.UseItemCnt = 0 u.Task.PlaySmall = 0 + u.FetchRdBagNum = 0 + u.ShakeTime = SHAKELIMIT //任务也需要处理 /*tasklist, err := GetTaskInfo(u.Userid, 1) @@ -894,7 +921,8 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR //处理一下领取等级奖励金币 if data.LvRewardGet == 1 { - cfg := GetUserLvConfig(data.Lv) + //等级红包作废 + /*cfg := GetUserLvConfig(data.Lv) if cfg != nil { gold, err := AddCoinToSdk(uuid, cfg.Cash, req.Gameid, req.Channel, 101) if err != nil { @@ -904,7 +932,7 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR } } data.LvRewardGet = 2 - + */ } SaveUserInfo(data, uniqueuid) @@ -918,6 +946,7 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR resp.Data.Userexp = data.Exp resp.Data.Sumloginday = data.SumLoginDay resp.Data.Shakeleftcnt = data.ShakeTime + resp.Data.IsNew = data.IsNew return nil } @@ -1155,7 +1184,19 @@ func GetCoinFromSdk(uuid int, gameid string, channel string) (int, error) { return resp.Data.Mycoin, nil } -func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype int) (int, error) { +func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype int) (int,int, error) { + //处理一下实际增加值 + realaddgoldnum := goldnum + newnum, err := GetCoinFromSdk(uuid, gameid, channel) + if err != nil { + logger.Error("AddCoinToSdk failed=%v", err) + return 0, 0, err + } + + if newnum >= 950000 { + realaddgoldnum = 1 + } + SERVERKEY := XIAOXINGXING_SERVERKEYTEST if gameid == "1015" { SERVERKEY = XIAOXINGXING_SERVERKEYTEST_1015 @@ -1177,7 +1218,7 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in paramlist = append(paramlist, pchannel) puid := "uid=" + strconv.Itoa(uuid) paramlist = append(paramlist, puid) - pcoin := "coin=" + strconv.Itoa(goldnum) + pcoin := "coin=" + strconv.Itoa(realaddgoldnum) paramlist = append(paramlist, pcoin) ptyp := "typ=" + strconv.Itoa(atype) paramlist = append(paramlist, ptyp) @@ -1193,7 +1234,7 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in var req AddCoinDesc req.Channel = channel req.Gameid = gameid - req.Coin = goldnum + req.Coin = realaddgoldnum req.Sign = sign req.Sign_type = "md5" req.Time_stamp = strconv.Itoa(int(time.Now().Unix())) @@ -1203,12 +1244,12 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in bys, err := json.Marshal(&req) if err != nil { logger.Error("AddCoinToSdk failed=%v", err) - return 0, err + return 0,realaddgoldnum, err } res, err := DoHttpPost(bys, "api/server/addcoin") if err != nil { logger.Error("AddCoinToSdk failed=%v", err) - return 0, err + return 0,realaddgoldnum, err } logger.Info("AddCoinToSdk res=%v", res) @@ -1216,15 +1257,15 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in err = json.Unmarshal([]byte(res), &resp) if err != nil { logger.Error("AddCoinToSdk failed=%v", err) - return 0, err + return 0,realaddgoldnum, err } if resp.Code != "0" { gold, _ := GetCoinFromSdk(uuid, gameid, channel) logger.Error("AddCoinToSdk failed=%v", resp.Msg) - return gold, err + return gold, realaddgoldnum,err } - return resp.Data.Mycoin, nil + return resp.Data.Mycoin,realaddgoldnum, nil } func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string, checkcoin int) (int, error) { diff --git a/src/HttpServer/logic/httpserver.go b/src/HttpServer/logic/httpserver.go index 20e75af..c3acebc 100644 --- a/src/HttpServer/logic/httpserver.go +++ b/src/HttpServer/logic/httpserver.go @@ -61,6 +61,7 @@ func startServerHttpServe() { http.HandleFunc("/eliminatestar/getnewlevelreward", Getnewlevelreward) //领取任务或者成就奖励 http.HandleFunc("/eliminatestar/querysigndata", Querysigndata) //获取签到数据 http.HandleFunc("/eliminatestar/usersign", Usersign) //玩家签到 + http.HandleFunc("/eliminatestar/fetchredbag", Fetchredbag) //领取红包 // http.HandleFunc("/eliminatestar/readNumUpload", ReadNumUpload) //阅读量上报 http.HandleFunc("/eliminatestar/queryreadgold", QueryReadGold) //获取微转发金币数 @@ -120,6 +121,27 @@ func ReadNumUpload(w http.ResponseWriter, r *http.Request) { HandlerReadNumUpload(w, s) } +func Fetchredbag(w http.ResponseWriter, r *http.Request) { + + Uuid := 0 + if len(r.Header) > 0 { + Uuid, _ = strconv.Atoi(r.Header.Get("Uuid")) + } + + if Uuid == 0 { + SetHeader(w) + //logger.Error("Uuid is nil!") + return + } + result, _ := ioutil.ReadAll(r.Body) + r.Body.Close() + + s := string(result) + logger.Info("Fetchredbag , body:%v,uuid=%v", s, Uuid) + + HandlerFetchredbag(w, s, Uuid) +} + func Usersign(w http.ResponseWriter, r *http.Request) { Uuid := 0 @@ -260,7 +282,7 @@ func Addcoin(w http.ResponseWriter, r *http.Request) { addgold = 10000 } //调用sdk - gold, err := AddCoinToSdk(Uuid, addgold, rdata.Gameid, rdata.Channel, 108) + gold,_, err := AddCoinToSdk(Uuid, addgold, rdata.Gameid, rdata.Channel, 108) if err != nil { logger.Error("Addcoin test ddt! err=%v", err) } @@ -328,7 +350,7 @@ func Testapi(w http.ResponseWriter, r *http.Request) { } //uinfo.RealGold += addgold //调用sdk - gold, err := AddCoinToSdk(Uuid, addgold, rdata.Gameid, rdata.Channel, 108) + gold,_, err := AddCoinToSdk(Uuid, addgold, rdata.Gameid, rdata.Channel, 108) if err != nil { logger.Error("test ddt! err=%v", err) } diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index a8f1822..1a9ff99 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -10,8 +10,11 @@ import ( "net/http" "strconv" "strings" + "sync" ) +var llock sync.Mutex + func HandlerQueryguaninfo(w http.ResponseWriter, data string, uuid int) { SetHeader(w) var resp QueryguaninfoResp @@ -293,7 +296,7 @@ func HandlerFetchreadgold(w http.ResponseWriter, data string, uuid int) { resp.Code = ERROR_SRV_ERROR break } - realgiold, err := AddCoinToSdk(uuid, addgold, rdata.Gameid, rdata.Channel, SDKOPGOLD_TYPEWE) + realgiold,_, err := AddCoinToSdk(uuid, addgold, rdata.Gameid, rdata.Channel, SDKOPGOLD_TYPEWE) if err != nil { logger.Error("HandlerFetchreadgold failed err=%v", err) resp.Message = "后台加金币失败" @@ -403,6 +406,8 @@ func HandlerGetnewlevelreward(w http.ResponseWriter, data string, uuid int) { var rdata GetnewlevelrewardReq err := json.Unmarshal([]byte(data), &rdata) for { + //取消等级红包 + break if err != nil { logger.Info("json decode HandlerGetnewlevelreward data failed:%v,for:%v", err, data) resp.Message = "网络错误" @@ -435,7 +440,7 @@ func HandlerGetnewlevelreward(w http.ResponseWriter, data string, uuid int) { break } - goldnum, err := AddCoinToSdk(uuid, cfg.Cash, rdata.Gameid, rdata.Channel, 101) + goldnum,_, err := AddCoinToSdk(uuid, cfg.Cash, rdata.Gameid, rdata.Channel, 101) if err != nil { logger.Error("AddCoinToSdk failed err=%v", err) resp.Message = "网络错误" @@ -446,7 +451,7 @@ func HandlerGetnewlevelreward(w http.ResponseWriter, data string, uuid int) { //uinfo.RealGold += cfg.Cash if rdata.Rewardtype == 2 { - goldnum, err = AddCoinToSdk(uuid, cfg.Extracash, rdata.Gameid, rdata.Channel, 104) + goldnum,_, err = AddCoinToSdk(uuid, cfg.Extracash, rdata.Gameid, rdata.Channel, 104) if err != nil { logger.Error("AddCoinToSdk failed err=%v", err) resp.Message = "网络错误" @@ -521,6 +526,53 @@ func HandlerReadNumUpload(w http.ResponseWriter, data string) { fmt.Fprint(w, string(respstr)) } +func HandlerFetchredbag(w http.ResponseWriter, data string, uuid int) { + SetHeader(w) + llock.Lock() + defer llock.Unlock() + var resp FetchredbagResp + resp.Code = 0 + var rdata FetchredbagReq + err := json.Unmarshal([]byte(data), &rdata) + for { + if err != nil { + logger.Info("json decode HandlerFetchredbag data failed:%v,for:%v", err, data) + resp.Message = "网络错误" + resp.Code = ERROR_JSONUNMASH_ERROR + break + } + + //需要加上渠道才是唯一的玩家id,不同渠道视为不同数据 + uniqueuuid := strconv.Itoa(uuid) + rdata.Channel + uinfo, err := GetUserInfo(uniqueuuid) + if err != nil || uinfo == nil { + logger.Error("redis failed err=%v", err) + resp.Message = "服务器错误" + resp.Code = ERROR_SRV_ERROR + break + } + + readaddgold := uinfo.FetchRedPacket(rdata.Gameid, rdata.Channel, uuid) + + resp.Data.Walletgold = uinfo.RealGold + resp.Data.Getgoldnum = readaddgold + + uinfo.IsNew = 0 + uinfo.FetchRdBagNum++ + + //保存数据 + err = SaveUserInfo(uinfo, uniqueuuid) + + resp.Code = ERROR_OK + break + } + + //回包 + respstr, _ := json.Marshal(&resp) + fmt.Fprint(w, string(respstr)) + +} + func HandlerUsersign(w http.ResponseWriter, data string, uuid int) { SetHeader(w) var resp UsersignResp @@ -572,7 +624,7 @@ func HandlerUsersign(w http.ResponseWriter, data string, uuid int) { } //uinfo.RealGold = - goldnum, err := AddCoinToSdk(uuid, cfg.Num, rdata.Gameid, rdata.Channel, 107) + goldnum,_, err := AddCoinToSdk(uuid, cfg.Num, rdata.Gameid, rdata.Channel, 107) if err != nil { uinfo.SignSum-- logger.Error("AddCoinToSdk failed err=%v", err) @@ -711,6 +763,7 @@ func HandlerQuerytaskinfo(w http.ResponseWriter, data string, uuid int) { } resp.Data.Taskdata = append(resp.Data.Taskdata, tasklist.Taskdata...) + resp.Data.Fetchrdnum = uinfo.FetchRdBagNum resp.Code = ERROR_OK break @@ -972,7 +1025,7 @@ func HandlerDrawguangold(w http.ResponseWriter, data string, uuid int) { } //todo 此处需要调佣SDK接口通知金币变化 - goldnum, err := AddCoinToSdk(uuid, rdata.Goldnum, rdata.Gameid, rdata.Channel, 105) + goldnum,realgold, err := AddCoinToSdk(uuid, rdata.Goldnum, rdata.Gameid, rdata.Channel, 105) if err != nil { logger.Error("Drawgold failed err=%v", err) resp.Message = "从存钱罐提取金币失败了" @@ -989,6 +1042,7 @@ func HandlerDrawguangold(w http.ResponseWriter, data string, uuid int) { resp.Data.Guangold = uinfo.GuanGold resp.Data.Wallgold = uinfo.RealGold resp.Data.Totalfetchcnt = uinfo.Achieve.SumGetGuan + resp.Data.Getgoldnum = realgold SaveUserInfo(uinfo, uniqueuuid) -- libgit2 0.21.0