generated from root/miduo_server
first commit
parent
5555d27a0c
commit
4a3cd04d34
|
|
@ -0,0 +1,5 @@
|
|||
/.idea
|
||||
|
||||
|
||||
/target
|
||||
/logs
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<root>
|
||||
<item name='com.jmfy.Application'>
|
||||
<annotation name='java.lang.Deprecated'/>
|
||||
</item>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version":0,
|
||||
"tables":""
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,100 @@
|
|||
{"_id":{"$numberLong":"100"},"level":{"$numberLong":"100"},"need_exp":{"$numberLong":"84077"},"strength_limit":{"$numberLong":"170"},"max_cost":{"$numberLong":"130"},"strength_add":{"$numberLong":"131"}}
|
||||
{"_id":{"$numberLong":"99"},"level":{"$numberLong":"99"},"need_exp":{"$numberLong":"81977"},"strength_limit":{"$numberLong":"169"},"max_cost":{"$numberLong":"129"},"strength_add":{"$numberLong":"130"}}
|
||||
{"_id":{"$numberLong":"98"},"level":{"$numberLong":"98"},"need_exp":{"$numberLong":"79907"},"strength_limit":{"$numberLong":"168"},"max_cost":{"$numberLong":"129"},"strength_add":{"$numberLong":"129"}}
|
||||
{"_id":{"$numberLong":"97"},"level":{"$numberLong":"97"},"need_exp":{"$numberLong":"77867"},"strength_limit":{"$numberLong":"167"},"max_cost":{"$numberLong":"128"},"strength_add":{"$numberLong":"128"}}
|
||||
{"_id":{"$numberLong":"96"},"level":{"$numberLong":"96"},"need_exp":{"$numberLong":"75857"},"strength_limit":{"$numberLong":"166"},"max_cost":{"$numberLong":"128"},"strength_add":{"$numberLong":"127"}}
|
||||
{"_id":{"$numberLong":"95"},"level":{"$numberLong":"95"},"need_exp":{"$numberLong":"73877"},"strength_limit":{"$numberLong":"165"},"max_cost":{"$numberLong":"127"},"strength_add":{"$numberLong":"126"}}
|
||||
{"_id":{"$numberLong":"94"},"level":{"$numberLong":"94"},"need_exp":{"$numberLong":"71927"},"strength_limit":{"$numberLong":"164"},"max_cost":{"$numberLong":"127"},"strength_add":{"$numberLong":"125"}}
|
||||
{"_id":{"$numberLong":"93"},"level":{"$numberLong":"93"},"need_exp":{"$numberLong":"70007"},"strength_limit":{"$numberLong":"163"},"max_cost":{"$numberLong":"126"},"strength_add":{"$numberLong":"124"}}
|
||||
{"_id":{"$numberLong":"92"},"level":{"$numberLong":"92"},"need_exp":{"$numberLong":"68117"},"strength_limit":{"$numberLong":"162"},"max_cost":{"$numberLong":"126"},"strength_add":{"$numberLong":"123"}}
|
||||
{"_id":{"$numberLong":"91"},"level":{"$numberLong":"91"},"need_exp":{"$numberLong":"66257"},"strength_limit":{"$numberLong":"161"},"max_cost":{"$numberLong":"125"},"strength_add":{"$numberLong":"122"}}
|
||||
{"_id":{"$numberLong":"90"},"level":{"$numberLong":"90"},"need_exp":{"$numberLong":"64427"},"strength_limit":{"$numberLong":"160"},"max_cost":{"$numberLong":"125"},"strength_add":{"$numberLong":"121"}}
|
||||
{"_id":{"$numberLong":"89"},"level":{"$numberLong":"89"},"need_exp":{"$numberLong":"62627"},"strength_limit":{"$numberLong":"159"},"max_cost":{"$numberLong":"124"},"strength_add":{"$numberLong":"120"}}
|
||||
{"_id":{"$numberLong":"88"},"level":{"$numberLong":"88"},"need_exp":{"$numberLong":"60857"},"strength_limit":{"$numberLong":"158"},"max_cost":{"$numberLong":"124"},"strength_add":{"$numberLong":"119"}}
|
||||
{"_id":{"$numberLong":"87"},"level":{"$numberLong":"87"},"need_exp":{"$numberLong":"59117"},"strength_limit":{"$numberLong":"157"},"max_cost":{"$numberLong":"123"},"strength_add":{"$numberLong":"118"}}
|
||||
{"_id":{"$numberLong":"86"},"level":{"$numberLong":"86"},"need_exp":{"$numberLong":"57407"},"strength_limit":{"$numberLong":"156"},"max_cost":{"$numberLong":"123"},"strength_add":{"$numberLong":"117"}}
|
||||
{"_id":{"$numberLong":"85"},"level":{"$numberLong":"85"},"need_exp":{"$numberLong":"55727"},"strength_limit":{"$numberLong":"155"},"max_cost":{"$numberLong":"122"},"strength_add":{"$numberLong":"116"}}
|
||||
{"_id":{"$numberLong":"84"},"level":{"$numberLong":"84"},"need_exp":{"$numberLong":"54077"},"strength_limit":{"$numberLong":"154"},"max_cost":{"$numberLong":"122"},"strength_add":{"$numberLong":"115"}}
|
||||
{"_id":{"$numberLong":"83"},"level":{"$numberLong":"83"},"need_exp":{"$numberLong":"52457"},"strength_limit":{"$numberLong":"153"},"max_cost":{"$numberLong":"121"},"strength_add":{"$numberLong":"114"}}
|
||||
{"_id":{"$numberLong":"82"},"level":{"$numberLong":"82"},"need_exp":{"$numberLong":"50867"},"strength_limit":{"$numberLong":"152"},"max_cost":{"$numberLong":"121"},"strength_add":{"$numberLong":"113"}}
|
||||
{"_id":{"$numberLong":"81"},"level":{"$numberLong":"81"},"need_exp":{"$numberLong":"49307"},"strength_limit":{"$numberLong":"151"},"max_cost":{"$numberLong":"120"},"strength_add":{"$numberLong":"112"}}
|
||||
{"_id":{"$numberLong":"80"},"level":{"$numberLong":"80"},"need_exp":{"$numberLong":"47777"},"strength_limit":{"$numberLong":"150"},"max_cost":{"$numberLong":"120"},"strength_add":{"$numberLong":"111"}}
|
||||
{"_id":{"$numberLong":"79"},"level":{"$numberLong":"79"},"need_exp":{"$numberLong":"46277"},"strength_limit":{"$numberLong":"149"},"max_cost":{"$numberLong":"119"},"strength_add":{"$numberLong":"110"}}
|
||||
{"_id":{"$numberLong":"78"},"level":{"$numberLong":"78"},"need_exp":{"$numberLong":"44807"},"strength_limit":{"$numberLong":"148"},"max_cost":{"$numberLong":"119"},"strength_add":{"$numberLong":"109"}}
|
||||
{"_id":{"$numberLong":"77"},"level":{"$numberLong":"77"},"need_exp":{"$numberLong":"43367"},"strength_limit":{"$numberLong":"147"},"max_cost":{"$numberLong":"118"},"strength_add":{"$numberLong":"108"}}
|
||||
{"_id":{"$numberLong":"76"},"level":{"$numberLong":"76"},"need_exp":{"$numberLong":"41957"},"strength_limit":{"$numberLong":"146"},"max_cost":{"$numberLong":"118"},"strength_add":{"$numberLong":"107"}}
|
||||
{"_id":{"$numberLong":"75"},"level":{"$numberLong":"75"},"need_exp":{"$numberLong":"40577"},"strength_limit":{"$numberLong":"145"},"max_cost":{"$numberLong":"117"},"strength_add":{"$numberLong":"106"}}
|
||||
{"_id":{"$numberLong":"74"},"level":{"$numberLong":"74"},"need_exp":{"$numberLong":"39227"},"strength_limit":{"$numberLong":"144"},"max_cost":{"$numberLong":"117"},"strength_add":{"$numberLong":"105"}}
|
||||
{"_id":{"$numberLong":"73"},"level":{"$numberLong":"73"},"need_exp":{"$numberLong":"37907"},"strength_limit":{"$numberLong":"143"},"max_cost":{"$numberLong":"116"},"strength_add":{"$numberLong":"104"}}
|
||||
{"_id":{"$numberLong":"72"},"level":{"$numberLong":"72"},"need_exp":{"$numberLong":"36617"},"strength_limit":{"$numberLong":"142"},"max_cost":{"$numberLong":"116"},"strength_add":{"$numberLong":"103"}}
|
||||
{"_id":{"$numberLong":"71"},"level":{"$numberLong":"71"},"need_exp":{"$numberLong":"35357"},"strength_limit":{"$numberLong":"141"},"max_cost":{"$numberLong":"115"},"strength_add":{"$numberLong":"102"}}
|
||||
{"_id":{"$numberLong":"70"},"level":{"$numberLong":"70"},"need_exp":{"$numberLong":"34127"},"strength_limit":{"$numberLong":"140"},"max_cost":{"$numberLong":"115"},"strength_add":{"$numberLong":"101"}}
|
||||
{"_id":{"$numberLong":"69"},"level":{"$numberLong":"69"},"need_exp":{"$numberLong":"32927"},"strength_limit":{"$numberLong":"139"},"max_cost":{"$numberLong":"114"},"strength_add":{"$numberLong":"100"}}
|
||||
{"_id":{"$numberLong":"68"},"level":{"$numberLong":"68"},"need_exp":{"$numberLong":"31757"},"strength_limit":{"$numberLong":"138"},"max_cost":{"$numberLong":"113"},"strength_add":{"$numberLong":"99"}}
|
||||
{"_id":{"$numberLong":"67"},"level":{"$numberLong":"67"},"need_exp":{"$numberLong":"30617"},"strength_limit":{"$numberLong":"137"},"max_cost":{"$numberLong":"112"},"strength_add":{"$numberLong":"98"}}
|
||||
{"_id":{"$numberLong":"66"},"level":{"$numberLong":"66"},"need_exp":{"$numberLong":"29507"},"strength_limit":{"$numberLong":"136"},"max_cost":{"$numberLong":"111"},"strength_add":{"$numberLong":"97"}}
|
||||
{"_id":{"$numberLong":"65"},"level":{"$numberLong":"65"},"need_exp":{"$numberLong":"28427"},"strength_limit":{"$numberLong":"135"},"max_cost":{"$numberLong":"110"},"strength_add":{"$numberLong":"96"}}
|
||||
{"_id":{"$numberLong":"64"},"level":{"$numberLong":"64"},"need_exp":{"$numberLong":"27377"},"strength_limit":{"$numberLong":"134"},"max_cost":{"$numberLong":"109"},"strength_add":{"$numberLong":"95"}}
|
||||
{"_id":{"$numberLong":"63"},"level":{"$numberLong":"63"},"need_exp":{"$numberLong":"26357"},"strength_limit":{"$numberLong":"133"},"max_cost":{"$numberLong":"108"},"strength_add":{"$numberLong":"94"}}
|
||||
{"_id":{"$numberLong":"62"},"level":{"$numberLong":"62"},"need_exp":{"$numberLong":"25367"},"strength_limit":{"$numberLong":"132"},"max_cost":{"$numberLong":"107"},"strength_add":{"$numberLong":"93"}}
|
||||
{"_id":{"$numberLong":"61"},"level":{"$numberLong":"61"},"need_exp":{"$numberLong":"24407"},"strength_limit":{"$numberLong":"131"},"max_cost":{"$numberLong":"106"},"strength_add":{"$numberLong":"92"}}
|
||||
{"_id":{"$numberLong":"60"},"level":{"$numberLong":"60"},"need_exp":{"$numberLong":"23477"},"strength_limit":{"$numberLong":"130"},"max_cost":{"$numberLong":"105"},"strength_add":{"$numberLong":"91"}}
|
||||
{"_id":{"$numberLong":"59"},"level":{"$numberLong":"59"},"need_exp":{"$numberLong":"22577"},"strength_limit":{"$numberLong":"129"},"max_cost":{"$numberLong":"104"},"strength_add":{"$numberLong":"90"}}
|
||||
{"_id":{"$numberLong":"58"},"level":{"$numberLong":"58"},"need_exp":{"$numberLong":"21707"},"strength_limit":{"$numberLong":"128"},"max_cost":{"$numberLong":"103"},"strength_add":{"$numberLong":"89"}}
|
||||
{"_id":{"$numberLong":"57"},"level":{"$numberLong":"57"},"need_exp":{"$numberLong":"20867"},"strength_limit":{"$numberLong":"127"},"max_cost":{"$numberLong":"102"},"strength_add":{"$numberLong":"88"}}
|
||||
{"_id":{"$numberLong":"56"},"level":{"$numberLong":"56"},"need_exp":{"$numberLong":"20057"},"strength_limit":{"$numberLong":"126"},"max_cost":{"$numberLong":"101"},"strength_add":{"$numberLong":"87"}}
|
||||
{"_id":{"$numberLong":"55"},"level":{"$numberLong":"55"},"need_exp":{"$numberLong":"19277"},"strength_limit":{"$numberLong":"125"},"max_cost":{"$numberLong":"100"},"strength_add":{"$numberLong":"86"}}
|
||||
{"_id":{"$numberLong":"54"},"level":{"$numberLong":"54"},"need_exp":{"$numberLong":"18527"},"strength_limit":{"$numberLong":"124"},"max_cost":{"$numberLong":"99"},"strength_add":{"$numberLong":"85"}}
|
||||
{"_id":{"$numberLong":"53"},"level":{"$numberLong":"53"},"need_exp":{"$numberLong":"17807"},"strength_limit":{"$numberLong":"123"},"max_cost":{"$numberLong":"98"},"strength_add":{"$numberLong":"84"}}
|
||||
{"_id":{"$numberLong":"52"},"level":{"$numberLong":"52"},"need_exp":{"$numberLong":"17117"},"strength_limit":{"$numberLong":"122"},"max_cost":{"$numberLong":"97"},"strength_add":{"$numberLong":"83"}}
|
||||
{"_id":{"$numberLong":"51"},"level":{"$numberLong":"51"},"need_exp":{"$numberLong":"16457"},"strength_limit":{"$numberLong":"121"},"max_cost":{"$numberLong":"96"},"strength_add":{"$numberLong":"82"}}
|
||||
{"_id":{"$numberLong":"50"},"level":{"$numberLong":"50"},"need_exp":{"$numberLong":"15827"},"strength_limit":{"$numberLong":"120"},"max_cost":{"$numberLong":"95"},"strength_add":{"$numberLong":"81"}}
|
||||
{"_id":{"$numberLong":"49"},"level":{"$numberLong":"49"},"need_exp":{"$numberLong":"15203"},"strength_limit":{"$numberLong":"118"},"max_cost":{"$numberLong":"94"},"strength_add":{"$numberLong":"80"}}
|
||||
{"_id":{"$numberLong":"48"},"level":{"$numberLong":"48"},"need_exp":{"$numberLong":"14585"},"strength_limit":{"$numberLong":"116"},"max_cost":{"$numberLong":"93"},"strength_add":{"$numberLong":"79"}}
|
||||
{"_id":{"$numberLong":"47"},"level":{"$numberLong":"47"},"need_exp":{"$numberLong":"13973"},"strength_limit":{"$numberLong":"114"},"max_cost":{"$numberLong":"92"},"strength_add":{"$numberLong":"78"}}
|
||||
{"_id":{"$numberLong":"46"},"level":{"$numberLong":"46"},"need_exp":{"$numberLong":"13367"},"strength_limit":{"$numberLong":"112"},"max_cost":{"$numberLong":"91"},"strength_add":{"$numberLong":"77"}}
|
||||
{"_id":{"$numberLong":"45"},"level":{"$numberLong":"45"},"need_exp":{"$numberLong":"12767"},"strength_limit":{"$numberLong":"110"},"max_cost":{"$numberLong":"90"},"strength_add":{"$numberLong":"76"}}
|
||||
{"_id":{"$numberLong":"44"},"level":{"$numberLong":"44"},"need_exp":{"$numberLong":"12173"},"strength_limit":{"$numberLong":"108"},"max_cost":{"$numberLong":"89"},"strength_add":{"$numberLong":"75"}}
|
||||
{"_id":{"$numberLong":"43"},"level":{"$numberLong":"43"},"need_exp":{"$numberLong":"11585"},"strength_limit":{"$numberLong":"106"},"max_cost":{"$numberLong":"88"},"strength_add":{"$numberLong":"74"}}
|
||||
{"_id":{"$numberLong":"42"},"level":{"$numberLong":"42"},"need_exp":{"$numberLong":"11003"},"strength_limit":{"$numberLong":"104"},"max_cost":{"$numberLong":"87"},"strength_add":{"$numberLong":"73"}}
|
||||
{"_id":{"$numberLong":"41"},"level":{"$numberLong":"41"},"need_exp":{"$numberLong":"10427"},"strength_limit":{"$numberLong":"102"},"max_cost":{"$numberLong":"86"},"strength_add":{"$numberLong":"72"}}
|
||||
{"_id":{"$numberLong":"40"},"level":{"$numberLong":"40"},"need_exp":{"$numberLong":"9857"},"strength_limit":{"$numberLong":"100"},"max_cost":{"$numberLong":"85"},"strength_add":{"$numberLong":"71"}}
|
||||
{"_id":{"$numberLong":"39"},"level":{"$numberLong":"39"},"need_exp":{"$numberLong":"9293"},"strength_limit":{"$numberLong":"98"},"max_cost":{"$numberLong":"84"},"strength_add":{"$numberLong":"70"}}
|
||||
{"_id":{"$numberLong":"38"},"level":{"$numberLong":"38"},"need_exp":{"$numberLong":"8735"},"strength_limit":{"$numberLong":"96"},"max_cost":{"$numberLong":"83"},"strength_add":{"$numberLong":"69"}}
|
||||
{"_id":{"$numberLong":"37"},"level":{"$numberLong":"37"},"need_exp":{"$numberLong":"8183"},"strength_limit":{"$numberLong":"94"},"max_cost":{"$numberLong":"82"},"strength_add":{"$numberLong":"68"}}
|
||||
{"_id":{"$numberLong":"36"},"level":{"$numberLong":"36"},"need_exp":{"$numberLong":"7637"},"strength_limit":{"$numberLong":"92"},"max_cost":{"$numberLong":"81"},"strength_add":{"$numberLong":"67"}}
|
||||
{"_id":{"$numberLong":"35"},"level":{"$numberLong":"35"},"need_exp":{"$numberLong":"7097"},"strength_limit":{"$numberLong":"90"},"max_cost":{"$numberLong":"80"},"strength_add":{"$numberLong":"66"}}
|
||||
{"_id":{"$numberLong":"34"},"level":{"$numberLong":"34"},"need_exp":{"$numberLong":"6563"},"strength_limit":{"$numberLong":"88"},"max_cost":{"$numberLong":"79"},"strength_add":{"$numberLong":"65"}}
|
||||
{"_id":{"$numberLong":"33"},"level":{"$numberLong":"33"},"need_exp":{"$numberLong":"6035"},"strength_limit":{"$numberLong":"86"},"max_cost":{"$numberLong":"78"},"strength_add":{"$numberLong":"64"}}
|
||||
{"_id":{"$numberLong":"32"},"level":{"$numberLong":"32"},"need_exp":{"$numberLong":"5513"},"strength_limit":{"$numberLong":"84"},"max_cost":{"$numberLong":"77"},"strength_add":{"$numberLong":"63"}}
|
||||
{"_id":{"$numberLong":"31"},"level":{"$numberLong":"31"},"need_exp":{"$numberLong":"4997"},"strength_limit":{"$numberLong":"82"},"max_cost":{"$numberLong":"76"},"strength_add":{"$numberLong":"62"}}
|
||||
{"_id":{"$numberLong":"30"},"level":{"$numberLong":"30"},"need_exp":{"$numberLong":"4487"},"strength_limit":{"$numberLong":"80"},"max_cost":{"$numberLong":"75"},"strength_add":{"$numberLong":"61"}}
|
||||
{"_id":{"$numberLong":"29"},"level":{"$numberLong":"29"},"need_exp":{"$numberLong":"3983"},"strength_limit":{"$numberLong":"78"},"max_cost":{"$numberLong":"74"},"strength_add":{"$numberLong":"60"}}
|
||||
{"_id":{"$numberLong":"28"},"level":{"$numberLong":"28"},"need_exp":{"$numberLong":"3485"},"strength_limit":{"$numberLong":"75"},"max_cost":{"$numberLong":"73"},"strength_add":{"$numberLong":"59"}}
|
||||
{"_id":{"$numberLong":"27"},"level":{"$numberLong":"27"},"need_exp":{"$numberLong":"2993"},"strength_limit":{"$numberLong":"72"},"max_cost":{"$numberLong":"72"},"strength_add":{"$numberLong":"58"}}
|
||||
{"_id":{"$numberLong":"26"},"level":{"$numberLong":"26"},"need_exp":{"$numberLong":"2507"},"strength_limit":{"$numberLong":"69"},"max_cost":{"$numberLong":"71"},"strength_add":{"$numberLong":"57"}}
|
||||
{"_id":{"$numberLong":"25"},"level":{"$numberLong":"25"},"need_exp":{"$numberLong":"2027"},"strength_limit":{"$numberLong":"66"},"max_cost":{"$numberLong":"70"},"strength_add":{"$numberLong":"56"}}
|
||||
{"_id":{"$numberLong":"24"},"level":{"$numberLong":"24"},"need_exp":{"$numberLong":"1889"},"strength_limit":{"$numberLong":"63"},"max_cost":{"$numberLong":"69"},"strength_add":{"$numberLong":"55"}}
|
||||
{"_id":{"$numberLong":"23"},"level":{"$numberLong":"23"},"need_exp":{"$numberLong":"1753"},"strength_limit":{"$numberLong":"60"},"max_cost":{"$numberLong":"68"},"strength_add":{"$numberLong":"54"}}
|
||||
{"_id":{"$numberLong":"22"},"level":{"$numberLong":"22"},"need_exp":{"$numberLong":"1619"},"strength_limit":{"$numberLong":"57"},"max_cost":{"$numberLong":"67"},"strength_add":{"$numberLong":"53"}}
|
||||
{"_id":{"$numberLong":"21"},"level":{"$numberLong":"21"},"need_exp":{"$numberLong":"1487"},"strength_limit":{"$numberLong":"54"},"max_cost":{"$numberLong":"66"},"strength_add":{"$numberLong":"52"}}
|
||||
{"_id":{"$numberLong":"20"},"level":{"$numberLong":"20"},"need_exp":{"$numberLong":"1357"},"strength_limit":{"$numberLong":"51"},"max_cost":{"$numberLong":"65"},"strength_add":{"$numberLong":"51"}}
|
||||
{"_id":{"$numberLong":"19"},"level":{"$numberLong":"19"},"need_exp":{"$numberLong":"1229"},"strength_limit":{"$numberLong":"50"},"max_cost":{"$numberLong":"64"},"strength_add":{"$numberLong":"50"}}
|
||||
{"_id":{"$numberLong":"18"},"level":{"$numberLong":"18"},"need_exp":{"$numberLong":"1103"},"strength_limit":{"$numberLong":"49"},"max_cost":{"$numberLong":"63"},"strength_add":{"$numberLong":"49"}}
|
||||
{"_id":{"$numberLong":"17"},"level":{"$numberLong":"17"},"need_exp":{"$numberLong":"979"},"strength_limit":{"$numberLong":"48"},"max_cost":{"$numberLong":"62"},"strength_add":{"$numberLong":"48"}}
|
||||
{"_id":{"$numberLong":"16"},"level":{"$numberLong":"16"},"need_exp":{"$numberLong":"857"},"strength_limit":{"$numberLong":"47"},"max_cost":{"$numberLong":"61"},"strength_add":{"$numberLong":"47"}}
|
||||
{"_id":{"$numberLong":"15"},"level":{"$numberLong":"15"},"need_exp":{"$numberLong":"737"},"strength_limit":{"$numberLong":"46"},"max_cost":{"$numberLong":"60"},"strength_add":{"$numberLong":"46"}}
|
||||
{"_id":{"$numberLong":"14"},"level":{"$numberLong":"14"},"need_exp":{"$numberLong":"619"},"strength_limit":{"$numberLong":"45"},"max_cost":{"$numberLong":"59"},"strength_add":{"$numberLong":"45"}}
|
||||
{"_id":{"$numberLong":"13"},"level":{"$numberLong":"13"},"need_exp":{"$numberLong":"503"},"strength_limit":{"$numberLong":"44"},"max_cost":{"$numberLong":"58"},"strength_add":{"$numberLong":"44"}}
|
||||
{"_id":{"$numberLong":"12"},"level":{"$numberLong":"12"},"need_exp":{"$numberLong":"403"},"strength_limit":{"$numberLong":"43"},"max_cost":{"$numberLong":"57"},"strength_add":{"$numberLong":"43"}}
|
||||
{"_id":{"$numberLong":"11"},"level":{"$numberLong":"11"},"need_exp":{"$numberLong":"323"},"strength_limit":{"$numberLong":"42"},"max_cost":{"$numberLong":"55"},"strength_add":{"$numberLong":"42"}}
|
||||
{"_id":{"$numberLong":"10"},"level":{"$numberLong":"10"},"need_exp":{"$numberLong":"263"},"strength_limit":{"$numberLong":"41"},"max_cost":{"$numberLong":"52"},"strength_add":{"$numberLong":"41"}}
|
||||
{"_id":{"$numberLong":"9"},"level":{"$numberLong":"9"},"need_exp":{"$numberLong":"213"},"strength_limit":{"$numberLong":"40"},"max_cost":{"$numberLong":"49"},"strength_add":{"$numberLong":"40"}}
|
||||
{"_id":{"$numberLong":"8"},"level":{"$numberLong":"8"},"need_exp":{"$numberLong":"168"},"strength_limit":{"$numberLong":"39"},"max_cost":{"$numberLong":"48"},"strength_add":{"$numberLong":"39"}}
|
||||
{"_id":{"$numberLong":"7"},"level":{"$numberLong":"7"},"need_exp":{"$numberLong":"128"},"strength_limit":{"$numberLong":"38"},"max_cost":{"$numberLong":"46"},"strength_add":{"$numberLong":"38"}}
|
||||
{"_id":{"$numberLong":"6"},"level":{"$numberLong":"6"},"need_exp":{"$numberLong":"93"},"strength_limit":{"$numberLong":"37"},"max_cost":{"$numberLong":"44"},"strength_add":{"$numberLong":"37"}}
|
||||
{"_id":{"$numberLong":"5"},"level":{"$numberLong":"5"},"need_exp":{"$numberLong":"63"},"strength_limit":{"$numberLong":"36"},"max_cost":{"$numberLong":"42"},"strength_add":{"$numberLong":"36"}}
|
||||
{"_id":{"$numberLong":"4"},"level":{"$numberLong":"4"},"need_exp":{"$numberLong":"31"},"strength_limit":{"$numberLong":"35"},"max_cost":{"$numberLong":"40"},"strength_add":{"$numberLong":"35"}}
|
||||
{"_id":{"$numberLong":"3"},"level":{"$numberLong":"3"},"need_exp":{"$numberLong":"18"},"strength_limit":{"$numberLong":"34"},"max_cost":{"$numberLong":"38"},"strength_add":{"$numberLong":"34"}}
|
||||
{"_id":{"$numberLong":"2"},"level":{"$numberLong":"2"},"need_exp":{"$numberLong":"6"},"strength_limit":{"$numberLong":"33"},"max_cost":{"$numberLong":"36"},"strength_add":{"$numberLong":"33"}}
|
||||
{"_id":{"$numberLong":"1"},"level":{"$numberLong":"1"},"need_exp":{"$numberLong":"0"},"strength_limit":{"$numberLong":"32"},"max_cost":{"$numberLong":"34"},"strength_add":{"$numberLong":"32"}}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{"_id":{"$numberLong":"1"},"member_position":"门主","member_position_num_limit":{"$numberLong":"1"},"open_boss_fight":{"$numberLong":"1"},"buy_extra_atk":{"$numberLong":"1"},"member_icon":"family_menzhu"}
|
||||
{"_id":{"$numberLong":"2"},"member_position":"副门主","member_position_num_limit":{"$numberLong":"2"},"open_boss_fight":{"$numberLong":"1"},"buy_extra_atk":{"$numberLong":"1"},"member_icon":"family_fumenzhu"}
|
||||
{"_id":{"$numberLong":"3"},"member_position":"长老","member_position_num_limit":{"$numberLong":"4"},"open_boss_fight":{"$numberLong":"0"},"buy_extra_atk":{"$numberLong":"0"},"member_icon":"family_zhanglao"}
|
||||
{"_id":{"$numberLong":"4"},"member_position":"精英","member_position_num_limit":{"$numberLong":"1000"},"open_boss_fight":{"$numberLong":"0"},"buy_extra_atk":{"$numberLong":"0"},"member_icon":"family_jingying"}
|
||||
{"_id":{"$numberLong":"5"},"member_position":"弟子","member_position_num_limit":{"$numberLong":"1000"},"open_boss_fight":{"$numberLong":"0"},"buy_extra_atk":{"$numberLong":"0"},"member_icon":"family_dizi"}
|
||||
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.jmfy</groupId>
|
||||
<artifactId>idip</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.6.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.thrift</groupId>
|
||||
<artifactId>libthrift</artifactId>
|
||||
<version>0.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.35</version>
|
||||
</dependency>
|
||||
<!--kafka-->
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
<version>0.9.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.resource</groupId>
|
||||
<artifactId>connector-api</artifactId>
|
||||
<version>1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.4</version>
|
||||
<classifier>jdk15</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20150729</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>3.7.0.Final</version>
|
||||
</dependency>
|
||||
<!--redis-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>1.5.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.2.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Main-Class: out
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.jmfy;
|
||||
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.ManagerManager;
|
||||
import com.jmfy.redisProperties.RedisAutoConfiguration;
|
||||
import com.jmfy.server.ServerConfiguration;
|
||||
import com.jmfy.server.ServerProperties;
|
||||
import com.jmfy.thrift.pool.ThriftPoolUtils;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
|
||||
public static String plat = "android";
|
||||
public static int isLAN = 0;
|
||||
public static String coreDb ;
|
||||
public static void main(String[] args) {
|
||||
|
||||
ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(Application.class, args);
|
||||
ServerConfiguration serverConfiguration = configurableApplicationContext.getBean(ServerConfiguration.class);
|
||||
ServerProperties serverProperties = serverConfiguration.getServerProperties();
|
||||
plat = serverProperties.getPlat();
|
||||
isLAN = serverProperties.getIsLAN();
|
||||
coreDb = serverProperties.getCoredb();
|
||||
LOGGER.info("main->plat={},isLAN={}",plat,isLAN);
|
||||
ManagerManager handlerManager = ManagerManager.getInstance();
|
||||
// STableManager.getInstance().init(configurableApplicationContext);
|
||||
// //初始化s表
|
||||
// STableManager.getInstance().initSTable();
|
||||
//// 初始化动态创建mongoClient 线程
|
||||
// AddMongoClient.startAddMongoClient(configurableApplicationContext);
|
||||
// //kafka连接
|
||||
// RedisRecordSendThread.getInstance().start();
|
||||
// //redis初始化
|
||||
RedisAutoConfiguration redisAutoConfiguration = configurableApplicationContext.getBean(RedisAutoConfiguration.class);
|
||||
RedisUtil.getInstence().init(redisAutoConfiguration.getRedisProperties());
|
||||
|
||||
//初使化连接池util类
|
||||
ThriftPoolUtils.getInstance().initContext(configurableApplicationContext);
|
||||
//数据库
|
||||
Map<String, BaseHandler> commandHanderMap = configurableApplicationContext.getBeansOfType(BaseHandler.class);
|
||||
for (BaseHandler handler : commandHanderMap.values()) {
|
||||
handlerManager.addHandler(handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,323 @@
|
|||
package com.jmfy.cenum;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
public enum CommandEnm {
|
||||
//修改钻石
|
||||
IDIP_DO_CHANGE_DIAMOND_REQ(0,4097),
|
||||
// 修改金币
|
||||
IDIP_DO_CHANGE_GOLD_REQ(1,4101),
|
||||
//修改经验
|
||||
IDIP_DO_CHANGE_EXP_REQ(2,4103),
|
||||
//修改等级
|
||||
IDIP_DO_CHANGE_LV_REQ(3,4105),
|
||||
//修改体力
|
||||
IDIP_DO_CHANGE_ENERGE_REQ(4,4107),
|
||||
//赠送道具
|
||||
IDIP_DO_GIFT_ITEM_REQ(5,4109),
|
||||
//删除道具
|
||||
IDIP_DO_DEL_ITEM_REQ(6,4111),
|
||||
//发送邮件
|
||||
IDIP_DO_SEND_MAIL_REQ(7,4113),
|
||||
//删除邮件
|
||||
IDIP_DO_DEL_MAIL_REQ(8,4115),
|
||||
//激活账号
|
||||
IDIP_DO_ACTIVATE_ACCOUNT_REQ(9,4117),
|
||||
//封号
|
||||
IDIP_DO_BAN_COUNT_REQ(10,4119),
|
||||
//解封
|
||||
IDIP_DO_UNBAN_COUNT_REQ(11,4121),
|
||||
//角色信息查询
|
||||
IDIP_QUERY_ROLE_INFO_REQ(12,4123),
|
||||
//账号角色查询
|
||||
IDIP_QUERY_COUNT_ROLE_REQ(13,4125),
|
||||
//卡牌详细信息查询
|
||||
IDIP_QUERY_CARD_INFO_REQ(14,4127),
|
||||
//邮件详情信息查询
|
||||
IDIP_QUERY_MAIL_INFO_REQ(15,4129),
|
||||
//封号状态查询
|
||||
IDIP_QUERY_BAN_STATUS_REQ(16,4133),
|
||||
//卡牌模板信息查询
|
||||
IDIP_QUERY_CARD_MODE_INFO_REQ(17,4135),
|
||||
//踢下线
|
||||
IDIP_DO_KICK_OFFLINE_REQ(18,4137),
|
||||
//删除激活账号
|
||||
IDIP_DO_DEL_ACTIVATEACCOUNT_REQ(19,4139),
|
||||
//查询激活账号
|
||||
IDIP_QUERY_ACTIVATE_ACCOUNT_REQ(20,4141),
|
||||
//大区配置
|
||||
IDIP_DO_SVR_CFG_REQ(21,4149),
|
||||
//发送公告
|
||||
IDIP_DO_SEND_NOTICE_REQ(22,4151),
|
||||
//查询公告
|
||||
IDIP_QUERY_NOTICE_INFO_REQ(23,4153),
|
||||
//删除公告
|
||||
IDIP_DO_DEL_NOTICE_REQ(24,4155),
|
||||
//发送走马灯
|
||||
IDIP_DO_SEND_LIGHT_REQ(25,4157),
|
||||
//查询走马灯
|
||||
IDIP_QUERY_LIGHT_INFO_REQ(26,4159),
|
||||
//删除走马灯
|
||||
IDIP_DO_DEL_LIGHT_REQ(27,4161),
|
||||
//发送弹幕
|
||||
IDIP_DO_SEND_BARAGE_REQ(28,4163),
|
||||
//查询弹幕
|
||||
IDIP_QUERY_BARAGE_INFO_REQ(29,4165),
|
||||
//删除弹幕
|
||||
IDIP_DO_DEL_BARAGE_REQ(30,4167),
|
||||
//全服发送奖励
|
||||
IDIP_DO_SENDALLSVR_REWARD_REQ(31,4193),
|
||||
//查询全服奖励
|
||||
IDIP_QUERY_ALLSVRS_INFO_REQ(32,4197),
|
||||
//删除全服奖励
|
||||
IDIP_DO_DEL_ALLSVRS_REQ(33,4199),
|
||||
//安全-查询角色信息
|
||||
IDIP_QUERY_ROLE_INFO_AQ_REQ(34,4169),
|
||||
//安全-修改金币
|
||||
IDIP_DO_CHANGE_GOLD_AQ_REQ(35,4171),
|
||||
//安全-修改钻石数量
|
||||
IDIP_DO_CHANGE_DIAMOND_AQ_REQ(36,4173),
|
||||
//安全-禁止参与排行榜
|
||||
IDIP_DO_BAN_RANK_AQ_REQ(37,4175),
|
||||
//安全-禁止指定玩法
|
||||
IDIP_DO_BAN_PLAY_AQ_REQ(38,4177),
|
||||
//安全-零收益
|
||||
IDIP_DO_ZEROINCOME_AQ_REQ(40,4181),
|
||||
//安全-禁止所有玩法
|
||||
IDIP_DO_BAN_ALLPLAY_AQ_REQ(39,4179),
|
||||
//安全-封号
|
||||
IDIP_DO_BAN_COUNT_AQ_REQ(41,4183),
|
||||
//安全-禁言
|
||||
IDIP_DO_BAN_CHAT_AQ_REQ(42,4185),
|
||||
//安全-发言清除
|
||||
IDIP_DO_CLEAR_CHAT_AQ_REQ(43,4187),
|
||||
//安全-解除处罚
|
||||
IDIP_DO_LIFT_PUNISH_AQ_REQ(44,4189),
|
||||
//开通用户GM权限
|
||||
IDIP_DO_OPEN_GM_REQ(45,4143),
|
||||
//关闭用户GM权限
|
||||
IDIP_DO_CLOSE_GM_REQ(46,4145),
|
||||
//查询用户GM权限
|
||||
IDIP_QUERY_ACCOUNT_GM_REQ(47,4147),
|
||||
//弹幕开关
|
||||
IDIP_DO_BARAGE_ONOFF_REQ(48,4201),
|
||||
//开通服务器GM权限
|
||||
IDIP_DO_OPEN_SVRGM_REQ(49,4203),
|
||||
//关闭服务器GM权限
|
||||
IDIP_DO_CLOSE_SVRGM_REQ(50,4205),
|
||||
//查询服务器GM权限
|
||||
IDIP_QUERY_SVR_GM_REQ(51,4207),
|
||||
//概率变化开关
|
||||
IDIP_DO_CHANGE_SWITCH_REQ(52,4209),
|
||||
//查询概率开关配置
|
||||
IDIP_QUERY_CHANGE_SWITCH_REQ(53,4213),
|
||||
//配置卡池模版开关
|
||||
IDIP_DO_MODEL_SWITCH_REQ(54,4215),
|
||||
//查询卡池模版开关配置
|
||||
IDIP_QUERY_MODEL_SWITCH_REQ(55,4217),
|
||||
//状态配置
|
||||
IDIP_DO_STATUS_CFG_REQ(56,4219),
|
||||
//查询状态配置
|
||||
IDIP_QUERY_STATUS_CFG_REQ(57,4221),
|
||||
//推荐配置
|
||||
IDIP_DO_COMMEND_CFG_REQ(58,4223),
|
||||
//查询推荐配置
|
||||
IDIP_QUERY_COMMEND_CFG_REQ(59,4225),
|
||||
//排队配置
|
||||
IDIP_DO_LINEUP_CFG_REQ(60,4227),
|
||||
//查询排队配置
|
||||
IDIP_QUERY_LINEUP_CFG_REQ(61,4229),
|
||||
//设置新服开服活动标准时间
|
||||
IDIP_DO_SET_ACTIVITY_NORMALTIME_REQ(63,4231),
|
||||
//查询新服开服活动标准时间
|
||||
IDIP_QUERY_ACTIVITY_NORMALTIME_REQ(64,4233),
|
||||
//设置服务器注册限制
|
||||
IDIP_DO_SET_REGISTER_LIMIT_REQ(65,4235),
|
||||
//查询服务器注册限制
|
||||
IDIP_QUERY_REGISTER_LIMIT_REQ(66,4237),
|
||||
/* 成长守护(禁玩/解禁) */
|
||||
IDIP_DO_SET_NO_PLAY_REQ(67,4239),
|
||||
|
||||
//防沉迷状态查询
|
||||
IDIP_QUERY_ANTI_INDULGENCE_STATUS_REQ(68,4241),
|
||||
//防沉迷状态重置
|
||||
IDIP_DO_REST_ANTI_INDULGENCE_REQ(69,4243),
|
||||
// uid转openid
|
||||
IDIP_QUERY_OPNEID_REQ(70,4245),
|
||||
//查询角色卡牌数量
|
||||
IDIP_QUERY_CARDS_NUM_REQ(71,4247),
|
||||
//查询角色当前通关关卡
|
||||
IDIP_QUERY_ROLE_CHECKPOINT_REQ(72,4249),
|
||||
//查询角色当天关卡通关次数
|
||||
IDIP_QUERY_CLEARANCE_NUM_REQ(73,4251),
|
||||
//查询角色当天在线时长
|
||||
IDIP_QUERY_ROLE_ONLINE_TIME_REQ(74,4253),
|
||||
//查询角色当天天才战对战次数
|
||||
IDIP_QUERY_TALENT_BATTLE_NUM_REQ(75,4255),
|
||||
//查询角色当天资源消耗数量
|
||||
IDIP_QUERY_RESOURCE_NUM_REQ(76,4257),
|
||||
//查询用户当前通关天幻圣境
|
||||
IDIP_QUERY_ROLE_THSJ_CHECKPOINT_REQ(77,4259),
|
||||
//查询角色当天天幻圣境通关次数
|
||||
IDIP_QUERY_THSJ_CLEARANCE_NUM_REQ(78,4261),
|
||||
//查询角色累计充值数量
|
||||
IDIP_QUERY_ROLE_ACCUM_RECHANGE_REQ(79,4263),
|
||||
//查询角色灵魂力
|
||||
IDIP_QUERY_ROLE_SOUL_REQ(80,4265),
|
||||
//查询角色天才战积分
|
||||
IDIP_QUERY_ROLE_TALENT_POINT_REQ(81,4267),
|
||||
/* 安全-禁止添加好友接口(AQ) */
|
||||
IDIP_DO_BAN_ADD_FRIEND_AQ_REQ(82,4269),
|
||||
/* 安全-修改角色昵称(AQ) */
|
||||
IDIP_DO_CHANGE_ROLE_NAME_AQ_REQ(83,4271),
|
||||
/* 安全-修改公会信息(AQ) */
|
||||
IDIP_DO_CHANGE_UNION_INFO_AQ_REQ(84,4273),
|
||||
/* 查询用户公会信息 */
|
||||
IDIP_QUERY_UNION_INFO_REQ(85,4275),
|
||||
/* 角色名查询用户账号 */
|
||||
IDIP_QUERY_ACCOUNT_THROUGH_NAME_REQ(86,4277),
|
||||
/* 游戏外部活动上架 */
|
||||
IDIP_DO_SHELF_OUTSIDE_ACTIVITY_REQ(87,4279),
|
||||
/* 删除游戏外部活动 */
|
||||
IDIP_DO_DEL_OUTSIDE_ACTIVITY_REQ(88,4281),
|
||||
/* 查询游戏外部活动 */
|
||||
IDIP_QUERY_OUTSIDE_ACTIVITY_REQ(89,4283),
|
||||
/* 活动白名单开关 */
|
||||
IDIP_DO_ACTIVITY_WHITELIST_SWITCH_REQ(90,4285),
|
||||
/* 活动白名单管理 */
|
||||
IDIP_DO_ACTIVITY_WHITELIST_MANAGE_REQ(91,4287),
|
||||
/* 中控防沉迷提醒 */
|
||||
IDIP_DO_ZK_PREVENT_ADDICTION_REMIND_REQ(92,4289),
|
||||
/* 中控防沉迷禁玩 */
|
||||
IDIP_DO_ZK_PREVENT_ADDICTION_BAN_REQ(93,4291),
|
||||
/* 中控防沉迷强制验证 */
|
||||
IDIP_DO_ZK_PREVENT_ADDICTION_FORCE_VERTIFY_REQ(94,4293);
|
||||
|
||||
private int key;
|
||||
private int value;
|
||||
CommandEnm(int key, int value) {
|
||||
this.key =key;
|
||||
this.value =value;
|
||||
}
|
||||
|
||||
public static CommandEnm valueOf(int value){
|
||||
switch (value){
|
||||
case 4097:return IDIP_DO_CHANGE_DIAMOND_REQ;
|
||||
case 4101:return IDIP_DO_CHANGE_GOLD_REQ;
|
||||
case 4103:return IDIP_DO_CHANGE_EXP_REQ;
|
||||
case 4105:return IDIP_DO_CHANGE_LV_REQ;
|
||||
case 4107:return IDIP_DO_CHANGE_ENERGE_REQ;
|
||||
case 4109:return IDIP_DO_GIFT_ITEM_REQ;
|
||||
case 4111:return IDIP_DO_DEL_ITEM_REQ;
|
||||
case 4113:return IDIP_DO_SEND_MAIL_REQ;
|
||||
case 4115:return IDIP_DO_DEL_MAIL_REQ;
|
||||
case 4117:return IDIP_DO_ACTIVATE_ACCOUNT_REQ;
|
||||
case 4119:return IDIP_DO_BAN_COUNT_REQ;
|
||||
case 4121:return IDIP_DO_UNBAN_COUNT_REQ;
|
||||
case 4123:return IDIP_QUERY_ROLE_INFO_REQ;
|
||||
case 4125:return IDIP_QUERY_COUNT_ROLE_REQ;
|
||||
case 4127:return IDIP_QUERY_CARD_INFO_REQ;
|
||||
case 4129:return IDIP_QUERY_MAIL_INFO_REQ;
|
||||
case 4133:return IDIP_QUERY_BAN_STATUS_REQ;
|
||||
case 4135:return IDIP_QUERY_CARD_MODE_INFO_REQ;
|
||||
case 4137:return IDIP_DO_KICK_OFFLINE_REQ;
|
||||
case 4139:return IDIP_DO_DEL_ACTIVATEACCOUNT_REQ;
|
||||
case 4141:return IDIP_QUERY_ACTIVATE_ACCOUNT_REQ;
|
||||
case 4149:return IDIP_DO_SVR_CFG_REQ;
|
||||
case 4151:return IDIP_DO_SEND_NOTICE_REQ;
|
||||
case 4153:return IDIP_QUERY_NOTICE_INFO_REQ;
|
||||
case 4155:return IDIP_DO_DEL_NOTICE_REQ;
|
||||
case 4157:return IDIP_DO_SEND_LIGHT_REQ;
|
||||
case 4159:return IDIP_QUERY_LIGHT_INFO_REQ;
|
||||
case 4161:return IDIP_DO_DEL_LIGHT_REQ;
|
||||
case 4163:return IDIP_DO_SEND_BARAGE_REQ;
|
||||
case 4165:return IDIP_QUERY_BARAGE_INFO_REQ;
|
||||
case 4167:return IDIP_DO_DEL_BARAGE_REQ;
|
||||
case 4193:return IDIP_DO_SENDALLSVR_REWARD_REQ;
|
||||
case 4197:return IDIP_QUERY_ALLSVRS_INFO_REQ;
|
||||
case 4199:return IDIP_DO_DEL_ALLSVRS_REQ;
|
||||
case 4169:return IDIP_QUERY_ROLE_INFO_AQ_REQ;
|
||||
case 4171:return IDIP_DO_CHANGE_GOLD_AQ_REQ;
|
||||
case 4173:return IDIP_DO_CHANGE_DIAMOND_AQ_REQ;
|
||||
case 4175:return IDIP_DO_BAN_RANK_AQ_REQ;
|
||||
case 4177:return IDIP_DO_BAN_PLAY_AQ_REQ;
|
||||
case 4179:return IDIP_DO_BAN_ALLPLAY_AQ_REQ;
|
||||
case 4181:return IDIP_DO_ZEROINCOME_AQ_REQ;
|
||||
case 4183:return IDIP_DO_BAN_COUNT_AQ_REQ;
|
||||
case 4185:return IDIP_DO_BAN_CHAT_AQ_REQ;
|
||||
case 4187:return IDIP_DO_CLEAR_CHAT_AQ_REQ;
|
||||
case 4189:return IDIP_DO_LIFT_PUNISH_AQ_REQ;
|
||||
case 4143:return IDIP_DO_OPEN_GM_REQ;
|
||||
case 4145:return IDIP_DO_CLOSE_GM_REQ;
|
||||
case 4147:return IDIP_QUERY_ACCOUNT_GM_REQ;
|
||||
case 4201:return IDIP_DO_BARAGE_ONOFF_REQ;
|
||||
case 4203:return IDIP_DO_OPEN_SVRGM_REQ;
|
||||
case 4205:return IDIP_DO_CLOSE_SVRGM_REQ;
|
||||
case 4207:return IDIP_QUERY_SVR_GM_REQ;
|
||||
case 4209:return IDIP_DO_CHANGE_SWITCH_REQ;
|
||||
case 4213:return IDIP_QUERY_CHANGE_SWITCH_REQ;
|
||||
case 4215:return IDIP_DO_MODEL_SWITCH_REQ;
|
||||
case 4217:return IDIP_QUERY_MODEL_SWITCH_REQ;
|
||||
case 4219:return IDIP_DO_STATUS_CFG_REQ;
|
||||
case 4221:return IDIP_QUERY_STATUS_CFG_REQ;
|
||||
case 4223:return IDIP_DO_COMMEND_CFG_REQ;
|
||||
case 4225:return IDIP_QUERY_COMMEND_CFG_REQ;
|
||||
case 4227:return IDIP_DO_LINEUP_CFG_REQ;
|
||||
case 4229:return IDIP_QUERY_LINEUP_CFG_REQ;
|
||||
case 4231:return IDIP_DO_SET_ACTIVITY_NORMALTIME_REQ;
|
||||
case 4233:return IDIP_QUERY_ACTIVITY_NORMALTIME_REQ;
|
||||
case 4235:return IDIP_DO_SET_REGISTER_LIMIT_REQ;
|
||||
case 4237:return IDIP_QUERY_REGISTER_LIMIT_REQ;
|
||||
case 4239:return IDIP_DO_SET_NO_PLAY_REQ;
|
||||
case 4241:return IDIP_QUERY_ANTI_INDULGENCE_STATUS_REQ;
|
||||
case 4243:return IDIP_DO_REST_ANTI_INDULGENCE_REQ;
|
||||
case 4245:return IDIP_QUERY_OPNEID_REQ;
|
||||
case 4247:return IDIP_QUERY_CARDS_NUM_REQ;
|
||||
case 4249:return IDIP_QUERY_ROLE_CHECKPOINT_REQ;
|
||||
case 4251:return IDIP_QUERY_CLEARANCE_NUM_REQ;
|
||||
case 4253:return IDIP_QUERY_ROLE_ONLINE_TIME_REQ;
|
||||
case 4255:return IDIP_QUERY_TALENT_BATTLE_NUM_REQ;
|
||||
case 4257:return IDIP_QUERY_RESOURCE_NUM_REQ;
|
||||
case 4259:return IDIP_QUERY_ROLE_THSJ_CHECKPOINT_REQ;
|
||||
case 4261:return IDIP_QUERY_THSJ_CLEARANCE_NUM_REQ;
|
||||
case 4263:return IDIP_QUERY_ROLE_ACCUM_RECHANGE_REQ;
|
||||
case 4265:return IDIP_QUERY_ROLE_SOUL_REQ;
|
||||
case 4267:return IDIP_QUERY_ROLE_TALENT_POINT_REQ;
|
||||
case 4269:return IDIP_DO_BAN_ADD_FRIEND_AQ_REQ;
|
||||
case 4271:return IDIP_DO_CHANGE_ROLE_NAME_AQ_REQ;
|
||||
case 4273:return IDIP_DO_CHANGE_UNION_INFO_AQ_REQ;
|
||||
case 4275:return IDIP_QUERY_UNION_INFO_REQ;
|
||||
case 4277:return IDIP_QUERY_ACCOUNT_THROUGH_NAME_REQ;
|
||||
case 4279:return IDIP_DO_SHELF_OUTSIDE_ACTIVITY_REQ;
|
||||
case 4281:return IDIP_DO_DEL_OUTSIDE_ACTIVITY_REQ;
|
||||
case 4283:return IDIP_QUERY_OUTSIDE_ACTIVITY_REQ;
|
||||
case 4285:return IDIP_DO_ACTIVITY_WHITELIST_SWITCH_REQ;
|
||||
case 4287:return IDIP_DO_ACTIVITY_WHITELIST_MANAGE_REQ;
|
||||
case 4289:return IDIP_DO_ZK_PREVENT_ADDICTION_REMIND_REQ;
|
||||
case 4291:return IDIP_DO_ZK_PREVENT_ADDICTION_BAN_REQ;
|
||||
case 4293:return IDIP_DO_ZK_PREVENT_ADDICTION_FORCE_VERTIFY_REQ;
|
||||
default:
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(int key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.model.BuriedPoint;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@RestController
|
||||
public class BuriedPointController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BuriedPointController.class);
|
||||
|
||||
private static final String _COLLECTION_NAME = "user_buried_point";
|
||||
|
||||
@Resource
|
||||
private MongoConnectDao mongoConnectDao;
|
||||
|
||||
/**
|
||||
* 埋点排重(之前没有添加,有查询)
|
||||
* @param channel
|
||||
* @param userId
|
||||
* @param point
|
||||
* @param response
|
||||
* testUrl: http://34.87.3.216:8081/idip/sfzb/point/buriedPoint?channel=baidu&userId=2020125&point=aaaaaaa
|
||||
*/
|
||||
@RequestMapping(value = "/point/buriedPoint", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public void buriedPoint(String channel, String userId, String point, HttpServletResponse response){
|
||||
|
||||
try {
|
||||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
|
||||
String channelUserId = channel + userId;
|
||||
|
||||
DBObject doc = new BasicDBObject();
|
||||
doc.put("channelUserId",channelUserId);
|
||||
doc.put("channel", channel);
|
||||
doc.put("userId", userId);
|
||||
doc.put("point", point);
|
||||
|
||||
//查询
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("channelUserId").is(channelUserId));
|
||||
query.addCriteria(cr);
|
||||
BuriedPoint buriedPoint = mongoTemplate.findOne(query, BuriedPoint.class);
|
||||
|
||||
boolean isPoint = false;
|
||||
//埋点过
|
||||
if(buriedPoint == null) {
|
||||
//存储
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
DBCollection dBCollection = mongoTemplate.getCollection(_COLLECTION_NAME);
|
||||
dBCollection.save(doc);
|
||||
}else {
|
||||
isPoint = true;
|
||||
}
|
||||
|
||||
JSONObject obj1 = new JSONObject();
|
||||
obj1.put("isPoint", isPoint);
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(obj1.toJSONString().getBytes());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.model.NoticeInfo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.sdk.ServerDemo;
|
||||
import com.jmfy.util.*;
|
||||
import com.jmfy.util.loginRedis.RedisKey;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.view.RedirectView;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
public class GmController {
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(GmController.class);
|
||||
@Autowired
|
||||
HttpSession session;
|
||||
//登录验证
|
||||
@RequestMapping(value = "/gm/in", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public String in(String name,String pwd) throws Exception{
|
||||
if("admin".equals(name) && "admin".equals(pwd)){
|
||||
session.setAttribute("name", "adminTank");
|
||||
//RedirectView redirectTarget = new RedirectView();
|
||||
//redirectTarget.setContextRelative(true);
|
||||
//redirectTarget.setUrl("/");
|
||||
//return redirectTarget;
|
||||
}
|
||||
return "ok";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/gm/other", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public String other(String name,String pwd) throws Exception{
|
||||
//验证是否登录
|
||||
if(!"adminTank".equals(session.getAttribute("name"))){
|
||||
return "9000";
|
||||
}
|
||||
//处理其他逻辑
|
||||
|
||||
return "ok";
|
||||
}
|
||||
|
||||
//发邮件
|
||||
@RequestMapping(value = "/gm/sendMail", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public String sendMail(int serverId,String uids,String title,String content,String reward) throws Exception{
|
||||
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverId), String.class, -1);
|
||||
if(null==rpcString){
|
||||
throw new Exception("serverAddress not exist");
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[1];
|
||||
|
||||
Result result = RPCClient.sendMailToRole(thriftIp, thriftPort,uids,title,content,reward);
|
||||
if (result.getResultCode() != 1) {
|
||||
throw new Exception(result.getResultMsg());
|
||||
}
|
||||
return "ok";
|
||||
}
|
||||
//改公告
|
||||
@RequestMapping(value = "/gm/updateNotice", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public String updateNotice(int level,long startTime,long endTime,String title,String content) throws Exception{
|
||||
|
||||
Map<String, NoticeInfo> noticeInfoMap = new HashMap<String, NoticeInfo>();
|
||||
NoticeInfo noticeInfo = new NoticeInfo();
|
||||
noticeInfo.setTitle(title);
|
||||
noticeInfo.setContent(content);
|
||||
noticeInfo.setLeve(level);
|
||||
noticeInfo.setStartTime(startTime);
|
||||
noticeInfo.setEndTime(endTime);
|
||||
noticeInfoMap.put("1",noticeInfo);
|
||||
RedisUtil.getInstence().putMap(RedisKey.NOTICE+":", "", noticeInfoMap, -1);
|
||||
|
||||
return "ok";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name ChiTu
|
||||
* @param pwd ChiTu220823
|
||||
* @param SID 平台方游戏服序号,可同研发方游戏服唯一标识一样或从1开始递增
|
||||
* @param _SID 研发方游戏服唯一标识 例: SID=1&_SID=1, 此方案最方便。 SID=1&_SID=50001,如果不能从1开始递增
|
||||
* @param STATE 1: 开启服务器, -2: 关闭服务器。 留空不传默认为1,默认开启
|
||||
* @param NAME 游戏服名称, 1服,2服。。。依此类推
|
||||
* @param START_TIME 开服时间,格式 2019-01-01 12:00:00
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/gm/registerGameServer", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public String registerGameServer(String name,String pwd,String SID,String _SID,String STATE,String NAME,String START_TIME) {
|
||||
try {
|
||||
//验证是否登录
|
||||
if ("ChiTu".equals(name) && "ChiTu220823".equals(pwd)) {
|
||||
session.setAttribute("name", "ChiTu");
|
||||
|
||||
//处理其他逻辑
|
||||
// 请求参数
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("GAME_ID", String.valueOf(Constant.CHITU_GAMEID)); //游戏ID,由平台方提供
|
||||
params.put("SID", SID); //平台方游戏服序号,可同研发方游戏服唯一标识一样或从1开始递增
|
||||
params.put("_SID", _SID); //研发方游戏服唯一标识 例: SID=1&_SID=1, 此方案最方便。 SID=1&_SID=50001,如果不能从1开始递增
|
||||
params.put("STATE", STATE); // 1: 开启服务器, -2: 关闭服务器。 留空不传默认为1,默认开启
|
||||
params.put("NAME", NAME); // 游戏服名称, 1服,2服。。。依此类推
|
||||
params.put("START_TIME", START_TIME); // 开服时间,格式 2019-01-01 12:00:00
|
||||
String currentTimeMillis = Long.toString(System.currentTimeMillis() / 100L); //时间戳 秒
|
||||
params.put("timestamp", currentTimeMillis);
|
||||
|
||||
// getAsciiSort(params); //Map根据键值按ASCII 码从小到大排序
|
||||
|
||||
//把所有参数用空字符拼接
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// for (String value : params.values()) {
|
||||
// sb.append(value);
|
||||
// }
|
||||
// String paramStr = sb.substring(0, sb.length() - 1);
|
||||
|
||||
StringBuilder sbStr = new StringBuilder();
|
||||
sbStr.append(params.get("GAME_ID"));
|
||||
sbStr.append(params.get("NAME"));
|
||||
sbStr.append(params.get("SID"));
|
||||
sbStr.append(params.get("START_TIME"));
|
||||
sbStr.append(params.get("STATE"));
|
||||
sbStr.append(params.get("_SID"));
|
||||
sbStr.append(params.get("timestamp"));
|
||||
|
||||
LOGGER.info("sbStr={}",sbStr);
|
||||
|
||||
String mySign = md5(sbStr.toString(),Constant.CHITU_SECRET_KEY);
|
||||
|
||||
LOGGER.info("mySign={}",mySign);
|
||||
|
||||
params.put("sign", mySign); // 签名
|
||||
|
||||
String url = "https://sdk.chituhuyu.com/game/center/sync_server";
|
||||
String resurl = HttpUtil.postForm(url, params);
|
||||
JSONObject jsonresObject = JSONObject.fromObject(resurl);
|
||||
LOGGER.info("res=" + jsonresObject.toString());
|
||||
|
||||
//“status”:0为成功, 其余为失败(-9为服已经存在),”msg”:”对应的信息提示”}
|
||||
// status状态为0时 成功 其他为失败
|
||||
if (jsonresObject.getInt("status") == 0) {
|
||||
return "添加成功!";
|
||||
}else if(jsonresObject.getInt("status") == -9){
|
||||
return "请勿重复添加!";
|
||||
} else {
|
||||
return jsonresObject.getJSONObject("status").getString("msg");
|
||||
}
|
||||
} else {
|
||||
return "Error:name or pwd err!";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "-1";
|
||||
}
|
||||
|
||||
public static String md5(String text, String key) throws Exception {
|
||||
//加密后的字符串
|
||||
String encodeStr= DigestUtils.md5Hex(text + key);
|
||||
|
||||
return encodeStr;
|
||||
}
|
||||
|
||||
//Map根据键值按ASCII 码从小到大排序,值为空的不拼接
|
||||
public static Map<String, String> getAsciiSort(Map<String, String> map) {
|
||||
//移除值为空的
|
||||
map.entrySet().removeIf(entry -> "".equals(entry.getValue()));
|
||||
|
||||
List<Map.Entry<String, String>> infoIds = new ArrayList<>(map.entrySet());
|
||||
//对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序)
|
||||
infoIds.sort((o1, o2) -> o1.getKey().compareToIgnoreCase(o2.getKey()));
|
||||
|
||||
Map<String, String> mapSort = new HashMap<>();
|
||||
for (Map.Entry<String, String> infoId : infoIds) {
|
||||
mapSort.put(infoId.getKey(),infoId.getValue());
|
||||
}
|
||||
return mapSort;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,311 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.dao.PayDao;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.model.User;
|
||||
import com.jmfy.model.sdk.RegisterUser;
|
||||
import com.jmfy.modelVo.PayVo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.*;
|
||||
import com.jmfy.util.loginRedis.TimeUtil;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.BasicQuery;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.Signature;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.jmfy.util.MD5Util.encrypByMd5;
|
||||
|
||||
@RestController
|
||||
public class ICanController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ICanController.class);
|
||||
private static final String DB_NAME_PREFIX = "x1_tw_game_";
|
||||
|
||||
@Resource
|
||||
private MongoConnectDao mongoConnectDao;
|
||||
@Resource
|
||||
private PayDao payDao;
|
||||
|
||||
@PostMapping("/ican/item")
|
||||
public JSONObject sendItem(String account, String serverId, String platform, String itemId, Integer count,
|
||||
String roleId, String time, String verify){
|
||||
LOGGER.info("ican send item, roleId:{}, serverId:{}, itemId:{}, count:{}", roleId, serverId, itemId, count);
|
||||
JSONObject json = new JSONObject();
|
||||
String s = account + serverId + itemId + count + time + Constant.AIKEN_SERVER_KEY;
|
||||
String mySign = MD5Util.encrypByMd5(s);
|
||||
if (!mySign.equals(verify)){
|
||||
json.put("code", "3");
|
||||
json.put("msg", "verify error");
|
||||
return json;
|
||||
}
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error");
|
||||
json.put("code", "99");
|
||||
json.put("msg", "server error");
|
||||
return json;
|
||||
}
|
||||
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("uid", Integer.parseInt(roleId)));
|
||||
CoreUserInfo userInfo = mongoTemplate.findOne(query, CoreUserInfo.class, "user_info");
|
||||
if (userInfo == null){
|
||||
LOGGER.error("user not exist, uid:{}", roleId);
|
||||
json.put("code", "1");
|
||||
json.put("msg", "account not exist");
|
||||
return json;
|
||||
}
|
||||
BasicQuery query1 = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query1, ServerInfo.class, "server_info");
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverInfo.getRealServerId()), String.class, -1);
|
||||
System.out.println("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", "99");
|
||||
json.put("msg", "server error");
|
||||
return json;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", "99");
|
||||
json.put("msg", "server error");
|
||||
return json;
|
||||
} else {
|
||||
StringBuilder reward = new StringBuilder();
|
||||
reward.append(itemId).append("#").append(count);
|
||||
String title = "艾肯道具发放";
|
||||
String content = "艾肯道具发放";
|
||||
Result result = null;
|
||||
try {
|
||||
result = RPCClient.sendMailToRole(thriftIp, thriftPort, roleId, title, content, reward.toString());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("addItem error, player_id:{}", roleId, e);
|
||||
json.put("code", "99");
|
||||
json.put("msg", "server error");
|
||||
return json;
|
||||
}
|
||||
if (result.getResultCode() != 1) {
|
||||
LOGGER.error("addItem error, player_id:{}", roleId);
|
||||
json.put("code", "99");
|
||||
json.put("msg", "server error");
|
||||
} else {
|
||||
LOGGER.info("addItem " + roleId + " is ok ");
|
||||
json.put("code", "0");
|
||||
json.put("msg", "");
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@PostMapping("/ican/user")
|
||||
public JSONObject queryUser(String account, String serverId, String time, String verify){
|
||||
LOGGER.info("ican query user, account:{}, serverId:{}, verify:{}", account, serverId, verify);
|
||||
JSONObject json = new JSONObject();
|
||||
String s = account + serverId + time + Constant.AIKEN_SERVER_KEY;
|
||||
String mySign = MD5Util.encrypByMd5(s);
|
||||
if (!mySign.equals(verify)){
|
||||
json.put("code", "3");
|
||||
json.put("msg", "verify error");
|
||||
return json;
|
||||
}
|
||||
JSONObject user = new JSONObject();
|
||||
try {
|
||||
user = getRoleById(account, serverId);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("ican query user error, account:{}, serverId:{}", account, serverId, e);
|
||||
json.put("code", "99");
|
||||
json.put("msg", "server error");
|
||||
return json;
|
||||
}
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(user);
|
||||
json.put("code", "0");
|
||||
json.put("roles", jsonArray);
|
||||
return json;
|
||||
}
|
||||
|
||||
@PostMapping( "/ican/pay")//艾肯sdk
|
||||
public JSONObject iCanWebOrder(@RequestParam("account") String account,
|
||||
@RequestParam("serverId") String serverId,
|
||||
@RequestParam("orderId") String orderId,
|
||||
@RequestParam("itemId") String itemId,
|
||||
@RequestParam("productId") String productId,
|
||||
@RequestParam("iMoney") Integer iMoney,
|
||||
@RequestParam("gMoney") Integer gMoney,
|
||||
@RequestParam("roleId") String roleId,
|
||||
@RequestParam("time") String time,
|
||||
@RequestParam("verify") String verify,
|
||||
@RequestParam("platform") String platform
|
||||
) {
|
||||
LOGGER.info("iCan web pay order, account:{}, serverId:{}, orderId:{}, itemId:{}, productId:{}, iMoney:{}, gMoney:{}, roleId:{}, time:{}",
|
||||
account, serverId, orderId, itemId, productId, iMoney, gMoney, roleId, time);
|
||||
JSONObject returnJb = new JSONObject();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(account).append(itemId).append(orderId).append(iMoney).append(Constant.AIKEN_SERVER_KEY).append(time).append(roleId);
|
||||
try {
|
||||
String mySign = encrypByMd5(sb.toString());
|
||||
if (!mySign.equals(verify)){
|
||||
LOGGER.error("iCan order sign verify fail, orderId:{}, roleId:{}",
|
||||
orderId, roleId);
|
||||
returnJb.put("code", "3");
|
||||
returnJb.put("msg", "verify error");
|
||||
return returnJb;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("iCan order sign error, orderId:{}, roleId:{}", orderId, roleId, e);
|
||||
returnJb.put("code", "3");
|
||||
returnJb.put("msg", "verify error");
|
||||
return returnJb;
|
||||
}
|
||||
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error");
|
||||
returnJb.put("status", "fail");
|
||||
returnJb.put("code", "99");
|
||||
returnJb.put("msg", "server error");
|
||||
return returnJb;
|
||||
}
|
||||
if (!StringUtil.isEmpty(productId)){
|
||||
itemId = productId;
|
||||
}
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("server_id", serverId));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query, ServerInfo.class, "server_info");
|
||||
PayVo payVo = null;
|
||||
try {
|
||||
payVo = payDao.getOder(orderId);
|
||||
if (payVo != null){
|
||||
if (payVo.getStatus() == 1){
|
||||
LOGGER.error("order already paid, orderNo:{}", orderId);
|
||||
returnJb.put("status", "fail");
|
||||
returnJb.put("code", "0");
|
||||
returnJb.put("msg", "order duplicate");
|
||||
return returnJb;
|
||||
}
|
||||
}else {
|
||||
CoreUserInfo userInfo = mongoTemplate.findById(Integer.parseInt(roleId), CoreUserInfo.class);
|
||||
payVo = new PayVo(userInfo.getOpenId(), Integer.parseInt(roleId), serverInfo.getRealServerId(), platform, itemId, TimeUtil.getTimeStamp(System.currentTimeMillis()), iMoney * 100 ,"NT");
|
||||
payVo.setBillno(orderId);
|
||||
mongoTemplate.insert(payVo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get order error, orderNo:{}", orderId, e);
|
||||
returnJb.put("status", "fail");
|
||||
returnJb.put("code", "99");
|
||||
returnJb.put("message", "server error");
|
||||
return returnJb;
|
||||
}
|
||||
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverInfo.getRealServerId()), String.class, -1);
|
||||
System.out.println("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
returnJb.put("status", "fail");
|
||||
returnJb.put("code", "99");
|
||||
returnJb.put("msg", "server error");
|
||||
return returnJb;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
returnJb.put("status", "fail");
|
||||
returnJb.put("code", "99");
|
||||
returnJb.put("msg", "server error");
|
||||
} else {
|
||||
Result result = null;
|
||||
try {
|
||||
result = RPCClient.deliveryRecharge(thriftIp, thriftPort, Integer.parseInt(roleId), itemId, "", orderId, System.currentTimeMillis(), iMoney * 100, platform);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("pay error, orderNo:{}", orderId, e);
|
||||
returnJb.put("code", "99");
|
||||
returnJb.put("msg", "server error");
|
||||
return returnJb;
|
||||
}
|
||||
|
||||
if (result.getResultCode() == 1){
|
||||
payVo.setStatus(1);
|
||||
try {
|
||||
payDao.upOder(payVo);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("update order status error, orderNo:{}", orderId, e);
|
||||
}
|
||||
LOGGER.info("orderNo:{} pay success", orderId);
|
||||
returnJb.put("status", "ok");
|
||||
returnJb.put("code", "0");
|
||||
returnJb.put("msg", "success");
|
||||
}else {
|
||||
LOGGER.error("orderNo:{} pay fail", orderId);
|
||||
returnJb.put("status", "fail");
|
||||
returnJb.put("code", "99");
|
||||
returnJb.put("msg", "server error");
|
||||
}
|
||||
}
|
||||
return returnJb;
|
||||
}
|
||||
|
||||
|
||||
private JSONObject getRoleById(String account, String serverId) throws Exception {
|
||||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
RegisterUser registerUser = mongoTemplate.findById(account, RegisterUser.class);
|
||||
String[] split = serverId.split("Y");
|
||||
BasicDBObject basicDBObject = new BasicDBObject();
|
||||
basicDBObject.put("openId", registerUser.getOpenId());
|
||||
basicDBObject.put("area", Integer.parseInt(split[1]));
|
||||
basicDBObject.put("serverId", split[0]);
|
||||
CoreUserInfo userInfo = mongoTemplate.findOne(new BasicQuery(basicDBObject), CoreUserInfo.class, "user_info");
|
||||
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query, ServerInfo.class, "server_info");
|
||||
MongoTemplate gameMongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(DB_NAME_PREFIX + serverInfo.getRealServerId());
|
||||
User user = gameMongoTemplate.findById(userInfo.getUid(), User.class, "user");
|
||||
if (user == null){
|
||||
return new JSONObject();
|
||||
}
|
||||
return getJsonUser(user);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "10002Y3";
|
||||
String[] ys = s.split("Y");
|
||||
System.out.println(Arrays.toString(ys));
|
||||
}
|
||||
|
||||
private JSONObject getJsonUser(User user) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("roleId", user.getId());
|
||||
jsonObject.put("roleName", user.getPlayerManager().getNickName());
|
||||
jsonObject.put("level", user.getPlayerManager().getLevel());
|
||||
jsonObject.put("gMoneyTotal", user.getPlayerManager().getRechargeInfo().getSaveAmt());
|
||||
jsonObject.put("createTime", user.getPlayerManager().getCreateTime());
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.ManagerManager;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
|
||||
@RestController
|
||||
public class ManagerController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ManagerController.class);
|
||||
|
||||
|
||||
@RequestMapping(value = "/deal/{uri}", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public BaseVo getResult(@PathVariable String uri, HttpServletRequest request) {
|
||||
try {
|
||||
JSONObject jsonObject = getJsonObject(request);
|
||||
if (null == jsonObject) {
|
||||
throw new Exception("查询异常 ");
|
||||
}
|
||||
BaseHandler baseHandler = ManagerManager.getInstance().getBaseHandler(uri);
|
||||
if (null != baseHandler) {
|
||||
if (jsonObject.containsKey("gid") && jsonObject.containsKey("pid")) {
|
||||
baseHandler.setGid(jsonObject.getIntValue("gid"));
|
||||
baseHandler.setPid(jsonObject.getIntValue("pid"));
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
BaseVo result = baseHandler.execute(jsonObject);
|
||||
if (null == result) {
|
||||
throw new Exception("查询异常 ");
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
throw new Exception("请求地址错误");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(String.valueOf(e));
|
||||
e.printStackTrace();
|
||||
BaseVo baseVo = new BaseVo();
|
||||
baseVo.setState(0);
|
||||
baseVo.setMsg(String.valueOf(e.getMessage()).substring(0, Math.min(e.getMessage().length(), 20)));
|
||||
return baseVo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
JSONObject getJsonObject(HttpServletRequest request) throws Exception {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (request.getMethod().equals("GET")) {
|
||||
String paramStr = request.getQueryString();
|
||||
if (null == paramStr) {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String[] params = paramStr.split("&");
|
||||
for (int i = 0; i < params.length; i++) {
|
||||
String[] param = params[i].split("=");
|
||||
if (param.length >= 2) {
|
||||
String key = param[0];
|
||||
String value = param[1];
|
||||
for (int j = 2; j < param.length; j++) {
|
||||
value += "=" + param[j];
|
||||
}
|
||||
try {
|
||||
jsonObject.put(key, value);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ServletInputStream inputStream = request.getInputStream();
|
||||
String s = IOUtils.toString(inputStream);
|
||||
String s1 = URLDecoder.decode(s, "UTF-8");
|
||||
jsonObject = JSON.parseObject(s1);
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
HashMap<String, String> getParameterMap(HttpServletRequest request) {
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter : " + paramName + "=" + paramValue);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* time | dsid | sign | appkey
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/backc")
|
||||
public BaseVo backC(HttpServletRequest request) {
|
||||
try {
|
||||
JSONObject jsonObject = getJsonObject(request);
|
||||
|
||||
BaseHandler handler = ManagerManager.getInstance().getBaseHandler("gm");
|
||||
BaseVo result = handler.execute(jsonObject);
|
||||
if (null == result) {
|
||||
throw new Exception("查询异常 ");
|
||||
}
|
||||
|
||||
LOGGER.info(result.getMsg());
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
BaseVo baseVo = new BaseVo();
|
||||
baseVo.setState(0);
|
||||
baseVo.setMsg(String.valueOf(e.getMessage()).substring(0, Math.min(e.getMessage().length(), 20)));
|
||||
LOGGER.info(baseVo.getMsg());
|
||||
return baseVo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// public BaseVo gmSend(HttpServletRequest request) {
|
||||
// try {
|
||||
// JSONObject jsonObject = getJsonObject(request);
|
||||
// BaseHandler handler = ManagerManager.getInstance().getBaseHandler("gm");
|
||||
// BaseVo result = handler.execute(jsonObject);
|
||||
// if (null == result) {
|
||||
// throw new Exception("查询异常 ");
|
||||
// }
|
||||
// return result;
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// BaseVo baseVo = new BaseVo();
|
||||
// baseVo.setState(0);
|
||||
// baseVo.setMsg(String.valueOf(e.getMessage()).substring(0, Math.min(e.getMessage().length(), 20)));
|
||||
// return baseVo;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,409 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.sdk.HmacSHA1Encryption;
|
||||
import com.jmfy.sdk.HttpUtil;
|
||||
import com.jmfy.sdk.ParamUtil;
|
||||
import com.jmfy.util.Constant;
|
||||
import com.jmfy.util.MD5Util;
|
||||
import com.jmfy.util.RPCClient;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject;
|
||||
import com.mongodb.WriteResult;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.BasicQuery;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.core.query.Update;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import static com.jmfy.util.MD5Util.encrypByMd5;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qipa")
|
||||
public class QiPaController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(QiPaController.class);
|
||||
private static final int DIAMOND_ITEM_ID = 16;
|
||||
|
||||
@Resource
|
||||
private MongoConnectDao mongoConnectDao;
|
||||
|
||||
|
||||
@GetMapping("/rebate")
|
||||
public JSONObject rebate(@RequestParam("rebate_type") Integer rebateType,
|
||||
@RequestParam("rebate_no") Integer rebateNo,
|
||||
@RequestParam("game_order_no") String gameOrderNo,
|
||||
@RequestParam("user_id") String userId,
|
||||
@RequestParam("pay_money") String payMoney,
|
||||
@RequestParam("gold") Integer gold,
|
||||
@RequestParam("game_id") Integer gameId,
|
||||
@RequestParam("service_id") String serviceId,
|
||||
@RequestParam("role_id") String roleId,
|
||||
@RequestParam("role_name") String roleName,
|
||||
@RequestParam("time") String time,
|
||||
@RequestParam("sign") String sign){
|
||||
LOGGER.info("rebate, role_id:{}, gold:{}", roleId, gold);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try {
|
||||
sb.append(rebateType);
|
||||
sb.append(rebateNo);
|
||||
sb.append(URLEncoder.encode(gameOrderNo, "utf-8"));
|
||||
sb.append(URLEncoder.encode(userId, "utf-8"));
|
||||
sb.append(payMoney);
|
||||
sb.append(gold);
|
||||
sb.append(gameId);
|
||||
sb.append(URLEncoder.encode(serviceId, "utf-8"));
|
||||
sb.append(URLEncoder.encode(roleId, "utf-8"));
|
||||
sb.append(time);
|
||||
sb.append(Constant.SUPER_ORDER_KEY);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
LOGGER.error("URLEncoder error, role_id:{}, rebate_no:{}", roleId, rebateNo, e);
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
String mySign = encrypByMd5(sb.toString());
|
||||
if (!mySign.equals(sign)){
|
||||
LOGGER.error("qipa rebate sign error, role_id:{}, rebate_no:{}, sign:{}, mySign:{}",
|
||||
roleId, rebateNo, sign, mySign);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "sign error");
|
||||
return json;
|
||||
}
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error");
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("uid", Integer.parseInt(roleId)));
|
||||
CoreUserInfo userInfo = mongoTemplate.findOne(query, CoreUserInfo.class, "user_info");
|
||||
if (userInfo == null){
|
||||
LOGGER.error("user not exist, uid:{}", roleId);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "user not exist");
|
||||
return json;
|
||||
}
|
||||
BasicQuery query1 = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query1, ServerInfo.class, "server_info");
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverInfo.getRealServerId()), String.class, -1);
|
||||
System.out.println("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
return json;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
return json;
|
||||
} else {
|
||||
String title = "充值返利邮件";
|
||||
String content = "充值已触达返利要求,奖励如下,请查收";
|
||||
String reward = DIAMOND_ITEM_ID + "#" + gold;
|
||||
Result result = null;
|
||||
try {
|
||||
result = RPCClient.sendMailToRole(thriftIp, thriftPort, roleId, title, content, reward);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("rebate error, role_id:{}, rebate_no:{}", roleId, rebateNo, e);
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
if (result.getResultCode() != 1) {
|
||||
LOGGER.error("rebate error, role_id:{}, rebate_no:{}", roleId, rebateNo);
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
} else {
|
||||
LOGGER.info("rebate " + rebateNo + " is ok ");
|
||||
json.put("code", 200);
|
||||
json.put("msg", "success");
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@PostMapping("/addItem")
|
||||
public JSONObject addItem(@RequestParam("active_id") Integer activeId,
|
||||
@RequestParam("is_freee") Integer isFreee,
|
||||
@RequestParam("money") Integer money,
|
||||
@RequestParam("title") String title,
|
||||
@RequestParam("content") String content,
|
||||
@RequestParam("player_id") String playerId,
|
||||
@RequestParam("server_id") String serverId,
|
||||
@RequestParam("item") String item,
|
||||
@RequestParam("sign") String sign){
|
||||
|
||||
LOGGER.info("addItem, player_id:{}, item:{}", playerId, item);
|
||||
JSONObject json = new JSONObject();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(activeId);
|
||||
sb.append(isFreee);
|
||||
sb.append(money);
|
||||
sb.append(title);
|
||||
sb.append(content);
|
||||
sb.append(playerId);
|
||||
sb.append(serverId);
|
||||
sb.append(Constant.SUPER_ITEM_KEY);
|
||||
|
||||
String mySign = encrypByMd5(sb.toString());
|
||||
if (!mySign.equals(sign)){
|
||||
LOGGER.error("qipa addItem sign error, player_id:{}, active_id:{}, sign:{}, mySign:{}",
|
||||
playerId, activeId, sign, mySign);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "sign error");
|
||||
return json;
|
||||
}
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error");
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("uid", Integer.parseInt(playerId)));
|
||||
CoreUserInfo userInfo = mongoTemplate.findOne(query, CoreUserInfo.class, "user_info");
|
||||
if (userInfo == null){
|
||||
LOGGER.error("user not exist, uid:{}", playerId);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "user not exist");
|
||||
return json;
|
||||
}
|
||||
BasicQuery query1 = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query1, ServerInfo.class, "server_info");
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverInfo.getRealServerId()), String.class, -1);
|
||||
System.out.println("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
return json;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
return json;
|
||||
} else {
|
||||
JSONArray jsonArray = JSON.parseArray(item);
|
||||
StringBuilder reward = new StringBuilder();
|
||||
for (Object object : jsonArray) {
|
||||
String itemId = ((JSONObject) object).getString("mid");
|
||||
int amount = ((JSONObject) object).getIntValue("amount");
|
||||
if (reward.length() != 0){
|
||||
reward.append("|");
|
||||
}
|
||||
reward.append(itemId).append("#").append(amount);
|
||||
}
|
||||
Result result = null;
|
||||
try {
|
||||
result = RPCClient.sendMailToRole(thriftIp, thriftPort, playerId, title, content, reward.toString());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("addItem error, player_id:{}, active_id:{}", playerId, activeId, e);
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
if (result.getResultCode() != 1) {
|
||||
LOGGER.error("addItem error, player_id:{}, active_id:{}", playerId, activeId);
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
} else {
|
||||
LOGGER.info("addItem " + activeId + " is ok ");
|
||||
json.put("code", 200);
|
||||
json.put("msg", "success");
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@GetMapping("/operate")
|
||||
public JSONObject operateUser(@RequestParam("userId") String userId,
|
||||
@RequestParam("roleId") String roleId,
|
||||
@RequestParam("roleName") String roleName,
|
||||
@RequestParam("gameId") Integer gameId,
|
||||
@RequestParam("serviceId") String serviceId,
|
||||
@RequestParam("opStatus") Integer opStatus,
|
||||
@RequestParam("shutupTime") Long shutupTime,
|
||||
@RequestParam("chatContents") String chatContents,
|
||||
@RequestParam("random") String random,
|
||||
@RequestParam("sign") String sign){
|
||||
|
||||
LOGGER.info("operate, roleId:{}, opStatus:{}", roleId, opStatus);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
try {
|
||||
sb.append(userId);
|
||||
sb.append(roleId);
|
||||
sb.append(URLEncoder.encode(roleName, "utf-8").toLowerCase());
|
||||
sb.append(gameId);
|
||||
sb.append(serviceId);
|
||||
sb.append(opStatus);
|
||||
sb.append(shutupTime);
|
||||
sb.append(URLEncoder.encode(chatContents, "utf-8").toLowerCase());
|
||||
sb.append(random);
|
||||
sb.append(Constant.SUPER_ORDER_KEY);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
LOGGER.error("URLEncoder error, role_id:{}", roleId,e);
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
|
||||
String mySign = encrypByMd5(sb.toString());
|
||||
if (!mySign.equals(sign)){
|
||||
LOGGER.error("qipa operate user sign error, roleId:{}, sign:{}, mySign:{}",
|
||||
roleId, sign, mySign);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "sign error");
|
||||
return json;
|
||||
}
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error");
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("uid", Integer.parseInt(roleId)));
|
||||
CoreUserInfo userInfo = mongoTemplate.findOne(query, CoreUserInfo.class, "user_info");
|
||||
if (userInfo == null){
|
||||
LOGGER.error("user not exist, uid:{}", roleId);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "user not exist");
|
||||
return json;
|
||||
}
|
||||
BasicQuery query1 = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query1, ServerInfo.class, "server_info");
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverInfo.getRealServerId()), String.class, -1);
|
||||
System.out.println("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
return json;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
return json;
|
||||
} else {
|
||||
Result result = null;
|
||||
try {
|
||||
result = RPCClient.operateUser(thriftIp, thriftPort, Integer.parseInt(roleId), opStatus);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("operate user error, player_id:{}", roleId, e);
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
if (result.getResultCode() != 1) {
|
||||
LOGGER.error("operate user error, player_id:{}", roleId);
|
||||
json.put("code", 601);
|
||||
json.put("msg", "rebate error");
|
||||
} else {
|
||||
LOGGER.info("operate user " + roleId + " is ok ");
|
||||
json.put("code", 200);
|
||||
json.put("msg", "success");
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@PostMapping("/openTime")
|
||||
public JSONObject openTime(@RequestParam("server_id") String serverId,
|
||||
@RequestParam("open_time") String openTime,
|
||||
@RequestParam("token") String token){
|
||||
JSONObject json = new JSONObject();
|
||||
String mySign = encrypByMd5(Constant.SUPER_ITEM_KEY);
|
||||
if (!mySign.equals(token)){
|
||||
LOGGER.error("qipa operate user sign error, serverId:{}, sign:{}, mySign:{}",
|
||||
serverId, token, mySign);
|
||||
json.put("code", 600);
|
||||
json.put("msg", "sign error");
|
||||
return json;
|
||||
}
|
||||
LOGGER.info("update server open time, serverId:{}, openTime:{}", serverId, openTime);
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error", e);
|
||||
json.put("code", 500);
|
||||
json.put("msg", "system error");
|
||||
return json;
|
||||
}
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("server_id", serverId+""));
|
||||
Update update = new Update();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = null;
|
||||
try {
|
||||
date = sdf.parse(openTime);
|
||||
} catch (ParseException e) {
|
||||
LOGGER.error("openTime parse error", e);
|
||||
json.put("code", 501);
|
||||
json.put("msg", "openTime parse error");
|
||||
return json;
|
||||
}
|
||||
update.set("open_time", String.valueOf(date.getTime()));
|
||||
WriteResult writeResult = mongoTemplate.updateFirst(query, update, "server_info");
|
||||
if (writeResult.isUpdateOfExisting()){
|
||||
json.put("code", 1);
|
||||
json.put("msg", "更新开服成功");
|
||||
LOGGER.info("update server open time success, serverId:{}, openTime:{}", serverId, openTime);
|
||||
}else {
|
||||
json.put("code", 601);
|
||||
json.put("msg", "更新开服失败");
|
||||
LOGGER.info("update server open time fail, serverId:{}, openTime:{}", serverId, openTime);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.dao.UserVerfyDao;
|
||||
import com.jmfy.sdk.SdkVerfy;
|
||||
import com.jmfy.util.Constant;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
public class SDKController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SDKController.class);
|
||||
|
||||
@Resource
|
||||
private UserVerfyDao userVerfyDao;
|
||||
|
||||
/**
|
||||
* sdk统一登录接口
|
||||
* 验证用户信息接口
|
||||
* @param userId
|
||||
* @param channel
|
||||
* @param sdksign
|
||||
* @param sdktoken
|
||||
* @param response
|
||||
*/
|
||||
@RequestMapping(value = "/sdk/verify", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public void verify(String userId, String channel, String sdksign, String sdktoken, HttpServletResponse response) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("uid", userId);
|
||||
params.put("channel", channel);
|
||||
params.put("sign", sdksign);
|
||||
params.put("token", sdktoken);
|
||||
JSONObject returnResult = new JSONObject();
|
||||
LOGGER.info("verify参数:userId={},channel={},sdksign={},sdktoken={}",userId,channel,sdksign,sdktoken);
|
||||
if (channel == null) {
|
||||
returnResult.put("errcode", -2);
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(returnResult.toJSONString().getBytes());
|
||||
return;
|
||||
}
|
||||
|
||||
int channelType = 0; //区分渠道
|
||||
String uid = "-1";
|
||||
switch (channel) {
|
||||
case "test":
|
||||
uid = SdkVerfy.testVerfy();
|
||||
break;
|
||||
case "quick":
|
||||
uid = SdkVerfy.quickVerfy(userId, sdktoken);
|
||||
break;
|
||||
case "xiaomi":
|
||||
uid = SdkVerfy.xiaomiVerfy(userId, sdktoken);
|
||||
break;
|
||||
case "weiwei":
|
||||
uid = SdkVerfy.weiweiVerfy(userId, sdktoken);
|
||||
break;
|
||||
case "Android_9377":
|
||||
uid = SdkVerfy.weiwei4366Verfy(userId, sdktoken);
|
||||
break;
|
||||
case "Android_ChiTu": //赤兔
|
||||
uid = SdkVerfy.chiTuVerfy(userId,sdksign, sdktoken);
|
||||
break;
|
||||
case "Android_ilod": //韩国正式
|
||||
case "Android_ilod_OneStore": //韩国正式 OneStore渠道
|
||||
case "Android_ilod_OneStoreCB": //韩国正式 CB不开支付
|
||||
case "iOS_ilod": //韩国正式 iOS渠道
|
||||
channelType = 1;
|
||||
uid = SdkVerfy.ilodVerfy(userId,sdksign, sdktoken);
|
||||
break;
|
||||
case "baidu": //百度正式之前
|
||||
uid = SdkVerfy.baiduVerfy(userId, sdktoken, sdksign);
|
||||
break;
|
||||
case "Android_BaiDu": //百度正式 现在
|
||||
case "iOS_BaiDu":
|
||||
uid = SdkVerfy.baiduVerfy(userId, sdktoken, sdksign);
|
||||
break;
|
||||
case "iOS_BaiDu_Test": //百度测试 现在
|
||||
uid = SdkVerfy.baiduTestVerfy(userId, sdktoken, sdksign);
|
||||
break;
|
||||
case "6kwOther":
|
||||
uid = SdkVerfy.sixkwVerfy(userId, sdktoken, Constant.SIXKW_APPID, Constant.SIXKW_VERIFY_URL, Constant.SIXKW_SECRET);
|
||||
break;
|
||||
case "6kw":
|
||||
uid = SdkVerfy.sixkwVerfy(userId, sdktoken, Constant.SIXKW_MAIN_APPID, Constant.SIXKW_VERIFY_URL, Constant.SIXKW_MAIN_LOGIN_SECRET);
|
||||
break;
|
||||
case "Android_QuickGame": //国内--时空战场 Android
|
||||
case "Android_QuickGame_douyin":
|
||||
uid = SdkVerfy.quickGameVerfy(userId,sdksign, sdktoken);
|
||||
break;
|
||||
case "iOS_QuickGame": //国内--时空战场 IOS
|
||||
uid = SdkVerfy.quickGameVerfy_IOS(userId,sdksign, sdktoken);
|
||||
break;
|
||||
case "Android_99": //国内--九九互动渠道Android_99
|
||||
case "Android_99_Child": //国内--九九互动渠道Android_99_Child
|
||||
case "Android_99_Child2": //国内--九九互动渠道Android_99_Child2
|
||||
case "Android_99_Child3": //国内--九九互动渠道Android_99_Child3
|
||||
case "Android_99_Child4": //国内--九九互动渠道Android_99_Child4
|
||||
uid = SdkVerfy.jjChannelVerfy(userId,sdksign,sdktoken); //sdksign 客户端 这个值传的是 appid值,因为appid值是变动的,所以需要客户端传
|
||||
break;
|
||||
case "Android_ChangWei": //长尾渠道 安卓
|
||||
case "iOS_ChangWei": //长尾渠道 IOS
|
||||
uid = SdkVerfy.changWeiGameVerify(userId,sdksign,sdktoken);
|
||||
break;
|
||||
case "Android_XiaoQi"://xiao7渠道
|
||||
uid = SdkVerfy.xiaoQiVerify(sdktoken, returnResult);
|
||||
break;
|
||||
case "Android_AiKen"://艾肯渠道安卓
|
||||
uid = SdkVerfy.aikenVerify(sdktoken);
|
||||
break;
|
||||
case "iOS_AiKen"://艾肯渠道ios
|
||||
uid = SdkVerfy.aikenVerify(sdktoken);
|
||||
break;
|
||||
case "Android_AiKen_Child1"://艾肯渠道
|
||||
uid = SdkVerfy.aikenVerify(sdktoken);
|
||||
break;
|
||||
case "Android_Tap"://千千官方
|
||||
uid = SdkVerfy.qianqianVerify(userId, sdktoken);
|
||||
break;
|
||||
case "Android_Tap_Quick"://千千quick
|
||||
uid = SdkVerfy.quickVerify(userId, sdktoken);
|
||||
break;
|
||||
case "Android_Ky_Quick"://0.1折
|
||||
uid = SdkVerfy.quickVerify2(userId, sdktoken);
|
||||
break;
|
||||
case "iOS_Ky_Quick"://0.1折
|
||||
uid = SdkVerfy.quickVerify2(userId, sdktoken);
|
||||
break;
|
||||
default:
|
||||
uid = "-1";
|
||||
}
|
||||
if(channelType ==1){ //韩服
|
||||
LOGGER.info("verify02参数: channel={}, uid={}", channel,uid);
|
||||
if(uid.equals("0") || uid.equals("-1") || uid.equals("-2") || uid.equals("-3") || uid == null){
|
||||
String errMessage = "登录验证失败";
|
||||
switch (uid){
|
||||
case "0":
|
||||
errMessage = "请求参数有误"; //body中有数据遗漏时。请求HTTP时请确认projectId、memberId、token是否已全部输入
|
||||
break;
|
||||
case "-1":
|
||||
errMessage = "登录token验证失败"; //Token验证失败。Token被伪造时
|
||||
break;
|
||||
case "-2":
|
||||
errMessage = "MemberId验证失败"; //MemberId验证失败.Token的用户ID信息与body的用户ID不一致时
|
||||
break;
|
||||
case "-3":
|
||||
errMessage = "Token到期"; //Token到期. SDK login api成功的时间与请求相应Authentication check的时间相差60分钟以上时
|
||||
break;
|
||||
default:
|
||||
errMessage = "登录验证失败";
|
||||
}
|
||||
|
||||
returnResult.put("errcode", -1);
|
||||
returnResult.put("errMessage", errMessage);
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(returnResult.toJSONString().getBytes());
|
||||
return;
|
||||
}
|
||||
}else { //非韩服
|
||||
if (uid.equals("-1") ||uid == null ) {
|
||||
returnResult.put("errcode", -1);
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(returnResult.toJSONString().getBytes());
|
||||
return;
|
||||
}
|
||||
}
|
||||
LOGGER.info("verify03参数: channel={},uid={}",channel, uid);
|
||||
String name = uid;
|
||||
String openId = userVerfyDao.verfyUser(name);
|
||||
//登录流程
|
||||
returnResult.put("openId", openId);
|
||||
returnResult.put("guid", uid);
|
||||
String token = UUID.randomUUID().toString();
|
||||
returnResult.put("token", token);
|
||||
RedisUtil.getInstence().putObject("JL_LOGIN_TOKEN", openId, token, -1);
|
||||
LOGGER.info("verify04参数: channel={}, openId={} token={},uid={}", channel, returnResult.get("openId"), returnResult.get("token"),uid);
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(returnResult.toJSONString().getBytes());
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("sdk verify error ",e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
byte[] bytes = UUID.randomUUID().toString().getBytes();
|
||||
System.out.println(bytes.length);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.ManagerManager;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
|
||||
@RestController
|
||||
public class SDKManagerController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SDKManagerController.class);
|
||||
|
||||
|
||||
@RequestMapping(value = "/xiaomi/all/{uri}", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public BaseVo getResult(@PathVariable String uri, HttpServletRequest request) {
|
||||
try {
|
||||
JSONObject jsonObject = getJsonObject(request);
|
||||
if (null == jsonObject) {
|
||||
throw new Exception("查询异常 ");
|
||||
}
|
||||
BaseHandler baseHandler = ManagerManager.getInstance().getBaseHandler(uri);
|
||||
if (null != baseHandler) {
|
||||
BaseVo result = baseHandler.execute(jsonObject);
|
||||
if (null == result) {
|
||||
throw new Exception("查询异常 ");
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
throw new Exception("请求地址错误");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(String.valueOf(e));
|
||||
e.printStackTrace();
|
||||
BaseVo baseVo = new BaseVo();
|
||||
baseVo.setState(0);
|
||||
baseVo.setMsg(String.valueOf(e.getMessage()).substring(0, Math.min(e.getMessage().length(), 20)));
|
||||
return baseVo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
JSONObject getJsonObject(HttpServletRequest request) throws Exception {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (request.getMethod().equals("GET")) {
|
||||
String paramStr = request.getQueryString();
|
||||
if (null == paramStr) {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String[] params = paramStr.split("&");
|
||||
for (int i = 0; i < params.length; i++) {
|
||||
String[] param = params[i].split("=");
|
||||
if (param.length >= 2) {
|
||||
String key = param[0];
|
||||
String value = param[1];
|
||||
for (int j = 2; j < param.length; j++) {
|
||||
value += "=" + param[j];
|
||||
}
|
||||
try {
|
||||
jsonObject.put(key, value);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ServletInputStream inputStream = request.getInputStream();
|
||||
String s = IOUtils.toString(inputStream);
|
||||
String s1 = URLDecoder.decode(s, "UTF-8");
|
||||
jsonObject = JSON.parseObject(s1);
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
HashMap<String, String> getParameterMap(HttpServletRequest request) {
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter : " + paramName + "=" + paramValue);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,499 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.model.User;
|
||||
import com.jmfy.model.sdk.RegisterUser;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.Constant;
|
||||
import com.jmfy.util.RPCClient;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import com.ljsd.jieling.thrift.idl.ItemConfig;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.BasicQuery;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.Signature;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
public class XiaoQiController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(XiaoQiController.class);
|
||||
private static final String DB_NAME_PREFIX = "x1_xq_game_";
|
||||
|
||||
|
||||
@Resource
|
||||
private MongoConnectDao mongoConnectDao;
|
||||
|
||||
@PostMapping("/x7/role")
|
||||
public JSONObject queryRole(String bizParams, String apiMethod, String reqTime, String appkey, String gameType,
|
||||
String signature) throws Exception {
|
||||
LOGGER.info("x7 query role, bizParams:{}, apiMethod:{}, reqTime:{}, appkey:{}, gameType:{}, signature:{}",
|
||||
bizParams, apiMethod, reqTime, appkey, gameType, signature);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("apiMethod", apiMethod);
|
||||
jsonObject.put("appkey", appkey);
|
||||
jsonObject.put("gameType", gameType);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ");
|
||||
String respTime = df.format(new Date());
|
||||
jsonObject.put("respTime", respTime);
|
||||
JSONObject respJsonObject = new JSONObject();
|
||||
try {
|
||||
String reqPayload = getPayload(apiMethod, appkey, gameType, reqTime, bizParams);
|
||||
byte[] keyBytes = Base64.decodeBase64(Constant.X7_PUBLIC_KEY);
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey publicK = keyFactory.generatePublic(keySpec);
|
||||
//SIGNATURE_ALGORITHM
|
||||
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||
sign.initVerify(publicK);
|
||||
sign.update(reqPayload.getBytes());
|
||||
boolean verify = sign.verify(Base64.decodeBase64(signature));
|
||||
if (!verify){
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "Signature verify fail");
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, reqTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
JSONObject reqParam = JSON.parseObject(bizParams);
|
||||
String roleId = reqParam.getString("roleId");
|
||||
String[] guids = null;
|
||||
JSONArray guidArray = reqParam.getJSONArray("guids");
|
||||
if (guidArray != null){
|
||||
guids = guidArray.toJavaObject(String[].class);
|
||||
}
|
||||
String serverId = reqParam.getString("serverId");
|
||||
JSONObject role = new JSONObject();
|
||||
JSONArray guidRoles = new JSONArray();
|
||||
if (roleId != null && !roleId.isEmpty()){
|
||||
role = getRoleById(roleId);
|
||||
}
|
||||
if (guids != null && guids.length > 0 && serverId != null && !serverId.isEmpty()){
|
||||
guidRoles = getRolesByIds(guids, serverId);
|
||||
}
|
||||
respJsonObject.put("respCode", "SUCCESS");
|
||||
respJsonObject.put("respMsg", "SUCCESS");
|
||||
respJsonObject.put("role", role);
|
||||
respJsonObject.put("guidRoles", guidRoles);
|
||||
LOGGER.info("x7 query role success, role:{}, guidRoles:{}", role, guidRoles);
|
||||
}catch (Exception e){
|
||||
LOGGER.error("x7 query role error, bizParams:{}", bizParams, e);
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "system error");
|
||||
}
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, respTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@PostMapping("/x7/role/2")
|
||||
public JSONObject queryRole2(String bizParams, String apiMethod, String reqTime, String appkey, String gameType,
|
||||
String signature) throws Exception {
|
||||
LOGGER.info("x7 query role2, bizParams:{}, apiMethod:{}, reqTime:{}, appkey:{}, gameType:{}, signature:{}",
|
||||
bizParams, apiMethod, reqTime, appkey, gameType, signature);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("apiMethod", apiMethod);
|
||||
jsonObject.put("appkey", appkey);
|
||||
jsonObject.put("gameType", gameType);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ");
|
||||
String respTime = df.format(new Date());
|
||||
jsonObject.put("respTime", respTime);
|
||||
JSONObject respJsonObject = new JSONObject();
|
||||
try {
|
||||
String reqPayload = getPayload(apiMethod, appkey, gameType, reqTime, bizParams);
|
||||
byte[] keyBytes = Base64.decodeBase64(Constant.X7_PUBLIC_KEY);
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey publicK = keyFactory.generatePublic(keySpec);
|
||||
//SIGNATURE_ALGORITHM
|
||||
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||
sign.initVerify(publicK);
|
||||
sign.update(reqPayload.getBytes());
|
||||
boolean verify = sign.verify(Base64.decodeBase64(signature));
|
||||
if (!verify){
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "Signature verify fail");
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, reqTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
JSONObject reqParam = JSON.parseObject(bizParams);
|
||||
String roleId = reqParam.getString("roleId");
|
||||
String guid = reqParam.getString("guid");
|
||||
JSONObject role = new JSONObject();
|
||||
JSONArray guidRoles = new JSONArray();
|
||||
if (roleId != null && !roleId.isEmpty()){
|
||||
role = getRoleById(roleId);
|
||||
}
|
||||
if (guid != null && !guid.isEmpty()){
|
||||
guidRoles = getRolesByGuid(guid);
|
||||
}
|
||||
respJsonObject.put("respCode", "SUCCESS");
|
||||
respJsonObject.put("respMsg", "SUCCESS");
|
||||
respJsonObject.put("role", role);
|
||||
respJsonObject.put("guidRoles", guidRoles);
|
||||
LOGGER.info("x7 query role success, role:{}, guidRoles:{}", role, guidRoles);
|
||||
}catch (Exception e){
|
||||
LOGGER.error("x7 query role2 error, bizParams:{}", bizParams, e);
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "system error");
|
||||
}
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, respTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@PostMapping("/x7/item")
|
||||
public JSONObject sendItem(String bizParams, String apiMethod, String reqTime, String appkey, String gameType,
|
||||
String signature) throws Exception {
|
||||
LOGGER.info("x7 send item, bizParams:{}, apiMethod:{}, reqTime:{}, appkey:{}, gameType:{}, signature:{}",
|
||||
bizParams, apiMethod, reqTime, appkey, gameType, signature);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("apiMethod", apiMethod);
|
||||
jsonObject.put("appkey", appkey);
|
||||
jsonObject.put("gameType", gameType);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ");
|
||||
String respTime = df.format(new Date());
|
||||
jsonObject.put("respTime", respTime);
|
||||
JSONObject respJsonObject = new JSONObject();
|
||||
try {
|
||||
String reqPayload = getPayload(apiMethod, appkey, gameType, reqTime, bizParams);
|
||||
byte[] keyBytes = Base64.decodeBase64(Constant.X7_PUBLIC_KEY);
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey publicK = keyFactory.generatePublic(keySpec);
|
||||
//SIGNATURE_ALGORITHM
|
||||
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||
sign.initVerify(publicK);
|
||||
sign.update(reqPayload.getBytes());
|
||||
boolean verify = sign.verify(Base64.decodeBase64(signature));
|
||||
if (!verify){
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "Signature verify fail");
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, reqTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
JSONObject reqParam = JSON.parseObject(bizParams);
|
||||
String roleId = reqParam.getString("roleId");
|
||||
String mailTitle = reqParam.getString("mailTitle");
|
||||
String mailContent = reqParam.getString("mailContent");
|
||||
JSONArray issuedProps = reqParam.getJSONArray("issuedProps");
|
||||
if (sendItem(roleId, mailTitle, mailContent, issuedProps)){
|
||||
respJsonObject.put("respCode", "SUCCESS");
|
||||
respJsonObject.put("respMsg", "SUCCESS");
|
||||
LOGGER.info("x7 send item success, roleId:{}", roleId);
|
||||
}else {
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "send item fail");
|
||||
LOGGER.info("x7 send item fail, roleId:{}", roleId);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
LOGGER.error("x7 send item error, bizParams:{}", bizParams, e);
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "system error");
|
||||
}
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, respTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@PostMapping("/x7/item/config")
|
||||
public JSONObject getItemConfig(String bizParams, String apiMethod, String reqTime, String appkey, String gameType,
|
||||
String signature) throws Exception {
|
||||
LOGGER.info("x7 get item config, bizParams:{}, apiMethod:{}, reqTime:{}, appkey:{}, gameType:{}, signature:{}",
|
||||
bizParams, apiMethod, reqTime, appkey, gameType, signature);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("apiMethod", apiMethod);
|
||||
jsonObject.put("appkey", appkey);
|
||||
jsonObject.put("gameType", gameType);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ");
|
||||
String respTime = df.format(new Date());
|
||||
jsonObject.put("respTime", respTime);
|
||||
JSONObject respJsonObject = new JSONObject();
|
||||
try {
|
||||
String reqPayload = getPayload(apiMethod, appkey, gameType, reqTime, bizParams);
|
||||
byte[] keyBytes = Base64.decodeBase64(Constant.X7_PUBLIC_KEY);
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey publicK = keyFactory.generatePublic(keySpec);
|
||||
//SIGNATURE_ALGORITHM
|
||||
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||
sign.initVerify(publicK);
|
||||
sign.update(reqPayload.getBytes());
|
||||
boolean verify = sign.verify(Base64.decodeBase64(signature));
|
||||
if (!verify){
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "Signature verify fail");
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, reqTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
JSONObject reqParam = JSON.parseObject(bizParams);
|
||||
JSONArray propCode = reqParam.getJSONArray("propCode");
|
||||
|
||||
List<ItemConfig> itemConfigList = getItemConfig(propCode.toJavaList(String.class));
|
||||
if (itemConfigList != null){
|
||||
respJsonObject.put("respCode", "SUCCESS");
|
||||
respJsonObject.put("respMsg", "SUCCESS");
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (ItemConfig itemConfig : itemConfigList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("propCode", itemConfig.getPropCode());
|
||||
item.put("propDesc", itemConfig.getPropDesc());
|
||||
item.put("propIcon", itemConfig.getPropIcon());
|
||||
item.put("propName", itemConfig.getPropName());
|
||||
jsonArray.add(item);
|
||||
}
|
||||
respJsonObject.put("props", jsonArray);
|
||||
LOGGER.info("x7 get item config success");
|
||||
}else {
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "get item config fail");
|
||||
LOGGER.info("x7 get item config fail");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
LOGGER.error("x7 get item config error, bizParams:{}", bizParams, e);
|
||||
respJsonObject.put("respCode", "FAIL");
|
||||
respJsonObject.put("respMsg", "system error");
|
||||
}
|
||||
String bizResp = respJsonObject.toJSONString();
|
||||
String payload = getPayload(apiMethod, appkey, gameType, respTime, bizResp);
|
||||
String respSign = sign(payload.getBytes(), Constant.X7_SERVER_KEY);
|
||||
jsonObject.put("bizResp", bizResp);
|
||||
jsonObject.put("signature", respSign);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
private List<ItemConfig> getItemConfig(List<String> itemIds){
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, "20001", String.class, -1);
|
||||
LOGGER.info("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
return null;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
return null;
|
||||
} else {
|
||||
|
||||
List<ItemConfig> result = null;
|
||||
try {
|
||||
result = RPCClient.getItemConfig(thriftIp, thriftPort, itemIds);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get item config error, itemIds:{}", itemIds, e);
|
||||
return null;
|
||||
}
|
||||
if (result == null) {
|
||||
LOGGER.error("get item config error, itemIds:{}", itemIds);
|
||||
} else {
|
||||
LOGGER.info("get item config is ok, itemIds:{} ", itemIds);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean sendItem(String playerId, String title, String content, JSONArray items){
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("get mongoTemplate error");
|
||||
return false;
|
||||
}
|
||||
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("uid", Integer.parseInt(playerId)));
|
||||
CoreUserInfo userInfo = mongoTemplate.findOne(query, CoreUserInfo.class, "user_info");
|
||||
if (userInfo == null){
|
||||
LOGGER.error("user not exist, uid:{}", playerId);
|
||||
return false;
|
||||
}
|
||||
BasicQuery query1 = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query1, ServerInfo.class, "server_info");
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverInfo.getRealServerId()), String.class, -1);
|
||||
System.out.println("rpcString " + rpcString);
|
||||
if (null == rpcString) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
return false;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[3];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
LOGGER.error("serverAddress not exist");
|
||||
return false;
|
||||
} else {
|
||||
StringBuilder reward = new StringBuilder();
|
||||
for (Object object : items) {
|
||||
String itemId = ((JSONObject) object).getString("propCode");
|
||||
int amount = ((JSONObject) object).getIntValue("propQuantity");
|
||||
if (reward.length() != 0){
|
||||
reward.append("|");
|
||||
}
|
||||
reward.append(itemId).append("#").append(amount);
|
||||
}
|
||||
Result result = null;
|
||||
try {
|
||||
result = RPCClient.sendMailToRole(thriftIp, thriftPort, playerId, title, content, reward.toString());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("addItem error, player_id:{}", playerId, e);
|
||||
return false;
|
||||
}
|
||||
if (result.getResultCode() != 1) {
|
||||
LOGGER.error("addItem error, player_id:{}", playerId);
|
||||
return false;
|
||||
} else {
|
||||
LOGGER.info("addItem " + playerId + " is ok ");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private JSONArray getRolesByIds(String[] guids, String serverId) throws Exception {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query(Criteria.where("_id").in(guids));
|
||||
List<RegisterUser> registerUserList = mongoTemplate.find(query, RegisterUser.class, "user_register_info");
|
||||
if (registerUserList == null || registerUserList.isEmpty()){
|
||||
return jsonArray;
|
||||
}
|
||||
Map<String, String> registerUserMap = registerUserList.stream().collect(Collectors.toMap(RegisterUser::getOpenId, RegisterUser::getId));
|
||||
Set<String> openIds = registerUserMap.keySet();
|
||||
Query query1 = new Query(Criteria.where("playerManager.openId").in(openIds));
|
||||
BasicQuery basicQuery = new BasicQuery(new BasicDBObject("server_id", serverId));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(basicQuery, ServerInfo.class, "server_info");
|
||||
MongoTemplate gameMongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(DB_NAME_PREFIX + serverInfo.getRealServerId());
|
||||
List<User> userList = gameMongoTemplate.find(query1, User.class, "user");
|
||||
if (userList == null || userList.isEmpty()){
|
||||
return jsonArray;
|
||||
}
|
||||
for (User user : userList) {
|
||||
String guid = registerUserMap.get(user.getPlayerManager().getOpenId());
|
||||
jsonArray.add(getJsonUser(user, guid, serverId, serverInfo.getName()));
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
private JSONArray getRolesByGuid(String guid) throws Exception {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
RegisterUser registerUser = mongoTemplate.findById(guid, RegisterUser.class, "user_register_info");
|
||||
if (registerUser == null){
|
||||
return jsonArray;
|
||||
}
|
||||
List<CoreUserInfo> userInfoList = mongoTemplate.find(new BasicQuery(new BasicDBObject("openId", registerUser.getOpenId())), CoreUserInfo.class, "user_info");
|
||||
for (CoreUserInfo userInfo : userInfoList) {
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(new BasicQuery(new BasicDBObject("server_id", String.valueOf(userInfo.getServerid()))), ServerInfo.class, "server_info");
|
||||
MongoTemplate gameMongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(DB_NAME_PREFIX + serverInfo.getRealServerId());
|
||||
User user = gameMongoTemplate.findById(userInfo.getUid(), User.class, "user");
|
||||
if (user == null){
|
||||
continue;
|
||||
}
|
||||
jsonArray.add(getJsonUser(user, guid, String.valueOf(userInfo.getServerid()), serverInfo.getName()));
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
private JSONObject getRoleById(String roleId) throws Exception {
|
||||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
CoreUserInfo userInfo = mongoTemplate.findById(Integer.parseInt(roleId), CoreUserInfo.class);
|
||||
BasicQuery query1 = new BasicQuery(new BasicDBObject("openId", userInfo.getOpenId()));
|
||||
RegisterUser registerUser = mongoTemplate.findOne(query1, RegisterUser.class, "user_register_info");
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("server_id", userInfo.getServerid()+""));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query, ServerInfo.class, "server_info");
|
||||
MongoTemplate gameMongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(DB_NAME_PREFIX + serverInfo.getRealServerId());
|
||||
User user = gameMongoTemplate.findById(Integer.parseInt(roleId), User.class, "user");
|
||||
if (user == null){
|
||||
return new JSONObject();
|
||||
}
|
||||
return getJsonUser(user, registerUser.getId(), String.valueOf(serverInfo.getServer_id()), serverInfo.getName());
|
||||
}
|
||||
|
||||
private JSONObject getJsonUser(User user, String guid, String serverId, String serverName){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("roleId", String.valueOf(user.getId()));
|
||||
jsonObject.put("guid", guid);
|
||||
jsonObject.put("roleName", user.getPlayerManager().getNickName());
|
||||
jsonObject.put("serverId", serverId);
|
||||
jsonObject.put("serverName", serverName);
|
||||
jsonObject.put("roleLevel", String.valueOf(user.getPlayerManager().getLevel()));
|
||||
jsonObject.put("roleCE", String.valueOf(user.getPlayerManager().getMaxForce()));
|
||||
jsonObject.put("roleStage", String.valueOf(user.getMainLevelManager().getFightId()));
|
||||
jsonObject.put("roleRechargeAmount", user.getPlayerManager().getRechargeInfo().getSaveAmt());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
private String getPayload(String apiMethod, String appkey, String gameType, String time, String params){
|
||||
String sb = "POST" + " " +
|
||||
apiMethod + "@" +
|
||||
appkey + "#" +
|
||||
gameType + "." +
|
||||
time + "\n\n" +
|
||||
params;
|
||||
return sb;
|
||||
}
|
||||
|
||||
public static String sign(byte[] data, String privateKey) throws Exception {
|
||||
byte[] keyBytes = Base64.decodeBase64(privateKey);
|
||||
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec);
|
||||
Signature signature = Signature.getInstance("SHA256withRSA");
|
||||
signature.initSign(privateK);
|
||||
signature.update(data);
|
||||
return Base64.encodeBase64String(signature.sign());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.sdk.HmacSHA1Encryption;
|
||||
import com.jmfy.sdk.HttpUtil;
|
||||
import com.jmfy.sdk.ParamUtil;
|
||||
import com.jmfy.util.Constant;
|
||||
import com.jmfy.util.MD5Util;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@RestController
|
||||
public class XiaomiController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(XiaomiController.class);
|
||||
private String verifySessionUrl = "http://mis.migc.xiaomi.com/api/biz/service/verifySession.do";
|
||||
|
||||
private static final String _COLLECTION_NAME = "user_register_info";
|
||||
|
||||
@Resource
|
||||
private MongoConnectDao mongoConnectDao;
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
|
||||
@RequestMapping(value = "/xiaomi/verify", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
public void xioamiverify(String appId, String userId, String session, HttpServletResponse response){
|
||||
|
||||
Map<String,String> params = new HashMap<String, String>();
|
||||
//params.put("appId",String.valueOf(Constant.APP_ID));
|
||||
params.put("appId",appId);
|
||||
params.put("uid",userId);
|
||||
params.put("session",session);
|
||||
LOGGER.info("/xiaomi/verify result {} ",appId);
|
||||
try {
|
||||
String requestUrl = getRequestUrl(params,verifySessionUrl);
|
||||
String result = HttpUtil.doGet(requestUrl);
|
||||
JSONObject obj = JSON.parseObject(result);
|
||||
LOGGER.info("/xiaomi/verify result {} ",obj.toJSONString());
|
||||
int errcode = obj.getIntValue("errcode");
|
||||
if(Constant.CODE_SUCCESS == errcode){
|
||||
//注册流程
|
||||
String name = userId;
|
||||
String password = "1";
|
||||
|
||||
String openId;
|
||||
//查询
|
||||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("_id").is(name));
|
||||
query.addCriteria(cr);
|
||||
com.jmfy.model.xiaomi.RegisterUser registerUser = mongoTemplate.findOne(query, com.jmfy.model.xiaomi.RegisterUser.class);
|
||||
//是否注册过
|
||||
if(registerUser == null){
|
||||
String salt = "d13b3e8ef74bf72d8aafce3a1c8672a0";
|
||||
String mySign = MD5Util.encrypByMd5(name + password + salt);
|
||||
DBObject doc = new BasicDBObject();
|
||||
doc.put("_id", name);
|
||||
doc.put("password", password);
|
||||
int random = new Random(1024).nextInt();
|
||||
openId = MD5Util.encrypByMd5(mySign + random);
|
||||
doc.put("openId", openId);
|
||||
//存储
|
||||
mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
DBCollection dBCollection = mongoTemplate.getCollection(_COLLECTION_NAME);
|
||||
dBCollection.save(doc);
|
||||
}else{
|
||||
openId = registerUser.getOpenId();
|
||||
}
|
||||
//登录流程`
|
||||
JSONObject returnResult = new JSONObject();
|
||||
returnResult.put("openId",openId);
|
||||
int token = new Random().nextInt(1024) +10000;
|
||||
returnResult.put("token",Integer.toString(token));
|
||||
RedisUtil.getInstence().putObject("JL_LOGIN_TOKEN", openId, token, -1);
|
||||
LOGGER.info("/xiaomi/verify openId {} token {}",returnResult.get("openId"),returnResult.get("token"));
|
||||
|
||||
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(returnResult.toJSONString().getBytes());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
JSONObject obj1 = new JSONObject();
|
||||
obj1.put("errcode", errcode);
|
||||
response.setContentType("application/json");
|
||||
response.getOutputStream().write(obj1.toJSONString().getBytes());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private String getRequestUrl(Map<String,String> params, String baseUrl) throws Exception{
|
||||
String signString = ParamUtil.getSortQueryString(params);
|
||||
String signature = getSign(params);
|
||||
return baseUrl + "?" + signString + "&signature=" + signature;
|
||||
}
|
||||
|
||||
private Map<String,String> getSignParams(String queryString) throws UnsupportedEncodingException {
|
||||
|
||||
Map<String,String> result = new HashMap<String, String>();
|
||||
String[] params = queryString.split("&");
|
||||
for(String param : params){
|
||||
String[] tmp = param.split("=");
|
||||
String key = tmp[0];
|
||||
if(!"signature".equals(key)) {
|
||||
result.put(key, URLDecoder.decode(tmp[1],"UTF-8"));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getSign(Map<String,String> params) throws Exception{
|
||||
String signString = ParamUtil.getSortQueryString(params);
|
||||
return HmacSHA1Encryption.hmacSHA1Encrypt(signString, Constant.AppSecret);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.model.GSUser;
|
||||
import org.springframework.data.mongodb.core.query.Update;
|
||||
|
||||
public interface GSUserDao {
|
||||
|
||||
GSUser findUserInfo(MarkedVo marked, int userId) throws Exception;
|
||||
|
||||
void updateUserInfo(MarkedVo marked, Update update, int id) throws Exception;
|
||||
|
||||
int findGuildId(MarkedVo marked, int userId) throws Exception;
|
||||
|
||||
String getThriftIpPort(MarkedVo marked, int userId);
|
||||
|
||||
|
||||
int findCuserOnline(MarkedVo marked,int id);
|
||||
|
||||
GSUser findUserInfoByname(MarkedVo marked, String roleName) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MongoConnectDao {
|
||||
Connect getConnect();
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.modelVo.PayVo;
|
||||
|
||||
public interface PayDao {
|
||||
|
||||
/**
|
||||
* 一个服一个角 多个返回Android 和ios同时在此服创角
|
||||
* @param orderId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PayVo getOder(String orderId) throws Exception;
|
||||
|
||||
PayVo upOder(PayVo payVo) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.WhiteList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RoleListDao {
|
||||
List<CoreUserInfo> findRoleList(MarkedVo marked) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import org.springframework.data.mongodb.core.query.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ServerInfoDao {
|
||||
ServerInfo findServerInfo(MarkedVo marked) throws Exception;
|
||||
|
||||
void updateServerInfo(MarkedVo marked, Update update, int id) throws Exception;
|
||||
|
||||
List<ServerInfo> findAllServerInfo(MarkedVo marked) throws Exception;
|
||||
|
||||
List<ServerInfo> findServerInfoByPlat(MarkedVo markedVo) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ServerListDao {
|
||||
|
||||
List<CoreServerList> findServerList(MarkedVo marked) throws Exception;
|
||||
|
||||
CoreServerList findServer(MarkedVo marked) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.WhiteList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ServerRoleInfoDao {
|
||||
|
||||
CoreUserInfo findServerRoleInfo(MarkedVo marked,int userId) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.WhiteList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ServerRoleListDao {
|
||||
|
||||
/**
|
||||
* 一个服一个角 多个返回Android 和ios同时在此服创角
|
||||
* @param marked
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<CoreUserInfo> findServerRoleList(MarkedVo marked) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
public interface UserVerfyDao {
|
||||
|
||||
/**
|
||||
* 一个服一个角 多个返回Android 和ios同时在此服创角
|
||||
* @param name
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
String verfyUser(String name) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.jmfy.util.GlobalsDef;
|
||||
import com.jmfy.util.MongoName;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.core.query.Update;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Component
|
||||
public class GSUserDaoImpl implements GSUserDao {
|
||||
@Resource
|
||||
private Connect connect;
|
||||
public static final String colon = ":";
|
||||
|
||||
@Override
|
||||
public GSUser findUserInfo(MarkedVo marked, int userId) throws Exception {
|
||||
// GSUser cUser = RedisUtil.getInstence().getObject(marked.getPartition() + colon + RedisUserKey.CUser_Key,
|
||||
// String.valueOf(userId), GSUser.class, GlobalsDef.REDIS_OVER_TIME);
|
||||
// if (cUser != null) {
|
||||
// return cUser;
|
||||
// }
|
||||
String dbName = MongoName.getMongoDBName(marked);
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("playerManager.rootId").is(userId));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.findOne(query, GSUser.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserInfo(MarkedVo marked, Update update, int id) throws Exception {
|
||||
// String dbName = MongoName.getMongoDBName(marked);
|
||||
// MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
// Query query = new Query(Criteria.where("playerManager.rootId").is(id));
|
||||
// mongoTemplate.updateMulti(query, update, GSUser.class);
|
||||
// GSUser cUser = mongoTemplate.findOne(query, GSUser.class);
|
||||
// RedisUtil.getInstence().putObject(marked.getPartition() + colon + RedisUserKey.CUser_Key, Integer.toString(id), cUser, 3600 * 24);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int findGuildId(MarkedVo marked, int userId) throws Exception {
|
||||
// String object = RedisUtil.getInstence().getObject(marked.getPartition() + colon + RedisUserKey.USER_FAMILY_ID, Integer.toString(userId), String.class, GlobalsDef.REDIS_OVER_FOREVER);
|
||||
// if (object != null && !object.isEmpty()) {
|
||||
// return Integer.parseInt(object);
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getThriftIpPort(MarkedVo marked, int uid) {
|
||||
return RedisUtil.getInstence().getObject(marked.getPartition() + colon + RedisUserKey.CUser_ServerInfo_Key, Integer.toString(uid),
|
||||
String.class, GlobalsDef.REDIS_OVER_TIME);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int findCuserOnline(MarkedVo marked,int uid) {
|
||||
int online = 0;
|
||||
String key = RedisUtil.getInstence().redisGetValue(marked.getPartition()+RedisUserKey.Delimiter_colon+RedisUserKey.CUser_Online_Key+RedisUserKey.Delimiter_colon+uid);
|
||||
if (key != null){
|
||||
online = Integer.parseInt(key);
|
||||
}
|
||||
return online;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GSUser findUserInfoByname(MarkedVo marked, String roleName) throws Exception {
|
||||
String dbName = MongoName.getMongoDBName(marked);
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
Query query = new Query(Criteria.where("userName").is(roleName));
|
||||
return mongoTemplate.findOne(query, GSUser.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class MongoConnectImpl implements MongoConnectDao {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MongoConnectImpl.class);
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
public Connect getConnect() {
|
||||
return connect;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.PayDao;
|
||||
import com.jmfy.modelVo.PayVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.jmfy.util.loginRedis.TimeUtil;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBObject;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.BasicQuery;
|
||||
import org.springframework.data.mongodb.core.query.BasicUpdate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
public class PayImpl implements PayDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
private static final String _COLLECTION_NAME = "user_register_info";
|
||||
|
||||
@Override
|
||||
public PayVo getOder(String orderId) {
|
||||
try {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("billno").is(orderId));
|
||||
query.addCriteria(cr);
|
||||
PayVo payVo = mongoTemplate.findOne(query, PayVo.class);
|
||||
return payVo;
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayVo upOder(PayVo payVo) {
|
||||
try {
|
||||
BasicDBObject basicDBObject = new BasicDBObject();
|
||||
DBObject value = new BasicDBObject();
|
||||
value.put("status", 1);
|
||||
value.put("callbaktime", TimeUtil.getTimeStamp(System.currentTimeMillis()));
|
||||
basicDBObject.put("$set", value);
|
||||
BasicUpdate basicUpdate = new BasicUpdate(basicDBObject);
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
mongoTemplate.updateFirst(new BasicQuery(new BasicDBObject("_id", payVo.getId())), basicUpdate, PayVo.class);
|
||||
return payVo;
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.RoleListDao;
|
||||
import com.jmfy.dao.ServerRoleListDao;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.WhiteList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.jmfy.util.MongoName;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RoleListDaoImpl implements RoleListDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect ;
|
||||
|
||||
@Override
|
||||
public List<CoreUserInfo> findRoleList(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("openId").is(marked.getOpenId()));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.find(query, CoreUserInfo.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.ServerInfoDao;
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.jmfy.util.GlobalsDef;
|
||||
import com.jmfy.util.MongoName;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.core.query.Update;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ServerInfoDaoImpl implements ServerInfoDao {
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
@Override
|
||||
public ServerInfo findServerInfo(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("plat").is(marked.getPlatId()), Criteria.where("server_id").is(marked.getPartition()),
|
||||
Criteria.where("channel").is(marked.getAreaId()));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.findOne(query, ServerInfo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateServerInfo(MarkedVo marked, Update update, int id) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query(Criteria.where("_id").is(id));
|
||||
mongoTemplate.updateMulti(query, update, ServerInfo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServerInfo> findAllServerInfo(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("plat").is(marked.getPlatId()), Criteria.where("channel").is(marked.getAreaId()));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.find(query, ServerInfo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServerInfo> findServerInfoByPlat(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query(Criteria.where("plat").is(marked.getPlatId()));
|
||||
return mongoTemplate.find(query, ServerInfo.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.WhiteList;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ServerListDaoImpl implements ServerListDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
@Override
|
||||
public List<CoreServerList> findServerList(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.findAll(CoreServerList.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoreServerList findServer(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("server_id").is(String.valueOf(marked.getPartition())));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.findOne(query, CoreServerList.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.ServerRoleInfoDao;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
public class ServerRoleInfoDaoImpl implements ServerRoleInfoDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect ;
|
||||
|
||||
@Override
|
||||
public CoreUserInfo findServerRoleInfo(MarkedVo marked, int userId) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("serverid").is(marked.getPartition()),
|
||||
Criteria.where("openId").is(marked.getOpenId()),
|
||||
Criteria.where("uid").is(userId));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.findOne(query, CoreUserInfo.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.ServerRoleListDao;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ServerRoleListDaoImpl implements ServerRoleListDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
@Override
|
||||
public List<CoreUserInfo> findServerRoleList(MarkedVo marked) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("serverId").is(marked.getPartition()),
|
||||
Criteria.where("openId").is(marked.getOpenId()));
|
||||
query.addCriteria(cr);
|
||||
return mongoTemplate.find(query, CoreUserInfo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.UserVerfyDao;
|
||||
import com.jmfy.model.sdk.RegisterUser;
|
||||
import com.jmfy.util.Connect;
|
||||
import com.jmfy.util.Constant;
|
||||
import com.jmfy.util.MD5Util;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Random;
|
||||
|
||||
@Component
|
||||
public class UserVerfyDaoImpl implements UserVerfyDao {
|
||||
|
||||
@Resource
|
||||
private Connect connect;
|
||||
|
||||
private static final String _COLLECTION_NAME = "user_register_info";
|
||||
|
||||
@Override
|
||||
public String verfyUser(String name) throws Exception {
|
||||
JSONObject result=new JSONObject();
|
||||
String password="1";
|
||||
String openId=null;
|
||||
//查询
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
cr.andOperator(Criteria.where("_id").is(name));
|
||||
query.addCriteria(cr);
|
||||
RegisterUser registerUser = mongoTemplate.findOne(query, RegisterUser.class);
|
||||
//是否注册过
|
||||
if(registerUser == null){
|
||||
String mySign = MD5Util.encrypByMd5(name + password + Constant.SALT);
|
||||
DBObject doc = new BasicDBObject();
|
||||
doc.put("_id", name);
|
||||
doc.put("password", password);
|
||||
int random = new Random(1024).nextInt();
|
||||
openId = MD5Util.encrypByMd5(mySign + random);
|
||||
doc.put("openId", openId);
|
||||
//存储
|
||||
mongoTemplate = connect.getMongoTemplete(Application.coreDb);
|
||||
DBCollection dBCollection = mongoTemplate.getCollection(_COLLECTION_NAME);
|
||||
dBCollection.save(doc);
|
||||
}else{
|
||||
openId = registerUser.getOpenId();
|
||||
}
|
||||
return openId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.jmfy.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import com.jmfy.util.MD5Util;
|
||||
|
||||
public abstract class BaseHandler {
|
||||
private int pid;
|
||||
private int gid;
|
||||
|
||||
public String getRequestURI() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public abstract BaseVo execute(JSONObject json) throws Exception ;
|
||||
|
||||
public static boolean validSign(String transdata, String sign) {
|
||||
try {
|
||||
String md5Str = MD5Util.encrypByMd5(transdata);
|
||||
if (md5Str.equals(sign)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public int getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(int pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public int getGid() {
|
||||
return gid;
|
||||
}
|
||||
|
||||
public void setGid(int gid) {
|
||||
this.gid = gid;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.handler;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class ManagerManager {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ManagerManager.class);
|
||||
private static ManagerManager instance;
|
||||
private Map<String, BaseHandler> uriHandlers = new HashMap();
|
||||
|
||||
public static ManagerManager getInstance(){
|
||||
if (instance == null){
|
||||
instance = new ManagerManager();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public BaseHandler getBaseHandler(String uri){
|
||||
return uriHandlers.get(uri);
|
||||
}
|
||||
|
||||
public void addHandler(BaseHandler handler) {
|
||||
uriHandlers.put(handler.getRequestURI(),handler);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.jmfy.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.util.Connect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public class MarkedInfo {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Connect.class);
|
||||
private static final String Y = "#";
|
||||
public static final String colon = "|";
|
||||
public static final String url_head = "mongodb://game:mongo5aiAXZ5@";
|
||||
public static final String url_middle = "/?replicaSet=";
|
||||
public static final String url_tail = "&authMechanism=MONGODB-CR&authSource=admin";
|
||||
|
||||
|
||||
public static MarkedVo getMarkedVo(JSONObject requestData) {
|
||||
MarkedVo marked = new MarkedVo();
|
||||
int channel = requestData.getIntValue("pid");
|
||||
String partition ="";
|
||||
//37给的多个接口文档命名不一样 区服id
|
||||
if (requestData.containsKey("dsid")) {
|
||||
partition = requestData.getString("dsid");
|
||||
}
|
||||
if (requestData.containsKey("partition")) {
|
||||
partition = requestData.getString("partition");
|
||||
}
|
||||
|
||||
marked.setAreaId(String.valueOf(channel));
|
||||
|
||||
marked.setPartition(partition);
|
||||
|
||||
//37给的类型还不一样 统一String
|
||||
if (requestData.containsKey("uid")) {
|
||||
marked.setOpenId(requestData.getString("uid"));
|
||||
}
|
||||
|
||||
return marked;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符url编码
|
||||
*
|
||||
* @param msg
|
||||
* @return
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public static String getUrlEncoder(String msg) throws UnsupportedEncodingException {
|
||||
return URLEncoder.encode(msg, "utf-8");
|
||||
}
|
||||
|
||||
|
||||
public static String getMongoUrl(int serverId) {
|
||||
int mongoId = (serverId % 1000 - 1) % 4 + 4 * (serverId / 1000 - 1) + 1;
|
||||
int mongoIdPort = mongoId + 27000;
|
||||
|
||||
StringBuilder mongoUrl = new StringBuilder();
|
||||
mongoUrl.append(url_head)
|
||||
.append("s").append(mongoId).append("P.game.ysj.db:").append(mongoIdPort).append(",")
|
||||
.append("s").append(mongoId).append("S.game.ysj.db:").append(mongoIdPort)
|
||||
.append(url_middle)
|
||||
.append("ysj-game-s").append(mongoId)
|
||||
.append(url_tail);
|
||||
|
||||
return mongoUrl.toString();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,69 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.dao.RoleListDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.MarkedInfo;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.modelVo.RoleListVo;
|
||||
import com.jmfy.util.SDK37Constans;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ChangeRoleNameHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ChangeRoleNameHandler.class);
|
||||
|
||||
|
||||
@Override
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
long time = 0;
|
||||
String uid = "";
|
||||
String dsid = "";
|
||||
String roleId = "";
|
||||
String sign = "";
|
||||
|
||||
if (jsonObject.containsKey("timestamp") && jsonObject.containsKey("uid") && jsonObject.containsKey("roleid") && jsonObject.containsKey("partition") && jsonObject.containsKey("sign")) {
|
||||
time = jsonObject.getLong("timestamp");
|
||||
uid = jsonObject.getString("uid");
|
||||
dsid = jsonObject.getString("partition");
|
||||
roleId = jsonObject.getString("roleid");
|
||||
sign = jsonObject.getString("sign");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
|
||||
if (!validSign(String.valueOf(getPid())
|
||||
+ String.valueOf(getGid()) + String.valueOf(time)
|
||||
+ String.valueOf(uid) + String.valueOf(dsid)
|
||||
+ String.valueOf(roleId)
|
||||
+ SDK37Constans.appkey, sign)) {
|
||||
throw new Exception("签名错误");
|
||||
}
|
||||
|
||||
BaseVo baseVo = new BaseVo();
|
||||
MarkedVo marked = MarkedInfo.getMarkedVo(jsonObject);
|
||||
LOGGER.info("-->areaId={},platId={},openid={},serverId={}", marked.getAreaId(), marked.getPlatId(), marked.getOpenId(), marked.getPartition());
|
||||
|
||||
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "rolelist";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.dao.RoleListDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.RPCClient;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import com.jmfy.util.SDK37Constans;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class GMHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(GMHandler.class);
|
||||
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
@Resource
|
||||
private RoleListDao roleListDao;
|
||||
@Resource
|
||||
private GSUserDao gsUserDao;
|
||||
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
|
||||
int atime;
|
||||
String uid;
|
||||
String gid;
|
||||
int dsid;
|
||||
int treat_type;
|
||||
String sign;
|
||||
if (jsonObject.containsKey("atime") && jsonObject.containsKey("uid") && jsonObject.containsKey("gid") && jsonObject.containsKey("dsid") && jsonObject.containsKey("treat_type") && jsonObject.containsKey("sign")) {
|
||||
atime = jsonObject.getIntValue("atime");
|
||||
uid = jsonObject.getString("uid");
|
||||
gid = jsonObject.getString("gid");
|
||||
dsid = jsonObject.getIntValue("dsid");
|
||||
treat_type = jsonObject.getIntValue("treat_type");
|
||||
sign = jsonObject.getString("sign");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
|
||||
if (!BaseHandler.validSign(SDK37Constans.chatKey + String.valueOf(uid) + String.valueOf(gid) + String.valueOf(dsid) + String.valueOf(treat_type)
|
||||
+ String.valueOf(atime), sign)) {
|
||||
throw new Exception("签名错误");
|
||||
}
|
||||
|
||||
boolean allServer = false;
|
||||
|
||||
String cmd = "";
|
||||
switch (treat_type){
|
||||
case 1:
|
||||
if(!jsonObject.containsKey("actor_id")){
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String actor_id_ban = jsonObject.getString("actor_id");
|
||||
cmd="silence "+actor_id_ban+" 1";
|
||||
break;
|
||||
case 2:
|
||||
if(!jsonObject.containsKey("actor_id")){
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String actor_id_no_ban = jsonObject.getString("actor_id");
|
||||
cmd="silence "+actor_id_no_ban+" 0";
|
||||
break;
|
||||
case 4:
|
||||
if(dsid==0){
|
||||
allServer=true;
|
||||
cmd="addblack ";
|
||||
}else {
|
||||
if(!jsonObject.containsKey("actor_id")){
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String id = jsonObject.getString("actor_id");
|
||||
cmd="addblack "+id;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if(dsid==0){
|
||||
allServer=true;
|
||||
cmd="reblack ";
|
||||
}else {
|
||||
if(!jsonObject.containsKey("actor_id")){
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String id2 = jsonObject.getString("actor_id");
|
||||
cmd="reblack "+id2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(!jsonObject.containsKey("actor_id")){
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String actor_id = jsonObject.getString("actor_id");
|
||||
cmd="kick "+actor_id;
|
||||
break;
|
||||
case 6:
|
||||
if(!jsonObject.containsKey("actor_id")){
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
String actor_id2 = jsonObject.getString("actor_id");
|
||||
if(!jsonObject.containsKey("actor_name")){
|
||||
cmd="changename "+actor_id2;
|
||||
}else {
|
||||
String actor_name = jsonObject.getString("actor_name");
|
||||
cmd="changename "+actor_id2+" "+actor_name;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(allServer){
|
||||
MarkedVo marked = new MarkedVo();
|
||||
marked.setOpenId(String.valueOf(uid));
|
||||
List<CoreUserInfo> coreUserInfoList = roleListDao.findRoleList(marked);
|
||||
if (coreUserInfoList == null) {
|
||||
throw new Exception("帐号不存在");
|
||||
} else {
|
||||
if (coreUserInfoList.size() == 0)
|
||||
throw new Exception("帐号不存在");
|
||||
for (CoreUserInfo coreUserInfo : coreUserInfoList) {
|
||||
MarkedVo marked2 = new MarkedVo();
|
||||
marked2.setPartition(String.valueOf(coreUserInfo.getServerid()));
|
||||
CoreServerList coreServerList = serverListDao.findServer(marked2);
|
||||
if (null == coreServerList) {
|
||||
continue;
|
||||
} else {
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(coreUserInfo.getServerid()), String.class, -1);
|
||||
if(null==rpcString){
|
||||
continue;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[1];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
continue;
|
||||
} else {
|
||||
cmd = cmd+coreUserInfo.getUid();
|
||||
Result result = RPCClient.gmSend(cmd, thriftIp, thriftPort);
|
||||
//异常或者错误
|
||||
// if (result.getResultCode() != 0) {
|
||||
// continue;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BaseVo baseVo = new BaseVo();
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}else {
|
||||
BaseVo baseVo = new BaseVo();
|
||||
MarkedVo marked = new MarkedVo();
|
||||
marked.setPartition(String.valueOf(dsid));
|
||||
CoreServerList coreServerList = serverListDao.findServer(marked);
|
||||
if (null == coreServerList) {
|
||||
throw new Exception("应用不存在");
|
||||
} else {
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(dsid), String.class, -1);
|
||||
if(null==rpcString){
|
||||
throw new Exception("serverAddress not exist");
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[1];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
throw new Exception("serverAddress not exist");
|
||||
} else {
|
||||
|
||||
Result result = RPCClient.gmSend(cmd, thriftIp, thriftPort);
|
||||
if (result.getResultCode() != 0) {
|
||||
throw new Exception(result.getResultMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "gm";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.dao.RoleListDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.MarkedInfo;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.modelVo.RoleListVo;
|
||||
import com.jmfy.util.SDK37Constans;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RoleListHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(RoleListHandler.class);
|
||||
|
||||
@Resource
|
||||
private RoleListDao roleListDao;
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
@Resource
|
||||
private GSUserDao gsUserDao;
|
||||
|
||||
@Override
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
|
||||
long time;
|
||||
String uid;
|
||||
String sign;
|
||||
if (jsonObject.containsKey("time") && jsonObject.containsKey("uid") && jsonObject.containsKey("sign")) {
|
||||
time = jsonObject.getLong("time");
|
||||
uid = jsonObject.getString("uid");
|
||||
sign = jsonObject.getString("sign");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
|
||||
if (!validSign(String.valueOf(time) + String.valueOf(getPid())
|
||||
+ String.valueOf(getGid()) + String.valueOf(uid)
|
||||
+ SDK37Constans.appkey, sign)) {
|
||||
throw new Exception("签名错误");
|
||||
}
|
||||
|
||||
BaseVo baseVo = new BaseVo();
|
||||
MarkedVo marked = MarkedInfo.getMarkedVo(jsonObject);
|
||||
LOGGER.info("-->areaId={},platId={},openid={},serverId={}", marked.getAreaId(), marked.getPlatId(), marked.getOpenId(), marked.getPartition());
|
||||
|
||||
List<RoleListVo> roleListVos = new ArrayList<>();
|
||||
|
||||
List<CoreUserInfo> coreUserInfoList = roleListDao.findRoleList(marked);
|
||||
if (coreUserInfoList == null) {
|
||||
throw new Exception("帐号不存在");
|
||||
} else {
|
||||
if (coreUserInfoList.size() == 0)
|
||||
throw new Exception("帐号不存在");
|
||||
for (CoreUserInfo coreUserInfo : coreUserInfoList) {
|
||||
MarkedVo marked1 = new MarkedVo();
|
||||
marked1.setOpenId(coreUserInfo.getOpenId());
|
||||
marked1.setPartition(String.valueOf(coreUserInfo.getServerid()));
|
||||
|
||||
RoleListVo roleListVo = new RoleListVo();
|
||||
|
||||
GSUser gsUser = gsUserDao.findUserInfo(marked1, coreUserInfo.getUid());
|
||||
if (null == gsUser) {
|
||||
throw new Exception("帐号不存在");
|
||||
}
|
||||
CoreServerList coreServerList = serverListDao.findServer(marked1);
|
||||
if (null == coreServerList) {
|
||||
throw new Exception("应用不存在");
|
||||
}
|
||||
roleListVo.setDrlevel(String.valueOf(gsUser.getPlayerManager().getLevel()));
|
||||
roleListVo.setDrname(gsUser.getPlayerManager().getNickName());
|
||||
roleListVo.setDrid(String.valueOf(coreUserInfo.getUid()));
|
||||
roleListVo.setDsid(String.valueOf(coreUserInfo.getServerid()));
|
||||
|
||||
roleListVo.setDsname(coreServerList.getName());
|
||||
roleListVos.add(roleListVo);
|
||||
}
|
||||
}
|
||||
baseVo.setData(roleListVos);
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "rolelist";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.dao.RoleListDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.util.RPCClient;
|
||||
import com.jmfy.util.RedisUtil;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
public class SDKHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SDKHandler.class);
|
||||
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
@Resource
|
||||
private RoleListDao roleListDao;
|
||||
@Resource
|
||||
private GSUserDao gsUserDao;
|
||||
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
int serverId;
|
||||
int uid;
|
||||
String goodsId;
|
||||
String openId;
|
||||
String orderId;
|
||||
long orderTime;
|
||||
int amount;
|
||||
if (jsonObject.containsKey("serverId") && jsonObject.containsKey("uid") && jsonObject.containsKey("goodsId") && jsonObject.containsKey("openId") && jsonObject.containsKey("orderId") && jsonObject.containsKey("orderTime") && jsonObject.containsKey("amount")) {
|
||||
serverId = jsonObject.getIntValue("serverId");
|
||||
uid = jsonObject.getIntValue("uid");
|
||||
goodsId = jsonObject.getString("goodsId");
|
||||
openId = jsonObject.getString("openId");
|
||||
orderId = jsonObject.getString("orderId");
|
||||
orderTime = jsonObject.getIntValue("orderTime");
|
||||
amount = jsonObject.getIntValue("amount");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
BaseVo baseVo = new BaseVo();
|
||||
MarkedVo marked = new MarkedVo();
|
||||
marked.setPartition(String.valueOf(serverId));
|
||||
CoreServerList coreServerList = serverListDao.findServer(marked);
|
||||
if (null == coreServerList) {
|
||||
throw new Exception("应用不存在");
|
||||
} else {
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(serverId), String.class, -1);
|
||||
LOGGER.info("rpcString {}",rpcString);
|
||||
if(null==rpcString){
|
||||
throw new Exception("serverAddress not exist");
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[1];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
throw new Exception("serverAddress not exist");
|
||||
} else {
|
||||
Result result = RPCClient.deliveryRecharge(thriftIp, thriftPort,uid,goodsId,openId,orderId,orderTime,amount, "");
|
||||
if (result.getResultCode() != 0) {
|
||||
throw new Exception(result.getResultMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "sdk";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.cenum.CommandEnm;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.MarkedInfo;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.modelVo.*;
|
||||
import com.jmfy.util.SDK37Constans;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class ServerListHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ServerListHandler.class);
|
||||
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
|
||||
@Override
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
|
||||
int time = 0;
|
||||
String sign = "";
|
||||
if (jsonObject.containsKey("time") && jsonObject.containsKey("sign")) {
|
||||
time = jsonObject.getIntValue("time");
|
||||
sign = jsonObject.getString("sign");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
if (!validSign(String.valueOf(time) + String.valueOf(getPid()) + String.valueOf(getGid()) + SDK37Constans.appkey, sign)) {
|
||||
throw new Exception("签名错误");
|
||||
}
|
||||
BaseVo baseVo = new BaseVo();
|
||||
List listBaseVo = new ArrayList();
|
||||
MarkedVo marked = MarkedInfo.getMarkedVo(jsonObject);
|
||||
LOGGER.info("-->areaId={},platId={},openid={},serverId={}", marked.getAreaId(), marked.getPlatId(), marked.getOpenId(), marked.getPartition());
|
||||
List<CoreServerList> lists = serverListDao.findServerList(marked);
|
||||
for (CoreServerList serverList : lists) {
|
||||
listBaseVo.add(new ServerListVo(serverList.get_id(), serverList.getName()));
|
||||
}
|
||||
baseVo.setData(listBaseVo);
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "serverlist";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.cenum.CommandEnm;
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.dao.ServerRoleInfoDao;
|
||||
import com.jmfy.dao.ServerRoleListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.MarkedInfo;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.modelVo.*;
|
||||
import com.jmfy.util.SDK37Constans;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class ServerRoleInfoHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ServerRoleInfoHandler.class);
|
||||
|
||||
@Resource
|
||||
private ServerRoleInfoDao serverRoleInfoDao;
|
||||
@Resource
|
||||
private GSUserDao gsUserDao;
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
|
||||
@Override
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
|
||||
long time = 0;
|
||||
String uid = "";
|
||||
String dsid = "";
|
||||
String roleId = "";
|
||||
int type = 0;
|
||||
String sign = "";
|
||||
|
||||
if (jsonObject.containsKey("timestamp") && jsonObject.containsKey("uid") && jsonObject.containsKey("roleid") && jsonObject.containsKey("partition") && jsonObject.containsKey("type") && jsonObject.containsKey("sign")) {
|
||||
time = jsonObject.getLong("timestamp");
|
||||
uid = jsonObject.getString("uid");
|
||||
dsid = jsonObject.getString("partition");
|
||||
roleId = jsonObject.getString("roleid");
|
||||
type = jsonObject.getIntValue("type");
|
||||
sign = jsonObject.getString("sign");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
|
||||
int date = 0;
|
||||
if (type == 0 || type == 2) {
|
||||
if (jsonObject.containsKey("date")) {
|
||||
date = jsonObject.getIntValue("date");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
}
|
||||
int begin = 0;
|
||||
int end = 0;
|
||||
if (type == 0 || type == 3 || type == 4) {
|
||||
if (jsonObject.containsKey("begin") && jsonObject.containsKey("end")) {
|
||||
begin = jsonObject.getIntValue("begin");
|
||||
end = jsonObject.getIntValue("end");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
}
|
||||
|
||||
if (!validSign(String.valueOf(getPid())
|
||||
+ String.valueOf(getGid()) + String.valueOf(time)
|
||||
+ String.valueOf(uid) + String.valueOf(dsid)
|
||||
+ String.valueOf(roleId) + String.valueOf(type)
|
||||
+ SDK37Constans.appkey, sign)) {
|
||||
throw new Exception("签名错误");
|
||||
}
|
||||
|
||||
BaseVo baseVo = new BaseVo();
|
||||
MarkedVo marked = MarkedInfo.getMarkedVo(jsonObject);
|
||||
LOGGER.info("-->areaId={},platId={},openid={},serverId={}", marked.getAreaId(), marked.getPlatId(), marked.getOpenId(), marked.getPartition());
|
||||
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
CoreUserInfo coreUserInfo = serverRoleInfoDao.findServerRoleInfo(marked, Integer.valueOf(roleId));
|
||||
if (coreUserInfo == null) {
|
||||
throw new Exception("帐号不存在");
|
||||
} else {
|
||||
|
||||
MarkedVo marked1 = new MarkedVo();
|
||||
marked1.setOpenId(coreUserInfo.getOpenId());
|
||||
marked1.setPartition(String.valueOf(coreUserInfo.getServerid()));
|
||||
|
||||
CoreServerList coreServerList = serverListDao.findServer(marked1);
|
||||
if (null == coreServerList) {
|
||||
throw new Exception("应用不存在");
|
||||
}
|
||||
GSUser gsUser = gsUserDao.findUserInfo(marked1, coreUserInfo.getUid());
|
||||
if (null == gsUser) {
|
||||
throw new Exception("帐号不存在");
|
||||
}
|
||||
|
||||
jsonObject1.put("dsid", String.valueOf(coreUserInfo.getServerid()));
|
||||
jsonObject1.put("dsname", coreServerList.getName());
|
||||
jsonObject1.put("droleid", String.valueOf(gsUser.getId()));
|
||||
jsonObject1.put("last_login_time", String.valueOf(gsUser.getPlayerManager().getLoginTime() / 1000));
|
||||
if (type == 0 || type == 2) {
|
||||
Map<Integer, Long> onlineTimeOfDay = gsUser.getPlayerManager().getOnlineTimeOfDay();
|
||||
long sumTime = 0;
|
||||
if (onlineTimeOfDay != null && onlineTimeOfDay.containsKey(date)) {
|
||||
sumTime = onlineTimeOfDay.get(date);
|
||||
} else {
|
||||
sumTime = 0;
|
||||
}
|
||||
jsonObject1.put("online_time", sumTime); //todo 修改记录数据
|
||||
}
|
||||
|
||||
jsonObject1.put("paynum", String.valueOf(gsUser.getPlayerManager().getRechargeInfo().getSaveAmt()));
|
||||
|
||||
if (type == 5) {
|
||||
jsonObject1.put("fight_value", String.valueOf(gsUser.getPlayerManager().getMaxForce()));
|
||||
jsonObject1.put("level", String.valueOf(gsUser.getPlayerManager().getLevel()));
|
||||
}
|
||||
if (type == 6) {
|
||||
jsonObject1.put("level", String.valueOf(gsUser.getPlayerManager().getLevel()));
|
||||
jsonObject1.put("profession", "");
|
||||
jsonObject1.put("profession_name", "");
|
||||
}
|
||||
}
|
||||
baseVo.setData(jsonObject1);
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "serverroleinfo";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.jmfy.handler.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.dao.RoleListDao;
|
||||
import com.jmfy.dao.ServerListDao;
|
||||
import com.jmfy.dao.ServerRoleListDao;
|
||||
import com.jmfy.handler.BaseHandler;
|
||||
import com.jmfy.handler.MarkedInfo;
|
||||
import com.jmfy.model.CoreServerList;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.modelVo.BaseVo;
|
||||
import com.jmfy.modelVo.MarkedVo;
|
||||
import com.jmfy.modelVo.RoleListVo;
|
||||
import com.jmfy.modelVo.ServerRoleListVo;
|
||||
import com.jmfy.util.SDK37Constans;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ServerRoleListInServerHandler extends BaseHandler {
|
||||
private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ServerRoleListInServerHandler.class);
|
||||
|
||||
@Resource
|
||||
private ServerRoleListDao serverRoleListDao;
|
||||
@Resource
|
||||
private ServerListDao serverListDao;
|
||||
@Resource
|
||||
private GSUserDao gsUserDao;
|
||||
|
||||
@Override
|
||||
public BaseVo execute(JSONObject jsonObject) throws Exception {
|
||||
|
||||
long time = 0;
|
||||
String uid = "";
|
||||
String dsid = "";
|
||||
String sign = "";
|
||||
if (jsonObject.containsKey("time") && jsonObject.containsKey("uid") && jsonObject.containsKey("dsid") && jsonObject.containsKey("sign")) {
|
||||
time = jsonObject.getLong("time");
|
||||
dsid = jsonObject.getString("dsid");
|
||||
uid = jsonObject.getString("uid");
|
||||
sign = jsonObject.getString("sign");
|
||||
} else {
|
||||
throw new Exception("缺少参数");
|
||||
}
|
||||
if (!validSign(String.valueOf(time) + String.valueOf(getPid())
|
||||
+ String.valueOf(getGid()) + String.valueOf(dsid) + String.valueOf(uid)
|
||||
+ SDK37Constans.appkey, sign)) {
|
||||
throw new Exception("签名错误");
|
||||
}
|
||||
|
||||
BaseVo baseVo = new BaseVo();
|
||||
MarkedVo marked = MarkedInfo.getMarkedVo(jsonObject);
|
||||
LOGGER.info("-->areaId={},platId={},openid={},serverId={}", marked.getAreaId(), marked.getPlatId(), marked.getOpenId(), marked.getPartition());
|
||||
|
||||
|
||||
List<RoleListVo> roleListVos = new ArrayList<>();
|
||||
|
||||
List<CoreUserInfo> coreUserInfoList = serverRoleListDao.findServerRoleList(marked);
|
||||
if (coreUserInfoList == null) {
|
||||
throw new Exception("openid does not exist");
|
||||
} else {
|
||||
|
||||
for (CoreUserInfo coreUserInfo : coreUserInfoList) {
|
||||
MarkedVo marked1 = new MarkedVo();
|
||||
marked1.setOpenId(coreUserInfo.getOpenId());
|
||||
marked1.setPartition(String.valueOf(coreUserInfo.getServerid()));
|
||||
|
||||
RoleListVo roleListVo = new RoleListVo();
|
||||
|
||||
GSUser gsUser = gsUserDao.findUserInfo(marked1, coreUserInfo.getUid());
|
||||
|
||||
if (null == gsUser) {
|
||||
throw new Exception("帐号不存在");
|
||||
}
|
||||
roleListVo.setDrlevel(String.valueOf(gsUser.getPlayerManager().getLevel()));
|
||||
roleListVo.setDrname(gsUser.getPlayerManager().getNickName());
|
||||
roleListVo.setDrid(String.valueOf(coreUserInfo.getUid()));
|
||||
roleListVo.setDsid(String.valueOf(coreUserInfo.getServerid()));
|
||||
CoreServerList coreServerList = serverListDao.findServer(marked1);
|
||||
if (null == coreServerList) {
|
||||
throw new Exception("应用不存在");
|
||||
}
|
||||
roleListVo.setDsname(coreServerList.getName());
|
||||
roleListVos.add(roleListVo);
|
||||
}
|
||||
|
||||
}
|
||||
baseVo.setData(roleListVos);
|
||||
baseVo.setState(1);
|
||||
baseVo.setMsg("成功");
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestURI() {
|
||||
return "serverrolelist";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
|
||||
@Document(collection = "user_buried_point")
|
||||
public class BuriedPoint {
|
||||
|
||||
@JsonProperty(value = "channelUserId")
|
||||
private String channelUserId;
|
||||
|
||||
@JsonProperty(value = "channel")
|
||||
private String channel;
|
||||
|
||||
@JsonProperty(value = "userId")
|
||||
private int userId;
|
||||
|
||||
@JsonProperty(value = "point")
|
||||
private String point;
|
||||
|
||||
public String getChannelUserId() {
|
||||
return channelUserId;
|
||||
}
|
||||
|
||||
public void setChannelUserId(String channelUserId) {
|
||||
this.channelUserId = channelUserId;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint(String point) {
|
||||
this.point = point;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
|
||||
@Document(collection="inc_c")
|
||||
public class CAutoIncrement {
|
||||
@Id
|
||||
private String name;
|
||||
|
||||
@Field(value = "uid")
|
||||
private int uid;
|
||||
|
||||
@Field(value = "server_id")
|
||||
private int server_id;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getServer_id() {
|
||||
return server_id;
|
||||
}
|
||||
|
||||
public void setServer_id(int server_id) {
|
||||
this.server_id = server_id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
public class CDataBaseVersion {
|
||||
|
||||
|
||||
private int version;
|
||||
private String tables;
|
||||
|
||||
public CDataBaseVersion(int version) {
|
||||
this.version = version;
|
||||
this.tables = "";
|
||||
}
|
||||
|
||||
public CDataBaseVersion() {
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public String getTables() {
|
||||
return tables;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/8/11.
|
||||
*/
|
||||
@Document(collection="server_info")
|
||||
public class CoreServerList {
|
||||
@Id
|
||||
private String _id;//ID
|
||||
|
||||
@Field(value = "name")
|
||||
private String name;//name
|
||||
|
||||
@Field(value = "ip")
|
||||
private String ip;
|
||||
|
||||
@Field(value = "port")
|
||||
private String port;
|
||||
|
||||
public String get_id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
public void set_id(String _id) {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Document(collection="user_info")
|
||||
public class CoreUserInfo {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
@Field(value = "openId")
|
||||
private String openId;
|
||||
|
||||
@Field(value = "uid")
|
||||
private int uid;
|
||||
|
||||
@Field(value = "serverId")
|
||||
private int serverid;
|
||||
|
||||
@Field(value = "area")
|
||||
private int area;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getServerid() {
|
||||
return serverid;
|
||||
}
|
||||
|
||||
public void setServerid(int serverid) {
|
||||
this.serverid = serverid;
|
||||
}
|
||||
|
||||
public int getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(int area) {
|
||||
this.area = area;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,321 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
|
||||
public class GSPlayerManagerBean {
|
||||
|
||||
private String openId;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private int level;
|
||||
|
||||
private int exp;
|
||||
|
||||
private int vipLevel;
|
||||
|
||||
private String head;
|
||||
|
||||
private int mapId;
|
||||
|
||||
private long createTime; //创建时间
|
||||
|
||||
private String clientVersion;
|
||||
|
||||
private int maxStamina ; // 最大体力
|
||||
|
||||
private long offLineTime;// 离线时间
|
||||
|
||||
private long loginTime;
|
||||
|
||||
private int hadTakeLevelBoxVip; //领取vip等级礼包
|
||||
|
||||
private int hadTakeDailyBoxVip=-1; //领取vip每日礼包
|
||||
|
||||
private int maxForce; //玩家历史最高战力
|
||||
|
||||
private Map<Integer,Integer> guidePoints = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> vipInfo = new HashMap<>();
|
||||
|
||||
private Set<Integer> reds = new CopyOnWriteArraySet<>();
|
||||
|
||||
private GSRechargeInfoBean rechargeInfo;
|
||||
|
||||
private int headFrame;
|
||||
|
||||
private int treasureScore; //孙龙的宝藏分数
|
||||
|
||||
private int hadBuyTreasure; //是否已购
|
||||
|
||||
private int guildId ;// 公会id
|
||||
|
||||
private int sign;//月签到天数
|
||||
|
||||
private int signTotay;//今天是否签到
|
||||
|
||||
private int rechargedaily;
|
||||
|
||||
private long onlineTime;
|
||||
|
||||
private int isdayFirst = 0;//给客户端记录下
|
||||
|
||||
private Set<Integer> fixIds = new CopyOnWriteArraySet<>();
|
||||
|
||||
private int sendDays;
|
||||
|
||||
private Map<Integer,Long> onlineTimeOfDay = new HashMap<>(); // 20190808
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public void setExp(int exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
public int getVipLevel() {
|
||||
return vipLevel;
|
||||
}
|
||||
|
||||
public void setVipLevel(int vipLevel) {
|
||||
this.vipLevel = vipLevel;
|
||||
}
|
||||
|
||||
public String getHead() {
|
||||
return head;
|
||||
}
|
||||
|
||||
public void setHead(String head) {
|
||||
this.head = head;
|
||||
}
|
||||
|
||||
public int getMapId() {
|
||||
return mapId;
|
||||
}
|
||||
|
||||
public void setMapId(int mapId) {
|
||||
this.mapId = mapId;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getClientVersion() {
|
||||
return clientVersion;
|
||||
}
|
||||
|
||||
public void setClientVersion(String clientVersion) {
|
||||
this.clientVersion = clientVersion;
|
||||
}
|
||||
|
||||
public int getMaxStamina() {
|
||||
return maxStamina;
|
||||
}
|
||||
|
||||
public void setMaxStamina(int maxStamina) {
|
||||
this.maxStamina = maxStamina;
|
||||
}
|
||||
|
||||
public long getOffLineTime() {
|
||||
return offLineTime;
|
||||
}
|
||||
|
||||
public void setOffLineTime(long offLineTime) {
|
||||
this.offLineTime = offLineTime;
|
||||
}
|
||||
|
||||
public long getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(long loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public int getHadTakeLevelBoxVip() {
|
||||
return hadTakeLevelBoxVip;
|
||||
}
|
||||
|
||||
public void setHadTakeLevelBoxVip(int hadTakeLevelBoxVip) {
|
||||
this.hadTakeLevelBoxVip = hadTakeLevelBoxVip;
|
||||
}
|
||||
|
||||
public int getHadTakeDailyBoxVip() {
|
||||
return hadTakeDailyBoxVip;
|
||||
}
|
||||
|
||||
public void setHadTakeDailyBoxVip(int hadTakeDailyBoxVip) {
|
||||
this.hadTakeDailyBoxVip = hadTakeDailyBoxVip;
|
||||
}
|
||||
|
||||
public int getMaxForce() {
|
||||
return maxForce;
|
||||
}
|
||||
|
||||
public void setMaxForce(int maxForce) {
|
||||
this.maxForce = maxForce;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getGuidePoints() {
|
||||
return guidePoints;
|
||||
}
|
||||
|
||||
public void setGuidePoints(Map<Integer, Integer> guidePoints) {
|
||||
this.guidePoints = guidePoints;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getVipInfo() {
|
||||
return vipInfo;
|
||||
}
|
||||
|
||||
public void setVipInfo(Map<Integer, Integer> vipInfo) {
|
||||
this.vipInfo = vipInfo;
|
||||
}
|
||||
|
||||
public Set<Integer> getReds() {
|
||||
return reds;
|
||||
}
|
||||
|
||||
public void setReds(Set<Integer> reds) {
|
||||
this.reds = reds;
|
||||
}
|
||||
|
||||
public GSRechargeInfoBean getRechargeInfo() {
|
||||
return rechargeInfo;
|
||||
}
|
||||
|
||||
public void setRechargeInfo(GSRechargeInfoBean rechargeInfo) {
|
||||
this.rechargeInfo = rechargeInfo;
|
||||
}
|
||||
|
||||
public int getHeadFrame() {
|
||||
return headFrame;
|
||||
}
|
||||
|
||||
public void setHeadFrame(int headFrame) {
|
||||
this.headFrame = headFrame;
|
||||
}
|
||||
|
||||
public int getTreasureScore() {
|
||||
return treasureScore;
|
||||
}
|
||||
|
||||
public void setTreasureScore(int treasureScore) {
|
||||
this.treasureScore = treasureScore;
|
||||
}
|
||||
|
||||
public int getHadBuyTreasure() {
|
||||
return hadBuyTreasure;
|
||||
}
|
||||
|
||||
public void setHadBuyTreasure(int hadBuyTreasure) {
|
||||
this.hadBuyTreasure = hadBuyTreasure;
|
||||
}
|
||||
|
||||
public int getGuildId() {
|
||||
return guildId;
|
||||
}
|
||||
|
||||
public void setGuildId(int guildId) {
|
||||
this.guildId = guildId;
|
||||
}
|
||||
|
||||
public int getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(int sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public int getSignTotay() {
|
||||
return signTotay;
|
||||
}
|
||||
|
||||
public void setSignTotay(int signTotay) {
|
||||
this.signTotay = signTotay;
|
||||
}
|
||||
|
||||
public int getRechargedaily() {
|
||||
return rechargedaily;
|
||||
}
|
||||
|
||||
public void setRechargedaily(int rechargedaily) {
|
||||
this.rechargedaily = rechargedaily;
|
||||
}
|
||||
|
||||
public long getOnlineTime() {
|
||||
return onlineTime;
|
||||
}
|
||||
|
||||
public void setOnlineTime(long onlineTime) {
|
||||
this.onlineTime = onlineTime;
|
||||
}
|
||||
|
||||
public int getIsdayFirst() {
|
||||
return isdayFirst;
|
||||
}
|
||||
|
||||
public void setIsdayFirst(int isdayFirst) {
|
||||
this.isdayFirst = isdayFirst;
|
||||
}
|
||||
|
||||
public Set<Integer> getFixIds() {
|
||||
return fixIds;
|
||||
}
|
||||
|
||||
public void setFixIds(Set<Integer> fixIds) {
|
||||
this.fixIds = fixIds;
|
||||
}
|
||||
|
||||
public int getSendDays() {
|
||||
return sendDays;
|
||||
}
|
||||
|
||||
public void setSendDays(int sendDays) {
|
||||
this.sendDays = sendDays;
|
||||
}
|
||||
|
||||
public Map<Integer, Long> getOnlineTimeOfDay() {
|
||||
return onlineTimeOfDay;
|
||||
}
|
||||
|
||||
public void setOnlineTimeOfDay(Map<Integer, Long> onlineTimeOfDay) {
|
||||
this.onlineTimeOfDay = onlineTimeOfDay;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class GSRechargeInfoBean {
|
||||
|
||||
private int saveAmt;//累计充值
|
||||
private int isFirst;
|
||||
private long createTime;
|
||||
private int hadBuyFound;
|
||||
private int isDayFirst;
|
||||
|
||||
private Map<Integer,Long> levelBagMap = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> buyGoodsTimes = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> goodseDurationMap = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> goodseSendDailyMap = new HashMap<>();
|
||||
|
||||
public GSRechargeInfoBean(){
|
||||
|
||||
}
|
||||
|
||||
public int getSaveAmt() {
|
||||
return saveAmt;
|
||||
}
|
||||
|
||||
public void setSaveAmt(int saveAmt) {
|
||||
this.saveAmt = saveAmt;
|
||||
}
|
||||
|
||||
public int getIsFirst() {
|
||||
return isFirst;
|
||||
}
|
||||
|
||||
public void setIsFirst(int isFirst) {
|
||||
this.isFirst = isFirst;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public int getHadBuyFound() {
|
||||
return hadBuyFound;
|
||||
}
|
||||
|
||||
public void setHadBuyFound(int hadBuyFound) {
|
||||
this.hadBuyFound = hadBuyFound;
|
||||
}
|
||||
|
||||
public int getIsDayFirst() {
|
||||
return isDayFirst;
|
||||
}
|
||||
|
||||
public void setIsDayFirst(int isDayFirst) {
|
||||
this.isDayFirst = isDayFirst;
|
||||
}
|
||||
|
||||
public Map<Integer, Long> getLevelBagMap() {
|
||||
return levelBagMap;
|
||||
}
|
||||
|
||||
public void setLevelBagMap(Map<Integer, Long> levelBagMap) {
|
||||
this.levelBagMap = levelBagMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getBuyGoodsTimes() {
|
||||
return buyGoodsTimes;
|
||||
}
|
||||
|
||||
public void setBuyGoodsTimes(Map<Integer, Integer> buyGoodsTimes) {
|
||||
this.buyGoodsTimes = buyGoodsTimes;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getGoodseDurationMap() {
|
||||
return goodseDurationMap;
|
||||
}
|
||||
|
||||
public void setGoodseDurationMap(Map<Integer, Integer> goodseDurationMap) {
|
||||
this.goodseDurationMap = goodseDurationMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getGoodseSendDailyMap() {
|
||||
return goodseSendDailyMap;
|
||||
}
|
||||
|
||||
public void setGoodseSendDailyMap(Map<Integer, Integer> goodseSendDailyMap) {
|
||||
this.goodseSendDailyMap = goodseSendDailyMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
@Document(collection = "user")
|
||||
public class GSUser implements java.io.Serializable {
|
||||
@Id
|
||||
private int id;
|
||||
|
||||
@Field(value = "playerManager")
|
||||
private GSPlayerManagerBean playerManager;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public GSPlayerManagerBean getPlayerManager() {
|
||||
return playerManager;
|
||||
}
|
||||
|
||||
public void setPlayerManager(GSPlayerManagerBean playerManager) {
|
||||
this.playerManager = playerManager;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
public class MainLevelManager {
|
||||
private int fightId; // 当前关卡id
|
||||
|
||||
public int getFightId() {
|
||||
return fightId;
|
||||
}
|
||||
|
||||
public void setFightId(int fightId) {
|
||||
this.fightId = fightId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Created by Marvin on 2017/9/20.
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "kafka")
|
||||
public class MyKafkaProperties {
|
||||
|
||||
private String serversUri = "127.0.0.1:9092";
|
||||
|
||||
private String producerAcks = "all";
|
||||
|
||||
private int producerRetries = 0;
|
||||
|
||||
private int producerBatchSize = 16384;
|
||||
|
||||
private int producerLinger = 1;
|
||||
|
||||
private int producerBufferMemory = 33554432;
|
||||
|
||||
private String consumerGroupId = "ysj";
|
||||
|
||||
private boolean consumerEnableAutoCommit = true;
|
||||
|
||||
private int consumerAutoCommitInterval = 1000;
|
||||
|
||||
private int consumerSessionTimeout = 30000;
|
||||
|
||||
private int consumerMaxPollRecords = 100;
|
||||
|
||||
|
||||
public String getServersUri() {
|
||||
return serversUri;
|
||||
}
|
||||
|
||||
public void setServersUri(String serversUri) {
|
||||
this.serversUri = serversUri;
|
||||
}
|
||||
|
||||
public String getProducerAcks() {
|
||||
return producerAcks;
|
||||
}
|
||||
|
||||
public void setProducerAcks(String producerAcks) {
|
||||
this.producerAcks = producerAcks;
|
||||
}
|
||||
|
||||
public int getProducerRetries() {
|
||||
return producerRetries;
|
||||
}
|
||||
|
||||
public void setProducerRetries(int producerRetries) {
|
||||
this.producerRetries = producerRetries;
|
||||
}
|
||||
|
||||
public int getProducerBatchSize() {
|
||||
return producerBatchSize;
|
||||
}
|
||||
|
||||
public void setProducerBatchSize(int producerBatchSize) {
|
||||
this.producerBatchSize = producerBatchSize;
|
||||
}
|
||||
|
||||
public int getProducerLinger() {
|
||||
return producerLinger;
|
||||
}
|
||||
|
||||
public void setProducerLinger(int producerLinger) {
|
||||
this.producerLinger = producerLinger;
|
||||
}
|
||||
|
||||
public int getProducerBufferMemory() {
|
||||
return producerBufferMemory;
|
||||
}
|
||||
|
||||
public void setProducerBufferMemory(int producerBufferMemory) {
|
||||
this.producerBufferMemory = producerBufferMemory;
|
||||
}
|
||||
|
||||
public String getConsumerGroupId() {
|
||||
return consumerGroupId;
|
||||
}
|
||||
|
||||
public void setConsumerGroupId(String consumerGroupId) {
|
||||
this.consumerGroupId = consumerGroupId;
|
||||
}
|
||||
|
||||
public boolean isConsumerEnableAutoCommit() {
|
||||
return consumerEnableAutoCommit;
|
||||
}
|
||||
|
||||
public void setConsumerEnableAutoCommit(boolean consumerEnableAutoCommit) {
|
||||
this.consumerEnableAutoCommit = consumerEnableAutoCommit;
|
||||
}
|
||||
|
||||
public int getConsumerAutoCommitInterval() {
|
||||
return consumerAutoCommitInterval;
|
||||
}
|
||||
|
||||
public void setConsumerAutoCommitInterval(int consumerAutoCommitInterval) {
|
||||
this.consumerAutoCommitInterval = consumerAutoCommitInterval;
|
||||
}
|
||||
|
||||
public int getConsumerSessionTimeout() {
|
||||
return consumerSessionTimeout;
|
||||
}
|
||||
|
||||
public void setConsumerSessionTimeout(int consumerSessionTimeout) {
|
||||
this.consumerSessionTimeout = consumerSessionTimeout;
|
||||
}
|
||||
|
||||
public int getConsumerMaxPollRecords() {
|
||||
return consumerMaxPollRecords;
|
||||
}
|
||||
|
||||
public void setConsumerMaxPollRecords(int consumerMaxPollRecords) {
|
||||
this.consumerMaxPollRecords = consumerMaxPollRecords;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Created by justin on 14-8-2.
|
||||
*/
|
||||
|
||||
@ConfigurationProperties(prefix = "netty")
|
||||
public class NettyProperties {
|
||||
|
||||
private int tcpPort;
|
||||
private int udpPort;
|
||||
private String udpTargetIp;
|
||||
private int udpTargetPort;
|
||||
private int reconnectDelay=300000;
|
||||
private int bossThreadCount=2;
|
||||
private int workerThreadCount=2;
|
||||
private int readTimeout=600;
|
||||
private int writeTimeout=600;
|
||||
private int allTimeout=1000;
|
||||
|
||||
public NettyProperties(){}
|
||||
|
||||
|
||||
public int getTcpPort() {
|
||||
return tcpPort;
|
||||
}
|
||||
|
||||
public void setTcpPort(int tcpPort) {
|
||||
this.tcpPort = tcpPort;
|
||||
}
|
||||
|
||||
public int getUdpPort() {
|
||||
return udpPort;
|
||||
}
|
||||
|
||||
public void setUdpPort(int udpPort) {
|
||||
this.udpPort = udpPort;
|
||||
}
|
||||
|
||||
public int getReconnectDelay() {
|
||||
return reconnectDelay;
|
||||
}
|
||||
|
||||
public void setReconnectDelay(int reconnectDelay) {
|
||||
this.reconnectDelay = reconnectDelay;
|
||||
}
|
||||
|
||||
public int getBossThreadCount() {
|
||||
return bossThreadCount;
|
||||
}
|
||||
|
||||
public void setBossThreadCount(int bossThreadCount) {
|
||||
this.bossThreadCount = bossThreadCount;
|
||||
}
|
||||
|
||||
public int getWorkerThreadCount() {
|
||||
return workerThreadCount;
|
||||
}
|
||||
|
||||
public void setWorkerThreadCount(int workerThreadCount) {
|
||||
this.workerThreadCount = workerThreadCount;
|
||||
}
|
||||
|
||||
public int getReadTimeout() {
|
||||
return readTimeout;
|
||||
}
|
||||
|
||||
public void setReadTimeout(int readTimeout) {
|
||||
this.readTimeout = readTimeout;
|
||||
}
|
||||
|
||||
public int getWriteTimeout() {
|
||||
return writeTimeout;
|
||||
}
|
||||
|
||||
public void setWriteTimeout(int writeTimeout) {
|
||||
this.writeTimeout = writeTimeout;
|
||||
}
|
||||
|
||||
public int getAllTimeout() {
|
||||
return allTimeout;
|
||||
}
|
||||
|
||||
public void setAllTimeout(int allTimeout) {
|
||||
this.allTimeout = allTimeout;
|
||||
}
|
||||
|
||||
public String getUdpTargetIp() {
|
||||
return udpTargetIp;
|
||||
}
|
||||
|
||||
public void setUdpTargetIp(String udpTargetIp) {
|
||||
this.udpTargetIp = udpTargetIp;
|
||||
}
|
||||
|
||||
public int getUdpTargetPort() {
|
||||
return udpTargetPort;
|
||||
}
|
||||
|
||||
public void setUdpTargetPort(int udpTargetPort) {
|
||||
this.udpTargetPort = udpTargetPort;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2015/8/13
|
||||
*/
|
||||
|
||||
public class NoticeInfo {
|
||||
|
||||
|
||||
private String _id;
|
||||
private String content;
|
||||
private String title;
|
||||
private int leve;
|
||||
private long startTime;
|
||||
private long endTime;
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String get_id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
public void set_id(String _id) {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public int getLeve() {
|
||||
return leve;
|
||||
}
|
||||
|
||||
public void setLeve(int leve) {
|
||||
this.leve = leve;
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(long startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public long getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(long endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
public class PlayerManager {
|
||||
private String openId;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private int level;
|
||||
|
||||
private int maxForce; //玩家历史最高战力
|
||||
|
||||
private long createTime; //创建时间
|
||||
|
||||
|
||||
private RechargeInfo rechargeInfo;
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getMaxForce() {
|
||||
return maxForce;
|
||||
}
|
||||
|
||||
public void setMaxForce(int maxForce) {
|
||||
this.maxForce = maxForce;
|
||||
}
|
||||
|
||||
public RechargeInfo getRechargeInfo() {
|
||||
return rechargeInfo;
|
||||
}
|
||||
|
||||
public void setRechargeInfo(RechargeInfo rechargeInfo) {
|
||||
this.rechargeInfo = rechargeInfo;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
public class RechargeInfo {
|
||||
private double saveAmt;//累计充值
|
||||
|
||||
public double getSaveAmt() {
|
||||
return saveAmt;
|
||||
}
|
||||
|
||||
public void setSaveAmt(double saveAmt) {
|
||||
this.saveAmt = saveAmt;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RoleInfo {
|
||||
@JsonProperty(value = "Partition")
|
||||
private int partition;
|
||||
@JsonProperty(value = "RoleId")
|
||||
private int roleId;
|
||||
@JsonProperty(value = "openId")
|
||||
private String openId;
|
||||
@JsonProperty(value = "Level")
|
||||
private int level;
|
||||
|
||||
public int getPartition() {
|
||||
return partition;
|
||||
}
|
||||
|
||||
public void setPartition(int partition) {
|
||||
this.partition = partition;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(int roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,277 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2015/8/13
|
||||
*/
|
||||
|
||||
@Document(collection = "server_info")
|
||||
public class ServerInfo {
|
||||
@Id
|
||||
private int _id;
|
||||
|
||||
@Field(value = "server_id")
|
||||
private int server_id;
|
||||
|
||||
@Field(value = "real_server_id")
|
||||
private int realServerId;
|
||||
|
||||
@Field(value = "IP")
|
||||
private String IP;
|
||||
|
||||
@Field(value = "port")
|
||||
private Integer port;
|
||||
|
||||
@Field(value = "name")
|
||||
private String name;
|
||||
|
||||
@Field(value = "type")
|
||||
private int type;
|
||||
|
||||
@Field(value = "open_time")
|
||||
private long open_time;
|
||||
/* 人工配置服务器状态:维护(1),流畅(2),拥挤(3),爆满(4) */
|
||||
@Field(value = "status")
|
||||
private int status;
|
||||
|
||||
@Field(value = "info")
|
||||
private String serverInfo;
|
||||
|
||||
@Field(value = "channel")
|
||||
private String channel;
|
||||
|
||||
@Field(value = "sub_channel")
|
||||
private String sub_channel;
|
||||
|
||||
@Field(value = "plat")
|
||||
private String plat;
|
||||
//0新服 1 为旧服
|
||||
@Field(value = "is_new")
|
||||
private int is_new;
|
||||
|
||||
@Field(value = "isWhite")
|
||||
private int isWhite ;
|
||||
/* 服务器状态判断类型:人工配置(0),服务器自动判断(1) */
|
||||
@Field(value = "status_type")
|
||||
private int status_type;
|
||||
/* 自动判断参数总注册阀值(人) */
|
||||
@Field(value = "total_server_register")
|
||||
private int total_server_register;
|
||||
/* 自动判断同时在线阀值上限(人) */
|
||||
@Field(value = "high_oniline")
|
||||
private int high_oniline;
|
||||
/* 自动判断同时在线阀值下限(人) */
|
||||
@Field(value = "low_online")
|
||||
private int low_online;
|
||||
/* 推荐状态判断类型:人工配置(0),服务器自动判断(1) */
|
||||
@Field(value = "commend_type")
|
||||
private int commend_type;
|
||||
/* 是否推荐服:否(0),是(1) */
|
||||
@Field(value = "is_ommend")
|
||||
private int is_ommend;
|
||||
/* 自动判断参数总注册阀值(人) */
|
||||
@Field(value = "total_register")
|
||||
private int total_register;
|
||||
/* 自动判断同时在线阀值(人) */
|
||||
@Field(value = "online_gate")
|
||||
private int online_gate;
|
||||
@Field(value = "mongo_url")
|
||||
private String mongoUrl;
|
||||
|
||||
public int get_id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
public void set_id(int _id) {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public int getServer_id() {
|
||||
return server_id;
|
||||
}
|
||||
|
||||
public void setServer_id(int server_id) {
|
||||
this.server_id = server_id;
|
||||
}
|
||||
|
||||
public String getIP() {
|
||||
return IP;
|
||||
}
|
||||
|
||||
public void setIP(String IP) {
|
||||
this.IP = IP;
|
||||
}
|
||||
|
||||
public Integer getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public long getOpen_time() {
|
||||
return open_time;
|
||||
}
|
||||
|
||||
public void setOpen_time(long open_time) {
|
||||
this.open_time = open_time;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getServerInfo() {
|
||||
return serverInfo;
|
||||
}
|
||||
|
||||
public void setServerInfo(String serverInfo) {
|
||||
this.serverInfo = serverInfo;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public String getSub_channel() {
|
||||
return sub_channel;
|
||||
}
|
||||
|
||||
public void setSub_channel(String sub_channel) {
|
||||
this.sub_channel = sub_channel;
|
||||
}
|
||||
|
||||
public String getPlat() {
|
||||
return plat;
|
||||
}
|
||||
|
||||
public void setPlat(String plat) {
|
||||
this.plat = plat;
|
||||
}
|
||||
|
||||
public int getIs_new() {
|
||||
return is_new;
|
||||
}
|
||||
|
||||
public void setIs_new(int is_new) {
|
||||
this.is_new = is_new;
|
||||
}
|
||||
|
||||
public int getIsWhite() {
|
||||
return isWhite;
|
||||
}
|
||||
|
||||
public void setIsWhite(int isWhite) {
|
||||
this.isWhite = isWhite;
|
||||
}
|
||||
|
||||
public int getStatus_type() {
|
||||
return status_type;
|
||||
}
|
||||
|
||||
public void setStatus_type(int status_type) {
|
||||
this.status_type = status_type;
|
||||
}
|
||||
|
||||
public int getTotal_server_register() {
|
||||
return total_server_register;
|
||||
}
|
||||
|
||||
public void setTotal_server_register(int total_server_register) {
|
||||
this.total_server_register = total_server_register;
|
||||
}
|
||||
|
||||
public int getHigh_oniline() {
|
||||
return high_oniline;
|
||||
}
|
||||
|
||||
public void setHigh_oniline(int high_oniline) {
|
||||
this.high_oniline = high_oniline;
|
||||
}
|
||||
|
||||
public int getLow_online() {
|
||||
return low_online;
|
||||
}
|
||||
|
||||
public void setLow_online(int low_online) {
|
||||
this.low_online = low_online;
|
||||
}
|
||||
|
||||
public int getCommend_type() {
|
||||
return commend_type;
|
||||
}
|
||||
|
||||
public void setCommend_type(int commend_type) {
|
||||
this.commend_type = commend_type;
|
||||
}
|
||||
|
||||
public int getIs_ommend() {
|
||||
return is_ommend;
|
||||
}
|
||||
|
||||
public void setIs_ommend(int is_ommend) {
|
||||
this.is_ommend = is_ommend;
|
||||
}
|
||||
|
||||
public int getTotal_register() {
|
||||
return total_register;
|
||||
}
|
||||
|
||||
public void setTotal_register(int total_register) {
|
||||
this.total_register = total_register;
|
||||
}
|
||||
|
||||
public int getOnline_gate() {
|
||||
return online_gate;
|
||||
}
|
||||
|
||||
public void setOnline_gate(int online_gate) {
|
||||
this.online_gate = online_gate;
|
||||
}
|
||||
|
||||
public String getMongoUrl() {
|
||||
return mongoUrl;
|
||||
}
|
||||
|
||||
public void setMongoUrl(String mongoUrl) {
|
||||
this.mongoUrl = mongoUrl;
|
||||
}
|
||||
|
||||
public int getRealServerId() {
|
||||
return realServerId;
|
||||
}
|
||||
|
||||
public void setRealServerId(int realServerId) {
|
||||
this.realServerId = realServerId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
@Document(collection="user")
|
||||
public class User {
|
||||
@Id
|
||||
private Integer id;
|
||||
@Field(value = "playerManager")
|
||||
private PlayerManager playerManager;
|
||||
@Field(value = "mainLevelManager")
|
||||
private MainLevelManager mainLevelManager;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public PlayerManager getPlayerManager() {
|
||||
return playerManager;
|
||||
}
|
||||
|
||||
public void setPlayerManager(PlayerManager playerManager) {
|
||||
this.playerManager = playerManager;
|
||||
}
|
||||
|
||||
public MainLevelManager getMainLevelManager() {
|
||||
return mainLevelManager;
|
||||
}
|
||||
|
||||
public void setMainLevelManager(MainLevelManager mainLevelManager) {
|
||||
this.mainLevelManager = mainLevelManager;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/8/11.
|
||||
*/
|
||||
@Document(collection="white_list")
|
||||
public class WhiteList {
|
||||
@Id
|
||||
private String id;//ID
|
||||
|
||||
@Field(value = "white_openid")
|
||||
private String white_openid;//用户openId
|
||||
|
||||
@Field(value = "plat")
|
||||
private String plat;//用户平台
|
||||
|
||||
@Field(value = "channel")
|
||||
private String channel;//用户渠道 微信 , 手q
|
||||
@Field(value = "serverid")
|
||||
private int serverid;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getWhite_openid() {
|
||||
return white_openid;
|
||||
}
|
||||
|
||||
public void setWhite_openid(String white_openid) {
|
||||
this.white_openid = white_openid;
|
||||
}
|
||||
|
||||
public String getPlat() {
|
||||
return plat;
|
||||
}
|
||||
|
||||
public void setPlat(String plat) {
|
||||
this.plat = plat;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public int getServerid() {
|
||||
return serverid;
|
||||
}
|
||||
|
||||
public void setServerid(int serverid) {
|
||||
this.serverid = serverid;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.jmfy.model.sdk;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "order")
|
||||
public class Order {
|
||||
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty(value = "orderId")
|
||||
private String orderId;
|
||||
|
||||
private int serverId;
|
||||
|
||||
private String uid;
|
||||
|
||||
private String productCode;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String productCount;
|
||||
|
||||
private String payTime;
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public int getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(int serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getProductCode() {
|
||||
return productCode;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode) {
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductCount() {
|
||||
return productCount;
|
||||
}
|
||||
|
||||
public void setProductCount(String productCount) {
|
||||
this.productCount = productCount;
|
||||
}
|
||||
|
||||
public String getPayTime() {
|
||||
return payTime;
|
||||
}
|
||||
|
||||
public void setPayTime(String payTime) {
|
||||
this.payTime = payTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.model.sdk;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "user_register_info")
|
||||
public class RegisterUser {
|
||||
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty(value = "openId")
|
||||
private String openId;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.jmfy.model.sdk6kw;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "order")
|
||||
public class Order {
|
||||
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty(value = "orderId")
|
||||
private String orderId;
|
||||
|
||||
private int serverId;
|
||||
|
||||
private String uid;
|
||||
|
||||
private String productCode;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String productCount;
|
||||
|
||||
private String payTime;
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public int getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(int serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getProductCode() {
|
||||
return productCode;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode) {
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductCount() {
|
||||
return productCount;
|
||||
}
|
||||
|
||||
public void setProductCount(String productCount) {
|
||||
this.productCount = productCount;
|
||||
}
|
||||
|
||||
public String getPayTime() {
|
||||
return payTime;
|
||||
}
|
||||
|
||||
public void setPayTime(String payTime) {
|
||||
this.payTime = payTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.model.sdk6kw;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "user_register_info")
|
||||
public class RegisterUser {
|
||||
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty(value = "openId")
|
||||
private String openId;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.jmfy.model.xiaomi;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "order")
|
||||
public class Order {
|
||||
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty(value = "orderId")
|
||||
private String orderId;
|
||||
|
||||
private int serverId;
|
||||
|
||||
private String uid;
|
||||
|
||||
private String productCode;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String productCount;
|
||||
|
||||
private String payTime;
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public int getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(int serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getProductCode() {
|
||||
return productCode;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode) {
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductCount() {
|
||||
return productCount;
|
||||
}
|
||||
|
||||
public void setProductCount(String productCount) {
|
||||
this.productCount = productCount;
|
||||
}
|
||||
|
||||
public String getPayTime() {
|
||||
return payTime;
|
||||
}
|
||||
|
||||
public void setPayTime(String payTime) {
|
||||
this.payTime = payTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.jmfy.model.xiaomi;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "user_register_info")
|
||||
public class RegisterUser {
|
||||
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty(value = "openId")
|
||||
private String openId;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class BaseVo implements IBaseVo{
|
||||
|
||||
@JsonProperty(value = "state")
|
||||
private int state;
|
||||
|
||||
@JsonProperty(value = "data")
|
||||
private Object data;
|
||||
|
||||
@JsonProperty(value = "msg")
|
||||
private String msg;
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
public interface IBaseVo {
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class MarkedVo {
|
||||
|
||||
@JsonProperty(value = "AreaId")
|
||||
private String areaId;
|
||||
@JsonProperty(value = "PlatId")
|
||||
private String platId;
|
||||
@JsonProperty(value = "Partition")
|
||||
private String partition;
|
||||
@JsonProperty(value = "OpenId")
|
||||
private String openId;
|
||||
|
||||
public String getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getPlatId() {
|
||||
return platId;
|
||||
}
|
||||
|
||||
public void setPlatId(String platId) {
|
||||
this.platId = platId;
|
||||
}
|
||||
|
||||
public String getPartition() {
|
||||
return partition;
|
||||
}
|
||||
|
||||
public void setPartition(String partition) {
|
||||
this.partition = partition;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,224 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document(collection = "pay")
|
||||
public class PayVo {
|
||||
private String id;
|
||||
private String openid;
|
||||
private int uid;
|
||||
private int region; //区服
|
||||
private String channel;// 渠道
|
||||
private int status;// 状态
|
||||
private int handlestatus;// 状态
|
||||
private String pay_item;// 状态
|
||||
private String billno;// 订单号
|
||||
private int money = 0;// 人民币
|
||||
private int amount; //支付金额 单位分
|
||||
@JsonProperty(value = "gameorderId")
|
||||
private String gameorderId;
|
||||
@JsonProperty(value = "cporderId")
|
||||
private String cporderId="";
|
||||
private int level = 0;
|
||||
private int vipLevel = 0;
|
||||
private String creattime;
|
||||
private String callbaktime;
|
||||
private String handletime;
|
||||
private String CurrencyCode;
|
||||
private String payWay; //支付方式 百度:·付款渠道, 0表示为微信支付, 1表示支付宝支付, 2表示苹果支付, 3表示谷歌支付,4 表示onestore, 5 表示mycard,
|
||||
private int sandbox; //是否是测试订单,1:是: 0:否
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(int region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getHandlestatus() {
|
||||
return handlestatus;
|
||||
}
|
||||
|
||||
public void setHandlestatus(int handlestatus) {
|
||||
this.handlestatus = handlestatus;
|
||||
}
|
||||
|
||||
public String getBillno() {
|
||||
return billno;
|
||||
}
|
||||
|
||||
public void setBillno(String billno) {
|
||||
this.billno = billno;
|
||||
}
|
||||
|
||||
public int getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(int money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getGameorderId() {
|
||||
return gameorderId;
|
||||
}
|
||||
|
||||
public void setGameorderId(String gameorderId) {
|
||||
this.gameorderId = gameorderId;
|
||||
}
|
||||
|
||||
public String getCporderId() {
|
||||
return cporderId;
|
||||
}
|
||||
|
||||
public void setCporderId(String cporderId) {
|
||||
this.cporderId = cporderId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getVipLevel() {
|
||||
return vipLevel;
|
||||
}
|
||||
|
||||
public void setVipLevel(int vipLevel) {
|
||||
this.vipLevel = vipLevel;
|
||||
}
|
||||
|
||||
public String getCreattime() {
|
||||
return creattime;
|
||||
}
|
||||
|
||||
public void setCreattime(String creattime) {
|
||||
this.creattime = creattime;
|
||||
}
|
||||
|
||||
public String getCallbaktime() {
|
||||
return callbaktime;
|
||||
}
|
||||
|
||||
public void setCallbaktime(String callbaktime) {
|
||||
this.callbaktime = callbaktime;
|
||||
}
|
||||
|
||||
public String getHandletime() {
|
||||
return handletime;
|
||||
}
|
||||
|
||||
public void setHandletime(String handletime) {
|
||||
this.handletime = handletime;
|
||||
}
|
||||
|
||||
public String getPay_item() {
|
||||
return pay_item;
|
||||
}
|
||||
|
||||
public void setPay_item(String pay_item) {
|
||||
this.pay_item = pay_item;
|
||||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
return CurrencyCode;
|
||||
}
|
||||
|
||||
public void setCurrencyCode(String currencyCode) {
|
||||
CurrencyCode = currencyCode;
|
||||
}
|
||||
|
||||
|
||||
public String getPayWay() {
|
||||
return payWay;
|
||||
}
|
||||
|
||||
public void setPayWay(String payWay) {
|
||||
this.payWay = payWay;
|
||||
}
|
||||
|
||||
public int getSandbox() {
|
||||
return sandbox;
|
||||
}
|
||||
|
||||
public void setSandbox(int sandbox) {
|
||||
this.sandbox = sandbox;
|
||||
}
|
||||
|
||||
public PayVo() {
|
||||
}
|
||||
|
||||
public PayVo(String openid, int uid, int region, String channel, String pay_item, String creattime, int money) {
|
||||
this.openid = openid;
|
||||
this.uid = uid;
|
||||
this.region = region;
|
||||
this.channel = channel;
|
||||
this.pay_item = pay_item;
|
||||
this.creattime = creattime;
|
||||
this.money=money;
|
||||
}
|
||||
|
||||
public PayVo(String openid, int uid, int region, String channel, String pay_item, String creattime, int money,String CurrencyCode) {
|
||||
this.openid = openid;
|
||||
this.uid = uid;
|
||||
this.region = region;
|
||||
this.channel = channel;
|
||||
this.pay_item = pay_item;
|
||||
this.creattime = creattime;
|
||||
this.money=money;
|
||||
this.CurrencyCode = CurrencyCode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RoleListVo implements IBaseVo {
|
||||
|
||||
@JsonProperty(value = "dsid")
|
||||
private String dsid;
|
||||
|
||||
@JsonProperty(value = "dsname")
|
||||
private String dsname;
|
||||
|
||||
@JsonProperty(value = "drid")
|
||||
private String drid;
|
||||
|
||||
@JsonProperty(value = "drname")
|
||||
private String drname;
|
||||
|
||||
@JsonProperty(value = "drlevel")
|
||||
private String drlevel;
|
||||
|
||||
|
||||
public String getDsid() {
|
||||
return dsid;
|
||||
}
|
||||
|
||||
public void setDsid(String dsid) {
|
||||
this.dsid = dsid;
|
||||
}
|
||||
|
||||
public String getDsname() {
|
||||
return dsname;
|
||||
}
|
||||
|
||||
public void setDsname(String dsname) {
|
||||
this.dsname = dsname;
|
||||
}
|
||||
|
||||
public String getDrid() {
|
||||
return drid;
|
||||
}
|
||||
|
||||
public void setDrid(String drid) {
|
||||
this.drid = drid;
|
||||
}
|
||||
|
||||
public String getDrname() {
|
||||
return drname;
|
||||
}
|
||||
|
||||
public void setDrname(String drname) {
|
||||
this.drname = drname;
|
||||
}
|
||||
|
||||
public String getDrlevel() {
|
||||
return drlevel;
|
||||
}
|
||||
|
||||
public void setDrlevel(String drlevel) {
|
||||
this.drlevel = drlevel;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ServerListVo implements IBaseVo {
|
||||
|
||||
@JsonProperty(value = "dsid")
|
||||
private String dsid;
|
||||
|
||||
@JsonProperty(value = "dsname")
|
||||
private String dsname;
|
||||
|
||||
public ServerListVo(String dsid, String dsname) {
|
||||
this.dsid = dsid;
|
||||
this.dsname = dsname;
|
||||
}
|
||||
|
||||
public String getDsid() {
|
||||
return dsid;
|
||||
}
|
||||
|
||||
public void setDsid(String dsid) {
|
||||
this.dsid = dsid;
|
||||
}
|
||||
|
||||
public String getDsname() {
|
||||
return dsname;
|
||||
}
|
||||
|
||||
public void setDsname(String dsname) {
|
||||
this.dsname = dsname;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ServerRoleInfoVo implements IBaseVo {
|
||||
|
||||
@JsonProperty(value = "dsid")
|
||||
private String dsid;
|
||||
@JsonProperty(value = "dsname")
|
||||
private String dsname;
|
||||
@JsonProperty(value = "droleid")
|
||||
private String droleid;
|
||||
@JsonProperty(value = "last_login_time")
|
||||
private String last_login_time;
|
||||
@JsonProperty(value = "online_time")
|
||||
private String online_time;
|
||||
@JsonProperty(value = "paynum")
|
||||
private String paynum;
|
||||
@JsonProperty(value = "pronum")
|
||||
private String pronum;
|
||||
@JsonProperty(value = "level")
|
||||
private String level;
|
||||
@JsonProperty(value = "fight_value")
|
||||
private String fight_value;
|
||||
@JsonProperty(value = "profession")
|
||||
private String profession;
|
||||
@JsonProperty(value = "profession_name")
|
||||
private String profession_name;
|
||||
|
||||
public String getDsid() {
|
||||
|
||||
|
||||
return dsid;
|
||||
}
|
||||
|
||||
public void setDsid(String dsid) {
|
||||
this.dsid = dsid;
|
||||
}
|
||||
|
||||
public String getDsname() {
|
||||
return dsname;
|
||||
}
|
||||
|
||||
public void setDsname(String dsname) {
|
||||
this.dsname = dsname;
|
||||
}
|
||||
|
||||
public String getDroleid() {
|
||||
return droleid;
|
||||
}
|
||||
|
||||
public void setDroleid(String droleid) {
|
||||
this.droleid = droleid;
|
||||
}
|
||||
|
||||
public String getLast_login_time() {
|
||||
return last_login_time;
|
||||
}
|
||||
|
||||
public void setLast_login_time(String last_login_time) {
|
||||
this.last_login_time = last_login_time;
|
||||
}
|
||||
|
||||
public String getOnline_time() {
|
||||
return online_time;
|
||||
}
|
||||
|
||||
public void setOnline_time(String online_time) {
|
||||
this.online_time = online_time;
|
||||
}
|
||||
|
||||
public String getPaynum() {
|
||||
return paynum;
|
||||
}
|
||||
|
||||
public void setPaynum(String paynum) {
|
||||
this.paynum = paynum;
|
||||
}
|
||||
|
||||
public String getPronum() {
|
||||
return pronum;
|
||||
}
|
||||
|
||||
public void setPronum(String pronum) {
|
||||
this.pronum = pronum;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(String level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getFight_value() {
|
||||
return fight_value;
|
||||
}
|
||||
|
||||
public void setFight_value(String fight_value) {
|
||||
this.fight_value = fight_value;
|
||||
}
|
||||
|
||||
public String getProfession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
public void setProfession(String profession) {
|
||||
this.profession = profession;
|
||||
}
|
||||
|
||||
public String getProfession_name() {
|
||||
return profession_name;
|
||||
}
|
||||
|
||||
public void setProfession_name(String profession_name) {
|
||||
this.profession_name = profession_name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.jmfy.modelVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ServerRoleListVo implements IBaseVo {
|
||||
|
||||
@JsonProperty(value = "dsid")
|
||||
private String dsid;
|
||||
|
||||
@JsonProperty(value = "dsname")
|
||||
private String dsname;
|
||||
|
||||
|
||||
public String getDsid() {
|
||||
return dsid;
|
||||
}
|
||||
|
||||
public void setDsid(String dsid) {
|
||||
this.dsid = dsid;
|
||||
}
|
||||
|
||||
public String getDsname() {
|
||||
return dsname;
|
||||
}
|
||||
|
||||
public void setDsname(String dsname) {
|
||||
this.dsname = dsname;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.jmfy.modelVo.xiaomi;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jmfy.modelVo.IBaseVo;
|
||||
|
||||
public class XiaoMiNotifyResponse implements IBaseVo{
|
||||
|
||||
@JsonProperty(value = "errcode")
|
||||
private int errcode;
|
||||
|
||||
public int getErrcode() {
|
||||
return errcode;
|
||||
}
|
||||
|
||||
public void setErrcode(int errcode) {
|
||||
this.errcode = errcode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.jmfy.netty;
|
||||
|
||||
import com.jmfy.model.NettyProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Created by justin on 14-8-2.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(NettyProperties.class)
|
||||
public class NettyServerAutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
private NettyProperties nettyProperties;
|
||||
|
||||
public NettyProperties getNettyProperties() {
|
||||
return nettyProperties;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.jmfy.netty;
|
||||
|
||||
import com.jmfy.netty.UDPClientChannelFactory;
|
||||
import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
|
||||
import org.jboss.netty.buffer.ChannelBuffer;
|
||||
import org.jboss.netty.buffer.DynamicChannelBuffer;
|
||||
import org.jboss.netty.channel.Channel;
|
||||
import org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/7/11.
|
||||
*/
|
||||
public class UDPClient {
|
||||
|
||||
private ConnectionlessBootstrap bootstrap;
|
||||
|
||||
private Channel channel;
|
||||
|
||||
private InetSocketAddress address;
|
||||
|
||||
public static UDPClient getInstance() {
|
||||
return Instance.udpClient;
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
private static UDPClient udpClient = new UDPClient();
|
||||
}
|
||||
|
||||
public void start(String ip, int port,int localPort){
|
||||
//init the bootstrap
|
||||
bootstrap=new ConnectionlessBootstrap(new NioDatagramChannelFactory());
|
||||
bootstrap.setPipelineFactory(new UDPClientChannelFactory());
|
||||
bootstrap.setOption("localAddress", new InetSocketAddress(localPort));
|
||||
channel=bootstrap.bind();
|
||||
address = new InetSocketAddress(ip,port);
|
||||
}
|
||||
|
||||
public void writebytes(byte[] bt){
|
||||
ChannelBuffer responseBuffer= new DynamicChannelBuffer(1000);
|
||||
responseBuffer.writeBytes(bt);
|
||||
channel.write(responseBuffer, address);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.jmfy.netty;
|
||||
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelPipelineFactory;
|
||||
import org.jboss.netty.channel.Channels;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/7/11.
|
||||
*/
|
||||
public class UDPClientChannelFactory implements ChannelPipelineFactory {
|
||||
|
||||
@Override
|
||||
public ChannelPipeline getPipeline() throws Exception {
|
||||
ChannelPipeline pipeline = Channels.pipeline();
|
||||
pipeline.addLast("handler", new UDPClientHandler());
|
||||
return pipeline;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.jmfy.netty;
|
||||
|
||||
import org.jboss.netty.buffer.ChannelBuffer;
|
||||
import org.jboss.netty.channel.ChannelHandlerContext;
|
||||
import org.jboss.netty.channel.ExceptionEvent;
|
||||
import org.jboss.netty.channel.MessageEvent;
|
||||
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/7/11.
|
||||
*/
|
||||
public class UDPClientHandler extends SimpleChannelUpstreamHandler {
|
||||
|
||||
@Override
|
||||
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
|
||||
throws Exception {
|
||||
|
||||
ChannelBuffer buffer = (ChannelBuffer)e.getMessage();
|
||||
byte[] recByte=buffer.copy().toByteBuffer().array();
|
||||
|
||||
String msg=new String(recByte);
|
||||
System.out.println("UDPClient get msg from server : "+msg);
|
||||
|
||||
|
||||
super.messageReceived(ctx, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
|
||||
throws Exception {
|
||||
super.exceptionCaught(ctx, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.jmfy.redisProperties;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/3/17.
|
||||
*/
|
||||
@Configuration(value = "redisAutoConfiguration")
|
||||
@EnableConfigurationProperties(RedisProperties.class)
|
||||
public class RedisAutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
private com.jmfy.redisProperties.RedisProperties RedisProperties;
|
||||
|
||||
public com.jmfy.redisProperties.RedisProperties getRedisProperties() {
|
||||
return RedisProperties;
|
||||
}
|
||||
|
||||
public void setRedisProperties(com.jmfy.redisProperties.RedisProperties RedisProperties) {
|
||||
RedisProperties = RedisProperties;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
package com.jmfy.redisProperties;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/3/17.
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "spring.redis")
|
||||
public class RedisProperties {
|
||||
|
||||
private String host;
|
||||
|
||||
private int port;
|
||||
|
||||
private String password;
|
||||
|
||||
private int expireTime; // 过期时间,单位分钟
|
||||
private int database ;
|
||||
//连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
|
||||
private boolean blockWhenExhausted;
|
||||
//是否启用pool的jmx管理功能, 默认true
|
||||
private boolean jmxEnabled;
|
||||
//是否启用后进先出, 默认true
|
||||
private boolean lifo;
|
||||
//最大空闲连接数, 默认8个
|
||||
private int maxIdle;
|
||||
//最大连接数, 默认8个
|
||||
private int maxTotal;
|
||||
//获取连接时的最大等待毫秒数(如果设置为阻塞时BlockWhenExhausted),如果超时就抛异常, 小于零:阻塞不确定的时间, 默认-1
|
||||
private int maxWaitMillis;
|
||||
//逐出连接的最小空闲时间 默认1800000毫秒(30分钟)
|
||||
private long minEvictableIdleTimeMillis;
|
||||
//最小空闲连接数, 默认0
|
||||
private int minIdle;
|
||||
//每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3
|
||||
private int numTestsPerEvictionRun;
|
||||
//对象空闲多久后逐出, 当空闲时间>该值 且 空闲连接>最大空闲数 时直接逐出,不再根据MinEvictableIdleTimeMillis判断 (默认逐出策略)
|
||||
private long softMinEvictableIdleTimeMillis;
|
||||
//在获取连接的时候检查有效性, 默认false
|
||||
private boolean testOnBorrow;
|
||||
//在空闲时检查有效性, 默认false
|
||||
private boolean testWhileIdle;
|
||||
//逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
|
||||
private int timeBetweenEvictionRunsMillis;
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public int getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(int expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public boolean isBlockWhenExhausted() {
|
||||
return blockWhenExhausted;
|
||||
}
|
||||
|
||||
public void setBlockWhenExhausted(boolean blockWhenExhausted) {
|
||||
this.blockWhenExhausted = blockWhenExhausted;
|
||||
}
|
||||
|
||||
public boolean isJmxEnabled() {
|
||||
return jmxEnabled;
|
||||
}
|
||||
|
||||
public void setJmxEnabled(boolean jmxEnabled) {
|
||||
this.jmxEnabled = jmxEnabled;
|
||||
}
|
||||
|
||||
public boolean isLifo() {
|
||||
return lifo;
|
||||
}
|
||||
|
||||
public void setLifo(boolean lifo) {
|
||||
this.lifo = lifo;
|
||||
}
|
||||
|
||||
public int getMaxIdle() {
|
||||
return maxIdle;
|
||||
}
|
||||
|
||||
public void setMaxIdle(int maxIdle) {
|
||||
this.maxIdle = maxIdle;
|
||||
}
|
||||
|
||||
public int getMaxTotal() {
|
||||
return maxTotal;
|
||||
}
|
||||
|
||||
public void setMaxTotal(int maxTotal) {
|
||||
this.maxTotal = maxTotal;
|
||||
}
|
||||
|
||||
public int getMaxWaitMillis() {
|
||||
return maxWaitMillis;
|
||||
}
|
||||
|
||||
public void setMaxWaitMillis(int maxWaitMillis) {
|
||||
this.maxWaitMillis = maxWaitMillis;
|
||||
}
|
||||
|
||||
public long getMinEvictableIdleTimeMillis() {
|
||||
return minEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
|
||||
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public int getMinIdle() {
|
||||
return minIdle;
|
||||
}
|
||||
|
||||
public void setMinIdle(int minIdle) {
|
||||
this.minIdle = minIdle;
|
||||
}
|
||||
|
||||
public int getNumTestsPerEvictionRun() {
|
||||
return numTestsPerEvictionRun;
|
||||
}
|
||||
|
||||
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {
|
||||
this.numTestsPerEvictionRun = numTestsPerEvictionRun;
|
||||
}
|
||||
|
||||
public long getSoftMinEvictableIdleTimeMillis() {
|
||||
return softMinEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis) {
|
||||
this.softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public boolean isTestOnBorrow() {
|
||||
return testOnBorrow;
|
||||
}
|
||||
|
||||
public void setTestOnBorrow(boolean testOnBorrow) {
|
||||
this.testOnBorrow = testOnBorrow;
|
||||
}
|
||||
|
||||
public boolean isTestWhileIdle() {
|
||||
return testWhileIdle;
|
||||
}
|
||||
|
||||
public void setTestWhileIdle(boolean testWhileIdle) {
|
||||
this.testWhileIdle = testWhileIdle;
|
||||
}
|
||||
|
||||
public int getTimeBetweenEvictionRunsMillis() {
|
||||
return timeBetweenEvictionRunsMillis;
|
||||
}
|
||||
|
||||
public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) {
|
||||
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
|
||||
}
|
||||
|
||||
public int getDatabase() {
|
||||
return database;
|
||||
}
|
||||
|
||||
public void setDatabase(int database) {
|
||||
this.database = database;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.jmfy.redisProperties;
|
||||
|
||||
public class RedisUserKey {
|
||||
|
||||
public final static String Delimiter_colon = ":";
|
||||
public final static String Delimiter_len = "|";
|
||||
public final static String Delimiter_code = "#";
|
||||
public final static String CUser_Key = "CUser_Key";
|
||||
public final static String CUser_Online_Key = "CUser_Online_Key";
|
||||
public final static String CHero_Key = "CHero_Key";
|
||||
public final static String CItem_Key = "CItem_Key";
|
||||
public final static String KICK_Old_key = "Kick_Old_Key";
|
||||
public final static String CMail_Key = "CMail_Key";
|
||||
public final static String Barage_Key = "Barage_Key";
|
||||
public final static String Title_Key = "Title_Key";
|
||||
public final static String Clear_Chat_Key = "Clear_Chat_Key";
|
||||
public final static String SendAllSVR_key = "SendAllSVR_key";
|
||||
public final static String Clight_Key = "Clight_Key";
|
||||
public final static String Notice_key = "Notice_key";
|
||||
public final static String HeroRandSwitch = "HeroRandSwitch";
|
||||
public final static String Server_GM = "Server_GM";
|
||||
public final static String CMind_Key = "CMind_Key";
|
||||
|
||||
public final static String Kick_old_User_key = "Kick_old_User_key";
|
||||
/** value key:roleUid,value:CBanInfo*/
|
||||
public final static String CBanInfo_Key = "CBanInfo_Key";
|
||||
|
||||
public final static String BlackList_key = "BlackList_key";
|
||||
public final static String UserInfo_key = "UserInfo_key";
|
||||
public final static String CTeam_Pos_Key = "CTeam_Pos_Key";
|
||||
public final static String SystemMaill_key = "SystemMaill_key";
|
||||
public final static String SERVER_OPEN_TIME_KEY = "Server_Open_Time_Key";
|
||||
public final static String CUser_ServerInfo_Key = "CUser_ServerInfo";
|
||||
//玩家普通困难关卡
|
||||
public final static String CFight_Key = "CFight_Key";
|
||||
//天幻圣境 关卡
|
||||
public final static String CActivityCopyFight_Key = "CActivityCopyFight_Key";
|
||||
|
||||
/**
|
||||
* hash key:roleUid,hashKey:heroUid,value:cHero
|
||||
*/
|
||||
public final static String Login_Server_Info = "Login_Server_Info";
|
||||
public final static String Server_Info = "Server_Info";
|
||||
public final static String Total_Register = "Total_Register";
|
||||
|
||||
//防沉迷
|
||||
public final static String Adti_Addict = "Adti_Addict";
|
||||
//用户世家id
|
||||
public final static String USER_FAMILY_ID = "USER_FAMILY_ID";
|
||||
public final static String C_AccountInfo_Key = "C_AccountInfo_Key";
|
||||
|
||||
public final static String CArenaInfo_Key = "CArenaInfo_Key";
|
||||
|
||||
public final static String CFamily_Info_Key = "CFamily_Info_Key";
|
||||
|
||||
public final static String CUser_Chat = "CUser_Chat";
|
||||
|
||||
public final static String Ban_Chat = "Ban_Chat";
|
||||
|
||||
public final static String Notice_WhiteList_isOpen = "Notice_WhiteList_isOpen";
|
||||
//道聚城白名单
|
||||
public final static String Notice_White_List = "Notice_White_List";
|
||||
|
||||
|
||||
public final static String RedisRecordMQ = "RedisRecordMQ";
|
||||
|
||||
public static final String LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.jmfy.sdk;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
public class HmacSHA1Encryption {
|
||||
|
||||
|
||||
private static final String MAC_NAME = "HmacSHA1";
|
||||
private static final String ENCODING = "UTF-8";
|
||||
/**
|
||||
* 使用 HMAC-SHA1 签名方法对对encryptText进行签名
|
||||
* @param encryptText 被签名的字符串
|
||||
* @param encryptKey 密钥
|
||||
* @return 返回被加密后的字符串
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String hmacSHA1Encrypt( String encryptText, String encryptKey ) throws Exception
|
||||
{
|
||||
byte[] data = encryptKey.getBytes( ENCODING );
|
||||
// 根据给定的字节数组构造一个密钥,第二参数指定一个密钥算法的名称
|
||||
SecretKey secretKey = new SecretKeySpec( data, MAC_NAME );
|
||||
// 生成一个指定 Mac 算法 的 Mac 对象
|
||||
Mac mac = Mac.getInstance( MAC_NAME );
|
||||
// 用给定密钥初始化 Mac 对象
|
||||
mac.init( secretKey );
|
||||
byte[] text = encryptText.getBytes( ENCODING );
|
||||
// 完成 Mac 操作
|
||||
byte[] digest = mac.doFinal( text );
|
||||
StringBuilder sBuilder = bytesToHexString( digest );
|
||||
return sBuilder.toString();
|
||||
}
|
||||
/**
|
||||
* 转换成Hex
|
||||
*
|
||||
* @param bytesArray
|
||||
*/
|
||||
public static StringBuilder bytesToHexString( byte[] bytesArray )
|
||||
{
|
||||
if ( bytesArray == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
StringBuilder sBuilder = new StringBuilder();
|
||||
for ( byte b : bytesArray )
|
||||
{
|
||||
String hv = String.format("%02x", b);
|
||||
// String hv = Integer.toHexString( b & 0xFF );
|
||||
sBuilder.append( hv );
|
||||
}
|
||||
return sBuilder;
|
||||
}
|
||||
/**
|
||||
* 使用 HMAC-SHA1 签名方法对对encryptText进行签名
|
||||
*
|
||||
* @param encryptData 被签名的字符串
|
||||
* @param encryptKey 密钥
|
||||
* @return 返回被加密后的字符串
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String hmacSHA1Encrypt( byte[] encryptData, String encryptKey ) throws Exception
|
||||
{
|
||||
byte[] data = encryptKey.getBytes( ENCODING );
|
||||
// 根据给定的字节数组构造一个密钥,第二参数指定一个密钥算法的名称
|
||||
SecretKey secretKey = new SecretKeySpec( data, MAC_NAME );
|
||||
// 生成一个指定 Mac 算法 的 Mac 对象
|
||||
Mac mac = Mac.getInstance( MAC_NAME );
|
||||
// 用给定密钥初始化 Mac 对象
|
||||
mac.init( secretKey );
|
||||
|
||||
// 完成 Mac 操作
|
||||
byte[] digest = mac.doFinal( encryptData );
|
||||
|
||||
StringBuilder sBuilder = bytesToHexString( digest );
|
||||
|
||||
return sBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.jmfy.sdk;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
public class HttpUtil {
|
||||
|
||||
private static int connectionTimeOut = 30 * 1000;
|
||||
private static int timeOut = 30 * 1000;
|
||||
|
||||
/**
|
||||
* http get 請求
|
||||
* @param urlString 請求地址
|
||||
* @return 返回的內容
|
||||
*/
|
||||
public static String doGet(String urlString) {
|
||||
InputStream is = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
URL url = new URL(urlString);
|
||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
||||
|
||||
conn.setRequestProperty("Accept-Charset", "utf-8");
|
||||
conn.setRequestProperty("Content-Type", "application/json");
|
||||
conn.setConnectTimeout(connectionTimeOut);
|
||||
conn.setReadTimeout(timeOut);
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
String line = null;
|
||||
|
||||
conn.connect();
|
||||
is = conn.getInputStream();
|
||||
// inputStreamReader = new InputStreamReader(inputStream);
|
||||
reader = new BufferedReader(new InputStreamReader(is));
|
||||
|
||||
while ((line = reader.readLine()) != null) {
|
||||
buffer.append(line);
|
||||
}
|
||||
tryClose(is);
|
||||
tryClose(reader);
|
||||
return buffer.toString();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
private static void tryClose(InputStream is ) {
|
||||
try{
|
||||
if( null != is ) {
|
||||
is.close();
|
||||
is = null;
|
||||
}
|
||||
} catch( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭Reader
|
||||
* @param reader
|
||||
*/
|
||||
private static void tryClose(java.io.Reader reader ) {
|
||||
try{
|
||||
if( null != reader ) {
|
||||
reader.close();
|
||||
reader = null;
|
||||
}
|
||||
} catch( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static String sendPost(String url,String Params,String sign)throws IOException {
|
||||
OutputStreamWriter out = null;
|
||||
BufferedReader reader = null;
|
||||
String response="";
|
||||
try {
|
||||
URL httpUrl = null; //HTTP URL类 用这个类来创建连接
|
||||
//创建URL
|
||||
httpUrl = new URL(url);
|
||||
//建立连接
|
||||
HttpURLConnection conn = (HttpURLConnection) httpUrl.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/json");
|
||||
conn.setRequestProperty("connection", "keep-alive");
|
||||
conn.setRequestProperty("AUTH6KW", sign);
|
||||
|
||||
|
||||
|
||||
|
||||
conn.setUseCaches(false);//设置不要缓存
|
||||
conn.setInstanceFollowRedirects(true);
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.connect();
|
||||
//POST请求
|
||||
out = new OutputStreamWriter(
|
||||
conn.getOutputStream());
|
||||
out.write(Params); | ||||