data.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262
  1. #pragma once
  2. #include <deque>
  3. #include <vector>
  4. #include <random>
  5. #include <fstream>
  6. #include <iostream>
  7. #include <boost/asio.hpp>
  8. #include <boost/thread.hpp>
  9. #include <boost/pfr.hpp>
  10. #include "bsoncxx/builder/stream/document.hpp"
  11. #include "mongocxx/instance.hpp"
  12. #include "mongocxx/uri.hpp"
  13. #include "mongocxx/client.hpp"
  14. #include <mongocxx/exception/exception.hpp>
  15. #include "bsoncxx/json.hpp"
  16. #include "rapidjson/document.h"
  17. #include "rapidjson/writer.h"
  18. #include "rapidjson/stringbuffer.h"
  19. #include <boost/filesystem.hpp>
  20. #include <unordered_set>
  21. #include <unordered_map>
  22. #include "funclib.hpp"
  23. #include "webfun.h"
  24. #include "resource.h"
  25. #include <string>
  26. #include <sstream>
  27. #include <iostream>
  28. #pragma pack(1)
  29. //data define
  30. #define MSG_NUM 20
  31. #define HTTPLEN 30000
  32. #define HTTPSENDLEN 300000
  33. #define RECLEN 5000
  34. #define LEN_ACCOUNTS 32
  35. #define LEN_PASSWORD 33
  36. #define LEN_SEAT_PHONE 33 //固定电话或移动电话
  37. #define LEN_INFO 128
  38. #define LEN_IP 16 //IP长度
  39. #define LEN_ACTION 100 //操作行动
  40. #define LEN_ACTIONINFO 400 //操作描述
  41. #define LEN_AUTHCODE 32 //授权码
  42. #define LEN_AUTHKEY 32 //授权密码
  43. #define LEN_MD5 33 //加密密码
  44. #define LEN_PERMS 200
  45. //msg define
  46. #define HTTPREGUSER 1 //注册玩家账号
  47. #define HTTPUPDATEUSERSCORE 2 //更新玩家分数
  48. #define HTTPREGADMIN 3 //注册管理员
  49. #define HTTPUPDATEADMINSCORE 4 //更新管理员分数
  50. #define HTTPADMINKICKUSER 5 //管理员把玩家踢出房价
  51. #define HTTPADMINPROHIBITADMIN 6 //上级管理员禁止下级管理员
  52. #define HTTPADMINPROHIBITUSER 7 //管理员禁止管理员所属玩家
  53. #define HTTPGETUSERACCOUNT 8 //获取用户账号
  54. #define HTTPADMINLOGIN 9 //账号登录
  55. #define HTTPMODIFYADMINPWD 10 //修改登录密码
  56. #define HTTPMODIFYADMINPWD2 11 //修改二级密码
  57. #define HTTPMODIFYADMININFO 12 //修改管理信息
  58. #define HTTPOPERATIONLOG 15 //操作日志
  59. #define HTTPMODIFYUSERPWD 16 //修改玩家登录密码
  60. #define HTTPADDADMINPWD2 17 //添加二级密码
  61. #define HTTPCHANGEADMINPWD2 19 //更改二级密码
  62. #define HTTPADMINPROHIBITMYUSER 20 //管理员禁止直属玩家
  63. #define HTTPMAKEUSERMANY 21 //创建多玩家
  64. #define HTTPMAKESUBADMIN 22 //创建子代理账号
  65. #define HTTPMODIFYSUBADMIN 23 //修改子代理账号
  66. #define HTTPCREATEAPI 25 //创建代理api
  67. #define HTTPDOWNGAMEINFO 26 //下载游戏信息
  68. #define HTTPSETADMINSHOWAREAID 27 //代理给代理设置不显示的地区列表
  69. #define HTTPGAMELOGDATA 28 //获取历史数据统计
  70. #define LEN_AUTHKEY 32 //授权密码
  71. #define HTTPSETTASK 33 //设置任务
  72. #define HTTPSETVIP 35 //设置VIP
  73. #define HTTPSETROLE 36 //设置角色
  74. #define HTTPSETWHEEL 37 //设置轮盘
  75. #define HTTPSETGASECRET 38 //设置google密钥
  76. #define HTTPSETSHOWGAME 39 //代理给玩家不显示的游戏列表
  77. #define HTTP_FREEGAME_CREATE 40 //向玩家赠送游戏免费旋转(创建活动)
  78. #define HTTP_FREEGAME_ENABLE 41 //向玩家赠送游戏免费旋转(启用)
  79. #define HTTP_FREEGAME_CANCEL 42 //向玩家赠送游戏免费旋转(取消)
  80. #define HTTPSETGASECRET_SUBUSER 43 //设置子账号google密钥
  81. #define HTTP_FREEGAME_EXPIRED 44 //向玩家赠送游戏免费旋转(设置过期)
  82. #define HTTP_FREEGAME_BETCONFIG 45 //游戏下注配置
  83. #define HTTPSERVERLOGDATA 50 //获取游戏房间数据
  84. #define HTTPUSERLOGDATA 51 //获取玩家排行数据
  85. #define HTTPMODIFYAPPLYAPI 53 //修改申请的信息
  86. #define HTTPAPPLYAPI 54 //申请开通无缝或者转账
  87. #define HTTPAGREEAPPLYAPI 55 //审核开通无缝或者转账
  88. #define HTTPMODIFYLEVEMSG 56 //留言修改
  89. #define HTTPJPTLOG 57 //jpt日志
  90. #define HTTPSPEJPTREVLOG 58 //specail revenue日志
  91. #define HTTPGAMELOGCNT 59 //game log cnt
  92. #define HTTPQUICKAPPLYAPI 60 //测试服快捷开通转账
  93. #define HTTP_CREDITAGENT_CUSTOMER 65 // 信用代理设置联系客服
  94. #define HTTP_CREDITAGENT_DELMARQUEE 66 // 信用代理跑马灯功能(删除)
  95. #define HTTP_CREDITAGENT_MARQUEE 67 // 信用代理跑马灯功能(设置)
  96. #define HTTP_CREDITAGENT_SITINFO 68 // 设置信用站点
  97. #define HTTP_CREDITAGENT_INIT 69 // 设置信用代理功能
  98. #define HTTP_PERMIT_API 70 // 设置账号权限
  99. #define HTTP_PERMIT_BONUSLMITI 71 // admin设置限红类型
  100. #define HTTP_PERMIT_REGISTER 72 // admin设置代理注册玩家的权限
  101. #define HTTP_PERMIT_ADDPOPULARIZE 73 // 代理添加推广网站权限
  102. #define HTTP_PERMIT_RETURNHALL 74 // 代理下玩家返回大厅开关
  103. #define HTTP_SET_REGION_GAMES 75 // 设置货币下属游戏
  104. #define HTTP_SET_ACTIVE_REGION 76 // 设置货币开放国家
  105. #define HTTP_AGENT_ACTIVE_REGION 77 // 设置代理开放国家
  106. #define HTTP_SORT_REGIONGAMES 78 // 排序货币下属游戏
  107. #define HTTP_DELETE_SORT_REGIONGAMES 79 // 删除货币下属游戏排序
  108. #define HTTP_MODIFY_GAMELIST 80 // 修改gamelist版本、排序
  109. #define HTTP_SET_WEBSIT_INFO 85 // 商户设置推广网站信息
  110. #define HTTP_SET_RESENDORDER 86 // 手动设置订单重发
  111. #define HTTP_SET_ORDERSTATUS 87 // 修改订单状态
  112. #define HTTP_CREDITAGENT_TOPWINNER 100 // 信用代理设置topwinner
  113. #define HTTP_SET_PLAYRECORDINI 105 // 后台设置platform.playrecordini
  114. #define HTTP_SET_ACTIVEINI 106 // 后台设置webdata.activeini
  115. #define HTTP_SET_NEWURLS 107 // 后台设置url变更
  116. #define HTTP_SET_Platfromini 108 // 后台设置platform.platfromini
  117. #define HTTP_CREDIT_GETUSERACCOUNT 150 // 信用代理创建账号
  118. #define HTTP_CREDIT_MULTIGETUSER 151 // 信用代理创建多个玩家
  119. #define HTTP_DEVELOPER_CREATE 160 // 新增厂商管理
  120. #define HTTP_UPDATE_GAMELIST 161 // 厂商管理-获取游戏列表
  121. #define HTTP_DEVELOPER_EDITGAME 162 // 编辑厂商游戏
  122. #define HTTP_DEVELOPER_SORTGAME 163 // 排序厂商游戏
  123. #define HTTP_REDEEMCODE_GENERATE 170 // 生成兑换码
  124. #define HTTP_REDEEMCODE_ACTIVE 171 // 生成兑换码
  125. #define HTTP_SETUSER_EXCHANGEMAX 172 //设置玩家兑换码兑换上限
  126. //game msg define
  127. #define MDM_CS_REGISTER 1
  128. #define MDM_CS_SERVICE_INFO 2
  129. #define SUB_CS_C_SERVER_UPDATESCORE 4
  130. #define SUB_CS_C_SERVER_DELUSER 6
  131. #define SUB_CS_C_REGISTER_WEB 103
  132. #define FlowType_Prize_mini 13
  133. #define FlowType_Prize_minor 14
  134. #define FlowType_Prize_major 15
  135. #define FlowType_Prize_grand 16
  136. #define FlowType_Prize_special 17
  137. enum EAgentLevel
  138. {
  139. EA_LEVEL1 = 1, //公司,admin
  140. EA_LEVEL2, //超级管理员,
  141. EA_LEVEL3, //管理
  142. EA_LEVEL4, //高级总代理
  143. EA_LEVEL5, //总代理,
  144. EA_LEVEL6 //商家
  145. };
  146. static std::string g_chars(
  147. "abcdefghijklmnopqrstuvwxyz"
  148. "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  149. "1234567890");
  150. static std::string g_redeemcodechars(
  151. "abcdefghijkmnpqrstuvwxyz"
  152. "ABCDEFGHIJKLMNPQRSTUVWXYZ"
  153. "23456789");
  154. //msg data
  155. typedef struct tagMsgBuffer
  156. {
  157. std::int32_t itype{0};
  158. std::int32_t idatasize{0};
  159. void* pdata{nullptr};
  160. }MsgBuffer;
  161. typedef struct tagwritedata
  162. {
  163. std::int64_t sendallsize{0}; //发送总长度
  164. std::int64_t completesize{0}; //发送完成长度
  165. }writedata;
  166. typedef struct tag_socketmsg
  167. {
  168. std::int32_t isize{0};
  169. void* pbuffer{nullptr};
  170. }socketmsg;
  171. struct activemsg
  172. {
  173. std::int64_t activecode{0}; //激活码
  174. char activekey[LEN_AUTHKEY]{0};
  175. };
  176. //game msg data
  177. struct CMD_CS_C_RegisterWeb
  178. {
  179. TCHAR szServerAddr[32]{0}; //服务地址
  180. };
  181. struct CMD_CS_C_UpdateScoreEx
  182. {
  183. DWORD dwUserID{0}; //用户标识
  184. LONGLONG addscore{0};
  185. WORD wgameserverid{0};
  186. DWORD dwGameContextID{0};
  187. DWORD dwLoginContextID{0};
  188. };
  189. //提出玩家
  190. struct CMD_CS_C_DelOnlineUser
  191. {
  192. DWORD dwUserID;
  193. WORD wserverid;
  194. DWORD dwGameContextID;
  195. };
  196. struct reguser
  197. {
  198. std::int64_t spreaderid{0}; //玩家对应推广id
  199. std::int64_t score{0}; //获取分数
  200. std::string account; //玩家账号 LEN_ACCOUNTS
  201. std::string pwd; //玩家密码 LEN_PASSWORD
  202. std::string name; //玩家姓名 LEN_ACCOUNTS
  203. std::string phone; //玩家电话 LEN_SEAT_PHONE
  204. std::string info; //玩家备注 LEN_INFO
  205. std::int32_t accprefix{1}; //玩家账号是否加上品牌前缀 0:不加 1:加
  206. public:
  207. std::string getfieldvalue(std::int32_t index)
  208. {
  209. const char* value[] = { "spreaderid", "score", "account", "pwd", "name", "phone", "info", "accprefix"};
  210. return value[index];
  211. }
  212. void getdata()
  213. {
  214. account = account.substr(0, LEN_ACCOUNTS);
  215. pwd = pwd.substr(0, LEN_PASSWORD);
  216. name = name.substr(0, LEN_ACCOUNTS);
  217. phone = phone.substr(0, LEN_SEAT_PHONE);
  218. info = info.substr(0, LEN_SEAT_PHONE);
  219. }
  220. };
  221. struct userscore
  222. {
  223. std::int64_t spreaderid{0}; //玩家对应推广id
  224. std::int64_t userid{0}; //玩家个人id
  225. std::int64_t score{0}; //玩家分数
  226. public:
  227. std::string getfieldvalue(std::int32_t index)
  228. {
  229. const char* value[] = { "spreaderid", "userid", "score" };
  230. return value[index];
  231. }
  232. void getdata()
  233. {
  234. }
  235. };
  236. struct outuser
  237. {
  238. std::int64_t userid{ 0 }; //玩家个人id
  239. public:
  240. std::string getfieldvalue(std::int32_t index)
  241. {
  242. const char* value[] = { "userid" };
  243. return value[index];
  244. }
  245. void getdata()
  246. {
  247. }
  248. };
  249. struct regadmin
  250. {
  251. std::int64_t spreaderid = 0; //玩家对应推广id
  252. std::int64_t score = 0; //获取分数
  253. std::int32_t isjpt = 0; //是否显示大奖池
  254. std::int32_t iareaid = 0; //区域id
  255. std::int32_t ilevel = 0; //代理类型 1是公司,2是超级管理,3是管理,4是高级总代,5是总代,6是商户
  256. std::int32_t betindex = 0;
  257. std::int64_t imin_bonus_buy = -1; // bonus_buy 最小倍数
  258. std::int64_t imax_bonus_buy = -1; // bonus_buy 最大倍数
  259. std::string strpfx{}; //只有商户才有前缀
  260. std::string stracc{}; //玩家账号
  261. std::string strpwd{}; //玩家密码
  262. std::string strname{}; //玩家姓名
  263. std::string strphone{}; //玩家电话
  264. std::string strkindidauth{}; //开放游戏列表
  265. std::string strareaidauth{}; //开放货币区域列表
  266. std::string strinfo{}; //info
  267. std::int32_t decimalnum = 2; //货币显示几位小数
  268. std::string currencyratio = "1"; //货币显示比例
  269. public:
  270. std::string getfieldvalue(std::int32_t index)
  271. {
  272. const char* value[] = { "spreaderid", "score", "sjpt", "areaid", "level", "betindex","imin_bonus_buy", "imax_bonus_buy", "pfx", "account", "pwd" ,\
  273. "name", "phone", "kindidauth", "areaidauth", "info", "decimalnum", "currencyratio" };
  274. return value[index];
  275. }
  276. void getdata()
  277. {
  278. strpfx = strpfx.substr(0, LEN_ACCOUNTS);
  279. stracc = stracc.substr(0, LEN_ACCOUNTS);
  280. strpwd = strpwd.substr(0, LEN_PASSWORD);
  281. strname = strname.substr(0, LEN_ACCOUNTS);
  282. strphone = strphone.substr(0, LEN_SEAT_PHONE);
  283. strkindidauth = strkindidauth.substr(0, 10000);
  284. strareaidauth = strareaidauth.substr(0, 10000);
  285. strinfo = strinfo.substr(0, LEN_INFO);
  286. }
  287. };
  288. struct prohibitadmin
  289. {
  290. std::int64_t spreaderid{0}; //下级管理员id
  291. std::int64_t userid{0}; //管理员本人id
  292. std::int32_t state{0}; //-1是封号,0是解封
  293. public:
  294. std::string getfieldvalue(std::int32_t index)
  295. {
  296. const char* value[] = { "spreaderid", "userid", "state" };
  297. return value[index];
  298. }
  299. void getdata()
  300. {
  301. }
  302. };
  303. // 用一个bit来表示一种权限
  304. enum EAuthorityBit
  305. {
  306. EAFB_Api = 0, // 使用api (int32 第0 bit位) (0:允许,1:禁止)
  307. EAFB_CanSetBonusLimit = 1, // 下级是否有限红编辑权限 (0:允许,1:禁止)
  308. EAFB_RegisterPlayer = 2, // 代理添加玩家权限(0:禁止 1:允许)
  309. EAFB_AddPopularize = 3, // 代理添加推广网站权限(0:禁止 1:允许)
  310. EAFB_ReturnHallSwitch = 4, // 代理下玩家返回大厅开关 (0:允许,1:禁止)
  311. EAFB_Max,
  312. };
  313. struct proSetAuthority
  314. {
  315. std::int64_t spreaderid{ 0 }; //管理员本人id
  316. std::int64_t userid{ 0 }; //被修改的代理id
  317. //std::int32_t authoritybit{ 0 }; //权限类型(枚举: EAuthorityBit)。 保险起见,不做统一接口。
  318. std::int32_t state{ 0 }; //各类型自己定义0表示禁止或开启
  319. public:
  320. std::string getfieldvalue(std::int32_t index)
  321. {
  322. const char* value[] = { "spreaderid", "userid", "state" };
  323. return value[index];
  324. }
  325. void getdata()
  326. {
  327. }
  328. };
  329. struct prohibituser
  330. {
  331. std::int64_t spreaderid{}; //管理员id
  332. std::int64_t userid{}; //管理员所属玩家id
  333. std::int32_t state{}; //-1是封号,0是解封
  334. public:
  335. std::string getfieldvalue(std::int32_t index)
  336. {
  337. const char* value[] = { "spreaderid", "userid", "state" };
  338. return value[index];
  339. }
  340. void getdata()
  341. {
  342. }
  343. };
  344. struct getaccount
  345. {
  346. std::int64_t ispreaderid{}; //代理id
  347. public:
  348. std::string getfieldvalue(std::int32_t index)
  349. {
  350. const char* value[] = { "spreaderid" };
  351. return value[index];
  352. }
  353. void getdata()
  354. {
  355. }
  356. };
  357. struct adminlogin
  358. {
  359. std::string account{}; //玩家账号 LEN_ACCOUNTS
  360. std::string pwd{}; //玩家密码 LEN_PASSWORD
  361. std::string ip{}; //登录IP地址 LEN_IP
  362. public:
  363. std::string getfieldvalue(std::int32_t index)
  364. {
  365. const char* value[] = { "account", "pwd", "ip" };
  366. return value[index];
  367. }
  368. void getdata()
  369. {
  370. account = account.substr(0, LEN_ACCOUNTS);
  371. pwd = pwd.substr(0, LEN_PASSWORD);
  372. ip = ip.substr(0, LEN_IP);
  373. }
  374. };
  375. struct adminnewloginpwd
  376. {
  377. std::string account{}; //要修改代理账号
  378. std::int64_t iuserid{0}; //当前登录代理id
  379. std::string pwdold{}; //旧密码
  380. std::string pwdnew{}; //新密码
  381. public:
  382. std::string getfieldvalue(std::int32_t index)
  383. {
  384. const char* value[] = { "account", "userid", "pwdold", "pwdnew" };
  385. return value[index];
  386. }
  387. void getdata()
  388. {
  389. account = account.substr(0, LEN_ACCOUNTS);
  390. pwdold = pwdold.substr(0, LEN_PASSWORD);
  391. pwdnew = pwdnew.substr(0, LEN_PASSWORD);
  392. }
  393. };
  394. struct adminnewpwd2
  395. {
  396. std::int64_t iuserid{0};
  397. std::string pwdold{}; //旧密码
  398. std::string pwdnew{}; //新密码
  399. public:
  400. std::string getfieldvalue(std::int32_t index)
  401. {
  402. const char* value[] = { "userid", "pwdold", "pwdnew" };
  403. return value[index];
  404. }
  405. void getdata()
  406. {
  407. pwdold = pwdold.substr(0, LEN_PASSWORD);
  408. pwdnew = pwdnew.substr(0, LEN_PASSWORD);
  409. }
  410. };
  411. struct admininfo
  412. {
  413. std::int64_t userid{0}; //当前后台的userid
  414. std::int32_t isjpt{0}; //是否显示大奖池
  415. std::int32_t betindex{0};
  416. std::int64_t imin_bonus_buy = -1; // bonus_buy 最小倍数
  417. std::int64_t imax_bonus_buy = -1; // bonus_buy 最大倍数
  418. std::string account{}; //代理账号
  419. std::string name{}; //代理姓名
  420. std::string pwd{}; //代理密码
  421. std::string phone{}; //代理电话
  422. std::string info{}; //代理备注
  423. std::string regiongames{}; //商户游戏列表
  424. std::int32_t decimalnum=2; //货币显示几位小数
  425. std::string currencyratio = "1"; //货币显示比例
  426. public:
  427. std::string getfieldvalue(std::int32_t index)
  428. {
  429. const char* value[] = { "userid", "sjpt", "betindex", "imin_bonus_buy", "imax_bonus_buy", "account", "name", "pwdnew", "phone", "info", "regiongames", "decimalnum", "currencyratio" };
  430. return value[index];
  431. }
  432. void getdata()
  433. {
  434. account = account.substr(0, LEN_ACCOUNTS);
  435. name = name.substr(0, LEN_ACCOUNTS);
  436. pwd = pwd.substr(0, LEN_PASSWORD);
  437. phone = phone.substr(0, LEN_SEAT_PHONE);
  438. info = info.substr(0, LEN_INFO);
  439. regiongames = regiongames.substr(0, 3000);
  440. }
  441. };
  442. struct operatinfo
  443. {
  444. std::string doaction{}; //操作行动
  445. std::string account{}; //操作者
  446. std::string doaccount{}; //被操作者
  447. std::string ip{}; //操作者ip
  448. std::string info{}; //操作描述
  449. public:
  450. std::string getfieldvalue(std::int32_t index)
  451. {
  452. const char* value[] = { "doaction", "account", "doaccount", "ip", "info" };
  453. return value[index];
  454. }
  455. void getdata()
  456. {
  457. doaction = doaction.substr(0, LEN_ACCOUNTS);
  458. account = account.substr(0, LEN_ACCOUNTS);
  459. doaccount = doaccount.substr(0, LEN_ACCOUNTS);
  460. ip = ip.substr(0, LEN_IP);
  461. info = info.substr(0, LEN_ACTIONINFO);
  462. }
  463. };
  464. struct userinfo
  465. {
  466. std::int64_t userid{0}; //当前后台的userid
  467. std::string account{}; //玩家账号
  468. std::string pwd{}; //玩家密码
  469. std::string name{}; //玩家姓名
  470. std::string phone{}; //玩家电话
  471. std::string info{}; //玩家备注
  472. public:
  473. std::string getfieldvalue(std::int32_t index)
  474. {
  475. const char* value[] = { "userid", "account", "pwdnew", "name", "phone", "info" };
  476. return value[index];
  477. }
  478. void getdata()
  479. {
  480. account = account.substr(0, LEN_ACCOUNTS);
  481. pwd = pwd.substr(0, LEN_PASSWORD);
  482. name = name.substr(0, LEN_ACCOUNTS);
  483. phone = phone.substr(0, LEN_IP);
  484. info = info.substr(0, LEN_ACTIONINFO);
  485. }
  486. };
  487. struct adminaddpwd2
  488. {
  489. std::int64_t iuserid{0};
  490. std::string pwd2new{}; //新二级密码
  491. public:
  492. std::string getfieldvalue(std::int32_t index)
  493. {
  494. const char* value[] = { "userid", "pwd2new" };
  495. return value[index];
  496. }
  497. void getdata()
  498. {
  499. pwd2new = pwd2new.substr(0, LEN_PASSWORD);
  500. }
  501. };
  502. struct adminchangepwd2
  503. {
  504. std::int64_t iuserid{0};
  505. std::string account{}; //代理账号
  506. __int32 iacctype{ 0 }; // 账号类型0主账号 1子账号
  507. public:
  508. std::string getfieldvalue(std::int32_t index)
  509. {
  510. const char* value[] = { "userid", "account" ,"acctype"};
  511. return value[index];
  512. }
  513. void getdata()
  514. {
  515. account = account.substr(0, LEN_ACCOUNTS);
  516. }
  517. };
  518. struct adminprohibituser
  519. {
  520. std::int64_t spreaderid{0}; //管理员id
  521. std::int32_t state{0}; //-1是封号,0是解封
  522. public:
  523. std::string getfieldvalue(std::int32_t index)
  524. {
  525. const char* value[] = { "spreaderid", "state" };
  526. return value[index];
  527. }
  528. void getdata()
  529. {
  530. }
  531. };
  532. struct makeusermany
  533. {
  534. std::int64_t spreaderid{ 0 }; //玩家对应推广id
  535. std::int64_t score{ 0 }; //获取分数
  536. std::int32_t iareaid{ 0 }; //地区id
  537. std::int32_t iusernum{ 0 }; //设置用户个数
  538. std::string pwd{}; //玩家密码
  539. std::string info{}; //玩家备注
  540. public:
  541. std::string getfieldvalue(std::int32_t index)
  542. {
  543. const char* value[] = { "spreaderid", "score", "areaid", "usernum", "pwd", "info" };
  544. return value[index];
  545. }
  546. void getdata()
  547. {
  548. pwd = pwd.substr(0, LEN_PASSWORD);
  549. info = info.substr(0, LEN_INFO);
  550. }
  551. };
  552. struct makesbadmin
  553. {
  554. std::int64_t userid{0}; //对应的主账号id
  555. std::string account{}; //子代理账号
  556. std::string pwd{}; //子账号密码
  557. std::string pwd2{}; //子账号二级密码
  558. std::string perms{}; //玩家备注
  559. std::string info{}; //玩家备注
  560. std::string menuperms{};
  561. public:
  562. std::string getfieldvalue(std::int32_t index)
  563. {
  564. const char* value[] = { "userid", "account", "pwd", "pwd2", "perms", "info", "menuperms" };
  565. return value[index];
  566. }
  567. void getdata()
  568. {
  569. account = account.substr(0, LEN_ACCOUNTS);
  570. pwd = pwd.substr(0, LEN_PASSWORD);
  571. pwd2 = pwd2.substr(0, LEN_PASSWORD);
  572. perms = perms.substr(0, LEN_PERMS);
  573. info = info.substr(0, LEN_INFO);
  574. menuperms = menuperms.substr(0, 1000);
  575. }
  576. };
  577. struct modsubadmin
  578. {
  579. std::int64_t usid{0}; //子账号id
  580. std::int32_t state{-1}; //状态0是正常状态1是禁止,-1是没有传递参数
  581. std::string pwd{}; //子账号密码
  582. std::string pwd2{}; //子账号二级密码
  583. std::string perms{}; //玩家备注
  584. std::string info{}; //玩家备注
  585. std::string menuperms{};
  586. public:
  587. std::string getfieldvalue(std::int32_t index)
  588. {
  589. const char* value[] = { "usid", "state", "pwd", "pwd2", "perms", "info", "menuperms" };
  590. return value[index];
  591. }
  592. void getdata()
  593. {
  594. pwd = pwd.substr(0, LEN_PASSWORD);
  595. pwd2 = pwd2.substr(0, LEN_PASSWORD);
  596. perms = perms.substr(0, LEN_PERMS);
  597. info = info.substr(0, LEN_INFO);
  598. menuperms = menuperms.substr(0, 1000);
  599. }
  600. };
  601. struct hidekindid
  602. {
  603. std::int32_t ihide{0}; //hide为0是显示hide为1是隐藏
  604. std::int32_t ikindid{0}; //游戏类型
  605. public:
  606. std::string getfieldvalue(std::int32_t index)
  607. {
  608. const char* value[] = { "hide", "kindid" };
  609. return value[index];
  610. }
  611. void getdata()
  612. {
  613. }
  614. };
  615. struct makeapi
  616. {
  617. std::int64_t userid{0}; //对应的主账号id
  618. std::string account{}; //代理的账号
  619. public:
  620. std::string getfieldvalue(std::int32_t index)
  621. {
  622. const char* value[] = { "userid", "account" };
  623. return value[index];
  624. }
  625. void getdata()
  626. {
  627. account = account.substr(0, LEN_ACCOUNTS);
  628. }
  629. };
  630. struct downgameinfo
  631. {
  632. std::int32_t itypeid{0}; //1是打开官网,2是点击下载
  633. std::int32_t idevicetype{0}; //1是pc电脑,2是安卓,3是ios
  634. std::string ip{}; //操作IP地址
  635. public:
  636. std::string getfieldvalue(std::int32_t index)
  637. {
  638. const char* value[] = { "typeid", "devicetype", "ip"};
  639. return value[index];
  640. }
  641. void getdata()
  642. {
  643. ip = ip.substr(0, LEN_IP);
  644. }
  645. };
  646. struct vipdata
  647. {
  648. std::string strarea{}; //货币代码
  649. std::string stracc{}; //代理账号
  650. std::int64_t ispreaderid{0}; //代理id
  651. std::int64_t iuserid{0}; //代理名下的商户
  652. std::int64_t ibet{0};
  653. std::int64_t iwin{0};
  654. std::int64_t ispebet{0};
  655. std::int64_t ispewin{0};
  656. std::int64_t isperev{0};
  657. std::int64_t isptcnt{0};
  658. std::int64_t roundcnt{0}; //代理名下玩家玩次数
  659. std::unordered_set<std::int64_t> playuser; //玩家人数去重
  660. };
  661. struct userdata
  662. {
  663. std::int64_t ispreaderid{0};
  664. std::string struseracc{};
  665. std::int64_t ibet{0};
  666. std::int64_t iwin{0};
  667. std::int64_t ispebet{ 0 };
  668. std::int64_t ispewin{ 0 };
  669. std::int64_t isperev{ 0 };
  670. std::int64_t isptcnt{ 0 };
  671. std::int64_t iroundcnt{0}; //玩家玩的次数
  672. std::int64_t inserttime{0};
  673. };
  674. struct vipareaid
  675. {
  676. std::map<std::int64_t, vipdata> mapspreaderdata; //代理数据
  677. };
  678. struct gamelogdata
  679. {
  680. std::int64_t ispreaderid{0};
  681. std::int64_t ibegintime{0};
  682. std::int64_t iendtime{0};
  683. public:
  684. std::string getfieldvalue(std::int32_t index)
  685. {
  686. const char* value[] = { "spreaderid", "begintime", "endtime" };
  687. return value[index];
  688. }
  689. void getdata()
  690. {
  691. }
  692. };
  693. struct showareaid
  694. {
  695. std::int64_t userid{0}; //操作商户的userid
  696. std::string strareaid{}; //操作的地区
  697. public:
  698. std::string getfieldvalue(std::int32_t index)
  699. {
  700. const char* value[] = { "userid", "areaid"};
  701. return value[index];
  702. }
  703. void getdata()
  704. {
  705. strareaid = funclib::urlDecode(strareaid);
  706. }
  707. };
  708. struct taskprize
  709. {
  710. std::int32_t iprizetype = 0; //奖励类型:0转盘,1金币,2rpscore,3promotionscore
  711. std::int32_t iprizenum = 0; //奖励数量
  712. };
  713. struct settaskinfo
  714. {
  715. std::int32_t updatetype{-1}; //0增加,1删除,2修改
  716. std::int64_t itaskid{-1}; //任务id
  717. std::int32_t ibigid{-1}; //大任务id
  718. std::int32_t ismallid{-1}; //小任务id
  719. std::int32_t itype{-1}; //任务类型:0每日任务,1成长任务,2循环任务
  720. std::int32_t itargetid{-1}; //任务说明id:0累计旋转,1累计投注
  721. std::int64_t itasknum{-1}; //任务目标值
  722. std::int32_t iprizetype0{-1}; //奖励类型:0转盘,1金币,2rpscore,3promotionscore
  723. std::int32_t iprizenum0{-1}; //奖励数量
  724. std::int32_t iprizetype1{-1}; //奖励类型:0转盘,1金币,2rpscore,3promotionscore
  725. std::int32_t iprizenum1{-1}; //奖励数量
  726. std::int32_t iprizetype2{-1}; //奖励类型:0转盘,1金币,2rpscore,3promotionscore
  727. std::int32_t iprizenum2{-1}; //奖励数量
  728. std::int32_t iprizetype3{-1}; //奖励类型:0转盘,1金币,2rpscore,3promotionscore
  729. std::int32_t iprizenum3{-1}; //奖励数量
  730. std::int64_t iaddprizepro{-1}; //奖励加成
  731. std::int32_t iprizecount{0}; //奖励数组个数
  732. taskprize tprize[4];
  733. public:
  734. std::string getfieldvalue(std::int32_t index)
  735. {
  736. if (index > 15)
  737. {
  738. return "";
  739. }
  740. const char* value[] = { "updatetype", "taskid", "bigid", "smallid", "tasktype", "targetid", "tasknum", \
  741. "prizetype0","prizenum0", "prizetype1", "prizenum1", "prizetype2", "prizenum2", "prizetype3", "prizenum3" \
  742. "addprizepro" };
  743. return value[index];
  744. }
  745. void getdata()
  746. {
  747. if (iprizetype0 != -1 && iprizenum0 != -1)
  748. {
  749. tprize[iprizecount].iprizetype = iprizetype0;
  750. tprize[iprizecount].iprizenum = iprizenum0;
  751. iprizecount++;
  752. }
  753. if (iprizetype1 != -1 && iprizenum1 != -1)
  754. {
  755. tprize[iprizecount].iprizetype = iprizetype1;
  756. tprize[iprizecount].iprizenum = iprizenum1;
  757. iprizecount++;
  758. }
  759. if (iprizetype2 != -1 && iprizenum2 != -1)
  760. {
  761. tprize[iprizecount].iprizetype = iprizetype2;
  762. tprize[iprizecount].iprizenum = iprizenum2;
  763. iprizecount++;
  764. }
  765. if (iprizetype3 != -1 && iprizenum3 != -1)
  766. {
  767. tprize[iprizecount].iprizetype = iprizetype3;
  768. tprize[iprizecount].iprizenum = iprizenum3;
  769. iprizecount++;
  770. }
  771. }
  772. };
  773. struct setvipinfo
  774. {
  775. std::int32_t updatetype{-1}; //0增加,1删除,2修改
  776. std::int32_t id{-1}; //vip等级
  777. std::int64_t expscore{-1}; //经验值
  778. std::int32_t chessexppro{-1}; //棋牌下注戏码奖励比例
  779. std::int32_t slotsexppro{-1}; //老虎机下注戏码奖励比例
  780. std::int32_t fishexppro{-1}; //捕鱼下注戏码奖励比例
  781. std::int32_t reelexppro{-1}; //真人下注戏码奖励比例
  782. std::int32_t lotexppro{-1}; //彩票下注戏码奖励比例
  783. std::int32_t chessprizepro{-1}; //棋牌经验值衰减比例
  784. std::int32_t slotsprizepro{-1}; //老虎机经验值衰减比例
  785. std::int32_t fishprizepro{-1}; //捕鱼经验值衰减比例
  786. std::int32_t reelprizepro{-1}; //真人经验值衰减比例
  787. std::int32_t lotprizepro{-1}; //彩票经验值衰减比例
  788. std::int64_t prizescoremax{-1}; //返利上限
  789. std::int32_t promotewheelnum{-1}; //晋升奖励:周奖励旋转次数
  790. std::int32_t wheelprizepro{-1}; //转盘奖励比例
  791. std::int32_t addprizescorepro{-1}; //奖金加成
  792. public:
  793. std::string getfieldvalue(std::int32_t index)
  794. {
  795. const char* value[] = { "updatetype", "vipid", "expscore", "chessexppro", "slotsexppro", "fishexppro", "reelexppro", "lotexppro", "chessprizepro" \
  796. , "slotsprizepro", "fishprizepro", "reelprizepro", "lotprizepro", "prizescoremax", "promotewheelnum", "wheelprizepro", "addprizescorepro" };
  797. return value[index];
  798. }
  799. void getdata()
  800. {
  801. }
  802. bool datavalue()
  803. {
  804. if (updatetype == -1 || id == -1 || expscore == -1 || chessexppro == -1 || slotsexppro == -1 || fishexppro == -1 || reelexppro == -1 ||
  805. lotexppro == -1 || chessprizepro == -1 || slotsprizepro == -1 || fishprizepro == -1 || reelprizepro == -1 || lotprizepro == -1 ||
  806. prizescoremax == -1 || promotewheelnum == -1 || wheelprizepro == -1 || addprizescorepro == -1)
  807. {
  808. return false;
  809. }
  810. return true;
  811. }
  812. };
  813. struct room
  814. {
  815. std::int32_t roomtype{-1}; //0增加,1删除,2修改
  816. std::int32_t roomid{-1}; //场次id
  817. std::int64_t expnum{-1}; //经验值
  818. std::int64_t exppro{-1}; //经验系数
  819. public:
  820. std::string getfieldvalue(std::int32_t index)
  821. {
  822. const char* value[] = { "roomtype", "roomid", "expnum", "exppro" };
  823. return value[index];
  824. }
  825. void getdata()
  826. {
  827. }
  828. bool datavalue()
  829. {
  830. if (roomtype == -1 || roomid == -1 || expnum == -1 || exppro == -1)
  831. {
  832. return false;
  833. }
  834. return true;
  835. }
  836. };
  837. struct roleparam
  838. {
  839. std::int32_t roletype{-1}; //0增加,1删除,2修改
  840. std::int32_t id{-1}; //role等级
  841. std::int64_t needexp{-1}; //对应经验值
  842. std::int64_t promoteprizescore{-1}; //晋升奖励分数
  843. std::int64_t freewheelnum{-1}; //获取免费转盘次数
  844. std::int32_t wheelprizepro{-1}; //转盘奖励比例
  845. std::int32_t wheelconsumepro{-1}; //转盘消耗比例
  846. std::int32_t addprizescorepro{-1}; //奖金加成
  847. public:
  848. std::string getfieldvalue(std::int32_t index)
  849. {
  850. const char* value[] = { "roletype", "roleid", "needexp", "promoteprizescore", "freewheelnum", "wheelprizepro", "wheelconsumepro", "addprizescorepro" };
  851. return value[index];
  852. }
  853. void getdata()
  854. {
  855. }
  856. bool datavalue()
  857. {
  858. if (roletype == -1 || id == -1 || needexp == -1 || promoteprizescore == -1 || freewheelnum == -1 || wheelprizepro == -1 || wheelconsumepro == -1 || addprizescorepro == -1)
  859. {
  860. return false;
  861. }
  862. return true;
  863. }
  864. };
  865. struct tagweight
  866. {
  867. std::int32_t updatetype{-1}; //0增加,1删除,2修改
  868. std::int32_t id{-1};
  869. std::int64_t weightnum{-1};
  870. std::int32_t itemid{-1}; //奖励类型:0转盘,1金币,2rpscore,3promotionscore
  871. std::int64_t prizepro{-1};
  872. std::int64_t itemcount{-1};
  873. public:
  874. std::string getfieldvalue(std::int32_t index)
  875. {
  876. const char* value[] = { "updatewheel", "weightid", "weightnum", "itemid", "prizepro", "itemcount" };
  877. return value[index];
  878. }
  879. void getdata()
  880. {
  881. }
  882. bool datavalue()
  883. {
  884. if (updatetype != 0 && updatetype != 1 && updatetype != 2)
  885. {
  886. return false;
  887. }
  888. if (id < 0 || itemid < 0 || weightnum < 0 || prizepro < 0 || itemcount < 0)
  889. {
  890. return false;
  891. }
  892. return true;
  893. }
  894. };
  895. struct tagwheel
  896. {
  897. std::int32_t count{-1};
  898. std::int64_t activetimebegin{-1};
  899. std::int64_t activetimeend{-1};
  900. std::int32_t vipwheel{-1};
  901. std::int32_t rolewheel{-1};
  902. std::int64_t consumepro{-1};
  903. std::int64_t consumescore{-1};
  904. public:
  905. std::string getfieldvalue(std::int32_t index)
  906. {
  907. const char* value[] = { "updatewheel", "weightid", "weightnum", "itemid", "prizepro", "itemcount" };
  908. return value[index];
  909. }
  910. void getdata()
  911. {
  912. }
  913. bool datavalue()
  914. {
  915. if (vipwheel != 0 && vipwheel != 1)
  916. {
  917. return false;
  918. }
  919. if (rolewheel != 0 && rolewheel != 1)
  920. {
  921. return false;
  922. }
  923. if (consumepro < 0 || consumescore < 0)
  924. {
  925. return false;
  926. }
  927. if (count == -1 || activetimebegin == -1 || activetimeend == -1)
  928. {
  929. return false;
  930. }
  931. return true;
  932. }
  933. };
  934. struct setsecret
  935. {
  936. std::int64_t iuserid{-1}; //设置google密钥
  937. std::string gasecret{}; //密钥
  938. public:
  939. std::string getfieldvalue(std::int32_t index)
  940. {
  941. const char* value[] = { "userid", "gasecret" };
  942. return value[index];
  943. }
  944. void getdata()
  945. {
  946. gasecret = gasecret.substr(0, 64);
  947. }
  948. bool datavalue()
  949. {
  950. if (iuserid == -1 || gasecret.empty())
  951. {
  952. return false;
  953. }
  954. return true;
  955. }
  956. };
  957. struct gameserverdata
  958. {
  959. std::string strservername{};
  960. std::string areacode{};
  961. std::string strgid{};
  962. std::int64_t areaid{0};
  963. std::int64_t ibet{0};
  964. std::int64_t iwin{0};
  965. std::int64_t iroundcnt{0}; //玩家玩的次数
  966. std::int64_t ispebet{ 0 };
  967. std::int64_t ispewin{ 0 };
  968. std::int64_t isjptrev{ 0 };
  969. std::int64_t isptcnt{ 0 };
  970. std::unordered_set<std::int64_t> playuser; //玩家人数去重
  971. };
  972. struct serverdata
  973. {
  974. std::int64_t ispreaderid{-1};
  975. std::int64_t ibegintime{-1};
  976. std::int64_t iendtime{-1};
  977. public:
  978. std::string getfieldvalue(std::int32_t index)
  979. {
  980. const char* value[] = { "spreaderid", "begintime", "endtime" };
  981. return value[index];
  982. }
  983. void getdata()
  984. {
  985. }
  986. bool datavalue()
  987. {
  988. if (ibegintime > iendtime)
  989. {
  990. return false;
  991. }
  992. if (ispreaderid <= 0 || ibegintime <= 0 || iendtime <= 0)
  993. {
  994. return false;
  995. }
  996. return true;
  997. }
  998. };
  999. struct userlosewininfo
  1000. {
  1001. std::string strspreaderidacc{};
  1002. std::string struseracc{};
  1003. std::int64_t ibet{0};
  1004. std::int64_t iwin{0};
  1005. std::int64_t iroundcnt{0};
  1006. std::int64_t iscore{0};
  1007. };
  1008. struct userlosewindata
  1009. {
  1010. std::int64_t ispreaderid{-1};
  1011. std::int64_t ibegintime{-1};
  1012. std::int64_t iendtime{-1};
  1013. public:
  1014. std::string getfieldvalue(std::int32_t index)
  1015. {
  1016. const char* value[] = { "spreaderid", "begintime", "endtime" };
  1017. return value[index];
  1018. }
  1019. void getdata()
  1020. {
  1021. }
  1022. bool datavalue()
  1023. {
  1024. if (ibegintime > iendtime)
  1025. {
  1026. return false;
  1027. }
  1028. if (ispreaderid <= 0 || ibegintime <= 0 || iendtime <= 0)
  1029. {
  1030. return false;
  1031. }
  1032. return true;
  1033. }
  1034. };
  1035. struct httpmodifyapplyapi
  1036. {
  1037. std::string strtoken{};
  1038. std::int64_t iuserid{ -1 }; //申请代理的uesrid
  1039. std::int32_t iapitype{ -1 }; //1是无缝;2是转账
  1040. std::string strcburl{}; //api回调url
  1041. std::string strwhiteips{}; //ip白名单
  1042. std::string strsiteurl{}; //网站url
  1043. std::string strsiteusername{}; //账号
  1044. std::string strsitepassword{}; //密码
  1045. std::string strhost{};
  1046. std::string strport{};
  1047. std::int32_t issl{ 1 };
  1048. std::string strtarget{};
  1049. public:
  1050. std::string getfieldvalue(std::int32_t index)
  1051. {
  1052. const char* value[] = {"strtoken", "userid", "apitype", "cburl", "whiteips", "siteurl", "siteusername", "sitepassword", \
  1053. "cburlhost", "cburlport", "cburlssl", "cburltarget" };
  1054. return value[index];
  1055. }
  1056. void getdata()
  1057. {
  1058. strtoken = strtoken.substr(0, 1000);
  1059. strcburl = strcburl.substr(0, 1000);
  1060. strwhiteips = strwhiteips.substr(0, 1000);
  1061. strsiteurl = strsiteurl.substr(0, 1000);
  1062. strsiteusername = strsiteusername.substr(0, LEN_ACCOUNTS);
  1063. strsitepassword = strsitepassword.substr(0, LEN_PASSWORD);
  1064. strport = strport.substr(0, 1000);
  1065. strtarget = strtarget.substr(0, 100);
  1066. }
  1067. };
  1068. struct httpapplyapi
  1069. {
  1070. std::int64_t iuserid{-1}; //申请代理的uesrid
  1071. std::int32_t iapitype{-1}; //1是无缝;2是转账
  1072. std::string strcburl{}; //api回调url
  1073. std::string strwhiteips{}; //ip白名单
  1074. std::string strsiteurl{}; //网站url
  1075. std::string strsiteusername{}; //账号
  1076. std::string strsitepassword{}; //密码
  1077. std::string strhost{};
  1078. std::string strport{};
  1079. std::int32_t issl{1};
  1080. std::string strtarget{};
  1081. public:
  1082. std::string getfieldvalue(std::int32_t index)
  1083. {
  1084. const char* value[] = { "userid", "apitype", "cburl", "whiteips", "siteurl", "siteusername", "sitepassword", \
  1085. "cburlhost", "cburlport", "cburlssl", "cburltarget" };
  1086. return value[index];
  1087. }
  1088. void getdata()
  1089. {
  1090. strcburl = strcburl.substr(0, 1000);
  1091. strwhiteips = strwhiteips.substr(0, 1000);
  1092. strsiteurl = strsiteurl.substr(0, 1000);
  1093. strsiteusername = strsiteusername.substr(0, LEN_ACCOUNTS);
  1094. strsitepassword = strsitepassword.substr(0, LEN_PASSWORD);
  1095. strport = strport.substr(0, 1000);
  1096. strtarget = strtarget.substr(0, 100);
  1097. }
  1098. };
  1099. struct httpagreeapplyapi
  1100. {
  1101. std::int64_t iuserid{ -1 }; //当前登录代理的uesrid
  1102. std::string strid{}; //审核的id
  1103. std::int32_t iagree{-1}; //0是拒绝,1是同意
  1104. std::string strinfo{}; //生成的附加信息
  1105. std::int32_t iapitype{ -1 }; //1是无缝;2是转账
  1106. std::int32_t isjpt = {-1}; //是否显示大奖池
  1107. std::string strcburl{}; //api回调url
  1108. std::string strwhiteips{}; //ip白名单
  1109. std::string strsiteurl{}; //网站url
  1110. std::string strsiteusername{}; //账号
  1111. std::string strsitepassword{}; //密码
  1112. std::string strhost{};
  1113. std::string strport{};
  1114. std::int32_t issl{ 1 };
  1115. std::string strtarget{};
  1116. public:
  1117. std::string getfieldvalue(std::int32_t index)
  1118. {
  1119. const char* value[] = { "userid", "id", "agree", "info", "apitype", "isjpt", "cburl", "whiteips", "siteurl", "siteusername", "sitepassword", \
  1120. "cburlhost", "cburlport", "cburlssl", "cburltarget" };
  1121. return value[index];
  1122. }
  1123. void getdata()
  1124. {
  1125. strcburl = strcburl.substr(0, 1000);
  1126. strwhiteips = strwhiteips.substr(0, 1000);
  1127. strsiteurl = strsiteurl.substr(0, 1000);
  1128. strsiteusername = strsiteusername.substr(0, LEN_ACCOUNTS);
  1129. strsitepassword = strsitepassword.substr(0, LEN_PASSWORD);
  1130. strport = strport.substr(0, 1000);
  1131. strtarget = strtarget.substr(0, 100);
  1132. strinfo = strinfo.substr(0, 2000);
  1133. }
  1134. };
  1135. struct httpquickapplyapi
  1136. {
  1137. std::int64_t iuserid{ -1 }; //申请代理的uesrid
  1138. public:
  1139. std::string getfieldvalue(std::int32_t index)
  1140. {
  1141. const char* value[] = { "userid" };
  1142. return value[index];
  1143. }
  1144. void getdata()
  1145. {
  1146. }
  1147. };
  1148. struct modifyleavemsg
  1149. {
  1150. std::string strid{}; //唯一id
  1151. std::int32_t istatus{-1}; //0是未读,1是已读
  1152. public:
  1153. std::string getfieldvalue(std::int32_t index)
  1154. {
  1155. const char* value[] = { "id", "status" };
  1156. return value[index];
  1157. }
  1158. void getdata()
  1159. {
  1160. strid = strid.substr(0, 100);
  1161. }
  1162. bool datavalue()
  1163. {
  1164. if (strid.empty() || (istatus != 0 && istatus != 1))
  1165. {
  1166. return false;
  1167. }
  1168. return true;
  1169. }
  1170. };
  1171. struct jptlogdata
  1172. {
  1173. std::int64_t ispreaderid{ -1 };
  1174. std::int64_t ibegintime{ -1 };
  1175. std::int64_t iendtime{ -1 };
  1176. std::string stracc{};
  1177. std::int32_t iareaid{ -1 };
  1178. std::int32_t ijpttype{ -1 };
  1179. public:
  1180. std::string getfieldvalue(std::int32_t index)
  1181. {
  1182. const char* value[] = { "spreaderid", "begintime", "endtime", "acc", "areaid", "jpttype"};
  1183. return value[index];
  1184. }
  1185. void getdata()
  1186. {
  1187. }
  1188. bool datavalue()
  1189. {
  1190. if (ibegintime > iendtime)
  1191. {
  1192. return false;
  1193. }
  1194. if (ispreaderid <= 0 || ibegintime <= 0 || iendtime <= 0)
  1195. {
  1196. return false;
  1197. }
  1198. return true;
  1199. }
  1200. };
  1201. struct spejptrevdata
  1202. {
  1203. std::int64_t ispreaderid{ -1 };
  1204. std::int64_t ibegintime{ -1 };
  1205. std::int64_t iendtime{ -1 };
  1206. std::string stracc{};
  1207. std::int32_t iareaid{ -1 };
  1208. public:
  1209. std::string getfieldvalue(std::int32_t index)
  1210. {
  1211. const char* value[] = { "spreaderid", "begintime", "endtime", "acc", "areaid" };
  1212. return value[index];
  1213. }
  1214. void getdata()
  1215. {
  1216. }
  1217. bool datavalue()
  1218. {
  1219. if (ibegintime > iendtime)
  1220. {
  1221. return false;
  1222. }
  1223. if (ispreaderid <= 0 || ibegintime <= 0 || iendtime <= 0)
  1224. {
  1225. return false;
  1226. }
  1227. return true;
  1228. }
  1229. };
  1230. struct gamelogcntdata
  1231. {
  1232. std::int64_t ispreaderid{ -1 };
  1233. std::int64_t ibegintime{ -1 };
  1234. std::int64_t iendtime{ -1 };
  1235. std::string strgid{};
  1236. std::int64_t iuserid{ -1 };
  1237. public:
  1238. std::string getfieldvalue(std::int32_t index)
  1239. {
  1240. const char* value[] = { "spreaderid", "begintime", "endtime", "gid", "userid"};
  1241. return value[index];
  1242. }
  1243. void getdata()
  1244. {
  1245. }
  1246. bool datavalue()
  1247. {
  1248. if (ibegintime > iendtime)
  1249. {
  1250. return false;
  1251. }
  1252. if (ispreaderid <= 0 || ibegintime <= 0 || iendtime <= 0)
  1253. {
  1254. return false;
  1255. }
  1256. return true;
  1257. }
  1258. };
  1259. struct proAdminSetRegionGames
  1260. {
  1261. std::int64_t userid{ -1 };
  1262. std::int32_t regionid{ -1 }; //货币id
  1263. std::string regiongames{}; //游戏列表
  1264. public:
  1265. std::string getfieldvalue(std::int32_t index)
  1266. {
  1267. const char* value[] = { "userid", "regionid", "regiongames" };
  1268. return value[index];
  1269. }
  1270. void getdata()
  1271. {
  1272. }
  1273. bool datavalue()
  1274. {
  1275. if (regionid <= 0)
  1276. {
  1277. return false;
  1278. }
  1279. return true;
  1280. }
  1281. };
  1282. struct taggamelist
  1283. {
  1284. std::string KindID = "";
  1285. std::string KindName = "";
  1286. std::string GID = "";
  1287. std::string ModuleName = "";
  1288. std::string ClientVersion = "";
  1289. std::string SortID = "";
  1290. std::string ResVersion = "";
  1291. std::string gametype = "";
  1292. };
  1293. struct SGameData {
  1294. std::string sSortId;
  1295. std::string sResVersion;
  1296. std::string sBrand;
  1297. std::string sSubLogo;
  1298. __int32 iHot;
  1299. __int32 iNew;
  1300. };
  1301. struct SRegionGameData {
  1302. std::string sSortId;
  1303. std::string sGid;
  1304. __int32 iHot;
  1305. __int32 iNew;
  1306. };
  1307. struct SAdminModifyGameList
  1308. {
  1309. std::int64_t userid{ -1 };
  1310. std::string resversion;
  1311. std::string baseversion;
  1312. std::string gamelist; /* json格式字符串
  1313. {
  1314. "ac0107":{"SortID": "11", "ResVersion" : "245"},
  1315. "ac0106" : {"SortID": "11", "ResVersion" : "245"}
  1316. }*/
  1317. public:
  1318. std::string getfieldvalue(std::int32_t index)
  1319. {
  1320. const char* value[] = { "userid", "resversion", "baseversion", "gamelist" };
  1321. return value[index];
  1322. }
  1323. void getdata()
  1324. {
  1325. }
  1326. bool datavalue()
  1327. {
  1328. return true;
  1329. }
  1330. };
  1331. struct SSetWebSitInfo
  1332. {
  1333. std::int64_t userid{ -1 };
  1334. std::string websitlogo;
  1335. std::string websitjump;
  1336. std::string websitbanner;
  1337. std::string websitmeta;
  1338. std::string websitepop;
  1339. std::string webdomainname;
  1340. public:
  1341. std::string getfieldvalue(std::int32_t index)
  1342. {
  1343. const char* value[] = { "userid", "websitlogo", "websitjump", "websitbanner", "websitmeta", "websitepop", "webdomainname"};
  1344. return value[index];
  1345. }
  1346. void getdata()
  1347. {
  1348. }
  1349. bool datavalue()
  1350. {
  1351. return true;
  1352. }
  1353. };
  1354. enum EFreeGameActivityType
  1355. {
  1356. EFGAT_SIMPLE = 1,
  1357. EFGAT_VARIABLE,
  1358. };
  1359. enum EFreeGameGiftType
  1360. {
  1361. EFGGT_FREEGAME_COUNT = 1, // 免费旋转,玩家被授予一定数量的免费旋转
  1362. };
  1363. enum EFreeGameStatus
  1364. {
  1365. EFGS_CREATE = 1, // 创建
  1366. EFGS_INPROGRESS, // 进行中
  1367. EFGS_GIVE, // 给予
  1368. EFGS_CANCEL, // 取消
  1369. };
  1370. enum EFreeGamePlayerType
  1371. {
  1372. EFGAT_All = 1, // 所有玩家
  1373. EFGAT_PlAYERLIST, // 玩家列表
  1374. };
  1375. enum EFreeGamePlayerState
  1376. {
  1377. EFGPS_READY = 0, // 未领取
  1378. EFGPS_ACCEPT, // 进行中
  1379. EFGPS_DONE, // 已完成
  1380. EFGPS_EXPIRED, // 已过期
  1381. EFGPS_DELETE, // 系统删除
  1382. };
  1383. struct SysGiftFreeGameCreate
  1384. {
  1385. std::int64_t createrid{ -1 }; // 创建者id
  1386. std::string bonuscode; //奖励代码
  1387. std::string name; //名称
  1388. std::string brand; // 品牌
  1389. std::int32_t fsbtype{}; // 简单/多变 类型
  1390. std::int32_t gifttype{}; // 免费旋转次数/限时
  1391. std::int32_t freespinsnumber{}; // 免费旋转次数
  1392. std::int64_t score{}; // 分数上限
  1393. std::int64_t startdata{}; // 开始日期
  1394. std::int64_t enddata{}; // 结束日期
  1395. std::int64_t validitydata{}; // 有效日期
  1396. std::int32_t playertype{}; // 赠送玩家对象类型
  1397. std::string playerlist; // 玩家列表(赠送所有对象时为空)
  1398. std::string games; // json格式
  1399. std::string filepath; // 玩家列表文件路径
  1400. public:
  1401. std::string getfieldvalue(std::int32_t index)
  1402. {
  1403. const char* value[] = {"createrid", "bonuscode", "name", "brand", "fsbtype", "gifttype", "freespinsnumber", "score",
  1404. "startdata", "enddata", "validitydata", "playertype", "playerlist", "games", "filepath"};
  1405. return value[index];
  1406. }
  1407. void getdata()
  1408. {
  1409. }
  1410. bool datavalue()
  1411. {
  1412. if (createrid <= 0 || name.empty() || brand.empty() || fsbtype <= 0)
  1413. {
  1414. return false;
  1415. }
  1416. return true;
  1417. }
  1418. };
  1419. struct SysGiftFreeGameChange
  1420. {
  1421. std::int64_t userid{ -1 }; // 创建者id
  1422. std::string bonuscode; //奖励代码
  1423. public:
  1424. std::string getfieldvalue(std::int32_t index)
  1425. {
  1426. const char* value[] = { "userid", "bonuscode"};
  1427. return value[index];
  1428. }
  1429. void getdata()
  1430. {
  1431. }
  1432. bool datavalue()
  1433. {
  1434. if (userid <= 0 || bonuscode.empty())
  1435. {
  1436. return false;
  1437. }
  1438. return true;
  1439. }
  1440. };
  1441. struct proCreditAgent
  1442. {
  1443. std::int64_t spreaderid{ 0 }; //管理员本人id
  1444. std::int64_t userid{ 0 }; //被修改的代理id
  1445. public:
  1446. std::string getfieldvalue(std::int32_t index)
  1447. {
  1448. const char* value[] = {"spreaderid", "userid"};
  1449. return value[index];
  1450. }
  1451. void getdata()
  1452. {
  1453. }
  1454. };
  1455. struct SCreditAgentSitInfo
  1456. {
  1457. std::int64_t userid{ -1 };
  1458. std::string websitmeta;
  1459. std::string websitbanner;
  1460. std::string websitertp;
  1461. std::string customerLink;
  1462. public:
  1463. std::string getfieldvalue(std::int32_t index)
  1464. {
  1465. const char* value[] = { "userid", "websitmeta", "websitbanner", "websitertp", "customerLink"};
  1466. return value[index];
  1467. }
  1468. void getdata()
  1469. {
  1470. }
  1471. bool datavalue()
  1472. {
  1473. return true;
  1474. }
  1475. };
  1476. // 信用代理-跑马灯
  1477. struct SCreditAgentMarquee
  1478. {
  1479. std::int64_t userid{ -1 };
  1480. std::string strtext;
  1481. __int64 ibegintime;
  1482. __int64 iendtime;
  1483. __int64 iinterval;
  1484. __int32 istate;
  1485. std::string sonlyid;
  1486. public:
  1487. std::string getfieldvalue(std::int32_t index)
  1488. {
  1489. const char* value[] = { "userid", "strtext", "ibegintime", "iendtime", "iinterval", "istate", "onlyid"};
  1490. return value[index];
  1491. }
  1492. void getdata()
  1493. {
  1494. }
  1495. bool datavalue()
  1496. {
  1497. if(!userid || strtext.empty() || ibegintime > iendtime || iinterval<=0)
  1498. return false;
  1499. return true;
  1500. }
  1501. };
  1502. struct resendorderinfo
  1503. {
  1504. std::string stronlyid{};
  1505. public:
  1506. std::string getfieldvalue(std::int32_t index)
  1507. {
  1508. const char* value[] = { "onlyid" };
  1509. return value[index];
  1510. }
  1511. void getdata()
  1512. {
  1513. stronlyid = stronlyid.substr(0, 100);
  1514. }
  1515. bool datavalue()
  1516. {
  1517. if (stronlyid.empty())
  1518. return false;
  1519. return true;
  1520. }
  1521. };
  1522. // 信用代理-topwinner
  1523. struct SCreditAgentTopWinner
  1524. {
  1525. std::string strtopwinners;
  1526. public:
  1527. std::string getfieldvalue(std::int32_t index)
  1528. {
  1529. const char* value[] = { "strtopwinners"};
  1530. return value[index];
  1531. }
  1532. void getdata()
  1533. {
  1534. }
  1535. bool datavalue()
  1536. {
  1537. return true;
  1538. }
  1539. };
  1540. struct proAdminSetActiveRegion
  1541. {
  1542. std::int64_t userid{ -1 };
  1543. std::int32_t regionid{ -1 }; //货币id
  1544. std::string country{}; //地区列表
  1545. public:
  1546. std::string getfieldvalue(std::int32_t index)
  1547. {
  1548. const char* value[] = { "userid", "regionid", "country" };
  1549. return value[index];
  1550. }
  1551. void getdata()
  1552. {
  1553. }
  1554. bool datavalue()
  1555. {
  1556. if (userid <= 0 || regionid <= 0)
  1557. {
  1558. return false;
  1559. }
  1560. return true;
  1561. }
  1562. };
  1563. struct proSetAgentActiveRegion
  1564. {
  1565. std::int64_t userid{ -1 };
  1566. std::int64_t agentid{ -1 };
  1567. std::string country{}; //地区列表
  1568. public:
  1569. std::string getfieldvalue(std::int32_t index)
  1570. {
  1571. const char* value[] = { "userid", "agentid", "country" };
  1572. return value[index];
  1573. }
  1574. void getdata()
  1575. {
  1576. }
  1577. bool datavalue()
  1578. {
  1579. if (userid <= 0 || agentid <= 0)
  1580. {
  1581. return false;
  1582. }
  1583. return true;
  1584. }
  1585. };
  1586. struct proModifyOrderStatus
  1587. {
  1588. std::int64_t agentid{ 0 }; //管理员本人id
  1589. std::int64_t userid{ 0 }; //订单用户id
  1590. std::string stronlyid{};
  1591. public:
  1592. std::string getfieldvalue(std::int32_t index)
  1593. {
  1594. const char* value[] = { "agentid", "userid" , "onlyid"};
  1595. return value[index];
  1596. }
  1597. void getdata()
  1598. {
  1599. }
  1600. bool datavalue()
  1601. {
  1602. if ( agentid <= 0 || userid <= 0 || stronlyid.empty())
  1603. {
  1604. return false;
  1605. }
  1606. return true;
  1607. }
  1608. };
  1609. struct tagSetPlayRecordini
  1610. {
  1611. std::int32_t datatype{};
  1612. std::int32_t uid{ 0 };
  1613. std::string data{}; //json data
  1614. public:
  1615. std::string getfieldvalue(std::int32_t index)
  1616. {
  1617. const char* value[] = { "datatype","uid", "data"};
  1618. return value[index];
  1619. }
  1620. void getdata()
  1621. {
  1622. }
  1623. bool datavalue()
  1624. {
  1625. if (uid <= 0 || data.empty())
  1626. {
  1627. return false;
  1628. }
  1629. return true;
  1630. }
  1631. };
  1632. struct SysGiftFreeGameBetConfig
  1633. {
  1634. std::int64_t agentid{ 0 }; //管理员本人id
  1635. std::string gamesbet{}; //json data
  1636. public:
  1637. std::string getfieldvalue(std::int32_t index)
  1638. {
  1639. const char* value[] = { "agentid", "gamesbet"};
  1640. return value[index];
  1641. }
  1642. void getdata()
  1643. {
  1644. }
  1645. bool datavalue()
  1646. {
  1647. if (agentid < 0 || gamesbet.empty())
  1648. {
  1649. return false;
  1650. }
  1651. return true;
  1652. }
  1653. };
  1654. // activity ini 设置
  1655. struct tagSetActivityini
  1656. {
  1657. std::int32_t datatype{};
  1658. std::int32_t name{ 0 };
  1659. std::string data{}; //json data
  1660. public:
  1661. std::string getfieldvalue(std::int32_t index)
  1662. {
  1663. const char* value[] = {"datatype", "name", "data" };
  1664. return value[index];
  1665. }
  1666. void getdata()
  1667. {
  1668. }
  1669. bool datavalue()
  1670. {
  1671. if (name <= 0 || data.empty())
  1672. {
  1673. return false;
  1674. }
  1675. return true;
  1676. }
  1677. };
  1678. struct proModifyUrls
  1679. {
  1680. std::int64_t agentid{ 0 }; //管理员本人id
  1681. std::string struploadurl{};
  1682. std::string strlogurl{};
  1683. std::string strgameicourl{};
  1684. std::string strreturnurl{};
  1685. std::string strgameurl{};
  1686. std::string strwebapiurl{};
  1687. public:
  1688. std::string getfieldvalue(std::int32_t index)
  1689. {
  1690. const char* value[] = { "agentid", "uploadurl" , "logurl", "gameicourl", "returnurl", "gameurl", "webapiurl"};
  1691. return value[index];
  1692. }
  1693. void getdata()
  1694. {
  1695. }
  1696. bool datavalue()
  1697. {
  1698. if (agentid <= 0)
  1699. {
  1700. return false;
  1701. }
  1702. return true;
  1703. }
  1704. };
  1705. struct proSetPlatformini
  1706. {
  1707. std::int64_t agentid{ 0 }; //管理员本人id
  1708. std::int32_t id{0};
  1709. std::int32_t open{ 0 };
  1710. std::string desc{}; //json data
  1711. public:
  1712. std::string getfieldvalue(std::int32_t index)
  1713. {
  1714. const char* value[] = { "agentid", "id", "open", "desc" };
  1715. return value[index];
  1716. }
  1717. void getdata()
  1718. {
  1719. }
  1720. bool datavalue()
  1721. {
  1722. if (agentid <=0 || id <= 0 || open < 0)
  1723. {
  1724. return false;
  1725. }
  1726. return true;
  1727. }
  1728. };
  1729. enum EThirdPlatform
  1730. {
  1731. EMega = 1, // 黑金
  1732. EZhenRenShiXun = 2, // iconic21
  1733. };
  1734. enum ECurrencyType
  1735. {
  1736. ECase = 1, // 现金
  1737. EBonus = 2, // 彩金
  1738. EFree = 3, // 免费币
  1739. ECurrMax,
  1740. };
  1741. enum GameTypeEnum
  1742. {
  1743. ETABLETOP = 0, // 棋牌
  1744. ESLOT = 1, // 老虎机
  1745. EFISH = 2, // 捕鱼
  1746. ELIVE = 3, //真人视讯
  1747. };
  1748. struct sThirdgamelist
  1749. {
  1750. std::int64_t spreaderid = 0; //玩家对应推广id
  1751. __int32 ideveloper = 0;
  1752. public:
  1753. std::string getfieldvalue(std::int32_t index)
  1754. {
  1755. const char* value[] = { "spreaderid", "developer" };
  1756. return value[index];
  1757. }
  1758. void getdata()
  1759. {
  1760. }
  1761. };
  1762. struct sCreatDeveloper
  1763. {
  1764. std::int64_t spreaderid = 0; //玩家对应推广id
  1765. __int32 ideveloper = 0; //厂商id
  1766. std::string strbrand = "";
  1767. std::string strcurrency = "";
  1768. __int32 open = -1;
  1769. public:
  1770. std::string getfieldvalue(std::int32_t index)
  1771. {
  1772. const char* value[] = { "spreaderid", "developer", "brand", "currency", "open"};
  1773. return value[index];
  1774. }
  1775. void getdata()
  1776. {
  1777. }
  1778. };
  1779. struct sDeveloperGamesEdit
  1780. {
  1781. std::int64_t spreaderid = 0; //玩家对应推广id
  1782. __int32 ideveloper = 0; //厂商id
  1783. std::string strgid = "";
  1784. __int32 open = -1;
  1785. std::string strcurrency = "";
  1786. public:
  1787. std::string getfieldvalue(std::int32_t index)
  1788. {
  1789. const char* value[] = { "spreaderid", "developer", "gid", "open", "currency" };
  1790. return value[index];
  1791. }
  1792. void getdata()
  1793. {
  1794. }
  1795. };
  1796. struct sDeveloperGamesSort
  1797. {
  1798. std::int64_t spreaderid = 0; //玩家对应推广id
  1799. __int32 ideveloper = 0; //厂商id
  1800. std::string strgames = "";
  1801. public:
  1802. std::string getfieldvalue(std::int32_t index)
  1803. {
  1804. const char* value[] = { "spreaderid", "developer", "games" };
  1805. return value[index];
  1806. }
  1807. void getdata()
  1808. {
  1809. }
  1810. };
  1811. enum ERedeemCodeType
  1812. {
  1813. ERCT_ONLY = 1, // 唯一码
  1814. ERCT_SHRE = 2, // 共享码
  1815. ERCT_MAX,
  1816. };
  1817. struct sRedeemCodeGenerate
  1818. {
  1819. std::int64_t spreaderid = 0; //玩家对应推广id
  1820. std::string info = ""; // lable
  1821. __int32 iquantity = 0; // 生成数量
  1822. __int32 icodetype = 1; // ERedeemCodeType
  1823. __int32 iexchangelimit = 1; // 兑换次数
  1824. __int32 iaccountlimit = 1; // 账号兑换次数
  1825. __int64 iscore = 0;
  1826. __int64 istarttime = 0;
  1827. __int64 iendtime = 0;
  1828. __int32 iopen = 0;
  1829. public:
  1830. std::string getfieldvalue(std::int32_t index)
  1831. {
  1832. const char* value[] = { "spreaderid", "info", "quantity", "type","exchangelimit", "accountlimit", "score", "st", "et", "open" };
  1833. return value[index];
  1834. }
  1835. bool datavalue()
  1836. {
  1837. if (info.empty() || (icodetype==2 && iexchangelimit < 2) || istarttime > iendtime || iscore < 1 || iaccountlimit < 1 || iquantity < 1)
  1838. {
  1839. return false;
  1840. }
  1841. return true;
  1842. }
  1843. void getdata()
  1844. {
  1845. }
  1846. };
  1847. struct sRedeemCodeActive
  1848. {
  1849. std::int64_t spreaderid = 0; //玩家对应推广id
  1850. std::string strcodelist = "";
  1851. __int32 iopen = 0;
  1852. public:
  1853. std::string getfieldvalue(std::int32_t index)
  1854. {
  1855. const char* value[] = { "spreaderid", "codelist", "open"};
  1856. return value[index];
  1857. }
  1858. bool datavalue()
  1859. {
  1860. if (strcodelist.empty())
  1861. {
  1862. return false;
  1863. }
  1864. return true;
  1865. }
  1866. void getdata()
  1867. {
  1868. }
  1869. };
  1870. struct sRedeemCodeUserMax
  1871. {
  1872. std::int64_t spreaderid = 0; //玩家对应推广id
  1873. __int64 iuserid = 0;
  1874. __int32 iuserlimit = 0;
  1875. public:
  1876. std::string getfieldvalue(std::int32_t index)
  1877. {
  1878. const char* value[] = { "spreaderid", "userid", "userlimit" };
  1879. return value[index];
  1880. }
  1881. bool datavalue()
  1882. {
  1883. if (iuserid<=0 || iuserlimit <= 0)
  1884. {
  1885. return false;
  1886. }
  1887. return true;
  1888. }
  1889. void getdata()
  1890. {
  1891. }
  1892. };
  1893. #pragma pack()