[
  {
    "path": ".gitignore",
    "content": "# Compiled class file\n*.class\n\n# Log file\n*.log\n\n# IDEA file\n.idea/\n*.iml\ntarget/\nupload/\n\n# BlueJ files\n*.ctxt\n\n# Mobile Tools for Java (J2ME)\n.mtj.tmp/\n\n# Package Files #\n*.jar\n*.war\n*.ear\n*.zip\n*.tar.gz\n*.rar\n\n# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml\nhs_err_pid*"
  },
  {
    "path": "LICENSE.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# Shop SSM框架搭建的网上游戏商城\n## 项目信息\n- 项目名字：WePlay\n- 项目描述：基于SSM框架的网上游戏商城\n## 环境配置\n- JDK 1.8\n- Spring 5.1.7\n- MyBatis 3.4\n- MySQL 5.7.18\n- Maven 3\n- Redis 3.0\n- Tomcat 8.5.15\n### maven 阿里云仓库\n```xml\n<mirror>\n    <id>alimaven</id>\n    <name>aliyun maven</name>\n    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>\n    <mirrorOf>central</mirrorOf>        \n</mirror>\n```\n# 一些问题及解决方案\n## 跨域请求\n　　在`Controller`控制器中添加了`@CrossOrigin`注解。\n## 用`token`验证用户身份\n　　使用唯一识别码`token`来识别每一个用户，用户登陆后生成一个`token`写入数据库和缓存中，同时写入到response中的cookie中，这样以后每次请求都会带上这个`token`，用`AuthInterceptor`对所有的请求进行拦截，根据`token`从缓存中查取对应的`uid`，再从数据库中查取对应的用户详情，并存到[`UserHolder`](https://github.com/RojerAlone/shop/blob/master/src/main/java/cn/cie/utils/UserHolder.java)这个工具类中。\n## 拦截器进行权限处理\n　　很多接口只有用户验证了才能进行下一步操作，写了一个拦截器对特定的请求进行拦截，如果用户没有登录，就跳转到登陆页面，登陆成功后跳转到之前的页面。\n## 使用`Redis`\n　　几乎所有的页面都会加载商品种类，因此将商品的种类信息放入缓存中；网站首页有一个每日推荐，是每天零时随机生成5个商品，由于这些商品访问频率高，因此将这5个商品放入缓存中，可将访问速度由10\\~20ms 缩减到3\\~5ms。\n\n　　同时用户`token`也放入了缓存中，并设置过期时间为1天，如果用户选择了保持登陆状态7天，那么`token`过期后再从数据库中取出放入缓存中。\n\n　　用户注册后需要验证邮箱，将验证码放入缓存中，15分钟过期。\n\n　　将重量型事件抽取出来，用Redis模拟消息队列，创建多线程添加到线程池中，线程从队列中获取消息并执行，比如发送邮件操作。\n"
  },
  {
    "path": "pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>cn.cie</groupId>\n  <artifactId>shop</artifactId>\n  <packaging>war</packaging>\n  <version>1.0</version>\n  <name>shop Maven Webapp</name>\n  <url>http://maven.apache.org</url>\n  <properties>\n    <spring.version>5.3.14</spring.version>\n    <aop.version>1.8.10</aop.version>\n    <mybatis.version>3.5.6</mybatis.version>\n    <log4j.version>1.2.17</log4j.version>\n  </properties>\n\n  <dependencies>\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <version>4.13.1</version>\n      <scope>test</scope>\n    </dependency>\n\n    <dependency>\n      <groupId>javax.servlet</groupId>\n      <artifactId>javax.servlet-api</artifactId>\n      <version>3.1.0</version>\n    </dependency>\n\n    <!-- spring核心包 -->\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-core</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-web</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-oxm</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-tx</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-jdbc</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-webmvc</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-aop</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-context-support</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-context</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring-test</artifactId>\n      <version>${spring.version}</version>\n    </dependency>\n    <!--aspectj依赖-->\n    <dependency>\n      <groupId>org.aspectj</groupId>\n      <artifactId>aspectjrt</artifactId>\n      <version>${aop.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.aspectj</groupId>\n      <artifactId>aspectjweaver</artifactId>\n      <version>${aop.version}</version>\n    </dependency>\n    <!--jackson包，没有这个包无法用ajax请求-->\n    <dependency>\n      <groupId>com.fasterxml.jackson.core</groupId>\n      <artifactId>jackson-databind</artifactId>\n      <version>2.10.0.pr1</version>\n    </dependency>\n    <!-- mybatis核心包 -->\n    <dependency>\n      <groupId>org.mybatis</groupId>\n      <artifactId>mybatis</artifactId>\n      <version>${mybatis.version}</version>\n    </dependency>\n    <!-- mybatis/spring包 -->\n    <dependency>\n      <groupId>org.mybatis</groupId>\n      <artifactId>mybatis-spring</artifactId>\n      <version>1.3.1</version>\n    </dependency>\n    <!-- 导入MySQL数据库连接jar包 -->\n    <dependency>\n      <groupId>mysql</groupId>\n      <artifactId>mysql-connector-java</artifactId>\n      <version>8.0.16</version>\n    </dependency>\n    <!-- 用来配置数据库 -->\n    <dependency>\n      <groupId>commons-dbcp</groupId>\n      <artifactId>commons-dbcp</artifactId>\n      <version>1.4</version>\n    </dependency>\n    <!-- JSTL标签类 -->\n    <dependency>\n      <groupId>jstl</groupId>\n      <artifactId>jstl</artifactId>\n      <version>1.2</version>\n    </dependency>\n     <!--log4j-->\n    <dependency>\n      <groupId>log4j</groupId>\n      <artifactId>log4j</artifactId>\n      <version>${log4j.version}</version>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-simple</artifactId>\n      <version>1.7.24</version>\n    </dependency>\n    <!--邮件发送-->\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-email</artifactId>\n      <version>1.3.1</version>\n    </dependency>\n    <!--jedis-->\n    <dependency>\n      <groupId>redis.clients</groupId>\n      <artifactId>jedis</artifactId>\n      <version>2.9.0</version>\n    </dependency>\n    <dependency>\n      <groupId>com.alibaba</groupId>\n      <artifactId>fastjson</artifactId>\n      <version>1.2.25</version>\n    </dependency>\n    <!--protostuff，用于序列化和反序列化-->\n    <!--<dependency>-->\n      <!--<groupId>com.dyuproject.protostuff</groupId>-->\n      <!--<artifactId>protostuff-core</artifactId>-->\n      <!--<version>1.1.1</version>-->\n    <!--</dependency>-->\n    <!--<dependency>-->\n      <!--<groupId>com.dyuproject.protostuff</groupId>-->\n      <!--<artifactId>protostuff-runtime</artifactId>-->\n      <!--<version>1.1.1</version>-->\n    <!--</dependency>-->\n    <!--apache common工具集-->\n    <dependency>\n      <groupId>org.apache.commons</groupId>\n      <artifactId>commons-lang3</artifactId>\n      <version>3.5</version>\n    </dependency>\n    <!--文件上传-->\n    <dependency>\n      <groupId>commons-fileupload</groupId>\n      <artifactId>commons-fileupload</artifactId>\n      <version>1.3.3</version>\n    </dependency>\n  </dependencies>\n\n  <build>\n    <finalName>shop</finalName>\n    <plugins>\n      <!--<plugin>-->\n        <!--<groupId>org.apahce.maven.plugins</groupId>-->\n        <!--<artifactId>maven-surefire-plugin</artifactId>-->\n        <!--<version>2.19.1</version>-->\n        <!--<configuration>-->\n          <!--<skipTests>true</skipTests>-->\n        <!--</configuration>-->\n      <!--</plugin>-->\n      <!--mybatis自动生成mapper-->\n      <plugin>\n        <groupId>org.mybatis.generator</groupId>\n        <artifactId>mybatis-generator-maven-plugin</artifactId>\n        <version>1.3.5</version>\n        <configuration>\n          <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>\n          <overwrite>true</overwrite>\n          <verbose>true</verbose>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n</project>\n"
  },
  {
    "path": "src/main/java/cn/cie/aop/LogAspectj.java",
    "content": "package cn.cie.aop;\n\nimport org.apache.log4j.Logger;\nimport org.apache.log4j.PropertyConfigurator;\nimport org.aspectj.lang.JoinPoint;\nimport org.aspectj.lang.annotation.AfterThrowing;\nimport org.aspectj.lang.annotation.Aspect;\nimport org.aspectj.lang.annotation.Before;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.context.request.RequestContextHolder;\nimport org.springframework.web.context.request.ServletRequestAttributes;\n\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletRequest;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n * 日志记录，包括请求日志和错误日志\n */\n@Component\n@Aspect\npublic class LogAspectj {\n\n    private final Logger logger = Logger.getLogger(this.getClass());\n\n    @Before(\"execution(* cn.cie.controller.*Controller.*(..)) && !execution( * cn.cie.controller.AbstractController.*(..))\")\n    // 切面为controller中的所有方法\n    public void logAccess(JoinPoint joinPoint) {\n        PropertyConfigurator.configure(this.getClass().getClassLoader().getResource(\"/\").getPath() + \"log4j-acc.properties\");\n        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();\n        HttpServletRequest request = attributes.getRequest();\n        StringBuilder sb = new StringBuilder();\n        String token = \"\";\n        if (request.getCookies() != null && request.getCookies().length > 0) {\n            for (Cookie cookie : request.getCookies()) {\n                if (cookie.getName().equals(\"token\")) {\n                    token = cookie.getValue();\n                }\n            }\n        }\n        sb.append(\"token: \" + token);\n        sb.append(\"\\tip: \" + request.getRemoteAddr());\n        sb.append(\"\\tmethod: \" + request.getMethod());\n        sb.append(\"\\turl: \" + request.getRequestURI());\n        sb.append(\"\\tparams: \");\n        for (Object object : joinPoint.getArgs()) {\n            if (object != null) {\n                sb.append(\"\\t\" + object.getClass().getSimpleName() + \" \" + object.toString());\n            }\n        }\n        logger.info(sb.toString());\n    }\n\n    @AfterThrowing(value = \"execution(* cn.cie.controller.*Controller.*(..)) && !execution( * cn.cie.controller.AbstractController.*(..))\", throwing = \"e\")\n    // 切面为controller中的所有方法\n    public void errorAccess(Throwable e) {\n        PropertyConfigurator.configure(this.getClass().getClassLoader().getResource(\"/\").getPath() + \"log4j-error.properties\");\n        if (e instanceof Exception) {\n            logger.error(\"\", e);\n        }\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/AbstractController.java",
    "content": "/*\n * Copyright 2002-2016 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage cn.cie.controller;\n\nimport org.apache.log4j.Logger;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.ModelAttribute;\n\nimport javax.servlet.ServletContext;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpSession;\n\n/**\n * 从左潇龙博客源码复制过来\n * 基础controller,各个web项目应该在此基础上扩展自己的基础controller.\n *\n * @author Boren You\n * @date 2016/5/12 21:28\n * @since 1.0.0\n */\npublic abstract class AbstractController {\n\n    /**\n     * 日志对象\n     */\n    protected Logger logger = Logger.getLogger(this.getClass());\n\n    /**\n     * 存放当前线程的HttpServletRequest对象\n     */\n    private static ThreadLocal<HttpServletRequest> httpServletRequestThreadLocal = new ThreadLocal<HttpServletRequest>();\n\n    /**\n     * 存放当前线程的Model对象\n     */\n    private static ThreadLocal<Model> modelThreadLocal = new ThreadLocal<Model>();\n\n    /**\n     * 使用@ModelAttribute注解标识的方法会在每个控制器中的方法访问之前先调用\n     *\n     * @param request\n     * @param model\n     */\n    @ModelAttribute\n    protected void setThreadLocal(HttpServletRequest request, Model model) {\n        httpServletRequestThreadLocal.set(request);\n        modelThreadLocal.set(model);\n    }\n\n    /**\n     * 获取当前线程的HttpServletRequest对象\n     *\n     * @return 当前线程的HttpServletRequest对象\n     */\n    protected HttpServletRequest getRequest() {\n        return httpServletRequestThreadLocal.get();\n    }\n\n    /**\n     * 获取当前线程的HttpSession对象\n     *\n     * @return 当前线程的HttpSession对象\n     */\n    protected HttpSession getSession() {\n        return getRequest().getSession();\n    }\n\n    /**\n     * 获取当前线程的Model对象\n     *\n     * @return 当前线程的Model对象\n     */\n    protected Model getModel() {\n        return modelThreadLocal.get();\n    }\n\n    /**\n     * 获取当前的ServletContext对象\n     *\n     * @return 当前的ServletContext对象\n     */\n    protected ServletContext getContext() {\n        return getRequest().getServletContext();\n    }\n\n    /**\n     * 向 Model 设置属性值\n     *\n     * @param name  属性名\n     * @param value 属性值\n     */\n    protected void setModelAttribute(String name, Object value) {\n        getModel().addAttribute(name, value);\n    }\n\n    /**\n     * 向 HttpServletRequest 设置属性值\n     *\n     * @param name  属性名\n     * @param value 属性值\n     */\n    protected void setRequestAttribute(String name, Object value) {\n        HttpServletRequest request = this.getRequest();\n        request.setAttribute(name, value);\n    }\n\n    /**\n     * 向 HttpSession 设置属性值\n     *\n     * @param name  属性名\n     * @param value 属性值\n     */\n    public void setSessionAttribute(String name, Object value) {\n        HttpSession session = this.getSession();\n        session.setAttribute(name, value);\n    }\n\n    /**\n     * 从 HttpSession 中获取属性值\n     *\n     * @param name 属性名\n     * @return 属性值\n     */\n    protected Object getSessionAttribute(String name) {\n        HttpSession session = this.getSession();\n        Object value = session.getAttribute(name);\n        return value;\n    }\n\n    /**\n     * 从 HttpServletRequest 中获取属性值\n     *\n     * @param name 属性名\n     * @return 属性值\n     */\n    protected Object getRequestAttribute(String name) {\n        HttpServletRequest request = this.getRequest();\n        Object value = request.getAttribute(name);\n        return value;\n    }\n\n    protected String getUserAgent() {\n        return this.getRequest().getHeader(\"User-Agent\");\n    }\n\n    protected String getRemoteIp() {\n        String remoteIp;\n        remoteIp = this.getRequest().getHeader(\"x-forwarded-for\");\n        if (remoteIp == null || remoteIp.length() == 0 || \"unknown\".equalsIgnoreCase(remoteIp)) {\n            remoteIp = this.getRequest().getHeader(\"Proxy-Client-IP\");\n        }\n        if (remoteIp == null || remoteIp.length() == 0 || \"unknown\".equalsIgnoreCase(remoteIp)) {\n            remoteIp = this.getRequest().getHeader(\"WL-Proxy-Client-IP\");\n        }\n        if (remoteIp == null || remoteIp.length() == 0 || \"unknown\".equalsIgnoreCase(remoteIp)) {\n            remoteIp = this.getRequest().getHeader(\"HTTP_CLIENT_IP\");\n        }\n        if (remoteIp == null || remoteIp.length() == 0 || \"unknown\".equalsIgnoreCase(remoteIp)) {\n            remoteIp = this.getRequest().getHeader(\"HTTP_X_FORWARDED-FOR\");\n        }\n        if (remoteIp == null || remoteIp.length() == 0 || \"unknown\".equalsIgnoreCase(remoteIp)) {\n            remoteIp = this.getRequest().getRemoteAddr();\n        }\n\n        //对于通过多个代理的情况，第一个IP为客户端真实IP,多个IP按照','分割\n        if (remoteIp != null && remoteIp.length() > 15) { //\"***.***.***.***\".length() = 15\n            if (remoteIp.indexOf(\",\") > 0) {\n                remoteIp = remoteIp.substring(0, remoteIp.indexOf(\",\"));\n            }\n        }\n        return remoteIp;\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/AdminController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.entity.Game;\nimport cn.cie.services.AdminService;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.util.Date;\n\n/**\n * Created by RojerAlone on 2017/6/15.\n */\n@CrossOrigin\n@Controller\n@RequestMapping(value = \"admin\")\npublic class AdminController extends AbstractController {\n\n    @Autowired\n    private AdminService adminService;\n\n    @GetMapping(value = \"login\")\n    public String login() {\n        return \"adminlogin\";\n    }\n\n    @PostMapping(value = \"login\")\n    @ResponseBody\n    public Result login(String username, String password, HttpServletResponse response) {\n        Result result = adminService.login(username, password);\n        if (result.isSuccess()) {\n            Cookie cookie = new Cookie(\"token\", (String) result.getData());\n            cookie.setPath(\"/\");\n            response.addCookie(cookie);\n            return Result.success();\n        }\n        return result;\n    }\n\n    @GetMapping(value = \"home\")\n    public String adminPage() {\n        return \"adminpage\";\n    }\n\n    @PostMapping(value = \"getuser\")\n    @ResponseBody\n    public Result getUser(@RequestParam(value = \"page\", required = false, defaultValue = \"1\") Integer page) {\n        return adminService.getUser(page);\n    }\n\n    @PostMapping(value = \"restrictuser\")\n    @ResponseBody\n    public Result restrict(Integer uid) {\n        return adminService.restrict(uid);\n    }\n\n    @PostMapping(value = \"relieveuser\")\n    @ResponseBody\n    public Result relieve(Integer uid) {\n        return adminService.relieve(uid);\n    }\n\n    @PostMapping(value = \"deluser\")\n    @ResponseBody\n    public Result delUser(Integer uid) {\n        return adminService.delete(uid);\n    }\n\n    @PostMapping(value = \"getgames\")\n    @ResponseBody\n    public Result getGames(@RequestParam(value = \"page\", required = false, defaultValue = \"1\") Integer page) {\n        return adminService.getGames(page);\n    }\n\n    @PostMapping(value = \"addgame\")\n    @ResponseBody\n    public Result addGame(Game game, Integer[] kinds, MultipartFile header,\n                          @RequestParam(value = \"pics\") MultipartFile[] pics) throws IOException {\n        return adminService.addGame(game, kinds, header, pics,\n                this.getSession().getServletContext().getRealPath(\"/WEB-INF/image\").replaceAll(\"\\\\\\\\\", \"/\"));\n    }\n\n    @PostMapping(value = \"updategameinfo\")\n    @ResponseBody\n    public Result updateGameInfo(Game game) {\n        return adminService.updateGameInfo(game);\n    }\n\n    @PostMapping(value = \"getgamekind\")\n    @ResponseBody\n    public Result getGameKind(Integer game) {\n        return adminService.getGameKind(game);\n    }\n\n    @PostMapping(value = \"updategamekind\")\n    @ResponseBody\n    public Result updateGameKind(Integer game, Integer[] kinds) {\n        return adminService.updateGameKind(game, Arrays.asList(kinds));\n    }\n\n    @PostMapping(value = \"upgame\")\n    @ResponseBody\n    public Result upGame(Integer game, @RequestParam(value = \"date\", required = false) Date date) {\n        return adminService.upGame(game, date);\n    }\n\n    @PostMapping(value = \"downgame\")\n    @ResponseBody\n    public Result downGame(Integer game) {\n        return adminService.downGame(game);\n    }\n\n    @PostMapping(value = \"addkind\")\n    @ResponseBody\n    public Result addKind(String kind) {\n        return adminService.addKind(kind);\n    }\n\n    @PostMapping(value = \"getallgames\")\n    @ResponseBody\n    public Result getAllGames() {\n        return adminService.getAllGames();\n    }\n\n    @PostMapping(value = \"managerkind\")\n    @ResponseBody\n    public Result managerKind(Integer kind, Integer[] games) {\n        return adminService.managerKind(kind, Arrays.asList(games));\n    }\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/controller/CommonController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.entity.User;\nimport cn.cie.services.GameService;\nimport cn.cie.services.UserService;\nimport cn.cie.utils.MsgCenter;\nimport cn.cie.utils.Result;\nimport cn.cie.utils.UserHolder;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by RojerAlone on 2017/6/9.\n */\n@CrossOrigin\n@Controller\npublic class CommonController extends AbstractController {\n\n    @Autowired\n    private UserHolder userHolder;\n    @Autowired\n    private UserService userService;\n    @Autowired\n    private GameService gameService;\n\n    @RequestMapping(value = {\"/\", \"/index\"})\n    public String index() {\n        return \"index\";\n    }\n\n    @GetMapping(value = \"login\")\n    public String login() {\n        String referer = getReferer();\n        // 如果用户已经登陆并且状态正常，那么跳转到之前的页面\n        if (userHolder.getUser() != null && userHolder.getUser().getStat().equals(User.STAT_OK)) {\n            return \"redirect:\" + referer;\n        }\n        return \"login\";\n    }\n\n    @PostMapping(value = \"login\")\n    @ResponseBody\n    public Result login(String username, String password,\n                        @RequestParam(value = \"remember\", defaultValue = \"false\", required = false) boolean remember,\n                        HttpServletResponse response) {\n        String referer = getReferer();\n        // 如果用户已经登陆，那么跳转到之前的页面\n        if (userHolder.getUser() != null && userHolder.getUser().getStat().equals(User.STAT_OK)) {\n            return Result.fail(MsgCenter.OK, referer);\n        }\n        Result result = userService.login(username, password, remember, this.getRemoteIp(), this.getUserAgent());\n        if (result.isSuccess()) {\n            Map<String, String> data = new HashMap<String, String>();\n            data.put(\"referer\", referer);\n            // response中添加cookie，以后每次请求都会带上cookie\n            Cookie cookie = new Cookie(\"token\", (String) result.getData());\n            cookie.setPath(\"/\");\n            if (remember) {\n                cookie.setMaxAge(60 * 60 * 24 * 7);\n            } else {\n                cookie.setMaxAge(60 * 60 * 24);\n            }\n            response.addCookie(cookie);\n            return Result.success(data);\n        } else {\n            return result;\n        }\n    }\n\n    @PostMapping(value = \"logout\")\n    @ResponseBody\n    public Result logout() {\n        String token = null;\n        // 从请求中获取token\n        if (this.getRequest().getCookies() != null) {\n            for (Cookie cookie : this.getRequest().getCookies()) {\n                if (cookie.getName().equals(\"token\")) {\n                    token = cookie.getValue();\n                }\n            }\n        }\n        return userService.logout(token);\n    }\n\n    @GetMapping(value = \"register\")\n    public String register() {\n        String referer = getReferer();\n        if (userHolder.getUser() != null) {\n            return \"redirect:\" + referer;\n        }\n        return \"register\";\n    }\n\n    @PostMapping(value = \"register\")\n    @ResponseBody\n    public Result register(User user, HttpServletResponse response) {\n        Result result = userService.register(user);\n        String pwd = user.getPassword();\n        // 注册成功就自动登录，前台跳转到验证页面\n        if (result.isSuccess()) {\n            login(user.getUsername(), pwd, false, response);\n            return Result.success();\n        }\n        return result;\n    }\n\n    /**\n     * 获取每日推荐，随机选取5个游戏，每日生成一次\n     *\n     * @return\n     */\n    @PostMapping(value = \"everyday\")\n    @ResponseBody\n    public Result everyday() {\n        return gameService.getRandomGames();\n    }\n\n\n    @GetMapping(value = \"shoppingcart\")\n    public String shoppingcart() {\n        return \"shoppingcart\";\n    }\n\n    /**\n     * 最新的5个游戏，根据上架时间排序，放在缓存中\n     *\n     * @return\n     */\n    @PostMapping(value = \"newestgames\")\n    @ResponseBody\n    public Result newestGames() {\n        return gameService.newestGames();\n    }\n\n    /**\n     * 最新的5个未上架游戏，根据时间排序，放在缓存中\n     *\n     * @return\n     */\n    @PostMapping(value = \"preupgames\")\n    @ResponseBody\n    public Result preUpGames() {\n        return gameService.preUpGames();\n    }\n\n    @PostMapping(value = \"freegames\")\n    @ResponseBody\n    public Result getFreeGames() {\n        return gameService.getFreeGames();\n    }\n\n    @GetMapping(value = \"search\")\n    public String search() {\n        return \"search\";\n    }\n\n    @PostMapping(value = \"search\")\n    @ResponseBody\n    public Result search(String info) {\n        return gameService.search(info);\n    }\n\n    /**\n     * 检查用户是否登陆，如果登陆就返回应该跳转到的页面，否则执行接下来的逻辑\n     * 每次登陆之前都从request的header中获取跳转之前的链接referer\n     * 如果为空（从别的网站跳转过来的），那么应该跳转到首页\n     * 登陆流程中第一次登陆就会调用本方法获取跳转链接，登陆失败将referer写入session中\n     * 如果是从登录页跳转过来的，可能是登陆出错了，但是跳转到登录页之前的referer在session存着，从session中获取\n     * 如果sesson中有referer，那么登陆成功跳转到referer，并且从session中删除referer\n     *\n     * @return\n     */\n    private String getReferer() {\n        String referer = null;\n        String tmp = this.getRequest().getHeader(\"Referer\");\n        // 如果为空，不是从本站跳转过来的，应该跳转到首页\n        if (tmp == null) {\n            referer = \"/\";\n        } else if (tmp.endsWith(\"/login\")) {\n            referer = (String) this.getSession().getAttribute(\"Referer\");\n        } else {\n            referer = tmp;\n        }\n        this.getSession().setAttribute(\"Referer\", referer);\n        return referer;\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/GameController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.exception.NotFoundException;\nimport cn.cie.services.GameService;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n */\n@CrossOrigin\n@Controller\n@RequestMapping(value = \"game\")\npublic class GameController extends AbstractController {\n\n    @Autowired\n    private GameService gameService;\n\n    @GetMapping(value = \"{id}\")\n    public String gameInfo(@PathVariable(value = \"id\") Integer id) {\n        if (!gameService.exists(id)) {\n            throw new NotFoundException();\n        }\n        this.getModel().addAttribute(\"id\", id);\n        return \"gameInfo\";\n    }\n\n    @PostMapping(value = \"{id}\")\n    @ResponseBody\n    public Result selectById(@PathVariable(value = \"id\") Integer id) {\n        return gameService.getById(id);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/KindController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.exception.NotFoundException;\nimport cn.cie.services.KindService;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletResponse;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n */\n@CrossOrigin\n@Controller\n@RequestMapping(value = \"kind\")\npublic class KindController extends AbstractController {\n\n    @Autowired\n    private KindService kindService;\n\n    @PostMapping(value = \"all\")\n    @ResponseBody\n    public Result allkinds(HttpServletResponse response) {\n        Result result = kindService.getAll();\n        return result;\n    }\n\n    @GetMapping(value = \"{kind}/games\")\n    public String getGames(@PathVariable(value = \"kind\") Integer kind) {\n        String name = kindService.getNameById(kind);\n        if (name == null) {\n            throw new NotFoundException();\n        }\n        this.getModel().addAttribute(\"id\", kind);\n        this.getModel().addAttribute(\"name\", name);\n        return \"kinds\";\n    }\n\n    @PostMapping(value = \"{kind}/games\")\n    @ResponseBody\n    public Result getGamesByKind(@PathVariable(value = \"kind\") Integer kind, @RequestParam(value = \"page\",\n            required = false, defaultValue = \"1\") Integer page) {\n        return kindService.getGamesByKind(kind, page);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/OrderController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.exception.NotFoundException;\nimport cn.cie.services.OrderService;\nimport cn.cie.utils.Result;\nimport cn.cie.utils.UserHolder;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.Arrays;\n\n/**\n * Created by RojerAlone on 2017/6/12.\n */\n@CrossOrigin\n@Controller\n@RequestMapping(value = \"/order\")\npublic class OrderController extends AbstractController {\n\n    @Autowired\n    private OrderService orderService;\n    @Autowired\n    private UserHolder userHolder;\n\n    @GetMapping(value = \"orders\")\n    public String orders() {\n        return \"order\";\n    }\n\n    @PostMapping(value = \"order\")\n    @ResponseBody\n    public Result order(@RequestParam(value = \"games\") Integer[] games) {\n        return orderService.addOrders(userHolder.getUser().getId(), Arrays.asList(games));\n    }\n\n    @PostMapping(value = \"{orderid}/cancel\")\n    @ResponseBody\n    public Result cancelOrder(@PathVariable(value = \"orderid\") Integer orderid) {\n        return orderService.cancelOrder(userHolder.getUser().getId(), orderid);\n    }\n\n    @GetMapping(value = \"{orderid}/payway\")\n    public String payway(@PathVariable(value = \"orderid\") Integer orderid) {\n        if (!orderService.exists(orderid)) {\n            throw new NotFoundException();\n        }\n        this.getModel().addAttribute(\"id\", orderid);\n        return \"order_1\";\n    }\n\n    @GetMapping(value = \"{orderid}/pay\")\n    public String pay(@PathVariable(value = \"orderid\") Integer orderid) {\n        if (!orderService.exists(orderid)) {\n            throw new NotFoundException();\n        }\n        this.getModel().addAttribute(\"id\", orderid);\n        return \"order_2\";\n    }\n\n    @PostMapping(value = \"{orderid}/pay\")\n    @ResponseBody\n    public Result payOrder(@PathVariable(value = \"orderid\") Integer orderid) {\n        return orderService.pay(userHolder.getUser().getId(), orderid);\n    }\n\n    @PostMapping(value = \"notpay/{page}\")\n    @ResponseBody\n    public Result getNotPayOrders(@PathVariable(value = \"page\") Integer page) {\n        return orderService.getNotPayOrders(userHolder.getUser().getId(), page);\n    }\n\n    @PostMapping(value = \"paid/{page}\")\n    @ResponseBody\n    public Result getPaidOrders(@PathVariable(value = \"page\") Integer page) {\n        return orderService.getPaidOrders(userHolder.getUser().getId(), page);\n    }\n\n    @PostMapping(value = \"cancel/{page}\")\n    @ResponseBody\n    public Result getCancelOrders(@PathVariable(value = \"page\") Integer page) {\n        return orderService.getCancelOrders(userHolder.getUser().getId(), page);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/TagController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.exception.NotFoundException;\nimport cn.cie.services.TagService;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/7.\n */\n@CrossOrigin\n@Controller\n@RequestMapping(value = \"tag\")\npublic class TagController extends AbstractController {\n\n    @Autowired\n    private TagService tagService;\n\n    @GetMapping(value = \"/{tag}/games\")\n    public String getGames(@PathVariable(value = \"tag\") Integer tag) {\n        String name = tagService.getNameById(tag);\n        if (name == null) {\n            throw new NotFoundException();\n        }\n        this.getModel().addAttribute(\"id\", tag);\n        this.getModel().addAttribute(\"name\", name);\n        return \"taggames\";\n    }\n\n    @PostMapping(value = \"/{tag}/games\")\n    @ResponseBody\n    public Result<List<GameDTO>> getGamesByTag(@PathVariable(value = \"tag\") Integer tag,\n                                               @RequestParam(value = \"page\", required = false, defaultValue = \"1\") Integer page) {\n        return tagService.getGamesByTag(tag, page);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/controller/UserController.java",
    "content": "package cn.cie.controller;\n\nimport cn.cie.entity.User;\nimport cn.cie.services.UserService;\nimport cn.cie.utils.MsgCenter;\nimport cn.cie.utils.Result;\nimport cn.cie.utils.UserHolder;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.*;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n */\n@CrossOrigin\n@Controller\n@RequestMapping(value = \"user\")\npublic class UserController extends AbstractController {\n\n    @Autowired\n    private UserService userService;\n    @Autowired\n    private UserHolder userHolder;\n\n    @GetMapping(value = \"validate\")\n    public String validate() {\n        String referer = getReferer();\n        if (userHolder.getUser().getStat().equals(User.STAT_OK)) {\n            return \"redirect:\" + referer;\n        }\n        return \"validate\";\n    }\n\n    @PostMapping(value = \"validate\")\n    @ResponseBody\n    public Result validate(String code) {\n        if (userHolder.getUser() == null) {\n            return Result.fail(MsgCenter.USER_NOT_LOGIN);\n        }\n        if (userHolder.getUser().getStat().equals(User.STAT_OK)) {    // 用户已经验证过了\n            return Result.fail(MsgCenter.USER_VALIDATED);\n        }\n        Result result = userService.validate(userHolder.getUser().getId(), code);\n        if (result.isSuccess()) {\n            return Result.success(\"/\");\n        }\n        return result;\n    }\n\n    @PostMapping(value = \"sendMail\")\n    @ResponseBody\n    public Result sendMail() {\n        if (userHolder.getUser() == null) {\n            return Result.fail(MsgCenter.USER_NOT_LOGIN);\n        }\n        return userService.sendMail(userHolder.getUser());\n    }\n\n    @GetMapping(value = \"personal\")\n    public String personal() {\n        return \"personal\";\n    }\n\n    @PostMapping(value = \"personal\")\n    @ResponseBody\n    public Result getPersonInfo() {\n        User user = userHolder.getUser();\n        if (user == null) {\n            return Result.fail(MsgCenter.USER_NOT_LOGIN);\n        }\n        user.setPassword(null);\n        return Result.success(user);\n    }\n\n    @GetMapping(value = \"update\")\n    public String update() {\n        return \"updateUserInfo\";\n    }\n\n    @PostMapping(value = \"update\")\n    @ResponseBody\n    public Result update(User user) {\n        return userService.updateUserInfo(user);\n    }\n\n    @GetMapping(value = \"updatepassword\")\n    public String updatePassword() {\n        return \"updatepassword\";\n    }\n\n    @PostMapping(value = \"updatepassword\")\n    @ResponseBody\n    public Result updatePassword(String password) {\n        return userService.updatePassword(password);\n    }\n\n    @GetMapping(value = \"findpassword\")\n    public String findPassword() {\n        return \"findpassword\";\n    }\n\n    @PostMapping(value = \"sendfetchpwdmail\")\n    @ResponseBody\n    public Result sendFetchPwdMail(String email) {\n        return userService.sendFetchPwdMail(email);\n    }\n\n    @PostMapping(value = \"findpassword\")\n    @ResponseBody\n    public Result findPassword(String password, String email, String code) {\n        return userService.forgetPassword(password, email, code);\n    }\n\n    /**\n     * 检查用户是否登陆，如果登陆就返回应该跳转到的页面，否则执行接下来的逻辑\n     * 每次登陆之前都从request的header中获取跳转之前的链接referer\n     * 如果为空（从别的网站跳转过来的），那么应该跳转到首页\n     * 登陆流程中第一次登陆就会调用本方法获取跳转链接，登陆失败将referer写入session中\n     * 如果是从登录页跳转过来的，可能是登陆出错了，但是跳转到登录页之前的referer在session存着，从session中获取\n     * 如果sesson中有referer，那么登陆成功跳转到referer，并且从session中删除referer\n     *\n     * @return\n     */\n    private String getReferer() {\n        String referer = null;\n        String tmp = this.getRequest().getHeader(\"Referer\");\n        // 如果为空，不是从本站跳转过来的，应该跳转到首页\n        if (tmp == null) {\n            referer = \"/\";\n        } else if (tmp.endsWith(\"/login\")) {\n            referer = (String) this.getSession().getAttribute(\"Referer\");\n        } else {\n            referer = tmp;\n        }\n        this.getSession().setAttribute(\"Referer\", referer);\n        return referer;\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/entity/Code.java",
    "content": "package cn.cie.entity;\n\n/**\n * 游戏激活码\n */\npublic class Code {\n\n    /**\n     * 未使用\n     */\n    public static final Byte STAT_NOT_USED = 0;\n    /**\n     * 已使用\n     */\n    public static final Byte STAT_USED = 1;\n\n    private Integer id;\n\n    private Integer item;\n\n    private Integer uid;\n\n    private String code;\n\n    private Byte stat;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public Integer getItem() {\n        return item;\n    }\n\n    public void setItem(Integer item) {\n        this.item = item;\n    }\n\n    public Integer getUid() {\n        return uid;\n    }\n\n    public void setUid(Integer uid) {\n        this.uid = uid;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public void setStat(Byte stat) {\n        this.stat = stat;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Game.java",
    "content": "package cn.cie.entity;\n\nimport java.util.Date;\n\n/**\n * 游戏\n */\npublic class Game {\n\n    /**\n     * 未上架\n     */\n    public static final Byte STAT_PRE = 0;\n    /**\n     * 已上架\n     */\n    public static final Byte STAT_OK = 1;\n    /**\n     * 已下架\n     */\n    public static final Byte STAT_DEL = 2;\n\n    private Integer id;\n\n    private String creater;\n\n    private String name;\n\n    private String desc;\n\n    private String systemcfg;\n\n    private Double price;\n\n    private Double discount;\n\n    private Date ctime;\n\n    private Date utime;\n\n    private Byte stat;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public String getCreater() {\n        return creater;\n    }\n\n    public void setCreater(String creater) {\n        this.creater = creater;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDesc() {\n        return desc;\n    }\n\n    public void setDesc(String desc) {\n        this.desc = desc;\n    }\n\n    public String getSystemcfg() {\n        return systemcfg;\n    }\n\n    public void setSystemcfg(String systemcfg) {\n        this.systemcfg = systemcfg;\n    }\n\n    public Double getPrice() {\n        return price;\n    }\n\n    public void setPrice(Double price) {\n        this.price = price;\n    }\n\n    public Double getDiscount() {\n        return discount;\n    }\n\n    public void setDiscount(Double discount) {\n        this.discount = discount;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public void setCtime(Date ctime) {\n        this.ctime = ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public void setUtime(Date utime) {\n        this.utime = utime;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public void setStat(Byte stat) {\n        this.stat = stat;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Img.java",
    "content": "package cn.cie.entity;\n\n/**\n * 游戏图片\n */\npublic class Img {\n    private Integer game;\n\n    private String img;\n\n    public Integer getGame() {\n        return game;\n    }\n\n    public void setGame(Integer game) {\n        this.game = game;\n    }\n\n    public String getImg() {\n        return img;\n    }\n\n    public void setImg(String img) {\n        this.img = img;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Kind.java",
    "content": "package cn.cie.entity;\n\npublic class Kind {\n    private Integer id;\n\n    private String name;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Kindmapper.java",
    "content": "package cn.cie.entity;\n\n/**\n * 游戏和种类映射\n */\npublic class Kindmapper {\n    private Integer game;\n\n    private Integer kind;\n\n    public Integer getGame() {\n        return game;\n    }\n\n    public void setGame(Integer game) {\n        this.game = game;\n    }\n\n    public Integer getKind() {\n        return kind;\n    }\n\n    public void setKind(Integer kind) {\n        this.kind = kind;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Order.java",
    "content": "package cn.cie.entity;\n\nimport java.util.Date;\n\n/**\n * 订单\n */\npublic class Order {\n\n    /**\n     * 未支付\n     */\n    public static final Byte STAT_NOT_PAY = 0;\n    /**\n     * 已支付\n     */\n    public static final Byte STAT_PAY = 1;\n    /**\n     * 取消\n     */\n    public static final Byte STAT_CANCEL = 2;\n\n    private Integer id;\n\n    private Integer uid;\n\n    private Double price;\n\n    private Date ctime;\n\n    private Date utime;\n\n    private Byte stat;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public Integer getUid() {\n        return uid;\n    }\n\n    public void setUid(Integer uid) {\n        this.uid = uid;\n    }\n\n    public Double getPrice() {\n        return price;\n    }\n\n    public void setPrice(Double price) {\n        this.price = price;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public void setCtime(Date ctime) {\n        this.ctime = ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public void setUtime(Date utime) {\n        this.utime = utime;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public void setStat(Byte stat) {\n        this.stat = stat;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Orderitem.java",
    "content": "package cn.cie.entity;\n\nimport java.util.Date;\n\n/**\n * 订单详情\n */\npublic class Orderitem {\n    private Integer id;\n\n    private Integer gid;\n\n    private Double price;\n\n    private Integer code;\n\n    private Date ctime;\n\n    private Date utime;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public Integer getGid() {\n        return gid;\n    }\n\n    public void setGid(Integer gid) {\n        this.gid = gid;\n    }\n\n    public Double getPrice() {\n        return price;\n    }\n\n    public void setPrice(Double price) {\n        this.price = price;\n    }\n\n    public Integer getCode() {\n        return code;\n    }\n\n    public void setCode(Integer code) {\n        this.code = code;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public void setCtime(Date ctime) {\n        this.ctime = ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public void setUtime(Date utime) {\n        this.utime = utime;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Ordermapper.java",
    "content": "package cn.cie.entity;\n\n/**\n * 订单-订单详情映射\n */\npublic class Ordermapper {\n    private Integer order;\n\n    private Integer item;\n\n    public Integer getOrder() {\n        return order;\n    }\n\n    public void setOrder(Integer order) {\n        this.order = order;\n    }\n\n    public Integer getItem() {\n        return item;\n    }\n\n    public void setItem(Integer item) {\n        this.item = item;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Tag.java",
    "content": "package cn.cie.entity;\n\n/**\n * 游戏标签\n */\npublic class Tag {\n    private Integer id;\n\n    private String name;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Tagmapper.java",
    "content": "package cn.cie.entity;\n\n/**\n * 游戏游戏标签映射\n */\npublic class Tagmapper {\n    private Integer game;\n\n    private Integer tag;\n\n    public Integer getGame() {\n        return game;\n    }\n\n    public void setGame(Integer game) {\n        this.game = game;\n    }\n\n    public Integer getTag() {\n        return tag;\n    }\n\n    public void setTag(Integer tag) {\n        this.tag = tag;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Token.java",
    "content": "package cn.cie.entity;\n\nimport java.util.Date;\n\n/**\n * token，用来标识一个用户\n */\npublic class Token {\n\n    /**\n     * 正常状态\n     */\n    public static final Byte STAT_OK = 0;\n    /**\n     * token已过期\n     */\n    public static final Byte STAT_EXPIRED = 1;\n\n    private Integer uid;\n\n    private String token;\n\n    private Date expiredTime;\n\n    private String ip;\n\n    private String device;\n\n    private Date ctime;\n\n    private Byte stat;\n\n    public Integer getUid() {\n        return uid;\n    }\n\n    public void setUid(Integer uid) {\n        this.uid = uid;\n    }\n\n    public String getToken() {\n        return token;\n    }\n\n    public void setToken(String token) {\n        this.token = token;\n    }\n\n    public Date getExpiredTime() {\n        return expiredTime;\n    }\n\n    public void setExpiredTime(Date expiredTime) {\n        this.expiredTime = expiredTime;\n    }\n\n    public String getIp() {\n        return ip;\n    }\n\n    public void setIp(String ip) {\n        this.ip = ip;\n    }\n\n    public String getDevice() {\n        return device;\n    }\n\n    public void setDevice(String device) {\n        this.device = device;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public void setCtime(Date ctime) {\n        this.ctime = ctime;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public void setStat(Byte stat) {\n        this.stat = stat;\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/User.java",
    "content": "package cn.cie.entity;\n\nimport java.util.Date;\n\npublic class User {\n\n    /**\n     * 未验证，需要邮箱验证\n     */\n    public static final Byte STAT_NOT_VALIDATE = 0;\n    /**\n     * 正常\n     */\n    public static final Byte STAT_OK = 1;\n    /**\n     * 受限\n     */\n    public static final Byte STAT_RESTRICT = 2;\n    /**\n     * 已删除\n     */\n    public static final Byte STAT_DEL = 3;\n\n    private Integer id;\n\n    private String username;\n\n    private String password;\n\n    private String nickname;\n\n    private String email;\n\n    private Long phone;\n\n    private Date ctime;\n\n    private Date utime;\n\n    private Byte stat;\n\n    public Integer getId() {\n        return id;\n    }\n\n    public void setId(Integer id) {\n        this.id = id;\n    }\n\n    public String getUsername() {\n        return username;\n    }\n\n    public void setUsername(String username) {\n        this.username = username;\n    }\n\n    public String getPassword() {\n        return password;\n    }\n\n    public void setPassword(String password) {\n        this.password = password;\n    }\n\n    public String getNickname() {\n        return nickname;\n    }\n\n    public void setNickname(String nickname) {\n        this.nickname = nickname;\n    }\n\n    public String getEmail() {\n        return email;\n    }\n\n    public void setEmail(String email) {\n        this.email = email;\n    }\n\n    public Long getPhone() {\n        return phone;\n    }\n\n    public void setPhone(Long phone) {\n        this.phone = phone;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public void setCtime(Date ctime) {\n        this.ctime = ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public void setUtime(Date utime) {\n        this.utime = utime;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public void setStat(Byte stat) {\n        this.stat = stat;\n    }\n\n    @Override\n    public String toString() {\n        return \"User{\" +\n                \"id=\" + id +\n                \", username='\" + username + '\\'' +\n                \", password='\" + password + '\\'' +\n                \", nickname='\" + nickname + '\\'' +\n                \", email='\" + email + '\\'' +\n                \", phone=\" + phone +\n                \", ctime=\" + ctime +\n                \", utime=\" + utime +\n                \", stat=\" + stat +\n                '}';\n    }\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/Validatecode.java",
    "content": "package cn.cie.entity;\n\n/**\n * 注册时发送到邮箱的验证码，用来验证用户邮箱\n */\npublic class Validatecode {\n\n    /**\n     * 验证码有效期，默认为10分钟\n     */\n    public static final int TIMEOUT = 60 * 10;\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/entity/dto/GameDTO.java",
    "content": "package cn.cie.entity.dto;\n\nimport cn.cie.entity.Game;\nimport cn.cie.entity.Kind;\nimport cn.cie.entity.Tag;\n\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n */\npublic class GameDTO {\n\n    private Integer id;\n\n    private String creater;\n\n    private String name;\n\n    private String desc;\n\n    private String systemcfg;\n\n    private Double price;\n\n    private Double discount;\n\n    private Date ctime;\n\n    private Date utime;\n\n    private Byte stat;\n\n    private List<Kind> kinds;\n\n    private List<Tag> tags;\n\n    private List<String> img;\n\n    public GameDTO() {}\n\n    public GameDTO(Game game, List<Tag> tags, List<String> img) {\n        this.id = game.getId();\n        this.creater = game.getCreater();\n        this.name = game.getName();\n        this.desc = game.getDesc();\n        this.systemcfg = game.getSystemcfg();\n        this.price = game.getPrice();\n        this.discount = game.getDiscount();\n        this.ctime = game.getCtime();\n        this.utime = game.getUtime();\n        this.stat = game.getStat();\n        this.tags = tags;\n        this.img = img;\n    }\n\n    public GameDTO(Game game, List<Kind> kinds, List<Tag> tags, List<String> img) {\n        this.id = game.getId();\n        this.creater = game.getCreater();\n        this.name = game.getName();\n        this.desc = game.getDesc();\n        this.systemcfg = game.getSystemcfg();\n        this.price = game.getPrice();\n        this.discount = game.getDiscount();\n        this.ctime = game.getCtime();\n        this.utime = game.getUtime();\n        this.stat = game.getStat();\n        this.kinds = kinds;\n        this.tags = tags;\n        this.img = img;\n    }\n\n    public Integer getId() {\n        return id;\n    }\n\n    public String getCreater() {\n        return creater;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public String getDesc() {\n        return desc;\n    }\n\n    public String getSystemcfg() {\n        return systemcfg;\n    }\n\n    public Double getPrice() {\n        return price;\n    }\n\n    public Double getDiscount() {\n        return discount;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public List<Kind> getKinds() {\n        return kinds;\n    }\n\n    public List<Tag> getTags() {\n        return tags;\n    }\n\n    public List<String> getImg() {\n        return img;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/entity/dto/OrderDTO.java",
    "content": "package cn.cie.entity.dto;\n\nimport cn.cie.entity.Order;\nimport cn.cie.entity.Orderitem;\n\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/12.\n */\npublic class OrderDTO {\n\n    /**\n     * 订单id\n     */\n    private Integer id;\n\n    /**\n     * 订单所属用户id\n     */\n    private Integer uid;\n\n    /**\n     * 订单的总价格\n     */\n    private Double total;\n\n    /**\n     * 订单创建时间\n     */\n    private Date ctime;\n\n    /**\n     * 订单更新时间\n     */\n    private Date utime;\n\n    /**\n     * 订单状态\n     */\n    private Byte stat;\n\n    /**\n     * 订单详细信息\n     */\n    private List<OrderItemDTO> orderitems;\n\n    public OrderDTO(Order order, List<OrderItemDTO> orderitems) {\n        this.id = order.getId();\n        this.uid = order.getUid();\n        this.total = order.getPrice();\n        this.ctime = order.getCtime();\n        this.utime = order.getUtime();\n        this.stat = order.getStat();\n        this.orderitems = orderitems;\n    }\n\n    public Integer getId() {\n        return id;\n    }\n\n    public Integer getUid() {\n        return uid;\n    }\n\n    public Double getTotal() {\n        return total;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public Byte getStat() {\n        return stat;\n    }\n\n    public List<OrderItemDTO> getOrderitems() {\n        return orderitems;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/entity/dto/OrderItemDTO.java",
    "content": "package cn.cie.entity.dto;\n\nimport cn.cie.entity.Code;\nimport cn.cie.entity.Game;\nimport cn.cie.entity.Orderitem;\n\nimport java.util.Date;\n\n/**\n * Created by RojerAlone on 2017/6/12.\n */\npublic class OrderItemDTO {\n\n    private Integer id;\n\n    private Double price;\n\n    private String code;\n\n    private Byte codeStat;\n\n    private Date ctime;\n\n    private Date utime;\n\n    private Game game;\n\n    public OrderItemDTO(Orderitem orderitem, Game game, Code code) {\n        this.id = orderitem.getId();\n        this.price = orderitem.getPrice();\n        this.game = game;\n        this.ctime = orderitem.getCtime();\n        this.utime = orderitem.getUtime();\n        if (code != null) {\n            this.code = code.getCode();\n            this.codeStat = code.getStat();\n        }\n    }\n\n    public Integer getId() {\n        return id;\n    }\n\n    public Double getPrice() {\n        return price;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public Byte getCodeStat() {\n        return codeStat;\n    }\n\n    public Date getCtime() {\n        return ctime;\n    }\n\n    public Date getUtime() {\n        return utime;\n    }\n\n    public Game getGame() {\n        return game;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/EventConsumer.java",
    "content": "package cn.cie.event;\n\nimport cn.cie.event.handler.EventHandler;\nimport cn.cie.utils.RedisUtil;\nimport org.apache.log4j.Logger;\nimport org.springframework.beans.BeansException;\nimport org.springframework.beans.factory.DisposableBean;\nimport org.springframework.beans.factory.InitializingBean;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.ApplicationContextAware;\nimport org.springframework.stereotype.Service;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.ThreadPoolExecutor;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 事件消费者，不断从事件队列中获取事件，根据事件类型处理不同的事件\n */\n@Service\npublic class EventConsumer implements InitializingBean, ApplicationContextAware, DisposableBean {\n\n    private final Logger logger = Logger.getLogger(this.getClass());\n\n    private ApplicationContext applicationContext;\n\n    @Autowired\n    private RedisUtil<EventModel> redisUtil;\n\n    private ThreadPoolExecutor threadPool;\n\n    /**\n     * 事件类型以及执行这些事件的handler\n     */\n    private Map<EventType, List<EventHandler>> handlers = new HashMap<EventType, List<EventHandler>>();\n\n    public void afterPropertiesSet() throws Exception {\n        // 从上下文中获取所有的handler\n        Map<String, EventHandler> beans = applicationContext.getBeansOfType(EventHandler.class);\n        if (beans != null) {\n            for (Map.Entry<String, EventHandler> entry : beans.entrySet()) {\n                // 遍历所有的 hander ，将 event-handler 的映射加入 handlers 中\n                List<EventType> types = entry.getValue().getSupportEvent();\n                for (EventType type : types) {\n                    if (!handlers.containsKey(type)) {\n                        handlers.put(type, new ArrayList<EventHandler>());\n                    }\n                    handlers.get(type).add(entry.getValue());\n                }\n            }\n        }\n        // 设置线程池的大小为 CPU 的核数 * 2\n        threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 2);\n        new Thread(new Runnable() {\n            public void run() {\n                while (true) {\n                    EventModel event = redisUtil.lpopObject(EventModel.EVENT_KEY, EventModel.class);\n                    if (event == null) {\n                        continue;\n                    }\n                    if (!handlers.containsKey(event.getEventType())) {\n                        logger.error(\"error event type\");\n                        continue;\n                    }\n                    for (EventHandler handler : handlers.get(event.getEventType())) {\n                        threadPool.execute(new EventConsumerThread(handler, event));\n                    }\n                }\n            }\n        }).start();\n    }\n\n    class EventConsumerThread implements Runnable {\n\n        private EventHandler handler;\n\n        private EventModel event;\n\n        public EventConsumerThread(EventHandler handler, EventModel event) {\n            this.handler = handler;\n            this.event = event;\n        }\n\n        public void run() {\n            handler.doHandler(event);\n        }\n    }\n\n    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n        this.applicationContext = applicationContext;\n    }\n\n    public void destroy() throws Exception {\n        if (threadPool != null) {\n            while (threadPool.getQueue().size() != 0 || threadPool.getActiveCount() != 0) {\n                // 等待所有任务执行完毕\n            }\n            threadPool.shutdownNow();\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/EventModel.java",
    "content": "package cn.cie.event;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 事件实体\n */\npublic class EventModel {\n\n    /**\n     * 在缓存中事件队列的key\n     */\n    public static final String EVENT_KEY = \"event\";\n\n    /**\n     * 事件类型\n     */\n    private EventType eventType;\n    /**\n     * 事件发出者id\n     */\n    private int fromId;\n    /**\n     * 事件接受者id\n     */\n    private int toId;\n    /**\n     * 触发事件的实体，比如评论点赞\n     */\n    private int entityId;\n    /**\n     * 实体拥有者\n     */\n    private int entityOwnerId;\n    /**\n     * 可能会有的额外信息\n     */\n    private Map<String ,String> exts = new HashMap<String, String>();\n\n    public EventModel() {\n\n    }\n\n    public EventModel(EventType eventType) {\n        this.eventType = eventType;\n    }\n\n    public EventType getEventType() {\n        return eventType;\n    }\n\n    public EventModel setEventType(EventType eventType) {\n        this.eventType = eventType;\n        return this;\n    }\n\n    public int getFromId() {\n        return fromId;\n    }\n\n    public EventModel setFromId(int fromId) {\n        this.fromId = fromId;\n        return this;\n    }\n\n    public int getToId() {\n        return toId;\n    }\n\n    public EventModel setToId(int toId) {\n        this.toId = toId;\n        return this;\n    }\n\n    public int getEntityId() {\n        return entityId;\n    }\n\n    public EventModel setEntityId(int entityId) {\n        this.entityId = entityId;\n        return this;\n    }\n\n    public int getEntityOwnerId() {\n        return entityOwnerId;\n    }\n\n    public EventModel setEntityOwnerId(int entityOwnerId) {\n        this.entityOwnerId = entityOwnerId;\n        return this;\n    }\n\n    public String getExts(String key) {\n        return exts.get(key);\n    }\n\n    public EventModel setExts(String key, String value) {\n        this.exts.put(key, value);\n        return this;\n    }\n\n    public Map<String, String> getExts() {\n        return exts;\n    }\n\n    public void setExts(Map<String, String> exts) {\n        this.exts = exts;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/EventProducer.java",
    "content": "package cn.cie.event;\n\nimport cn.cie.utils.RedisUtil;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 事件生产者\n */\n@Component\npublic class EventProducer {\n\n    @Autowired\n    private RedisUtil redisUtil;\n\n    public long product(EventModel model) {\n        return redisUtil.rpushObject(EventModel.EVENT_KEY, EventModel.class, model);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/EventType.java",
    "content": "package cn.cie.event;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 异步事件类型\n */\npublic enum EventType {\n\n    SEND_VALIDATE_EMAIL(1),\n    SEND_FIND_PWD_EMAIL(2);\n\n    private int value;\n\n    EventType(int value) {\n        this.value = value;\n    }\n\n    public int getValue() {\n        return value;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/handler/EventHandler.java",
    "content": "package cn.cie.event.handler;\n\nimport cn.cie.event.EventModel;\nimport cn.cie.event.EventType;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 事件处理接口，包含了事件处理以及关心的所有事件\n */\npublic interface EventHandler {\n\n    /**\n     * 处理事件\n     */\n    void doHandler(EventModel eventModel);\n\n    /**\n     * 获取支持的事件类型\n     * @return\n     */\n    List<EventType> getSupportEvent();\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/handler/SendFindPwdMailHandler.java",
    "content": "package cn.cie.event.handler;\n\nimport cn.cie.event.EventModel;\nimport cn.cie.event.EventType;\nimport cn.cie.utils.MailUtil;\nimport org.springframework.stereotype.Service;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 发送找回密码邮件事件\n */\n@Service\npublic class SendFindPwdMailHandler implements EventHandler {\n\n    public void doHandler(EventModel model) {\n        MailUtil.sendFetchPwdMail(model.getExts(\"mail\"), model.getExts(\"code\"));\n    }\n\n    public List<EventType> getSupportEvent() {\n        return Arrays.asList(EventType.SEND_FIND_PWD_EMAIL);\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/event/handler/SendValidateMailHandler.java",
    "content": "package cn.cie.event.handler;\n\nimport cn.cie.event.EventModel;\nimport cn.cie.event.EventType;\nimport cn.cie.utils.MailUtil;\nimport org.springframework.stereotype.Service;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/25.\n * 发送注册用户时邮箱验证码事件\n */\n@Service\npublic class SendValidateMailHandler implements EventHandler {\n\n    public void doHandler(EventModel model) {\n        MailUtil.sendValidateMail(model.getExts(\"mail\"), model.getExts(\"code\"));\n    }\n\n    public List<EventType> getSupportEvent() {\n        return Arrays.asList(EventType.SEND_VALIDATE_EMAIL);\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/exception/NotFoundException.java",
    "content": "package cn.cie.exception;\n\nimport cn.cie.utils.MsgCenter;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.web.bind.annotation.ResponseStatus;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n * 自定义异常\n */\n@ResponseStatus(value = HttpStatus.NOT_FOUND)\npublic class NotFoundException extends RuntimeException {\n\n    public NotFoundException() {\n        super(MsgCenter.NOT_FOUND);\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/interceptor/AdminInterceptor.java",
    "content": "package cn.cie.interceptor;\n\nimport cn.cie.utils.UserHolder;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n/**\n * Created by RojerAlone on 2017/6/21.\n * 管理员权限拦截，如果用户不是管理员，那么跳转到管理员的登陆页面\n */\npublic class AdminInterceptor implements HandlerInterceptor {\n\n    @Autowired\n    private UserHolder userHolder;\n\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n        if (request.getRequestURI().equals(\"/admin/login\")) {\n            return true;\n        }\n        if (userHolder.getUser() != null && userHolder.getUser().getUsername().equals(\"admin\")) {\n            return true;\n        }\n        response.sendRedirect(\"/admin/login\");\n        return false;\n    }\n\n    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n\n    }\n\n    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/interceptor/AuthInterceptor.java",
    "content": "package cn.cie.interceptor;\n\nimport cn.cie.entity.Token;\nimport cn.cie.entity.User;\nimport cn.cie.mapper.TokenMapper;\nimport cn.cie.mapper.UserMapper;\nimport cn.cie.utils.RedisUtil;\nimport cn.cie.utils.UserHolder;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.http.HttpMethod;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Date;\n\n/**\n * Created by RojerAlone on 2017/6/11.\n * 拦截器，根据token获取用户身份\n * 先从缓存中查找，如果找不到再从数据库中找\n */\n@Component\npublic class AuthInterceptor implements HandlerInterceptor {\n\n    @Autowired\n    private TokenMapper tokenMapper;\n    @Autowired\n    private UserMapper userMapper;\n    @Autowired\n    private RedisUtil redisUtil;\n    @Autowired\n    private UserHolder userHolder;\n\n    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {\n        // 如果请求静态资源直接pass\n        if (httpServletRequest.getRequestURI().matches(\"^/img/[\\\\S]+\\\\.(png|jpg)$\") || httpServletRequest.getRequestURI().matches(\"^/css/[\\\\S]+\\\\.css$\")\n                || httpServletRequest.getRequestURI().matches(\"^/js/[\\\\S]+\\\\.js$\")) {\n            return true;\n        }\n        String token = null;\n        // 从请求中获取token\n        if (httpServletRequest.getCookies() != null) {\n            for (Cookie cookie : httpServletRequest.getCookies()) {\n                if (cookie.getName().equals(\"token\")) {\n                    token = cookie.getValue();\n                }\n            }\n        }\n        // 如果获取到了token\n        if (token != null) {\n            String userid = redisUtil.get(token);\n            int uid = 0;\n            // 缓存中没有token，从数据库中查找\n            if (userid == null) {\n                Token t = tokenMapper.selectByTokenAndStat(token, Token.STAT_OK);\n                // 如果token为空或者已经过期但是定时任务还没有来得及更改状态\n                Date now = new Date();\n                if (t == null || t.getExpiredTime().before(now)) {\n                    return true;\n                }\n                // token不为空，但是缓存中没有了，将token加入缓存中\n                uid = t.getUid();\n                long oneday = 86400000L;\n                long expired = t.getExpiredTime().getTime() - now.getTime();\n                // 如果token剩余有效期大于1天，加入缓存中的token有效期为1天\n                if (expired > oneday) {\n                    redisUtil.putEx(token, String.valueOf(uid), 60 * 60 * 24);\n                } else {    // 否则有效期为剩下的时间\n                    redisUtil.putEx(token, String.valueOf(uid), (int) (expired / 1000));\n                }\n            } else {\n                uid = Integer.valueOf(userid);\n            }\n            // token有效，将当前用户暂时存放起来，之后在所有的地方都可以通过依赖注入的UserHolder获取当前用户\n            User user = userMapper.selectById(uid);\n            if (user == null) {\n                return true;\n            }\n            userHolder.setUser(user);\n            // 跳过post方法\n            if (httpServletRequest.getMethod().equals(\"POST\")) {\n                return true;\n            }\n            // 如果用户登陆成功但是没有验证邮箱，跳转到邮箱验证页面(防止请求的url就是验证页时会循环跳转)\n            if (user.getStat().equals(User.STAT_NOT_VALIDATE) && !httpServletRequest.getRequestURI().equals(\"/user/validate\")) {\n                httpServletResponse.sendRedirect(\"/user/validate\");\n                return false;\n            } else if (user.getStat().equals(User.STAT_DEL)) {      // 用户被删除\n                userHolder.remove();\n            }\n        }\n        return true;\n    }\n\n    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {\n        if (modelAndView == null) {\n            return;\n        }\n        if (httpServletRequest.getMethod().equals(\"GET\") && userHolder.getUser() != null) {\n            modelAndView.getModel().put(\"user\", userHolder.getUser().getNickname());\n        }\n    }\n\n    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {\n        userHolder.remove();\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/interceptor/LoginInterceptor.java",
    "content": "package cn.cie.interceptor;\n\nimport cn.cie.utils.UserHolder;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n/**\n * Created by RojerAlone on 2017/6/12.\n * 拦截器，某些功能需要登录才能继续，如果没有登录会被拦截，跳转到登录页\n */\n@Component\npublic class LoginInterceptor implements HandlerInterceptor {\n\n    @Autowired\n    private UserHolder userHolder;\n\n    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {\n        if (userHolder.getUser() == null) {\n            httpServletResponse.sendRedirect(\"/login\");\n            return false;\n        }\n        return true;\n    }\n\n    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {\n\n    }\n\n    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {\n\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/mapper/CodeMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Code;\n\npublic interface CodeMapper {\n\n    int insert(Code record);\n\n    Code selectById(Integer id);\n\n    int update(Code record);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/GameMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Game;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface GameMapper {\n\n    int insert(Game record);\n\n    Game selectById(Integer id);\n\n    int selectNums();\n\n    List<Game> selectAll();\n\n    List<Game> selectByPage(@Param(value = \"startPos\") Integer startPos, @Param(value = \"size\") Integer size);\n\n    List<Game> selectByIds(@Param(value = \"ids\") List<Integer> ids);\n\n    List<Game> selectByIdsAndStat(@Param(value = \"ids\") List<Integer> ids, @Param(value = \"stat\") Byte stat);\n\n    List<Game> selectByIdsAndStatAndPage(@Param(value = \"ids\") List<Integer> ids, @Param(value = \"stat\") Byte stat,\n                                         @Param(value = \"startPos\") Integer startPos, @Param(value = \"size\") Integer size);\n\n    List<Game> selectByStat(Byte stat);\n\n    List<Game> selectByStatOrderByDate(Byte stat);\n\n    List<Game> selectByIdsAndInfo(@Param(value = \"ids\") List<Integer> ids, @Param(value = \"info\") String info);\n\n    List<Game> selectByInfo(String info);\n\n    List<Game> selectFreeGames();\n\n    int update(Game record);\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/ImgMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Img;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface ImgMapper {\n    int insert(Img record);\n\n    int insertBatch(@Param(value = \"game\") Integer game, @Param(value = \"imgs\") List<String> imgs);\n\n    List<String> selectByGame(Integer game);\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/KindMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Kind;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface KindMapper {\n\n    int insert(Kind record);\n\n    Kind selectById(Integer id);\n\n    List<Kind> selectAll();\n\n    List<Kind> selectByIds(@Param(value = \"ids\") List<Integer> ids);\n\n    Kind selectByName(String name);\n\n    List<Integer> selectIdByLikeName(String name);\n\n    int delete(Integer id);\n\n    int update(Kind record);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/KindmapperMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Kindmapper;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface KindmapperMapper {\n\n    int insert(Kindmapper record);\n\n    int insertKindBatch(@Param(value = \"game\") Integer game, @Param(value = \"kinds\") List<Integer> kinds);\n\n    int insertGameBatch(@Param(value = \"kind\") Integer kind, @Param(value = \"games\") List<Integer> games);\n\n    List<Integer> selectByKind(Integer kind);\n\n    List<Integer> selectByGame(Integer game);\n\n    List<Integer> selectBatchByKinds(@Param(value = \"kinds\") List<Integer> kinds);\n\n    int deleteByGame(Integer game);\n\n    int deleteByKind(Integer kind);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/OrderMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Order;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.Date;\nimport java.util.List;\n\npublic interface OrderMapper {\n\n    int insert(Order record);\n\n    Order selectById(Integer id);\n\n    List<Order> selectByUidAndStat(@Param(value = \"uid\") Integer uid, @Param(value = \"stat\") Byte stat);\n\n    List<Order> selectByUidAndStatAndPage(@Param(value = \"uid\") Integer uid, @Param(value = \"stat\") Byte stat,\n                                          @Param(value = \"startPos\") Integer startPos, @Param(value = \"size\") Integer size);\n\n    int getOrderNumsByUidAndStat(@Param(value = \"uid\") Integer uid, @Param(value = \"stat\") Byte stat);\n\n    int updateStatByDate(@Param(value = \"oldstat\") Byte oldstat, @Param(value = \"newstat\") Byte newstat, @Param(value = \"date\") Date date);\n\n    int update(Order record);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/OrderitemMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Orderitem;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface OrderitemMapper {\n\n    int insert(Orderitem record);\n\n    List<Orderitem> selectByIds(@Param(value = \"ids\") List<Integer> ids);\n\n    int update(Orderitem record);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/OrdermapperMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Order;\nimport cn.cie.entity.Ordermapper;\n\nimport java.util.List;\n\npublic interface OrdermapperMapper {\n    int insert(Ordermapper record);\n\n    List<Integer> selectByOrder(Integer order);\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/TagMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Tag;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface TagMapper {\n\n    int insert(Tag record);\n\n    Tag selectById(Integer id);\n\n    List<Tag> selectByIds(@Param(value = \"ids\") List<Integer> ids);\n\n    List<Integer> selectIdByLikeName(String info);\n\n    List<Tag> selectAll();\n\n    int update(Tag record);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/TagmapperMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Tagmapper;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface TagmapperMapper {\n    int insert(Tagmapper record);\n\n    List<Integer> selectByTag(Integer tag);\n\n    List<Integer> selectByGame(Integer game);\n\n    List<Integer> selectBatchByTags(@Param(value = \"tags\") List<Integer> tags);\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/TokenMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Token;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.Date;\nimport java.util.List;\n\npublic interface TokenMapper {\n\n    int insert(Token record);\n\n    Token selectByToken(String token);\n\n    Token selectByTokenAndStat(@Param(value = \"token\") String token, @Param(value = \"stat\") Byte stat);\n\n    List<Token> selectByUid(Integer uid);\n\n    int updateStatByDate(@Param(value = \"date\") Date date, @Param(value = \"stat\") Byte stat);\n\n    int updateStatByToken(@Param(value = \"stat\") Byte stat, @Param(value = \"token\") String token);\n}"
  },
  {
    "path": "src/main/java/cn/cie/mapper/UserMapper.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.User;\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\n\npublic interface UserMapper {\n\n    int insert(User record);\n\n    User selectById(Integer id);\n\n    User selectByName(String username);\n\n    User selectByEmail(String email);\n\n    int selectAllNums();\n\n    List<User> selectByPage(@Param(value = \"startPos\") Integer startPos, @Param(value = \"size\") Integer size);\n\n    List<User> selectByStat(Byte stat);\n\n    int update(User record);\n\n    int deleteById(Integer id);\n\n}"
  },
  {
    "path": "src/main/java/cn/cie/schedule/Scheduler.java",
    "content": "package cn.cie.schedule;\n\nimport cn.cie.services.OrderService;\nimport cn.cie.services.UserService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.scheduling.annotation.Scheduled;\nimport org.springframework.stereotype.Component;\n\n/**\n * Created by RojerAlone on 2017/6/9.\n * 定时任务\n * http://blog.csdn.net/sd4000784/article/details/7745947\n */\n@Component\npublic class Scheduler {\n\n    @Autowired\n    private UserService userService;\n    @Autowired\n    private OrderService orderService;\n\n    @Scheduled(fixedRate = 1000 * 60 * 3)\n    public void delNotValidateUser() {\n        userService.delNotValidateUser();\n    }\n\n    @Scheduled(fixedRate = 1000 * 60 * 10)\n    public void expireToken() {\n        userService.expireToken();\n    }\n\n    @Scheduled(fixedRate = 1000 * 60)\n    public void cancelOrder() {\n        orderService.autoCancelOrder();\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/AdminService.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.entity.Game;\nimport cn.cie.utils.Result;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.IOException;\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/15.\n * 管理员相关\n */\npublic interface AdminService {\n\n    /**\n     * 管理员登陆\n     * @param username\n     * @param password\n     * @return\n     */\n    Result login(String username, String password);\n\n    /**\n     * 获取所有的用户\n     * @param page 当前的页数\n     * @return User Page\n     */\n    Result getUser(int page);\n\n    /**\n     * 限制账户操作\n     * @param uid\n     * @return\n     */\n    Result restrict(Integer uid);\n\n    /**\n     * 解除账户限制\n     * @param uid\n     * @return\n     */\n    Result relieve(Integer uid);\n\n    /**\n     * 删除用户\n     * @param uid\n     * @return\n     */\n    Result delete(Integer uid);\n\n    /**\n     * 获取所有游戏\n     * @param page 获取游戏的页数\n     * @return GameDTO Page\n     */\n    Result getGames(int page);\n\n    /**\n     * 添加游戏\n     * @param game 游戏实体，需要游戏名字、开发者、描述、配置、价格\n     * @param kind 游戏种类，数组类型\n     * @param header 游戏图片\n     * @param pics 至少5张游戏截图\n     * @param path 图片存储路径\n     * @return\n     */\n    Result addGame(Game game, Integer[] kind, MultipartFile header, MultipartFile[] pics, String path) throws IOException;\n\n    /**\n     * 更新游戏信息\n     * @param game\n     * @return\n     */\n    Result updateGameInfo(Game game);\n\n    /**\n     * 获取游戏种类\n     * @param game\n     * @return\n     */\n    Result getGameKind(Integer game);\n\n    /**\n     * 更新游戏的种类\n     * @param game\n     * @param kinds\n     * @return\n     */\n    Result updateGameKind(Integer game, List<Integer> kinds);\n\n    /**\n     * 将游戏上架\n     * @param id\n     * @param date 上架时间\n     * @return\n     */\n    Result upGame(Integer id, Date date);\n\n    /**\n     * 下架游戏\n     * @param id\n     * @return\n     */\n    Result downGame(Integer id);\n\n    /**\n     * 添加游戏种类\n     * @param name\n     * @return\n     */\n    Result addKind(String name);\n\n    /**\n     * 管理种类对应的游戏\n     * @param kind\n     * @param games\n     * @return\n     */\n    Result managerKind(Integer kind, List<Integer> games);\n\n    /**\n     * 获取所有的游戏\n     * @return\n     */\n    Result getAllGames();\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/GameService.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.utils.Result;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n */\npublic interface GameService {\n\n    /**\n     * 根据游戏id获取游戏详细信息\n     * @param id\n     * @return\n     */\n    Result<GameDTO> getById(Integer id);\n\n    /**\n     * 获取随机图片，用于每日推荐\n     * @return\n     */\n    Result<List<GameDTO>> getRandomGames();\n\n    /**\n     * 从缓存中获取最新的5个游戏，如果没有就从数据库中获取\n     * @return\n     */\n    Result<List<GameDTO>> newestGames();\n\n    /**\n     * 从缓存中获取最新的5个准备上架的游戏，如果没有就从数据库中获取\n     * @return\n     */\n    Result<List<GameDTO>> preUpGames();\n\n    /**\n     * 搜索，从种类、标签、游戏信息中搜索\n     * @param info\n     * @return\n     */\n    Result<List<GameDTO>> search(String info);\n\n    /**\n     * 获取免费游戏\n     * @return\n     */\n    Result getFreeGames();\n\n    /**\n     * 判断游戏是否存在\n     * @param id\n     * @return\n     */\n    boolean exists(Integer id);\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/KindService.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.entity.Kind;\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.utils.Result;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n */\npublic interface KindService {\n\n    /**\n     * 根据种类id获取种类名字，如果不存在返回null\n     * @param id\n     * @return\n     */\n    String getNameById(Integer id);\n\n    /**\n     * 获取所有的种类\n     * @return\n     */\n    Result<Kind> getAll();\n\n    /**\n     * 根据种类获取所有的游戏，包括游戏信息和游戏的种类、标签\n     * @param kind\n     * @param page\n     * @return\n     */\n    Result<List<GameDTO>> getGamesByKind(int kind, int page);\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/OrderService.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.utils.Result;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n */\npublic interface OrderService {\n\n    /**\n     * 创建新订单\n     * @param uid\n     * @param gids\n     * @return\n     */\n    Result addOrders(int uid, List<Integer> gids);\n\n    /**\n     * 取消订单\n     * @param orderid\n     * @return\n     */\n    Result cancelOrder(int uid, int orderid);\n\n    /**\n     * 支付订单\n     * @param uid\n     * @param orderid\n     * @return\n     */\n    Result pay(int uid, int orderid);\n\n    /**\n     * 判断订单是否存在\n     * @param orderid\n     * @return\n     */\n    boolean exists(int orderid);\n\n    /**\n     * 获取待支付订单\n     * @param uid\n     * @return\n     */\n    Result getNotPayOrders(int uid, int page);\n\n    /**\n     * 获取支付过的订单\n     * @param uid\n     * @return\n     */\n    Result getPaidOrders(int uid, int page);\n\n    /**\n     * 获取取消的订单\n     * @param uid\n     * @return\n     */\n    Result getCancelOrders(int uid, int page);\n\n    /**\n     * 自动取消15分钟还未支付的订单，定时器每1分钟检查一次\n     */\n    void autoCancelOrder();\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/TagService.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.entity.Tag;\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.utils.Result;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/7.\n */\npublic interface TagService {\n\n    /**\n     * 根据标签id获取标签名字，如果不存在返回null\n     * @param id\n     * @return\n     */\n    String getNameById(Integer id);\n\n    /**\n     * 获取所有的标签\n     * @return\n     */\n    Result<List<Tag>> getAll();\n\n    /**\n     * 添加标签，不绑定到游戏\n     * @param name\n     * @return\n     */\n    Result<Tag> addTag(String name);\n\n    /**\n     * 添加标签并绑定到游戏\n     * @param name\n     * @param game\n     * @return\n     */\n    Result addTag(String name, Integer game);\n\n    /**\n     * 绑定标签到游戏\n     * @param tag\n     * @param game\n     * @return\n     */\n    Result addTag(Integer tag, Integer game);\n\n    /**\n     * 根据标签获取所有游戏\n     * @param tag\n     * @param page\n     * @return\n     */\n    Result<List<GameDTO>> getGamesByTag(Integer tag, Integer page);\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/UserService.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.entity.User;\nimport cn.cie.utils.Result;\n\n/**\n * Created by RojerAlone on 2017/5/31.\n */\npublic interface UserService {\n\n    /**\n     * 注册\n     * @param user\n     * @return\n     */\n    Result register(User user);\n\n    /**\n     * 给用户注册的邮箱发送验证码\n     * @param user\n     * @return\n     */\n    Result sendMail(User user);\n\n    /**\n     * 邮箱验证\n     * @param uid\n     * @param code\n     * @return\n     */\n    Result validate(Integer uid, String code);\n\n    /**\n     * 登录\n     * 登陆时如果选择了“记住我”选项，那么token保持7天，否则保存1天\n     * 登陆成功，将token存在数据库中记录，同时存入缓存，过期时间为1天\n     * 每次请求时拦截器先从缓存中查找，如果没有再去数据库中查找\n     * @param username  用户名\n     * @param password  密码\n     * @param remember  是否保持登陆（token生存周期为7天）\n     * @return\n     */\n    Result login(String username, String password, boolean remember, String ip, String device);\n\n    /**\n     * 登出\n     * @return\n     */\n    Result logout(String token);\n\n    /**\n     * 更新用户信息\n     * @param user\n     * @return\n     */\n    Result updateUserInfo(User user);\n\n    /**\n     * 更新密码\n     * @param password\n     * @return\n     */\n    Result updatePassword(String password);\n\n    /**\n     * 忘记密码\n     * @param password\n     * @param code\n     * @return\n     */\n    Result forgetPassword(String password, String email, String code);\n\n    /**\n     * 忘记密码时需要给邮箱发送验证码\n     * @param email\n     * @return\n     */\n    Result sendFetchPwdMail(String email);\n\n    /**\n     * 删除没有验证的用户\n     */\n    void delNotValidateUser();\n\n    /**\n     * 删除已经过期的token\n     */\n    void expireToken();\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/impl/AdminServiceImpl.java",
    "content": "package cn.cie.services.impl;\n\nimport cn.cie.entity.*;\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.mapper.*;\nimport cn.cie.services.AdminService;\nimport cn.cie.utils.*;\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.lang3.StringUtils;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.*;\n\n/**\n * Created by RojerAlone on 2017/6/15.\n */\n@Service\npublic class AdminServiceImpl implements AdminService {\n\n    @Autowired\n    private UserMapper userMapper;\n    @Autowired\n    private GameMapper gameMapper;\n    @Autowired\n    private KindMapper kindMapper;\n    @Autowired\n    private KindmapperMapper kindmapperMapper;\n    @Autowired\n    private TagMapper tagMapper;\n    @Autowired\n    private TagmapperMapper tagmapperMapper;\n    @Autowired\n    private ImgMapper imgMapper;\n    @Autowired\n    private RedisUtil redisUtil;\n\n\n    public Result login(String username, String password) {\n        if (username == null || password == null) {\n            return Result.fail(MsgCenter.EMPTY_LOGIN);\n        } else if (username.equals(\"admin\") == false) {\n            return Result.fail(MsgCenter.LOGIN_NOT_ALLOW);\n        }\n        User user = userMapper.selectByName(username);\n        // 用户名不存在或者密码错误或者用户已经被删除\n        if (user == null || !user.getPassword().equals(PasswordUtil.pwd2Md5(password))\n                || user.getStat().equals(User.STAT_DEL)) {\n            return Result.fail(MsgCenter.ERROR_LOGIN);\n        } else if (user.getStat().equals(User.STAT_RESTRICT)) {\n            return Result.fail(MsgCenter.USER_RESTRICT);\n        } else {\n            String token = UUID.randomUUID().toString().replaceAll(\"-\", \"\");\n            redisUtil.putEx(token, String.valueOf(user.getId()), 60 * 60 * 24);\n            return Result.success(token);\n        }\n    }\n\n    public Result getUser(int page) {\n        PageUtil pageUtil = new PageUtil(userMapper.selectAllNums(), page);\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"user\", userMapper.selectByPage(pageUtil.getStartPos(), pageUtil.getSize()));\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    public Result restrict(Integer uid) {\n        User user = new User();\n        user.setId(uid);\n        user.setStat(User.STAT_RESTRICT);\n        if (1 == userMapper.update(user)) {\n            return Result.success();\n        } else {\n            return Result.fail(\"\");\n        }\n    }\n\n    public Result relieve(Integer uid) {\n        User user = new User();\n        user.setId(uid);\n        user.setStat(User.STAT_OK);\n        if (1 == userMapper.update(user)) {\n            return Result.success();\n        } else {\n            return Result.fail(\"\");\n        }\n    }\n\n    public Result delete(Integer uid) {\n        User user = new User();\n        user.setId(uid);\n        user.setStat(User.STAT_DEL);\n        if (1 == userMapper.update(user)) {\n            return Result.success();\n        } else {\n            return Result.fail(\"\");\n        }\n    }\n\n    public Result getGames(int page) {\n        PageUtil pageUtil = new PageUtil(gameMapper.selectNums(), page);\n        List<Game> games = gameMapper.selectByPage(pageUtil.getStartPos(), pageUtil.getSize());\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"game\", paresGameDTO(games));\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    @Transactional\n    public Result addGame(Game game, Integer[] kind, MultipartFile header, MultipartFile[] pics, String path) throws IOException {\n        // 判断游戏信息\n        if (StringUtils.isBlank(game.getCreater()) || StringUtils.isBlank(game.getName())\n                || StringUtils.isBlank(game.getDesc()) || StringUtils.isBlank(game.getSystemcfg())\n                || game.getPrice() == null || game.getPrice() < 0) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        // 判断文件类型是否合法\n        if (!header.getContentType().equalsIgnoreCase(\"image/jpeg\") && !header.getContentType().equalsIgnoreCase(\"image/png\")) {\n            return Result.fail(MsgCenter.ERROR_FILE_TYPE);\n        }\n        for (MultipartFile pic : pics) {\n            if (!pic.getContentType().equalsIgnoreCase(\"image/jpeg\") && !pic.getContentType().equalsIgnoreCase(\"image/png\")) {\n                return Result.fail(MsgCenter.ERROR_FILE_TYPE);\n            }\n        }\n\n        gameMapper.insert(game);\n        if (kind != null && kind.length > 0) {\n            kindmapperMapper.insertKindBatch(game.getId(), Arrays.asList(kind));\n        }\n        Img image = new Img();\n        image.setGame(game.getId());\n        String headertype = null;\n        if (header.getContentType().equalsIgnoreCase(\"image/jpeg\")) {\n            headertype = \"jpg\";\n        } else if (header.getContentType().equalsIgnoreCase(\"image/png\")) {\n            headertype = \"png\";\n        }\n        image.setImg(\"/\" + game.getId() + \"/header.\" + headertype);\n        imgMapper.insert(image);\n        FileUtils.copyInputStreamToFile(header.getInputStream(), new File(path + \"/\" + game.getId(), \"header.\" + headertype));\n        int index = 1;\n        List<String> imgs = new ArrayList<String>();\n        for (MultipartFile pic : pics) {\n            String type = null;\n            if (pic.getContentType().equalsIgnoreCase(\"image/jpeg\")) {\n                type = \"jpg\";\n            } else if (pic.getContentType().equalsIgnoreCase(\"image/png\")) {\n                type = \"png\";\n            }\n            // 拼接写入数据库的图片信息\n            String img = \"/\" + game.getId() + \"/\" + index + \".\" + type;\n            imgs.add(img);\n            FileUtils.copyInputStreamToFile(pic.getInputStream(), new File(path + \"/\" + game.getId(), index + \".\" + type));\n            index++;\n        }\n        imgMapper.insertBatch(game.getId(), imgs);\n        return Result.success();\n    }\n\n    public Result updateGameInfo(Game game) {\n        if (game.getId() == null) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        gameMapper.update(game);\n        return Result.success();\n    }\n\n    public Result getGameKind(Integer game) {\n        if (gameMapper.selectById(game) == null) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        List<Integer> kindIds = kindmapperMapper.selectByGame(game);\n        List<Kind> kinds = kindMapper.selectByIds(kindIds);\n        return Result.success(kinds);\n    }\n\n    @Transactional\n    public Result updateGameKind(Integer game, List<Integer> kinds) {\n        kindmapperMapper.deleteByGame(game);\n        kindmapperMapper.insertKindBatch(game, kinds);\n        return Result.success();\n    }\n\n    public Result upGame(Integer id, Date date) {\n        Game game = gameMapper.selectById(id);\n        // 如果没有这个游戏返回参数错误\n        if (game == null) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        game.setStat(Game.STAT_OK);\n        if (date == null) {\n            game.setUtime(new Date());\n        } else {\n            game.setUtime(date);\n        }\n        if (1 == gameMapper.update(game)) {\n            redisUtil.delete(RedisUtil.NEWESTGAME);    // 上架游戏后将缓存中的最新游戏清空\n            return Result.success();\n        }\n        return Result.fail(MsgCenter.ERROR);\n    }\n\n    public Result downGame(Integer id) {\n        Game game = gameMapper.selectById(id);\n        // 如果没有这个游戏返回参数错误\n        if (game == null) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        game.setStat(Game.STAT_DEL);\n        if (1 == gameMapper.update(game)) {\n            redisUtil.delete(RedisUtil.NEWESTGAME);    // 下架游戏后将缓存中的最新游戏清空\n            return Result.success();\n        }\n        return Result.fail(MsgCenter.ERROR);\n    }\n\n    @Transactional\n    public Result addKind(String name) {\n        Kind kind = kindMapper.selectByName(name);\n        if (kind != null) {\n            return Result.fail(MsgCenter.NAME_EXISTS);\n        }\n        kind = new Kind();\n        kind.setName(name);\n        if (1 == kindMapper.insert(kind)) {\n            redisUtil.rpushObject(\"kinds\", Kind.class, kind);   // 添加到缓存中\n            return Result.success();\n        } else {\n            return Result.fail(MsgCenter.ERROR);\n        }\n    }\n\n    @Transactional\n    public Result managerKind(Integer kind, List<Integer> games) {\n        kindmapperMapper.deleteByKind(kind);\n        kindmapperMapper.insertGameBatch(kind, games);\n        return Result.success();\n    }\n\n    public Result getAllGames() {\n        List<Game> games = gameMapper.selectAll();\n        List<GameDTO> gameDTOS = new ArrayList<GameDTO>();\n        for (Game game : games) {\n            List<Kind> kinds = null;\n            List<Integer> kindIds = kindmapperMapper.selectByGame(game.getId());   // 根据游戏id获取所有的种类id\n            if (kindIds.size() != 0) {\n                kinds = kindMapper.selectByIds(kindIds);                             // 根据种类id获取种类信息\n            }\n            GameDTO dto = new GameDTO(game, kinds, null, null);\n            gameDTOS.add(dto);\n        }\n        return Result.success(gameDTOS);\n    }\n\n    private List<GameDTO> paresGameDTO(List<Game> games) {\n        List<GameDTO> gameDTOS = new ArrayList<GameDTO>();\n        for (Game game : games) {\n            List<Tag> tags = null;\n            List<Kind> kinds = null;\n            List<Integer> tagIds = tagmapperMapper.selectByGame(game.getId());     // 获取游戏的标签id\n            if (tagIds.size() != 0) {\n                tags = tagMapper.selectByIds(tagIds);                               // 根据id获取所有的标签信息\n            }\n            List<String> img = imgMapper.selectByGame(game.getId());                // 获取所有的图片\n            List<Integer> kindIds = kindmapperMapper.selectByGame(game.getId());   // 根据游戏id获取所有的种类id\n            if (kindIds.size() != 0) {\n                kinds = kindMapper.selectByIds(kindIds);                             // 根据种类id获取种类信息\n            }\n            GameDTO dto = new GameDTO(game, kinds, tags, img);\n            gameDTOS.add(dto);\n        }\n        return gameDTOS;\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/impl/GameServiceImpl.java",
    "content": "package cn.cie.services.impl;\n\nimport cn.cie.entity.Game;\nimport cn.cie.entity.Kind;\nimport cn.cie.entity.Tag;\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.mapper.*;\nimport cn.cie.services.GameService;\nimport cn.cie.utils.MsgCenter;\nimport cn.cie.utils.RedisUtil;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\nimport java.util.*;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n */\n@Service\npublic class GameServiceImpl implements GameService {\n\n    @Autowired\n    private GameMapper gameMapper;\n    @Autowired\n    private KindMapper kindMapper;\n    @Autowired\n    private KindmapperMapper kindmapperMapper;\n    @Autowired\n    private TagmapperMapper tagmapperMapper;\n    @Autowired\n    private TagMapper tagMapper;\n    @Autowired\n    private ImgMapper imgMapper;\n    @Autowired\n    private RedisUtil<GameDTO> redisUtil;\n\n    public Result<GameDTO> getById(Integer id) {\n        Game game = gameMapper.selectById(id);\n        if (game == null) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        List<Integer> tagIds = tagmapperMapper.selectByGame(id);\n        List<Tag> tags = null;\n        if (tagIds.size() != 0) {\n            tags = tagMapper.selectByIds(tagIds);\n        }\n        List<String> img = imgMapper.selectByGame(game.getId());\n        GameDTO res = new GameDTO(game, tags, img);\n        return Result.success(res);\n    }\n\n    public Result<List<GameDTO>> getRandomGames() {\n        // 先从缓存中取数据，如果没有再自动生成\n        List<GameDTO> res = redisUtil.lall(\"everyday\", GameDTO.class);\n        if (res == null || res.size() == 0) {\n            List<Game> allgames = gameMapper.selectByStat(Game.STAT_OK);\n            int count = allgames.size();\n            Set<Integer> numSet = new HashSet<Integer>();\n            Random random = new Random();\n            List<Game> games = new ArrayList<Game>();\n            // 如果游戏数量大于5个就随机取5个，否则取全部的\n            if (count > 5) {\n                while (numSet.size() < 5) {\n                    numSet.add(random.nextInt(count));\n                }\n                Iterator i = numSet.iterator();\n                while (i.hasNext()) {\n                    games.add(allgames.get((Integer) i.next()));\n                }\n            } else {\n                games = allgames;\n            }\n            res = paresGameDTO(games);\n            // 将数据存入缓存中\n            int tmp = 1000 * 3600 * 24;\n            long zero = (System.currentTimeMillis() / tmp * tmp + tmp - TimeZone.getDefault().getRawOffset()) / 1000;    //明天零点零分零秒的unix时间戳\n            redisUtil.rpushObjectExAtTime(RedisUtil.EVERYDAY, GameDTO.class, zero, res.toArray());\n        }\n        return Result.success(res);\n    }\n\n    public Result<List<GameDTO>> newestGames() {\n        List<GameDTO> res = redisUtil.lall(RedisUtil.NEWESTGAME, GameDTO.class);\n        if (res == null || res.size() == 0) {\n            List<Game> games = gameMapper.selectByStatOrderByDate(Game.STAT_OK);\n            res = paresGameDTO(games);\n            redisUtil.rpushObjectEx(RedisUtil.NEWESTGAME, GameDTO.class, 60 * 10, res.toArray());\n        }\n        return Result.success(res);\n    }\n\n    public Result<List<GameDTO>> preUpGames() {\n        List<GameDTO> res = redisUtil.lall(RedisUtil.PRE_UP_GAMES, GameDTO.class);\n        if (res == null || res.size() == 0) {\n            List<Game> games = gameMapper.selectByStatOrderByDate(Game.STAT_PRE);\n            res = paresGameDTO(games);\n            redisUtil.rpushObjectEx(RedisUtil.PRE_UP_GAMES, GameDTO.class, 60 * 10, res.toArray());\n        }\n        return Result.success(res);\n    }\n\n    public Result<List<GameDTO>> search(String info) {\n        List<Integer> kindIds = kindMapper.selectIdByLikeName(info);\n        List<Integer> tagIds = tagMapper.selectIdByLikeName(info);\n        List<Integer> gameIdsOfKind = null;\n        if (kindIds != null && kindIds.size() > 0) {\n            gameIdsOfKind = kindmapperMapper.selectBatchByKinds(kindIds);\n        }\n        List<Integer> gameIdsOfTag = null;\n        if (tagIds != null && tagIds.size() > 0) {\n            gameIdsOfTag = tagmapperMapper.selectBatchByTags(tagIds);\n        }\n        Set<Integer> tmpGameIds = new HashSet<Integer>();\n        if (gameIdsOfKind != null && gameIdsOfKind.size() > 0) {\n            tmpGameIds.addAll(gameIdsOfKind);\n        }\n        if (gameIdsOfTag != null && gameIdsOfTag.size() > 0) {\n            tmpGameIds.addAll(gameIdsOfTag);\n        }\n        List<Game> games = null;\n        if (tmpGameIds.size() > 0) {\n            List<Integer> gameIds = new ArrayList<Integer>(tmpGameIds);\n            games = gameMapper.selectByIdsAndInfo(gameIds, info);\n        } else {\n            games = gameMapper.selectByInfo(info);\n        }\n        return Result.success(paresGameDTO(games));\n    }\n\n    public Result getFreeGames() {\n        List<Game> games = gameMapper.selectFreeGames();\n        return Result.success(paresGameDTO(games));\n    }\n\n    public boolean exists(Integer id) {\n        return gameMapper.selectById(id) != null;\n    }\n\n    private List<GameDTO> paresGameDTO(List<Game> games) {\n        List<GameDTO> gameDTOS = new ArrayList<GameDTO>();\n        for (Game game : games) {\n            List<String> img = imgMapper.selectByGame(game.getId());                // 获取所有的图片\n            GameDTO dto = new GameDTO(game, null, img);\n            gameDTOS.add(dto);\n        }\n        return gameDTOS;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/impl/KindServiceImpl.java",
    "content": "package cn.cie.services.impl;\n\nimport cn.cie.entity.Game;\nimport cn.cie.entity.Kind;\nimport cn.cie.entity.Tag;\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.mapper.*;\nimport cn.cie.services.KindService;\nimport cn.cie.utils.MsgCenter;\nimport cn.cie.utils.PageUtil;\nimport cn.cie.utils.RedisUtil;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n\nimport java.lang.reflect.Array;\nimport java.util.*;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n */\n@Service\npublic class KindServiceImpl implements KindService {\n\n    @Autowired\n    private KindMapper kindMapper;\n    @Autowired\n    private KindmapperMapper kindmapperMapper;\n    @Autowired\n    private GameMapper gameMapper;\n    @Autowired\n    private ImgMapper imgMapper;\n    @Autowired\n    private TagMapper tagMapper;\n    @Autowired\n    private TagmapperMapper tagmapperMapper;\n    @Autowired\n    private RedisUtil<Kind> redisUtil;\n\n    public String getNameById(Integer id) {\n        Kind kind = kindMapper.selectById(id);\n        if (kind == null) {\n            return null;\n        }\n        return kind.getName();\n    }\n\n    public Result<Kind> getAll() {\n        List<Kind> kinds = redisUtil.lall(RedisUtil.KINDS, Kind.class);\n        // 如果缓存中没有，从数据库中查询，并且添加到缓存中\n        if (kinds == null || kinds.size() == 0) {\n            List<Kind> data = kindMapper.selectAll();\n            redisUtil.rpushObject(RedisUtil.KINDS, Kind.class, data.toArray());\n            return Result.success(data);\n        }\n        return Result.success(kinds);\n    }\n\n    public Result<List<GameDTO>> getGamesByKind(int kind, int page) {\n        if (kindMapper.selectById(kind) == null) {\n            return Result.fail(MsgCenter.NOT_FOUND);\n        }\n        List<Integer> gameIds = kindmapperMapper.selectByKind(kind);\n        // 如果没有就返回\n        if (gameIds == null || gameIds.size() == 0) {\n            return Result.success();\n        }\n        List<Game> games = gameMapper.selectByIdsAndStat(gameIds, Game.STAT_OK);\n        PageUtil pageUtil = new PageUtil(games.size(), page);\n        // 假分页\n        int size = pageUtil.getStartPos() + 10 > games.size() - 1 ? games.size() : pageUtil.getStartPos() + 10;\n        List<GameDTO> gameDTOS = paresGameDTO(games.subList(pageUtil.getStartPos(), size));\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"game\", gameDTOS);\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    private List<GameDTO> paresGameDTO(List<Game> games) {\n        List<GameDTO> gameDTOS = new ArrayList<GameDTO>();\n        for (Game game : games) {\n            List<Tag> tags = null;\n            List<Integer> tagIds = tagmapperMapper.selectByGame(game.getId());     // 获取游戏的标签id\n            if (tagIds.size() != 0) {\n                tags = tagMapper.selectByIds(tagIds);                               // 根据id获取所有的标签信息\n            }\n            List<String> img = imgMapper.selectByGame(game.getId());                // 获取所有的图片\n            GameDTO dto = new GameDTO(game, tags, img);\n            gameDTOS.add(dto);\n        }\n        return gameDTOS;\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/impl/OrderServiceImpl.java",
    "content": "package cn.cie.services.impl;\n\nimport cn.cie.entity.*;\nimport cn.cie.entity.dto.OrderDTO;\nimport cn.cie.entity.dto.OrderItemDTO;\nimport cn.cie.mapper.*;\nimport cn.cie.services.OrderService;\nimport cn.cie.utils.MsgCenter;\nimport cn.cie.utils.PageUtil;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.*;\n\n/**\n * Created by RojerAlone on 2017/6/12.\n */\n@Service\npublic class OrderServiceImpl implements OrderService {\n\n    @Autowired\n    private OrderMapper orderMapper;\n    @Autowired\n    private OrderitemMapper orderitemMapper;\n    @Autowired\n    private GameMapper gameMapper;\n    @Autowired\n    private OrdermapperMapper ordermapperMapper;\n    @Autowired\n    private CodeMapper codeMapper;\n\n    @Transactional\n    public Result addOrders(int uid, List<Integer> gids) {\n        Order order = new Order();\n        order.setUid(uid);\n        orderMapper.insert(order);\n        double total = 0;\n        // 对所有的游戏进行存储、计价\n        for (Integer gid : gids) {\n            Game game = gameMapper.selectById(gid);\n            if (game.getStat() != Game.STAT_OK) {\n                return Result.fail(MsgCenter.ERROR_PARAMS);\n            }\n            Orderitem item = new Orderitem();\n            item.setGid(gid);\n            // 如果现价不为空，那么就计算现价\n            if (game.getDiscount() != null) {\n                total += game.getDiscount();\n                item.setPrice(game.getDiscount());\n            } else {\n                total += game.getPrice();\n                item.setPrice(game.getPrice());\n            }\n            orderitemMapper.insert(item);\n            Ordermapper mapper = new Ordermapper();\n            mapper.setItem(item.getId());\n            mapper.setOrder(order.getId());\n            ordermapperMapper.insert(mapper);\n        }\n        // 更新所有游戏的价格\n        order.setPrice(total);\n        orderMapper.update(order);\n        return Result.success(order);\n    }\n\n    public Result cancelOrder(int uid, int orderid) {\n        Order order = orderMapper.selectById(orderid);\n        // 如果orderid错误或者用户与订单不匹配，就返回错误\n        if (order == null || order.getUid() != uid) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        order.setStat(Order.STAT_CANCEL);\n        if (1 == orderMapper.update(order)) {\n            return Result.success();\n        }\n        return Result.fail(MsgCenter.ERROR);\n    }\n\n    @Transactional\n    public Result pay(int uid, int orderid) {\n        Order order = orderMapper.selectById(orderid);\n        // 如果orderid错误或者用户与订单不匹配，就返回错误\n        if (order == null || order.getUid() != uid) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        order.setStat(Order.STAT_PAY);\n        orderMapper.update(order);\n        List<Integer> orderitems = ordermapperMapper.selectByOrder(orderid);\n        List<Orderitem> orderitemList = orderitemMapper.selectByIds(orderitems);\n        for (Orderitem item : orderitemList) {\n            // 生产激活码并插入数据库\n            String uuid = UUID.randomUUID().toString();\n            Code code = new Code();\n            code.setItem(item.getId());\n            code.setUid(uid);\n            code.setCode(uuid);\n            codeMapper.insert(code);\n            // 插入code后更新orderitem的对应codeid\n            item.setCode(code.getId());\n            orderitemMapper.update(item);\n        }\n        return Result.success();\n    }\n\n    public boolean exists(int orderid) {\n        return orderMapper.selectById(orderid) != null;\n    }\n\n\n    public Result getNotPayOrders(int uid, int page) {\n        PageUtil pageUtil = new PageUtil(orderMapper.getOrderNumsByUidAndStat(uid, Order.STAT_NOT_PAY), page);\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"order\", parseOrderByStatAndPage(uid, Order.STAT_NOT_PAY, pageUtil));\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    public Result getPaidOrders(int uid, int page) {\n        PageUtil pageUtil = new PageUtil(orderMapper.getOrderNumsByUidAndStat(uid, Order.STAT_PAY), page);\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"order\", parseOrderByStatAndPage(uid, Order.STAT_PAY, pageUtil));\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    public Result getCancelOrders(int uid, int page) {\n        PageUtil pageUtil = new PageUtil(orderMapper.getOrderNumsByUidAndStat(uid, Order.STAT_CANCEL), page);\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"order\", parseOrderByStatAndPage(uid, Order.STAT_CANCEL, pageUtil));\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    public void autoCancelOrder() {\n        Date date = new Date();\n        date.setTime(date.getTime() - 1000 * 60 * 15);  // 过期时间为15分钟\n        orderMapper.updateStatByDate(Order.STAT_NOT_PAY, Order.STAT_CANCEL, date);\n    }\n\n    private List<OrderDTO> parseOrderByStatAndPage(Integer uid, Byte stat, PageUtil pageUtil) {\n        List<OrderDTO> res = new ArrayList<OrderDTO>();\n        List<Order> orders = orderMapper.selectByUidAndStatAndPage(uid, stat, pageUtil.getStartPos(), pageUtil.getSize());\n        for (Order order : orders) {\n            List<Integer> orderids = ordermapperMapper.selectByOrder(order.getId());    // 获取订单内所有的订单详情id\n            List<Orderitem> orderitemList = orderitemMapper.selectByIds(orderids);      // 根据订单详情id获取订单详情\n            List<OrderItemDTO> orderItemDTOList = new ArrayList<OrderItemDTO>();\n            // 拼接订单详情信息，包括订单对应的游戏和激活码\n            for (Orderitem orderitem : orderitemList) {\n                Game game = gameMapper.selectById(orderitem.getGid());      // 游戏信息\n                Code code;\n                // 如果code不为空那么获取code\n                if (orderitem.getCode() != null) {\n                    code = codeMapper.selectById(orderitem.getCode());     // 激活码信息\n                } else {\n                    code = null;\n                }\n                orderItemDTOList.add(new OrderItemDTO(orderitem, game, code));\n            }\n            res.add(new OrderDTO(order, orderItemDTOList));\n        }\n        return res;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/impl/TagServiceImpl.java",
    "content": "package cn.cie.services.impl;\n\nimport cn.cie.entity.Game;\nimport cn.cie.entity.Tag;\nimport cn.cie.entity.Tagmapper;\nimport cn.cie.entity.dto.GameDTO;\nimport cn.cie.mapper.GameMapper;\nimport cn.cie.mapper.ImgMapper;\nimport cn.cie.mapper.TagMapper;\nimport cn.cie.mapper.TagmapperMapper;\nimport cn.cie.services.TagService;\nimport cn.cie.utils.MsgCenter;\nimport cn.cie.utils.PageUtil;\nimport cn.cie.utils.Result;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * Created by RojerAlone on 2017/6/7.\n */\n@Service\npublic class TagServiceImpl implements TagService {\n\n    @Autowired\n    private TagMapper tagMapper;\n    @Autowired\n    private TagmapperMapper tagmapperMapper;\n    @Autowired\n    private GameMapper gameMapper;\n    @Autowired\n    private ImgMapper imgMapper;\n\n    public String getNameById(Integer id) {\n        Tag tag = tagMapper.selectById(id);\n        if (tag == null) {\n            return null;\n        }\n        return tag.getName();\n    }\n\n    public Result<List<Tag>> getAll() {\n        return Result.success(tagMapper.selectAll());\n    }\n\n    public Result<Tag> addTag(String name) {\n        Tag tag = new Tag();\n        tag.setName(name);\n        if (1 == tagMapper.insert(tag)) {\n            return Result.success(tag);\n        } else {\n            return Result.fail(MsgCenter.ERROR);\n        }\n    }\n\n    @Transactional\n    public Result addTag(String name, Integer game) {\n        // 如果没有这个游戏，就返回404\n        if (gameMapper.selectById(game) == null) {\n            return Result.fail(MsgCenter.NOT_FOUND);\n        }\n        Result result = addTag(name);\n        if (result.isSuccess()) {\n            Tagmapper tagmapper = new Tagmapper();\n            tagmapper.setGame(game);\n            tagmapper.setTag(((Tag) result.getData()).getId());\n            if (1 == tagmapperMapper.insert(tagmapper)) {\n                return Result.success();\n            }\n        }\n        return Result.fail(MsgCenter.ERROR);\n    }\n\n    public Result addTag(Integer tag, Integer game) {\n        // 如果没有这个游戏，就返回404\n        if (gameMapper.selectById(game) == null) {\n            return Result.fail(MsgCenter.NOT_FOUND);\n        }\n        Tagmapper tagmapper = new Tagmapper();\n        tagmapper.setGame(game);\n        tagmapper.setTag(tag);\n        if (1 == tagmapperMapper.insert(tagmapper)) {\n            return Result.success();\n        } else {\n            return Result.fail(MsgCenter.ERROR);\n        }\n    }\n\n    public Result<List<GameDTO>> getGamesByTag(Integer tag, Integer page) {\n        // 没有这个标签，返回404\n        if (tagMapper.selectById(tag) == null) {\n            return Result.fail(MsgCenter.NOT_FOUND);\n        }\n        List<Integer> gameIds = tagmapperMapper.selectByTag(tag);                  // 根据标签获取所有的游戏ID\n        List<Game> games = gameMapper.selectByIdsAndStat(gameIds, Game.STAT_OK);\n        PageUtil pageUtil = new PageUtil(games.size(), page);\n        // 假分页\n        int size = pageUtil.getStartPos() + 10 > games.size() - 1 ? games.size() : pageUtil.getStartPos() + 10;\n        List<GameDTO> gameDTOS = paresGameDTO(games.subList(pageUtil.getStartPos(), size));\n        Map<String, Object> map = new HashMap<String, Object>();\n        map.put(\"game\", gameDTOS);\n        map.put(\"page\", pageUtil);\n        return Result.success(map);\n    }\n\n    private List<GameDTO> paresGameDTO(List<Game> games) {\n        List<GameDTO> gameDTOS = new ArrayList<GameDTO>();\n        for (Game game : games) {\n            List<Tag> tags = null;\n            List<Integer> tagIds = tagmapperMapper.selectByGame(game.getId());     // 获取游戏的标签id\n            if (tagIds.size() != 0) {\n                tags = tagMapper.selectByIds(tagIds);                         // 根据id获取所有的标签信息\n            }\n            List<String> img = imgMapper.selectByGame(game.getId());                // 获取所有的图片\n            GameDTO dto = new GameDTO(game, tags, img);\n            gameDTOS.add(dto);\n        }\n        return gameDTOS;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/services/impl/UserServiceImpl.java",
    "content": "package cn.cie.services.impl;\n\nimport cn.cie.entity.Token;\nimport cn.cie.entity.User;\nimport cn.cie.event.EventModel;\nimport cn.cie.event.EventProducer;\nimport cn.cie.event.EventType;\nimport cn.cie.utils.UserHolder;\nimport cn.cie.entity.Validatecode;\nimport cn.cie.mapper.TokenMapper;\nimport cn.cie.mapper.UserMapper;\nimport cn.cie.services.UserService;\nimport cn.cie.utils.*;\nimport org.apache.commons.lang3.StringUtils;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.*;\nimport java.util.regex.Pattern;\n\n/**\n * Created by RojerAlone on 2017/5/31.\n */\n@Service\npublic class UserServiceImpl implements UserService {\n\n    @Autowired\n    private UserMapper userMapper;\n    @Autowired\n    private TokenMapper tokenMapper;\n    @Autowired\n    private UserHolder userHolder;\n    @Autowired\n    private RedisUtil redisUtil;\n    @Autowired\n    private EventProducer eventProducer;\n\n    @Transactional\n    public Result register(User user) {\n        // 验证参数是否合法\n        if (StringUtils.isBlank(user.getUsername())) {\n            return Result.fail(MsgCenter.EMPTY_USERNAME);\n        } else if (StringUtils.isBlank(user.getNickname())) {\n            return Result.fail(MsgCenter.EMPTY_NICKNAME);\n        } else if (user.getNickname().length() > 10) {\n            return Result.fail(MsgCenter.ERROR_NICINAME);\n        } else if (StringUtils.isBlank(user.getPassword())) {\n            return Result.fail(MsgCenter.EMPTY_PASSWORD);\n        } else if (16 < user.getPassword().replaceAll(\" \", \"\").length()\n                || user.getPassword().replaceAll(\" \", \"\").length() < 6) {\n            return Result.fail(MsgCenter.ERROR_PASSWORD_FORMAT);\n        } else if (StringUtils.isBlank(user.getEmail())) {\n            return Result.fail(MsgCenter.EMPTY_EMAIL);\n        } else if (Pattern.compile(\"^([a-z0-9A-Z]+[-|_|\\\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-zA-Z]{2,}$\").\n                matcher(user.getEmail()).find() == false) {   // 判断邮箱格式是否正确\n            return Result.fail(MsgCenter.ERROR_EMAIL);\n        } else if (user.getPhone() == null) {\n            return Result.fail(MsgCenter.EMPTY_PHONE);\n        } else if (Pattern.compile(\"1[3|5|7|8|]\\\\d{9}\").matcher(user.getPhone().toString()).find() == false) {  // 验证手机号码是否格式正确\n            return Result.fail(MsgCenter.ERROR_PHONE);\n        } else if (userMapper.selectByName(user.getUsername()) != null) {                  // 用户名已经被注册\n            return Result.fail(MsgCenter.USER_USERNAME_EXISTS);\n        } else if (userMapper.selectByEmail(user.getEmail()) != null) {             // 邮箱已被注册\n            return Result.fail(MsgCenter.EMAIL_REGISTERED);\n        }\n\n        user.setPassword(PasswordUtil.pwd2Md5(user.getPassword().replaceAll(\" \", \"\")));                // 加密密码\n        if (1 == userMapper.insert(user)) {                                      // 注册成功\n            String uuid = UUID.randomUUID().toString();\n            redisUtil.putEx(\"validatecode_\" + user.getId(), uuid, Validatecode.TIMEOUT);    // 存入redis\n            eventProducer.product(new EventModel(EventType.SEND_VALIDATE_EMAIL).setExts(\"mail\", user.getEmail()).setExts(\"code\", uuid));\n            return Result.success(user.getId());\n        }\n        return Result.fail(MsgCenter.ERROR);\n    }\n\n    @Transactional\n    public Result sendMail(User user) {\n        if (user.getStat().equals(User.STAT_OK)) {    // 用户已经验证过了\n            return Result.fail(MsgCenter.USER_VALIDATED);\n        }\n        String uuid = UUID.randomUUID().toString();\n        // 将数据存入redis中，固定时间后过期\n        redisUtil.putEx(\"validatecode_\" + user.getId(), uuid, Validatecode.TIMEOUT);\n        // 将邮件发送事件添加到异步事件队列中去\n        eventProducer.product(new EventModel(EventType.SEND_VALIDATE_EMAIL).setExts(\"mail\", user.getEmail()).setExts(\"code\", uuid));\n        return Result.success();\n    }\n\n    @Transactional\n    public Result validate(Integer uid, String code) {\n        String uuid = redisUtil.get(\"validatecode_\" + uid);\n        if (code != null && code.length() == 36 && code.equals(uuid)) {\n            User user = userHolder.getUser();\n            user.setStat(User.STAT_OK);\n            if (1 == userMapper.update(user)) {\n                redisUtil.delete(\"validatecode_\" + uid);        // 验证成功后删除验证码\n                return Result.success();\n            } else {\n                return Result.fail(MsgCenter.ERROR);\n            }\n        }\n        return Result.fail(MsgCenter.CODE_ERROR);\n    }\n\n    @Transactional\n    public Result login(String username, String password, boolean remember, String ip, String device) {\n        if (username == null || password == null) {\n            return Result.fail(MsgCenter.EMPTY_LOGIN);\n        }\n        User user = userMapper.selectByName(username);\n        // 用户名不存在或者密码错误或者用户已经被删除\n        if (user == null || !user.getPassword().equals(PasswordUtil.pwd2Md5(password))\n                || user.getStat().equals(User.STAT_DEL)) {\n            return Result.fail(MsgCenter.ERROR_LOGIN);\n        } else if (user.getStat().equals(User.STAT_RESTRICT)) {\n            return Result.fail(MsgCenter.USER_RESTRICT);\n        } else {\n            String uuid = UUID.randomUUID().toString().replaceAll(\"-\", \"\");\n            Token token = new Token();\n            token.setUid(user.getId());\n            token.setToken(uuid);\n            token.setIp(ip);\n            token.setDevice(device);\n            // 如果保持登陆，过期时间就为7天，否则为1天\n            if (remember) {\n                token.setExpiredTime(new Date(1000 * 60 * 60 * 24 * 7 + System.currentTimeMillis()));\n            } else {\n                token.setExpiredTime(new Date(1000 * 60 * 60 * 24 + System.currentTimeMillis()));\n            }\n            tokenMapper.insert(token);\n            redisUtil.putEx(uuid, String.valueOf(user.getId()), 60 * 60 * 24);\n            return Result.success(uuid);\n        }\n    }\n\n    public Result logout(String token) {\n        if (token == null || token.length() != 32) {\n            return Result.fail(MsgCenter.ERROR_PARAMS);\n        }\n        redisUtil.delete(token);\n        tokenMapper.updateStatByToken(Token.STAT_EXPIRED, token);\n        return Result.success();\n    }\n\n    public Result updateUserInfo(User user) {\n        if (userHolder.getUser() == null) {\n            return Result.fail(MsgCenter.USER_NOT_LOGIN);\n        }\n        // 验证参数是否合法\n        if (StringUtils.isBlank(user.getNickname())) {\n            return Result.fail(MsgCenter.EMPTY_NICKNAME);\n        } else if (user.getNickname().length() > 10) {\n            return Result.fail(MsgCenter.ERROR_NICINAME);\n        } else if (StringUtils.isBlank(user.getEmail())) {\n            return Result.fail(MsgCenter.EMPTY_EMAIL);\n        } else if (Pattern.compile(\"^([a-z0-9A-Z]+[-|_|\\\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-zA-Z]{2,}$\").\n                matcher(user.getEmail()).find() == false) {   // 判断邮箱格式是否正确\n            return Result.fail(MsgCenter.ERROR_EMAIL);\n        } else if (user.getPhone() == null) {\n            return Result.fail(MsgCenter.EMPTY_PHONE);\n        } else if (Pattern.compile(\"1[3|5|7|8|]\\\\d{9}\").matcher(user.getPhone().toString()).find() == false) {  // 验证手机号码是否格式正确\n            return Result.fail(MsgCenter.ERROR_PHONE);\n        } else if (userMapper.selectByEmail(user.getEmail()) != null && !userHolder.getUser().getEmail().equals(user.getEmail())) {             // 更改邮箱同时邮箱已被注册\n            return Result.fail(MsgCenter.EMAIL_REGISTERED);\n        }\n        user.setId(userHolder.getUser().getId());\n        user.setPassword(null);\n        user.setStat(null);\n        if (1 == userMapper.update(user)) {\n            return Result.success();\n        }\n        return Result.fail(MsgCenter.ERROR);\n    }\n\n    public Result updatePassword(String password) {\n        if (StringUtils.isBlank(password)) {\n            return Result.fail(MsgCenter.EMPTY_PASSWORD);\n        } else if (16 < password.replaceAll(\" \", \"\").length()\n                || password.replaceAll(\" \", \"\").length() < 6) {\n            return Result.fail(MsgCenter.ERROR_PASSWORD_FORMAT);\n        }\n        User user = userHolder.getUser();\n        user.setPassword(PasswordUtil.pwd2Md5(password.replaceAll(\" \", \"\")));\n        if (1 == userMapper.update(user)) {\n            return Result.success();\n        } else {\n            return Result.fail(MsgCenter.ERROR);\n        }\n    }\n\n    public Result forgetPassword(String password, String email, String code) {\n        User user = null;\n        if (StringUtils.isBlank(email)) {\n            return Result.fail(MsgCenter.EMPTY_EMAIL);\n        } else if (Pattern.compile(\"^([a-z0-9A-Z]+[-|_|\\\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-zA-Z]{2,}$\").\n                matcher(email).find() == false || (user = userMapper.selectByEmail(email)) == null) {   // 判断邮箱格式以及两次邮箱是否一致\n            return Result.fail(MsgCenter.ERROR_EMAIL);\n        } else if (StringUtils.isBlank(password)) {\n            return Result.fail(MsgCenter.EMPTY_PASSWORD);\n        } else if (16 < password.replaceAll(\" \", \"\").length()\n                || password.replaceAll(\" \", \"\").length() < 6) {\n            return Result.fail(MsgCenter.ERROR_PASSWORD_FORMAT);\n        }\n        String uuid = redisUtil.get(email);\n        if (code != null && code.length() == 36 && code.equals(uuid)) {\n            user.setPassword(PasswordUtil.pwd2Md5(password.replaceAll(\" \", \"\")));\n            if (1 == userMapper.update(user)) {\n                redisUtil.delete(email);        // 验证成功后删除验证码\n                return Result.success(user.getUsername());\n            } else {\n                return Result.fail(MsgCenter.ERROR);\n            }\n        }\n        return Result.fail(MsgCenter.CODE_ERROR);\n    }\n\n    public Result sendFetchPwdMail(String email) {\n        if (StringUtils.isBlank(email)) {\n            return Result.fail(MsgCenter.EMPTY_EMAIL);\n        } else if (Pattern.compile(\"^([a-z0-9A-Z]+[-|_|\\\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-zA-Z]{2,}$\").\n                matcher(email).find() == false) {   // 判断邮箱格式是否正确\n            return Result.fail(MsgCenter.ERROR_EMAIL);\n        }\n        User user = userMapper.selectByEmail(email);\n        if (user == null) {\n            return Result.fail(MsgCenter.EMAIL_NOT_REGISTERED);\n        }\n        String uuid = UUID.randomUUID().toString();\n        // 将数据存入redis中，固定时间后过期\n        redisUtil.putEx(email, uuid, Validatecode.TIMEOUT);\n        eventProducer.product(new EventModel(EventType.SEND_FIND_PWD_EMAIL).setExts(\"mail\", user.getEmail()).setExts(\"code\", uuid));\n        return Result.success();\n    }\n\n    public void delNotValidateUser() {\n        List<User> users = userMapper.selectByStat(User.STAT_NOT_VALIDATE);\n        Date date = new Date();\n        date.setTime(date.getTime() - 1000 * 60 * 60);  // 删除一小时前注册但未验证的用户\n        for (User user : users) {\n            if (user.getCtime().before(date)) {\n                userMapper.deleteById(user.getId());\n            }\n        }\n    }\n\n    public void expireToken() {\n        Date date = new Date();\n        tokenMapper.updateStatByDate(date, Token.STAT_EXPIRED);\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/MailUtil.java",
    "content": "package cn.cie.utils;\n\nimport org.apache.commons.mail.EmailException;\nimport org.apache.commons.mail.SimpleEmail;\n\n/**\n * Created by RojerAlone on 2017/6/2.\n * 邮件工具\n */\npublic class MailUtil {\n\n    private final static String USERNAME = \"rojeralone@163.com\";\n    private final static String PASSWORD = \"password\";           // 需要打开SMTP并使用此授权码登录\n\n    /**\n     * 发送邮件给指定人，需要主题和内容\n     * @param user\n     * @param title\n     * @param content\n     */\n    public static void sendMail(String user, String title, String content) {\n        SimpleEmail email = new SimpleEmail();\n        email.setCharset(\"UTF8\");\n        email.setHostName(\"smtp.163.com\");\n        email.setAuthentication(USERNAME, PASSWORD);\n        try {\n            email.setFrom(USERNAME);\n            email.addTo(user);\n            email.setSubject(title);\n            email.setMsg(content);\n            email.send();\n        } catch (EmailException e) {\n            e.printStackTrace();\n        }\n    }\n\n    /**\n     * 发送验证邮件给用户\n     * @param user\n     * @param code\n     */\n    public static void sendValidateMail(String user, String code) {\n\n        String title = \"WePlay注册验证码\";\n        String content = \"感谢您注册WePlay，您的验证码为 \\n\" + code + \"\\n，请注意保存，此验证码有效期为 10分钟 ，并且只能使用一次。\";\n\n        sendMail(user, title, content);\n    }\n\n    /**\n     * 忘记密码时发送验证邮件给用户\n     * @param user\n     * @param code\n     */\n    public static void sendFetchPwdMail(String user, String code) {\n\n        String title = \"WePlay找回密码\";\n        String content = \"这封邮件是在验证您的WePlay邮箱，用来找回密码，如果不是您本人的操作，请忽略此邮件。\\n您的验证码为 \\n\" + code + \"\\n请注意保存，此验证码有效期为 10分钟 ，并且只能使用一次。\";\n\n        sendMail(user, title, content);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/MsgCenter.java",
    "content": "package cn.cie.utils;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n * 消息字典\n */\npublic class MsgCenter {\n\n    public static final String OK = \"OK\";\n\n    public static final String ERROR = \"服务器内部错误\";\n\n    public static final String ERROR_PARAMS = \"参数错误\";\n\n    public static final String NOT_FOUND = \"没有找到请求的资源\";\n\n    public static final String ERROR_LOGIN = \"用户名或密码错误\";\n\n    public static final String EMPTY_LOGIN = \"用户名或密码不能为空\";\n\n    public static final String EMPTY_NICKNAME = \"昵称不能为空\";\n\n    public static final String ERROR_NICINAME = \"昵称长度不能大于10个字符且不能包含非法字符\";\n\n    public static final String USER_NOT_VALIDATE = \"请先验证邮箱\";\n\n    public static final String USER_USERNAME_EXISTS = \"该用户名已被注册\";\n\n    public static final String USER_VALIDATED = \"您的邮箱已经验证过了，无需再次验证\";\n\n    public static final String USER_HAVE_LOGIN = \"您已经登陆，无需再次登陆\";\n\n    public static final String USER_NOT_LOGIN = \"请先登陆\";\n\n    public static final String USER_RESTRICT = \"你已经被限制登陆，请联系管理员解除限制\";\n\n    public static final String EMAIL_REGISTERED = \"该邮箱已被注册\";\n\n    public static final String EMAIL_NOT_REGISTERED = \"该邮箱还未注册\";\n\n    public static final String ERROR_EMAIL = \"请输入正确的电子邮箱\";\n\n    public static final String CODE_ERROR = \"邮箱验证码错误\";\n\n    public static final String EMPTY_USERNAME = \"用户名不能为空\";\n\n    public static final String EMPTY_PASSWORD = \"密码不能为空\";\n\n    public static final String EMPTY_PHONE = \"手机号不能为空\";\n\n    public static final String ERROR_PHONE = \"请填入真实的手机号码\";\n\n    public static final String EMPTY_EMAIL = \"邮箱不能为空\";\n\n    public static final String ERROR_PASSWORD_FORMAT = \"密码应不少于6位且不大于16位\";\n\n    public static final String NAME_EXISTS = \"该名称已存在\";\n\n    public static final String LOGIN_NOT_ALLOW = \"没有权限，禁止登陆\";\n\n    public static final String ERROR_FILE_TYPE = \"不支持的文件类型\";\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/PageUtil.java",
    "content": "package cn.cie.utils;\n\n/**\n * Created by RojerAlone on 2017/6/21.\n * 分页工具\n */\npublic class PageUtil {\n\n    private int num;        // 记录的总数\n    private int pages;      // 页数总数\n    private int current;    // 当前页数\n    private int size;       // 每页显示记录数\n    private int startPos;  // 从数据库中查询时开始的条数\n\n    public PageUtil(int num, int current, int size) {\n        this.num = num;\n        this.size = size;\n        this.pages = num % size == 0 ? num / size : num / size + 1;\n        if (current <= 0) {\n            this.current = 1;\n        } else {\n            this.current = current > pages ? pages : current;\n        }\n        this.startPos = this.size * (this.current - 1) < 0 ? 0 : this.size * (this.current - 1);\n    }\n\n    /**\n     * 默认每页大小为10\n     * @param num\n     * @param current\n     */\n    public PageUtil(int num, int current) {\n        this.num = num;\n        this.size = 10;\n        this.pages = num % size == 0 ? num / size : num / size + 1;\n        if (current <= 0) {\n            this.current = 1;\n        } else {\n            this.current = current > pages ? pages : current;\n        }\n        this.startPos = this.size * (this.current - 1) < 0 ? 0 : this.size * (this.current - 1);\n    }\n\n    public int getNum() {\n        return num;\n    }\n\n    public void setNum(int num) {\n        this.num = num;\n    }\n\n    public int getPages() {\n        return pages;\n    }\n\n    public void setPages(int pages) {\n        this.pages = pages;\n    }\n\n    public int getCurrent() {\n        return current;\n    }\n\n    public void setCurrent(int current) {\n        this.current = current;\n    }\n\n    public int getSize() {\n        return size;\n    }\n\n    public void setSize(int size) {\n        this.size = size;\n    }\n\n    public int getStartPos() {\n        return startPos;\n    }\n\n    public void setStartPos(int startPos) {\n        this.startPos = startPos;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/PasswordUtil.java",
    "content": "package cn.cie.utils;\n\nimport org.springframework.util.DigestUtils;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n * 将密码进行MD5加密\n */\npublic class PasswordUtil {\n\n    private static final String SALT = \"gp30#?>2a\";\n\n    public static String pwd2Md5(String paswword) {\n        return DigestUtils.md5DigestAsHex((paswword + SALT).getBytes());\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/RedisUtil.java",
    "content": "package cn.cie.utils;\n\nimport com.alibaba.fastjson.JSON;\nimport org.springframework.beans.factory.InitializingBean;\nimport org.springframework.stereotype.Component;\nimport redis.clients.jedis.Jedis;\nimport redis.clients.jedis.JedisPool;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/13.\n * 封装了redis操作，用protostuff进行序列化和反序列化\n * 如果要插入对象，需要传入插入对象的Class类型\n */\n@Component\npublic class RedisUtil<T> implements InitializingBean {\n\n    private JedisPool jedisPool;\n\n    private static final String REDIS_URL = \"redis://localhost:6379/6\";\n\n    public static final String EVERYDAY = \"everyday\";\n\n    public static final String KINDS = \"kinds\";\n\n    public static final String NEWESTGAME = \"newestgame\";\n\n    public static final String PRE_UP_GAMES = \"preupgames\";\n\n    /**\n     * 存放一条数据\n     *\n     * @param key\n     * @param value\n     * @return\n     */\n    public String put(String key, String value) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return jedis.set(key, value);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 存放一条定时过期的数据\n     *\n     * @param key\n     * @param value\n     * @param timeout\n     * @return\n     */\n    public String putEx(String key, String value, int timeout) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return jedis.setex(key, timeout, value);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 根据key获取value\n     *\n     * @param key\n     * @return\n     */\n    public String get(String key) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return jedis.get(key);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 存放一个对象\n     *\n     * @param key\n     * @param value\n     * @return\n     */\n    public String putObject(String key, T value) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return jedis.set(key, JSON.toJSONString(value));\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 存放一个定时过期的对象\n     *\n     * @param key\n     * @param value\n     * @param timeout\n     * @return\n     */\n    public String putObjectEx(String key, T value, int timeout) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return jedis.setex(key, timeout, JSON.toJSONString(value));\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 根据key获取对应的对象\n     *\n     * @param key\n     * @return\n     */\n    public T getObject(String key, Class clazz) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return (T) JSON.parseObject(jedis.get(key), clazz);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 根据key删除数据\n     *\n     * @param key\n     * @return\n     */\n    public long delete(String key) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return jedis.del(key);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 从队列头部出队一个元素，如果没有，则会阻塞 timeout 秒后返回null\n     * 如果 timeout 为0，那么会一直阻塞直到有元素\n     *\n     * @param timeout 阻塞的时间，单位为秒\n     * @param key\n     * @param clazz\n     * @return\n     */\n    public T blpopObject(int timeout, String key, Class clazz) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            List<String> list = jedis.blpop(timeout, key);\n            return (T) JSON.parseObject(list.get(0), clazz);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 从队列左边出队一个元素\n     *\n     * @param key\n     * @param clazz\n     * @return\n     */\n    public T lpopObject(String key, Class clazz) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            return (T) JSON.parseObject(jedis.lpop(key), clazz);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 向列表尾部添加数据\n     *\n     * @param key\n     * @param values\n     * @return\n     */\n    public long rpushObject(String key, Class clazz, Object... values) {\n        if (values == null || values.length == 0) {\n            return 0;\n        }\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            String[] jsonStrs = new String[values.length];\n            int index = 0;\n            for (Object value : values) {\n                jsonStrs[index] = JSON.toJSONString(value);\n                ++index;\n            }\n            return jedis.rpush(key, jsonStrs);\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 向列表尾部添加某个时间点删除的数据\n     *\n     * @param key\n     * @param time   unix时间戳\n     * @param values\n     * @return\n     */\n    public long rpushObjectExAtTime(String key, Class clazz, long time, Object... values) {\n        if (values.length == 0) {\n            return 0;\n        }\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            String[] jsonStrs = new String[values.length];\n            int index = 0;\n            for (Object value : values) {\n                jsonStrs[index] = JSON.toJSONString(value);\n                ++index;\n            }\n            long res = jedis.rpush(key, jsonStrs);\n            jedis.expireAt(key.getBytes(), time);      // 手动设置过期时间\n            return res;\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 在列表尾部添加一个定期删除的数据\n     *\n     * @param key\n     * @param clazz\n     * @param timeout\n     * @param values\n     * @return\n     */\n    public long rpushObjectEx(String key, Class clazz, int timeout, Object... values) {\n        if (values.length == 0) {\n            return 0;\n        }\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            String[] jsonStrs = new String[values.length];\n            int index = 0;\n            for (Object value : values) {\n                jsonStrs[index] = JSON.toJSONString(value);\n                ++index;\n            }\n            long res = jedis.rpush(key, jsonStrs);\n            jedis.expire(key, timeout);\n            return res;\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * 获取列表中所有数据,ruguo\n     *\n     * @param key\n     * @return\n     */\n    public List<T> lall(String key, Class clazz) {\n        Jedis jedis = null;\n        try {\n            jedis = jedisPool.getResource();\n            // 0表示第一个元素，-1表示最后一个元素\n            List<String> list = jedis.lrange(key, 0, -1);\n            List<T> res = new ArrayList<T>();\n            if (list == null || list.size() == 0) {\n                return res;\n            }\n            for (String str : list) {\n                res.add((T) JSON.parseObject(str, clazz));\n            }\n            return res;\n        } finally {\n            if (jedis != null) {\n                jedis.close();\n            }\n        }\n    }\n\n    /**\n     * spring注入之后会自动调用这个方法\n     *\n     * @throws Exception\n     */\n    public void afterPropertiesSet() throws Exception {\n        jedisPool = new JedisPool(REDIS_URL);\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/Result.java",
    "content": "package cn.cie.utils;\n\n/**\n * Created by RojerAlone on 2017/6/6.\n * 后台接口返回结果，标识了是否成功、消息以及返回的数据\n */\npublic class Result<T> {\n\n    private boolean success;\n    private String msg;\n    private T data;\n\n    private Result(boolean success, String msg) {\n        this.success = success;\n        this.msg = msg;\n    }\n\n    private Result(boolean success, String msg, T data) {\n        this.success = success;\n        this.msg = msg;\n        this.data = data;\n    }\n\n    public static Result success() {\n        return new Result(true, MsgCenter.OK);\n    }\n\n    public static Result success(Object data) {\n        return new Result(true, MsgCenter.OK, data);\n    }\n\n    public static Result fail(String msg) {\n        return new Result(false, msg);\n    }\n\n    public static Result fail(String msg, Object data) {\n        return new Result(false, msg, data);\n    }\n\n    public boolean isSuccess() {\n        return success;\n    }\n\n    public String getMsg() {\n        return msg;\n    }\n\n    public T getData() {\n        return data;\n    }\n}\n"
  },
  {
    "path": "src/main/java/cn/cie/utils/UserHolder.java",
    "content": "package cn.cie.utils;\n\nimport cn.cie.entity.User;\nimport org.springframework.stereotype.Component;\n\n/**\n * Created by RojerAlone on 2017/6/11.\n * 每次请求时存放请求者的信息\n */\n@Component\npublic class UserHolder {\n\n    private static ThreadLocal<User> users = new ThreadLocal<User>();\n\n    public User getUser() {\n        return users.get();\n    }\n\n    public void setUser(User user) {\n        users.set(user);\n    }\n\n    public void remove() {\n        users.remove();\n    }\n\n}\n"
  },
  {
    "path": "src/main/resources/dbdata.sql",
    "content": "insert into `shop`.`game`(`creater`, `name`, `desc`, `systemcfg`, `price`) values\n ('Killerfish Games', 'Cold Waters', 'Spiritual Successor to the Microprose Classic “Red Storm Rising”.',\n  '操作系统: XP 处理器: Intel Atom\n  内存: 2 GB RAM\n  DirectX 版本: 9.0c\n  存储空间: 需要 2 GB 可用空间', 58),\n ('LR Studio', 'Confess My Love', '游戏发生在某一天的放学后，男生未宇打算向心仪的女生阑珊表明自己的心意，但又因为害怕被拒绝犹豫不决。',\n  '操作系统: Windows XP/ Vista/7/10\n  处理器: Intel Core 2 1.06Ghz\n  内存: 1 GB RAM\n  存储空间: 需要 50 MB 可用空间', 0),\n ('Motion Twin', 'Dead Cells', '欢迎来到《死亡细胞》，这是一款将Roguelite与银河战士恶魔城类特点融为一炉的2D平台动作游戏。游戏中并无检查点，玩家将体验魂味战斗，一路挑战诸多守卫，在杀戮与死亡的反复轮回中探索一座房间不断变化的巨大城堡。”.',\n  '操作系统: Windows 7+\n  处理器: Intel i5+\n  内存: 2 GB RAM\n  图形: Nvidia 450 GTS / Radeon HD 5750 or better\n  存储空间: 需要 500 MB 可用空间\n  附注事项: OpenGL 3.2+', 0),\n ('ROCKFISH Games', 'EVERSPACE', '《EVERSPACE™》是一款侧重于动作的单人太空射击游戏，结合了类Rogue元素和一流的视觉效果及引人入胜的故事。游戏将带领你在一个不断变化、制作精美且充满惊喜的宇宙中，展开一段富有挑战性的旅程。 你的技能、经验和随机应变的天赋都将持续受到考验；与此同时，通过遭遇其他有趣且各有奥秘的人物角色，你将了解自己的存在意义。每个回合都是激动人心的体验，每次航行都是全新的局势，让游戏的每一个部分都能长久地持续下去， 并从中创造大量独特而意味深长的体验时刻。然而，不管你的飞行技术多么高超，死亡都是不可避免的，而这只是一段更宏大旅程的开始。',\n  '操作系统: 32/64-bit Windows 7 / 8.1 / 10\n  处理器: Intel CPU Core i3\n  内存: 4 GB RAM\n  图形: Nvidia GTX 480 / AMD Radeon HD 5870\n  DirectX 版本: 10\n  存储空间: 需要 8 GB 可用空间', 49.9),\n ('Modern Visual Arts Laboratory', 'Lucy -The Eternity She Wished For', '如果世界上有机器人能够像人一样微笑，一样哭泣，一样悲伤。',\n  '操作系统: Microsoft Windows 2000/XP(SP3)/Vista\n  处理器: Intel Pentium 4 1.5Ghz/AMD Athlon 1800\n  内存: 128 MB RAM\n  DirectX 版本: 9.0c\n  存储空间: 需要 1 GB 可用空间\n  附注事项: Microsoft .Net Framework', 124),\n ('Klei Entertainment', 'Mark of the Ninja', 'In Mark of the Ninja, you''ll know what it is to truly be a ninja. You must be silent, agile and clever to outwit your opponents in a world of gorgeous scenery and flowing animation. Marked with cursed tattoos giving you heightened senses, every situation presents you with options.',\n  'OS:Windows XP SP3, Windows Vista SP2, Windows 7 SP1\n  Processor:AMD Phenom 9750 or Pentium D 800+\n  Memory:2 GB RAM\n  Graphics:NVIDIA® GeForce® 7800 GT or ATI Radeon™ HD 3000+ or better DirectX®:9.0c\n  Hard Drive:2.5 GB\n  HD space Sound:100% DirectX9.0c compatible sound card and drivers', 66),\n ('Klei Entertainment', 'Oxygen Not Included', 'Oxygen Not Included is a space-colony simulation game. Deep inside an alien space rock your industrious crew will need to master science, overcome strange new lifeforms, and harness incredible space tech to survive, and possibly, thrive.',\n  '操作系统: Windows 7 (64 bit)\n  处理器: Dual Core 2 GHz\n  内存: 4 GB RAM\n  图形: Intel HD 4600 (AMD or NVIDIA equivalent)\n  DirectX 版本: 11\n  存储空间: 需要 2 GB 可用空间', 76),\n ('ConcernedApe', 'Stardew Valley', '你继承了你爷爷在星露谷留下的老旧农场。带着爷爷留下的残旧工具和几枚硬币开始了你的新生活。你能适应这小镇上的生活并且将这个杂草丛生的老旧农场变成一个繁荣的家吗？',\n  '操作系统: Windows Vista or greater\n  处理器: 2 Ghz\n  内存: 2 GB RAM\n  图形: 256 mb video memory, shader model 3.0+\n  DirectX 版本: 10\n  存储空间: 需要 500 MB 可用空间', 21),\n ('Thekla, Inc.', 'The Witness', '你孤身一人醒来。这是一座充满挑战和惊奇、遍地谜题的奇怪小岛。',\n  '操作系统: Windows 7\n  处理器: 1.8GHz\n  内存: 4 GB RAM\n  图形: Intel HD 4000 series\n  DirectX 版本: 10\n  存储空间: 需要 5 GB 可用空间', 21),\n ('Illusion Ranger', 'Aeon', '我们把所有精力都注入在打击感的挖掘上，创造出一款顶级打击感的VR射击游戏。你将体验大口径火枪爽快的爆裂射击，同时用你的武士刀随心所欲地斩杀胆敢靠近的敌人。',\n  '操作系统: win7\n处理器: intel i5\n内存: 8000 MB RAM\n图形: Nvidia 970\nDirectX 版本: 11\n存储空间: 需要 2000 MB 可用空间\n附注事项: HTC vive only', 55),\n ('Reactive Drop Team', 'Alien Swarm Reactive Drop', 'Co-operative top-down shooter game available for free. An epic bug hunt featuring a unique blend of co-op play and squad-level tactics.',\n  '操作系统: Windows® XP or above\n处理器: Pentium 4 3.0GHz\n内存: 2 GB RAM\n图形: DirectX 9 compatible video card with 128 MB, Shader model 2.0. ATI X800, NVidia 6600 or better\nDirectX 版本: 9.0\n存储空间: 需要 10 GB 可用空间\n声卡: DirectX 9.0c compatible sound card', 76),\n ('Valve', 'Counter-Strike Global Offensive', '《反恐精英：全球攻势》（CS: GO）在团队竞技游戏模式的基础上加以开发，这一模式自 12 年前发布以来一直引领至今。 CS: GO 的特色是全新的地图、人物、武器以及最新版本的 CS 经典内容（de_dust 等）。此外，CS: GO 引入了全新的游戏模式、对战匹配、排行榜以及更多新的内容。',\n  '操作系统: Windows® 7/Vista/XP\n处理器: Intel® Core™ 2 Duo E6600 or AMD Phenom™ X3 8750 processor or better\n内存: 2 GB RAM\n图形: Video card must be 256 MB or more and should be a DirectX 9-compatible with support for Pixel Shader 3.0\nDirectX 版本: 9.0c\n存储空间: 需要 15 GB 可用空间', 58),\n ('Sports Interactive', 'Football Manager 2017', '作为迄今为止最真实的足球经理类游戏，Football Manager 2017 让你操控自己最喜欢的球队征战绿茵赛场。',\n  '操作系统: Windows Vista (SP2), 7 (SP1), 8, 8.1, 10 (1607) – 64-bit or 32-bit\n处理器: Intel Pentium 4, Intel Core or AMD Athlon – 2.2 GHz +\n内存: 2 GB RAM\n图形: Intel GMA X3100, NVIDIA GeForce 8600M GT or AMD/ATI Mobility Radeon HD 2400 – 256MB VRAM\nDirectX 版本: 9.0c\n存储空间: 需要 3 GB 可用空间', 75),\n ('Telltale Games', 'Marvel''s Guardians of the Galaxy The Telltale Series', '从地球到米兰号再到不毛之地以及更远的地方，伴随着超棒的音乐节奏，这个分为五章节的系列游戏将带你进入穿着火箭靴的星爵的全新Guardians历险。游戏故事由曾获奖的Telltale独特风格讲述，你的选择和动作将决定你所体验的故事轨迹。 ',\n  '操作系统: Windows 7 64Bit Service Pack 1 or higher\n处理器: Intel Core 2 Duo 2.4GHz\n内存: 3 GB RAM\n图形: Nvidia GTS 450+ with 1024MB+ VRAM (excluding GT)\nDirectX 版本: 11\n存储空间: 需要 15 GB 可用空间\n声卡: Direct X 11 sound device', 198),\n ('Bluehole, Inc.', 'PLAYERUNKNOWN''S BATTLEGROUNDS', '绝地求生(PLAYERUNKNOWN’S BATTLEGROUNDS)是大逃杀类型的游戏，每一局游戏将有100名玩家参与，他们将被投放在绝地岛(battlegrounds)的上空，游戏开始跳伞时所有人都一无所有。',\n  '操作系统: 64-bit Windows 7, Windows 8.1, Windows 10\n处理器: Intel Core i3-4340 / AMD FX-6300\n内存: 6 GB RAM\n图形: nVidia GeForce GTX 660 2GB / AMD Radeon HD 7850 2GB\nDirectX 版本: 11\n网络: 宽带互联网连接\n存储空间: 需要 30 GB 可用空间', 200),\n ('Keen Games', 'Portal Knights', '将熟悉的世界抛在身后，踏入 Portal Knights 这个奇妙的未知世界！在由古代传送门连接的众多沙盒岛屿上，和你的好友一起展开这场惊险刺激的制作冒险。没有人记得自从和平的世界因为碎裂分崩离析、陷入黑暗之后已经过了多久。是否还有勇者敢于将这片破碎之地复原？打造你的冒险之旅。',\n  '操作系统: 64bit Versions of Windows 7, Windows 8, Windows 10\n处理器: AMD Phenom(tm) 8450 Triple-Core Processor (3 CPUs), ~2.1GHz or Intel Core 2 Duo E8400 @ 3.0 GHz\n内存: 4 GB RAM\n图形: Graphics: NVIDIA® GeForce GTX 470 (1Gb VRAM) / ATI Radeon TM HD 6870 (1Gb VRAM)\nDirectX 版本: 11\n网络: 宽带互联网连接\n存储空间: 需要 2 GB 可用空间\n声卡: On Board', 98),\n ('Arkane Studios', 'Prey', 'In Prey, you awaken aboard Talos I, a space station orbiting the moon in the year 2032. You are the key subject of an experiment meant to alter humanity forever – but things have gone terribly wrong. The space station has been overrun by hostile aliens and you are now being hunted. ',\n  '操作系统: Windows 7/8/10 (64-bit versions)\n处理器: Intel i5-2400, AMD FX-8320\n内存: 8 GB RAM\n图形: GTX 660 2GB, AMD Radeon 7850 2GB\n存储空间: 需要 20 GB 可用空间', 79),\n ('Eugen Systems', 'Steel Division Normandy 44', 'Steel Division: Normandy is a tactical real-time strategy (RTS) game that pits players against AI enemies in a single-player campaign -- or against several opponents in massive 10-on-10 multiplayer battles. ',\n  '操作系统: 64-bit Windows 10 / 8.1 / 7 with Service Pack 1\n处理器: Intel Core i3-2100 (3.1 GHz) or equivalent\n内存: 3 GB RAM\n图形: 1 GB AMD 5570 or nVidia 450\nDirectX 版本: 11\n网络: 宽带互联网连接\n存储空间: 需要 32 GB 可用空间\n声卡: DirectX Compatible Sound Card', 66),\n ('SNK Playmore', 'THE KING OF FIGHTERS XIII STEAM EDITION', '“THE KING OF FIGHTERS XIII”, SNK PLAYMORE’s flagship 2D versus fighting title returns in an ultimate version on Steam!!The many features exclusive to the console version of the game, such as the ONLINE Mode that allows you to enjoy smooth online versus matches with rivals from around the world',\n  '操作系统: Windows XP\n处理器: Intel Pentium4 2.0 GHz and up\n内存: 1 GB RAM\n图形: GeForce 9500 GT ,VRAM: 256MB and up\nDirectX 版本: 9.0c\n存储空间: 需要 5 GB 可用空间\n声卡: DirectSound, DirectX9.0c Compatible Audio', 50),\n  ('Rockstar North', 'GTA Online: Shark Cash Cards', '该内容需要在 Steam 拥有基础游戏 Grand Theft Auto V 才能运行。',\n   '操作系统: Windows 10 64 Bit, Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)\n处理器: Intel Core 2 Quad CPU Q6600 @ 2.40GHz (4 CPUs) / AMD Phenom 9850 Quad-Core Processor (4 CPUs) @ 2.5GHz\n内存: 4 GB RAM\n图形: NVIDIA 9800 GT 1GB / AMD HD 4870 1GB (DX 10, 10.1, 11)\n存储空间: 需要 72 GB 可用空间\n声卡: 100% DirectX 10 compatible', 148),\n ('Giant Squid', 'ABZU', '沿袭 Journey蕴含的艺术思想，ABZU 是一款能唤起潜水梦想的唯美海底冒险游戏。深入海洋中心，将自己沉浸在生机勃勃的隐秘世界中，这里色彩缤纷，生物繁多。但要注意，当你不断深入，危险就潜伏在深处。',\n  '操作系统: Windows 7, 64-bit\n处理器: 3.0GHz CPU Dual Core\n内存: 4 GB RAM\n图形: Geforce GTX 750 / Radeon R7 260X\nDirectX 版本: 11\n存储空间: 需要 6 GB 可用空间\n声卡: DirectX compatible sound card', 68),\n ('Rad Codex', 'Alvora Tactics', 'Alvora Tactics is an indie Tactics RPG that combines strategic combat with immersive exploration. Explore and conquer Great Serpent Alvora with your own customizable band of warriors!',\n  '操作系统: Windows XP\n内存: 1 GB RAM\n图形: Must support Shader Model 2.0\nDirectX 版本: 9.0c\n存储空间: 需要 1000 MB 可用空间', 32),\n ('Codemasters', 'DiRT 4', '世界领先的越野赛系列游戏回归了！《DiRT 4》让你驾驶有史以来最强的赛车去面对这个星球的拉力赛、rallycross 和 landrush 中危险重重的赛道。游戏改变了“你的赛段”系统，只要轻轻触摸一个按钮，即可创建无数条赛道。',\n  '操作系统: 64bit Versions of Windows 7, Windows 8, Windows 10\n处理器: AMD FX Series or Intel Core i3 Series\n内存: 4 GB RAM\n图形: AMD HD5570 or NVIDIA GT440 with 1GB of VRAM (DirectX 11 graphics card required)\n网络: 宽带互联网连接\n存储空间: 需要 50 GB 可用空间\n声卡: DirectX Compatible soundcard', 158),\n ('FromSoftware, Inc.', 'DARK SOULS III', 'Dark Souls即将推出极具话题性及代表性的系列新作。',\n  '操作系统: Windows 7 SP1 64bit, Windows 8.1 64bit Windows 10 64bit\n处理器: Intel Core i3-2100 / AMD® FX-6300\n内存: 4 GB RAM\n图形: NVIDIA® GeForce GTX 750 Ti / ATI Radeon HD 7950\nDirectX 版本: 11\n网络: 宽带互联网连接\n存储空间: 需要 25 GB 可用空间\n声卡: DirectX 11 sound device', 268),\n ('Laser Unicorns', 'Kung Fury', 'Miami Police Department detective and martial artist Kung Fury time travels from the 1980s to World War II to kill Adolf Hitler, a.k.a. \"Kung Führer\", and revenge his friend''s death at the hands of the Nazi leader. An error in the time machine sends him further back to the Viking Age.',\n  '操作系统: Windows 7\n处理器: 英特尔酷睿 2 处理器或相同性能的 AMD 处理器\n内存: 1 GB RAM\n网络: 宽带互联网连接\n存储空间: 需要 200 MB 可用空间', 0),\n ('Rockstar North', 'Grand Theft Auto V', 'A young street hustler, a retired bank robber and a terrifying psychopath must pull off a series of dangerous heists to survive in a ruthless city in which they can trust nobody, least of all each other.',\n  '操作系统: Windows 10 64 Bit, Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)\n处理器: Intel Core 2 Quad CPU Q6600 @ 2.40GHz (4 CPUs) / AMD Phenom 9850 Quad-Core Processor (4 CPUs) @ 2.5GHz\n内存: 4 GB RAM\n图形: NVIDIA 9800 GT 1GB / AMD HD 4870 1GB (DX 10, 10.1, 11)\n存储空间: 需要 72 GB 可用空间\n声卡: 100% DirectX 10 compatible', 198),\n ('IMCGAMES Co.,Ltd.', 'Tree of Savior (English Ver.)', 'Tree of Savior(abbreviated as TOS thereafter) is an MMORPG in which you embark on a journey to search for the goddesses in the world of chaos. Fairy-tale like colors accompanied with beautiful graphics in TOS will have you reminiscing about precious moments all throughout the game.',\n  '操作系统: Windows XP\n处理器: Intel Pentium Core 2\n内存: 4 GB RAM\n图形: NVIDIA Geforce 8600\nDirectX 版本: 9.0c\n网络: 宽带互联网连接\n存储空间: 需要 4 GB 可用空间', 0),\n ('Daybreak Game Company', 'H1Z1 King of the Kill', '《杀戮之王》是一款单败淘汰制多人在线射击游戏，可容纳150名身经百战的玩家角逐于一个强大而复杂的世界。搜寻武器、弹药、盔甲、车辆和补给，在竞争中脱颖而出，并坚持到最后。',\n  '操作系统: Windows 7, 8, 8.1, 10 (64 bit only)\n处理器: Intel i5 Quad-Core\n内存: 6 GB RAM\n图形: nVidia GeForce GTX 280 series or higher\nDirectX 版本: 10\n网络: 宽带互联网连接\n存储空间: 需要 20 GB 可用空间\n声卡: DirectX Compatible Sound Card', 68),\n ('Codemasters ,\tFeral Interactive (Mac)', 'F1 2016', '在F1 2016中创造您自己的传奇。准备好全身心投入这场有史以来最著名的顶尖赛车赛事中。与您的代理人、工程师与团队共同合作，以十个赛季的丰富经验深度开发您的赛车。',\n  '操作系统: 64bit Versions of Windows 7, Windows 8, Windows 10\n处理器: Intel Core i3 530 or AMD FX 4100\n内存: 8 GB RAM\n图形: Nvidia GTX 460 or AMD HD 5870\nDirectX 版本: 11\n网络: 宽带互联网连接\n存储空间: 需要 30 GB 可用空间\n声卡: DirectX Compatible Soundcard', 158),\n ('Piranha Bytes', 'ELEX', 'ELEX is a handcrafted action role-playing experience from the award-winning creators of the Gothic series, set in a brand new post-apocalyptic Science Fantasy universe that puts players into a huge seamless game world full of original characters, mutated creatures, deep moral choices and powerful action.',\n  '操作系统: Windows 7, 8, Windows 10 (64 bit)\n处理器: Intel Core i5 at 2.5 GHz or better or AMD Phenom II x4 940 at 3.0 GHz\n内存: 6 GB RAM\n图形: NVIDIA GeForce GTX 570 or AMD Radeon HD 5870, 1 GB VRAM\nDirectX 版本: 11\n存储空间: 需要 20 GB 可用空间\n声卡: DirectX compatible Sound card', 44.1),\n ('IllFonic', 'Friday the 13th: The Game', 'Jason is back! Jason Voorhees is unleashed and stalking the grounds of Camp Crystal Lake! Friday the 13th: The Game is one of the most highly-anticipated horror titles of all time. You will finally be able to take on the role as Jason Voorhees and Camp Crystal Lake counselors.',\n  '操作系统: Windows 7, Windows 8, Windows 10\n处理器: Intel Core i3-530 (2 * 2930), AMD Athlon II X2 270 (2 * 3400)\n内存: 4096 MB RAM\n图形: GeForce GTX 650 Ti (1024 MB), Radeon HD 7770 (1024 MB)\nDirectX 版本: 11\n网络: 宽带互联网连接\n存储空间: 需要 4 GB 可用空间', 39);\n\ninsert into `shop`.`kind`(name) values ('独立'), ('动作'), ('冒险'), ('休闲'), ('策略'), ('模拟'), ('角色扮演'), ('免费'), ('单人'), ('大型多人在线'), ('射击'), ('体育'), ('氛围'), ('暴力');\n\ninsert into `shop`.`kindmapper` values (1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1), (7, 1), (8, 1), (9, 1), (10, 2), (11, 2), (12, 2), (13, 2), (14, 2), (15, 2), (16, 2), (17, 2), (18, 2), (19, 2),\n (20, 3), (21, 4), (22, 5), (23, 6), (24, 7), (25, 8), (26, 9), (27, 10), (28, 11), (29, 12), (30, 13), (31, 14);\n\ninsert into `shop`.`tag`(`name`) values ('模拟'), ('独立'), ('海军'), ('策略'), ('冷战'), ('免费'), ('冒险'), ('角色扮演'), ('日本动画'), ('动作'), ('太空'), ('科幻'), ('单人'), ('剧情'),\n ('机器人'), ('潜行'), ('忍者'), ('多人'), ('二维'), ('建筑建造'), ('生存'), ('农业'), ('工业'), ('解密'), ('探索'), ('第一人称'), ('射击'), ('虚拟现实'), ('合作'), ('外星人'), ('体育'),\n ('足球'), ('恐怖'), ('即时战略'), ('街机'), ('格斗'), ('竞速'), ('困难'), ('女主人翁'), ('丧尸'), ('氛围'), ('暴力'), ('犯罪'), ('砍杀'), ('萝莉'), ('养成'), ('种植');\n\ninsert into `shop`.`tagmapper` values (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 6), (2, 2), (2, 7), (2, 8), (2, 9), (2, 45), (2, 46), (3, 10), (3, 2), (4, 11), (4, 10), (4, 2), (4, 12), (4, 13),\n (5, 9), (5, 14), (5, 1), (5, 15), (5, 45), (5, 46), (6, 16), (6, 17), (6, 13), (6, 19), (6, 10), (7, 20), (7, 21), (7, 1), (7, 13), (8, 8), (8, 1), (8, 22), (8, 23), (9, 24), (9, 25), (9, 26),\n (9, 13), (10, 10), (10, 26), (10, 27), (10, 2), (10, 28), (11, 29), (11, 18), (11, 10), (11, 30), (12, 26), (12, 27), (12, 18), (12, 10), (12, 29), (13, 31), (13, 1), (13, 32), (13, 4), (13, 34),\n (14, 7), (14, 14), (14, 10), (15, 21), (15, 27), (15, 18), (16, 7), (16, 18), (16, 8), (17, 12), (17, 10), (17, 11), (17, 26), (17, 27), (17, 33), (18, 4), (18, 34), (18, 1), (18, 10), (18, 18),\n (19, 35), (19, 36), (19, 10), (19, 9), (19, 37), (19, 41), (19, 44), (20, 10), (20, 7), (20, 18), (20, 27), (20, 42), (20, 43), (20, 44), (21, 41), (21, 24), (21, 25), (22, 2), (22, 4), (22, 8),\n (22, 47), (23, 37), (23, 1), (23, 31), (23, 18), (24, 41), (24, 38), (24, 8), (24, 25), (25, 10), (25, 35), (25, 36), (25, 12), (26, 18), (26, 27), (26, 37), (26, 42), (26, 43), (26, 44), (27, 1),\n (27, 7), (27, 8), (27, 47), (28, 18), (28, 21), (28, 27), (28, 44), (29, 41), (29, 37), (30, 8), (30, 7), (30, 12), (30, 10), (31, 40), (31, 18), (31, 33), (31, 42);\n\ninsert into `shop`.`img` values (1, '/1/header.jpg'), (1, '/1/1.jpg'), (1, '/1/2.jpg'), (1, '/1/3.jpg'), (1, '/1/4.jpg'), (1, '/1/5.jpg'), (2, '/2/header.jpg'), (2, '/2/1.jpg'),\n (2, '/2/2.jpg'), (2, '/2/3.jpg'), (2, '/2/4.jpg'), (2, '/2/5.jpg'), (3, '/3/header.jpg'), (3, '/3/1.jpg'), (3, '/3/2.jpg'), (3, '/3/3.jpg'), (3, '/3/4.jpg'), (3, '/3/5.jpg'),\n (4, '/4/header.jpg'), (4, '/4/1.jpg'), (4, '/4/2.jpg'), (4, '/4/3.jpg'), (4, '/4/4.jpg'), (4, '/4/5.jpg'), (5, '/5/header.jpg'), (5, '/5/1.jpg'), (5, '/5/2.jpg'), (5, '/5/3.jpg'),\n (5, '/5/4.jpg'), (5, '/5/5.jpg'), (6, '/6/header.jpg'), (6, '/6/1.jpg'), (6, '/6/2.jpg'), (6, '/6/3.jpg'), (6, '/6/4.jpg'), (6, '/6/5.jpg'), (7, '/7/header.jpg'), (7, '/7/1.jpg'),\n (7, '/7/2.jpg'), (7, '/7/3.jpg'), (7, '/7/4.jpg'), (7, '/7/5.jpg'), (7, '/7/6.jpg'), (8, '/8/header.jpg'), (8, '/8/1.jpg'), (8, '/8/2.jpg'), (8, '/8/3.jpg'), (8, '/8/4.jpg'),\n (8, '/8/5.jpg'), (9, '/9/header.jpg'), (9, '/9/1.jpg'), (9, '/9/2.jpg'), (9, '/9/3.jpg'), (9, '/9/4.jpg'), (9, '/9/5.jpg'), (10, '/10/header.jpg'), (10, '/10/1.jpg'), (10, '/10/2.jpg'),\n (10, '/10/3.jpg'), (10, '/10/4.jpg'), (10, '/10/5.jpg'), (10, '/10/6.jpg'), (11, '/11/header.jpg'), (11, '/11/1.jpg'), (11, '/11/2.jpg'), (11, '/11/3.jpg'), (11, '/11/4.jpg'),\n (11, '/11/5.jpg'), (11, '/11/6.jpg'), (12, '/12/header.jpg'), (12, '/12/1.jpg'), (12, '/12/2.jpg'), (12, '/12/3.jpg'), (12, '/12/4.jpg'), (12, '/12/5.jpg'), (12, '/12/6.jpg'),\n (13, '/13/header.jpg'), (13, '/13/1.jpg'), (13, '/13/2.jpg'), (13, '/13/3.jpg'), (13, '/13/4.jpg'), (13, '/13/5.jpg'), (13, '/13/6.jpg'), (14, '/14/header.jpg'), (14, '/14/1.jpg'),\n (14, '/14/2.jpg'), (14, '/14/3.jpg'), (14, '/14/4.jpg'), (14, '/14/5.jpg'), (15, '/15/header.jpg'), (15, '/15/1.jpg'), (15, '/15/2.jpg'), (15, '/15/3.jpg'), (15, '/15/4.jpg'),\n (15, '/15/5.jpg'), (16, '/16/header.jpg'), (16, '/16/1.jpg'), (16, '/16/2.jpg'), (16, '/16/3.jpg'), (16, '/16/4.jpg'), (16, '/16/5.jpg'), (16, '/16/6.jpg'), (17, '/17/header.jpg'),\n (17, '/17/1.jpg'), (17, '/17/2.jpg'), (17, '/17/3.jpg'), (17, '/17/4.jpg'), (17, '/17/5.jpg'), (17, '/17/6.jpg'), (18, '/18/header.jpg'), (18, '/18/1.jpg'), (18, '/18/2.jpg'),\n (18, '/18/3.jpg'), (18, '/18/4.jpg'), (18, '/18/5.jpg'), (18, '/18/6.jpg'), (19, '/19/header.jpg'), (19, '/19/1.jpg'), (19, '/19/2.jpg'), (19, '/19/3.jpg'), (19, '/19/4.jpg'),\n (19, '/19/5.jpg'), (20, '/20/header.jpg'), (20, '/20/1.jpg'), (20, '/20/2.jpg'), (20, '/20/3.jpg'), (20, '/20/4.jpg'), (20, '/20/5.jpg'), (21, '/21/header.jpg'), (21, '/21/1.jpg'),\n (21, '/21/2.jpg'), (21, '/21/3.jpg'), (21, '/21/4.jpg'), (21, '/21/5.jpg'), (21, '/21/6.jpg'), (22, '/22/header.jpg'), (22, '/22/1.jpg'), (22, '/22/2.jpg'), (22, '/22/3.jpg'),\n (22, '/22/4.jpg'), (22, '/22/5.jpg'), (23, '/23/header.jpg'), (23, '/23/1.jpg'), (23, '/23/2.jpg'), (23, '/23/3.jpg'), (23, '/23/4.jpg'), (23, '/23/5.jpg'), (24, '/24/header.jpg'),\n (24, '/24/1.jpg'), (24, '/24/2.jpg'), (24, '/24/3.jpg'), (24, '/24/4.jpg'), (24, '/24/5.jpg'), (25, '/25/header.jpg'), (25, '/25/1.jpg'), (25, '/25/2.jpg'), (25, '/25/3.jpg'),\n (25, '/25/4.jpg'), (25, '/25/5.jpg'), (26, '/26/header.jpg'), (26, '/26/1.jpg'), (26, '/26/2.jpg'), (26, '/26/3.jpg'), (26, '/26/4.jpg'), (26, '/26/5.jpg'), (27, '/27/header.jpg'),\n (27, '/27/1.jpg'), (27, '/27/2.jpg'), (27, '/27/3.jpg'), (27, '/27/4.jpg'), (27, '/27/5.jpg'), (28, '/28/header.jpg'), (28, '/28/1.jpg'), (28, '/28/2.jpg'), (28, '/28/3.jpg'),\n (28, '/28/4.jpg'), (28, '/28/5.jpg'), (29, '/29/header.jpg'), (29, '/29/1.jpg'), (29, '/29/2.jpg'), (29, '/29/3.jpg'), (29, '/29/4.jpg'), (29, '/29/5.jpg'), (30, '/30/header.jpg'),\n (30, '/30/1.jpg'), (30, '/30/2.jpg'), (30, '/30/3.jpg'), (30, '/30/4.jpg'), (30, '/30/5.jpg'), (30, '/30/6.jpg'), (31, '/31/header.jpg'), (31, '/31/1.jpg'), (31, '/31/2.jpg'),\n (31, '/31/3.jpg'), (31, '/31/4.jpg'), (31, '/31/5.jpg'), (31, '/31/6.jpg');\n"
  },
  {
    "path": "src/main/resources/generator/generatorConfig.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE generatorConfiguration\n        PUBLIC \"-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN\"\n        \"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd\">\n<generatorConfiguration>\n    <properties resource=\"jdbc.properties\" />\n    <!--指定数据库驱动jar包-->\n    <classPathEntry\n            location=\"C:\\Users\\PC\\.m2\\repository\\mysql\\mysql-connector-java\\5.1.40\\mysql-connector-java-5.1.40.jar\" />\n    <context id=\"mysql\" targetRuntime=\"MyBatis3\" defaultModelType=\"flat\">\n        <commentGenerator>\n            <!-- 抑制警告 -->\n            <property name=\"suppressTypeWarnings\" value=\"true\" />\n            <!-- 是否去除自动生成的注释 true：是 ： false:否 -->\n            <property name=\"suppressAllComments\" value=\"true\" />\n            <!-- 是否生成注释代时间戳-->\n            <property name=\"suppressDate\" value=\"true\" />\n        </commentGenerator>\n        <jdbcConnection driverClass=\"${jdbc.driver}\"\n                        connectionURL=\"${jdbc.url}\"\n                        userId=\"${jdbc.username}\"\n                        password=\"${jdbc.password}\">\n        </jdbcConnection>\n        <javaModelGenerator targetPackage=\"cn.cie.entity\" targetProject=\"src/main/java\"></javaModelGenerator>\n        <sqlMapGenerator targetPackage=\"mapper\" targetProject=\"src/main/resources\"/>\n        <javaClientGenerator type=\"XMLMAPPER\"\n                             targetPackage=\"cn.cie.mapper\"\n                             targetProject=\"src\\main\\java\">\n        </javaClientGenerator>\n        <!--<table tableName=\"user\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"game\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"img\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"code\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"order\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"orderitem\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"ordermapper\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"kind\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"kindmapper\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"tag\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"tagmapper\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"validatecode\"-->\n               <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n               <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n               <!--selectByExampleQueryId=\"false\"></table>-->\n        <!--<table tableName=\"token\"-->\n        <!--enableCountByExample=\"false\" enableUpdateByExample=\"false\"-->\n        <!--enableDeleteByExample=\"false\" enableSelectByExample=\"false\"-->\n        <!--selectByExampleQueryId=\"false\"></table>-->\n    </context>\n</generatorConfiguration>"
  },
  {
    "path": "src/main/resources/jdbc.properties",
    "content": "jdbc.driver=com.mysql.jdbc.Driver\njdbc.url=jdbc:mysql://localhost:3306/shop?useUnicode=true&characterEncoding=utf8&useSSL=false\njdbc.username=root\njdbc.password=123456\njdbc.initialSize=0\njdbc.maxActive=20\njdbc.maxIdle=20\njdbc.minIdle=1\njdbc.maxWait=60000"
  },
  {
    "path": "src/main/resources/log4j-acc.properties",
    "content": "log4j.rootLogger=INFO,LOGFILE\n\nlog4j.appender.LOGFILE = org.apache.log4j.RollingFileAppender\nlog4j.appender.LOGFILE.File = /usr/local/log/acc.log\nlog4j.appender.LOGFILE.MaxFileSize = 10MB\nlog4j.appender.LOGFILE.MaxBackupIndex = 1000\nlog4j.appender.LOGFILE.layout = org.apache.log4j.PatternLayout\nlog4j.appender.LOGFILE.layout.ConversionPattern = %d{yyyy-MM-dd HH\\:mm\\:ss} %m%n\n# %-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n"
  },
  {
    "path": "src/main/resources/log4j-error.properties",
    "content": "log4j.rootLogger=ERROR,LOGFILE\n\nlog4j.appender.LOGFILE = org.apache.log4j.RollingFileAppender\nlog4j.appender.LOGFILE.File = /usr/local/log/err.log\nlog4j.appender.LOGFILE.MaxFileSize = 10MB\n#log4j.appender.LOGFILE.Threshold = ALL\nlog4j.appender.LOGFILE.layout = org.apache.log4j.PatternLayout\nlog4j.appender.LOGFILE.layout.ConversionPattern = %d{yyyy-MM-dd HH\\:mm\\:ss} %m%n"
  },
  {
    "path": "src/main/resources/mapper/CodeMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.CodeMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Code\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"item\" jdbcType=\"INTEGER\" property=\"item\" />\n    <result column=\"uid\" jdbcType=\"INTEGER\" property=\"uid\" />\n    <result column=\"code\" jdbcType=\"VARCHAR\" property=\"code\" />\n    <result column=\"stat\" jdbcType=\"TINYINT\" property=\"stat\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, item, uid, code, stat\n  </sql>\n\n  <select id=\"selectById\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select \n    <include refid=\"Base_Column_List\" />\n    from code\n    where id = #{id,jdbcType=INTEGER}\n  </select>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Code\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into code\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"item != null\">\n        item,\n      </if>\n      <if test=\"uid != null\">\n        uid,\n      </if>\n      <if test=\"code != null\">\n        code,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"item != null\">\n        #{item,jdbcType=INTEGER},\n      </if>\n      <if test=\"uid != null\">\n        #{uid,jdbcType=INTEGER},\n      </if>\n      <if test=\"code != null\">\n        #{code,jdbcType=VARCHAR},\n      </if>\n    </trim>\n  </insert>\n\n  <update id=\"update\" parameterType=\"cn.cie.entity.Code\">\n    update code\n    <set>\n      <if test=\"stat != null\">\n        stat = #{stat,jdbcType=TINYINT},\n      </if>\n    </set>\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/GameMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.GameMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Game\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"creater\" jdbcType=\"VARCHAR\" property=\"creater\" />\n    <result column=\"name\" jdbcType=\"VARCHAR\" property=\"name\" />\n    <result column=\"desc\" jdbcType=\"VARCHAR\" property=\"desc\" />\n    <result column=\"systemcfg\" jdbcType=\"VARCHAR\" property=\"systemcfg\" />\n    <result column=\"price\" jdbcType=\"DOUBLE\" property=\"price\" />\n    <result column=\"discount\" jdbcType=\"DOUBLE\" property=\"discount\" />\n    <result column=\"ctime\" jdbcType=\"TIMESTAMP\" property=\"ctime\" />\n    <result column=\"utime\" jdbcType=\"TIMESTAMP\" property=\"utime\" />\n    <result column=\"stat\" jdbcType=\"TINYINT\" property=\"stat\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, creater, `name`, `desc`, systemcfg, price, discount, ctime, utime, stat\n  </sql>\n\n  <select id=\"selectAll\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n  </select>\n  <select id=\"selectById\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select \n    <include refid=\"Base_Column_List\" />\n    from game\n    where id = #{id,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectByPage\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    order by id asc limit #{startPos}, #{size}\n  </select>\n  <select id=\"selectByIds\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n    </where>\n  </select>\n  <select id=\"selectByIdsAndStat\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n      and stat = #{stat,jdbcType=TINYINT}\n    </where>\n  </select>\n  <select id=\"selectByIdsAndStatAndPage\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n      and stat = #{stat,jdbcType=TINYINT}\n    </where>\n    limit #{startPos}, #{size}\n  </select>\n  <select id=\"selectByStat\" parameterType=\"java.lang.Byte\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    where stat = #{stat,jdbcType=TINYINT}\n  </select>\n  <select id=\"selectNums\" resultType=\"java.lang.Integer\">\n    select count(*) from game\n  </select>\n  <select id=\"selectByStatOrderByDate\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    where stat = #{stat,jdbcType=TINYINT}\n    order by utime desc limit 5\n  </select>\n  <select id=\"selectByIdsAndInfo\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n      or name like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n      or creater like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n      or `desc` like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n    </where>\n  </select>\n  <select id=\"selectByInfo\" parameterType=\"java.lang.String\" resultMap=\"BaseResultMap\">\n    select <include refid=\"Base_Column_List\" />\n    from game\n    where name like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n    or creater like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n    or `desc` like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n  </select>\n  <select id=\"selectFreeGames\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from game where (price = 0 or discount = 0) and stat = 1\n  </select>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Game\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into game\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"creater != null\">\n        creater,\n      </if>\n      <if test=\"name != null\">\n        `name`,\n      </if>\n      <if test=\"desc != null\">\n        `desc`,\n      </if>\n      <if test=\"systemcfg != null\">\n        systemcfg,\n      </if>\n      <if test=\"price != null\">\n        price,\n      </if>\n      <if test=\"discount != null\">\n        discount,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"creater != null\">\n        #{creater,jdbcType=VARCHAR},\n      </if>\n      <if test=\"name != null\">\n        #{name,jdbcType=VARCHAR},\n      </if>\n      <if test=\"desc != null\">\n        #{desc,jdbcType=VARCHAR},\n      </if>\n      <if test=\"systemcfg != null\">\n        #{systemcfg,jdbcType=VARCHAR},\n      </if>\n      <if test=\"price != null\">\n        #{price,jdbcType=DOUBLE},\n      </if>\n      <if test=\"discount != null\">\n        #{discount,jdbcType=DOUBLE},\n      </if>\n    </trim>\n  </insert>\n\n  <update id=\"update\" parameterType=\"cn.cie.entity.Game\">\n    update game\n    <set>\n      <if test=\"creater != null\">\n        creater = #{creater,jdbcType=VARCHAR},\n      </if>\n      <if test=\"name != null\">\n        `name` = #{name,jdbcType=VARCHAR},\n      </if>\n      <if test=\"desc != null\">\n        `desc` = #{desc,jdbcType=VARCHAR},\n      </if>\n      <if test=\"systemcfg != null\">\n        systemcfg = #{systemcfg,jdbcType=VARCHAR},\n      </if>\n      <if test=\"price != null\">\n        price = #{price,jdbcType=DOUBLE},\n      </if>\n      <if test=\"discount != null\">\n        discount = #{discount,jdbcType=DOUBLE},\n      </if>\n      <if test=\"stat != null\">\n        stat = #{stat,jdbcType=TINYINT},\n      </if>\n    </set>\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/ImgMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.ImgMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Img\">\n    <result column=\"game\" jdbcType=\"INTEGER\" property=\"game\" />\n    <result column=\"img\" jdbcType=\"VARCHAR\" property=\"img\" />\n  </resultMap>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Img\">\n    insert into img\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"game != null\">\n        game,\n      </if>\n      <if test=\"img != null\">\n        img,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"game != null\">\n        #{game,jdbcType=INTEGER},\n      </if>\n      <if test=\"img != null\">\n        #{img,jdbcType=VARCHAR},\n      </if>\n    </trim>\n  </insert>\n  <insert id=\"insertBatch\" parameterType=\"list\">\n    insert into img (game, img)\n    values\n    <foreach collection=\"imgs\" item=\"img\" separator=\",\">\n      (#{game,jdbcType=INTEGER}, #{img})\n    </foreach>\n  </insert>\n\n  <select id=\"selectByGame\" parameterType=\"java.lang.Integer\" resultType=\"java.lang.String\">\n    select img from img where game = #{game,jdbcType=INTEGER}\n  </select>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/KindMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.KindMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Kind\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"name\" jdbcType=\"VARCHAR\" property=\"name\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, name\n  </sql>\n\n  <select id=\"selectById\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select \n    <include refid=\"Base_Column_List\" />\n    from kind\n    where id = #{id,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectAll\" resultType=\"cn.cie.entity.Kind\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from kind;\n  </select>\n  <select id=\"selectByIds\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from kind\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n    </where>\n  </select>\n  <select id=\"selectByName\" parameterType=\"java.lang.String\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from kind\n    where `name` = #{name,jdbcType=VARCHAR}\n  </select>\n  <select id=\"selectIdByLikeName\" parameterType=\"java.lang.String\" resultType=\"java.lang.Integer\">\n    select id from kind where name like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n  </select>\n\n  <delete id=\"delete\" parameterType=\"java.lang.Integer\">\n    delete from kind\n    where id = #{id,jdbcType=INTEGER}\n  </delete>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Kind\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into kind\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"name != null\">\n        name,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"name != null\">\n        #{name,jdbcType=VARCHAR},\n      </if>\n    </trim>\n  </insert>\n\n  <update id=\"updateByPrimaryKey\" parameterType=\"cn.cie.entity.Kind\">\n    update kind\n    set name = #{name,jdbcType=VARCHAR}\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/KindmapperMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.KindmapperMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Kindmapper\">\n    <result column=\"game\" jdbcType=\"INTEGER\" property=\"game\" />\n    <result column=\"kind\" jdbcType=\"INTEGER\" property=\"kind\" />\n  </resultMap>\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Kindmapper\">\n    insert into kindmapper (game, kind)\n    values (#{game,jdbcType=INTEGER}, #{kind,jdbcType=INTEGER})\n  </insert>\n  <insert id=\"insertKindBatch\" parameterType=\"list\">\n    insert into kindmapper (game, kind)\n    values\n    <foreach collection=\"kinds\" item=\"kind\" separator=\",\">\n      (#{game,jdbcType=INTEGER}, #{kind,jdbcType=INTEGER})\n    </foreach>\n  </insert>\n  <insert id=\"insertGameBatch\" parameterType=\"list\">\n    insert into kindmapper (kind, game)\n    values\n    <foreach collection=\"games\" item=\"game\" separator=\",\">\n      (#{kind,jdbcType=INTEGER}, #{game,jdbcType=INTEGER})\n    </foreach>\n  </insert>\n\n  <select id=\"selectByKind\" parameterType=\"java.lang.Integer\" resultType=\"java.lang.Integer\">\n    select game from kindmapper where kind = #{kind,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectByGame\" parameterType=\"java.lang.Integer\" resultType=\"java.lang.Integer\">\n    select kind from kindmapper where game = #{game,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectBatchByKinds\" parameterType=\"list\" resultType=\"java.lang.Integer\">\n    select game from kindmapper\n    <where>\n      kind in\n      <foreach collection=\"kinds\" item=\"kind\" separator=\",\" open=\"(\" close=\")\">\n        #{kind}\n      </foreach>\n    </where>\n  </select>\n\n  <delete id=\"deleteByGame\" parameterType=\"java.lang.Integer\">\n    delete from kindmapper where game = #{game,jdbcType=INTEGER}\n  </delete>\n  <delete id=\"deleteByKind\" parameterType=\"java.lang.Integer\">\n    delete from kindmapper where kind = #{kind,jdbcType=INTEGER}\n  </delete>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/OrderMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.OrderMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Order\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"uid\" jdbcType=\"INTEGER\" property=\"uid\" />\n    <result column=\"price\" jdbcType=\"DOUBLE\" property=\"price\" />\n    <result column=\"ctime\" jdbcType=\"TIMESTAMP\" property=\"ctime\" />\n    <result column=\"utime\" jdbcType=\"TIMESTAMP\" property=\"utime\" />\n    <result column=\"stat\" jdbcType=\"TINYINT\" property=\"stat\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, uid, price, ctime, utime, stat\n  </sql>\n\n  <select id=\"selectById\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select \n    <include refid=\"Base_Column_List\" />\n    from `order`\n    where id = #{id,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectByUidAndStat\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from `order`\n    where uid = #{uid,jdbcType=INTEGER}\n    and stat = #{stat,jdbcType=TINYINT}\n  </select>\n  <select id=\"selectByUidAndStatAndPage\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from `order`\n    where uid = #{uid,jdbcType=INTEGER}\n    and stat = #{stat,jdbcType=TINYINT}\n    order by id asc\n    limit #{startPos,jdbcType=INTEGER}, #{size,jdbcType=INTEGER}\n  </select>\n  <select id=\"getOrderNumsByUidAndStat\" resultType=\"java.lang.Integer\">\n    select count(id) from `order` where uid = #{uid,jdbcType=INTEGER} and stat = #{stat,jdbcType=TINYINT}\n  </select>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Order\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into `order`\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"uid != null\">\n        uid,\n      </if>\n      <if test=\"price != null\">\n        price,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"uid != null\">\n        #{uid,jdbcType=INTEGER},\n      </if>\n      <if test=\"price != null\">\n        #{price,jdbcType=DOUBLE},\n      </if>\n    </trim>\n  </insert>\n  <update id=\"update\" parameterType=\"cn.cie.entity.Order\">\n    update `order`\n    <set>\n      <if test=\"price != null\">\n        price = #{price,jdbcType=DOUBLE},\n      </if>\n      <if test=\"stat != null\">\n        stat = #{stat,jdbcType=TINYINT},\n      </if>\n    </set>\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n  <update id=\"updateStatByDate\">\n    update `order` set stat = #{newstat,jdbcType=TINYINT}\n    where stat = #{oldstat,jdbcType=TINYINT} and utime &lt; #{date,jdbcType=TIMESTAMP}\n  </update>\n\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/OrderitemMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.OrderitemMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Orderitem\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"gid\" jdbcType=\"INTEGER\" property=\"gid\" />\n    <result column=\"price\" jdbcType=\"DOUBLE\" property=\"price\" />\n    <result column=\"code\" jdbcType=\"INTEGER\" property=\"code\" />\n    <result column=\"ctime\" jdbcType=\"TIMESTAMP\" property=\"ctime\" />\n    <result column=\"utime\" jdbcType=\"TIMESTAMP\" property=\"utime\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, gid, price, code, ctime, utime\n  </sql>\n\n  <select id=\"selectByIds\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from orderitem\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n    </where>\n  </select>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Orderitem\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into orderitem\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"gid != null\">\n        gid,\n      </if>\n      <if test=\"price != null\">\n        price,\n      </if>\n      <if test=\"code != null\">\n        code,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"gid != null\">\n        #{gid,jdbcType=INTEGER},\n      </if>\n      <if test=\"price != null\">\n        #{price,jdbcType=DOUBLE},\n      </if>\n      <if test=\"code != null\">\n        #{code,jdbcType=INTEGER},\n      </if>\n    </trim>\n  </insert>\n\n  <update id=\"update\" parameterType=\"cn.cie.entity.Orderitem\">\n    update orderitem\n    <set>\n      <if test=\"price != null\">\n        price = #{price,jdbcType=DOUBLE},\n      </if>\n      <if test=\"code != null\">\n        code = #{code,jdbcType=INTEGER},\n      </if>\n    </set>\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/OrdermapperMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.OrdermapperMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Ordermapper\">\n    <result column=\"order\" jdbcType=\"INTEGER\" property=\"order\" />\n    <result column=\"item\" jdbcType=\"INTEGER\" property=\"item\" />\n  </resultMap>\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Ordermapper\">\n    insert into ordermapper (`order`, item)\n    values (#{order,jdbcType=INTEGER}, #{item,jdbcType=INTEGER})\n  </insert>\n  <select id=\"selectByOrder\" parameterType=\"java.lang.Integer\" resultType=\"java.lang.Integer\">\n    select item from `ordermapper` where `order` = #{order, jdbcType=INTEGER}\n  </select>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/TagMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.TagMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Tag\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"name\" jdbcType=\"VARCHAR\" property=\"name\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, name\n  </sql>\n\n  <select id=\"selectById\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select \n    <include refid=\"Base_Column_List\" />\n    from tag\n    where id = #{id,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectByIds\" parameterType=\"list\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from tag\n    <where>\n      id in\n      <foreach collection=\"ids\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n        #{id}\n      </foreach>\n    </where>\n  </select>\n  <select id=\"selectAll\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from tag\n  </select>\n  <select id=\"selectIdByLikeName\" parameterType=\"java.lang.String\" resultType=\"java.lang.Integer\">\n    select id from tag where name like CONCAT('%',#{info,jdbcType=VARCHAR},'%')\n  </select>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Tag\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into tag (id, name)\n    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})\n  </insert>\n\n  <update id=\"update\" parameterType=\"cn.cie.entity.Tag\">\n    update tag\n    <set>\n      <if test=\"name != null\">\n        name = #{name,jdbcType=VARCHAR},\n      </if>\n    </set>\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/TagmapperMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.TagmapperMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Tagmapper\">\n    <result column=\"game\" jdbcType=\"INTEGER\" property=\"game\" />\n    <result column=\"tag\" jdbcType=\"INTEGER\" property=\"tag\" />\n  </resultMap>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Tagmapper\">\n    insert into tagmapper (game, tag)\n    values (#{game,jdbcType=INTEGER}, #{tag,jdbcType=INTEGER})\n  </insert>\n\n  <select id=\"selectByTag\" parameterType=\"java.lang.Integer\" resultType=\"java.lang.Integer\">\n    select game from tagmapper where tag = #{tag,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectByGame\" parameterType=\"java.lang.Integer\" resultType=\"java.lang.Integer\">\n    select tag from tagmapper where game = #{game,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectBatchByTags\" parameterType=\"list\" resultType=\"java.lang.Integer\">\n    select game from tagmapper\n    <where>\n      tag in\n      <foreach collection=\"tags\" item=\"tag\" separator=\",\" open=\"(\" close=\")\">\n        #{tag}\n      </foreach>\n    </where>\n  </select>\n\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/TokenMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.TokenMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.Token\">\n    <result column=\"uid\" jdbcType=\"INTEGER\" property=\"uid\" />\n    <result column=\"token\" jdbcType=\"VARCHAR\" property=\"token\" />\n    <result column=\"expired_time\" jdbcType=\"TIMESTAMP\" property=\"expiredTime\" />\n    <result column=\"ip\" jdbcType=\"VARCHAR\" property=\"ip\" />\n    <result column=\"device\" jdbcType=\"VARCHAR\" property=\"device\" />\n    <result column=\"ctime\" jdbcType=\"TIMESTAMP\" property=\"ctime\" />\n    <result column=\"stat\" jdbcType=\"TINYINT\" property=\"stat\" />\n  </resultMap>\n\n  <sql id=\"Base_Column_List\">\n    uid, token, expired_time, device, ctime, stat\n  </sql>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.Token\">\n    insert into token\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"uid != null\">\n        uid,\n      </if>\n      <if test=\"token != null\">\n        token,\n      </if>\n      <if test=\"expiredTime != null\">\n        expired_time,\n      </if>\n      <if test=\"ip != null\">\n        ip,\n      </if>\n      <if test=\"device != null\">\n        device,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"uid != null\">\n        #{uid,jdbcType=INTEGER},\n      </if>\n      <if test=\"token != null\">\n        #{token,jdbcType=VARCHAR},\n      </if>\n      <if test=\"expiredTime != null\">\n        #{expiredTime,jdbcType=TIMESTAMP},\n      </if>\n      <if test=\"ip != null\">\n        #{ip,jdbcType=VARCHAR},\n      </if>\n      <if test=\"device != null\">\n        #{device,jdbcType=VARCHAR},\n      </if>\n    </trim>\n  </insert>\n\n  <select id=\"selectByToken\" parameterType=\"java.lang.String\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from token\n    where token = #{token,jdbcType=VARCHAR}\n  </select>\n  <select id=\"selectByTokenAndStat\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from token\n    where token = #{token,jdbcType=VARCHAR} and stat = #{stat,jdbcType=TINYINT}\n  </select>\n  <select id=\"selectByUid\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from token\n    where uid = #{uid,jdbcType=INTEGER}\n  </select>\n\n  <update id=\"updateStatByDate\">\n    update token set stat = #{stat,jdbcType=TINYINT}\n    where expired_time &lt; #{date,jdbcType=TIMESTAMP}\n  </update>\n  <update id=\"updateStatByToken\">\n    update token set stat = #{stat,jdbcType=TINYINT} where token = #{token,jdbcType=VARCHAR}\n  </update>\n</mapper>"
  },
  {
    "path": "src/main/resources/mapper/UserMapper.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"cn.cie.mapper.UserMapper\">\n  <resultMap id=\"BaseResultMap\" type=\"cn.cie.entity.User\">\n    <id column=\"id\" jdbcType=\"INTEGER\" property=\"id\" />\n    <result column=\"username\" jdbcType=\"VARCHAR\" property=\"username\" />\n    <result column=\"password\" jdbcType=\"VARCHAR\" property=\"password\" />\n    <result column=\"nickname\" jdbcType=\"VARCHAR\" property=\"nickname\" />\n    <result column=\"email\" jdbcType=\"VARCHAR\" property=\"email\" />\n    <result column=\"phone\" jdbcType=\"BIGINT\" property=\"phone\" />\n    <result column=\"ctime\" jdbcType=\"TIMESTAMP\" property=\"ctime\" />\n    <result column=\"utime\" jdbcType=\"TIMESTAMP\" property=\"utime\" />\n    <result column=\"stat\" jdbcType=\"TINYINT\" property=\"stat\" />\n  </resultMap>\n  <sql id=\"Base_Column_List\">\n    id, username, password, nickname, email, phone, ctime, utime, stat\n  </sql>\n  <sql id=\"Columns_Without_Pwd\">\n    id, username, nickname, email, phone, ctime, utime, stat\n  </sql>\n\n  <select id=\"selectById\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select \n    <include refid=\"Base_Column_List\" />\n    from user\n    where id = #{id,jdbcType=INTEGER}\n  </select>\n  <select id=\"selectByName\" parameterType=\"java.lang.String\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from user\n    where username = #{username,jdbcType=VARCHAR}\n  </select>\n  <select id=\"selectByEmail\" parameterType=\"java.lang.String\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Base_Column_List\" />\n    from user\n    where email = #{email,jdbcType=VARCHAR}\n  </select>\n  <select id=\"selectByStat\" parameterType=\"java.lang.Byte\" resultMap=\"BaseResultMap\">\n    select id, ctime from user where stat = #{stat,jdbcType=TINYINT}\n  </select>\n  <select id=\"selectByPage\" parameterType=\"java.lang.Integer\" resultMap=\"BaseResultMap\">\n    select\n    <include refid=\"Columns_Without_Pwd\" />\n    from user where id != 1\n    order by id asc limit #{startPos}, #{size}\n  </select>\n  <select id=\"selectAllNums\" resultType=\"java.lang.Integer\">\n    select count(id) from user where id != 1;\n  </select>\n\n  <insert id=\"insert\" parameterType=\"cn.cie.entity.User\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n    insert into user\n    <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"username != null\">\n        username,\n      </if>\n      <if test=\"password != null\">\n        password,\n      </if>\n      <if test=\"nickname != null\">\n        nickname,\n      </if>\n      <if test=\"email != null\">\n        email,\n      </if>\n      <if test=\"phone != null\">\n        phone,\n      </if>\n    </trim>\n    <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\">\n      <if test=\"username != null\">\n        #{username,jdbcType=VARCHAR},\n      </if>\n      <if test=\"password != null\">\n        #{password,jdbcType=VARCHAR},\n      </if>\n      <if test=\"nickname != null\">\n        #{nickname,jdbcType=VARCHAR},\n      </if>\n      <if test=\"email != null\">\n        #{email,jdbcType=VARCHAR},\n      </if>\n      <if test=\"phone != null\">\n        #{phone,jdbcType=BIGINT},\n      </if>\n    </trim>\n  </insert>\n\n  <update id=\"update\" parameterType=\"cn.cie.entity.User\">\n    update user\n    <set>\n      <if test=\"password != null\">\n        password = #{password,jdbcType=VARCHAR},\n      </if>\n      <if test=\"nickname != null\">\n        nickname = #{nickname,jdbcType=VARCHAR},\n      </if>\n      <if test=\"email != null\">\n        email = #{email,jdbcType=VARCHAR},\n      </if>\n      <if test=\"phone != null\">\n        phone = #{phone,jdbcType=BIGINT},\n      </if>\n      <if test=\"stat != null\">\n        stat = #{stat,jdbcType=TINYINT},\n      </if>\n    </set>\n    where id = #{id,jdbcType=INTEGER}\n  </update>\n\n  <delete id=\"deleteById\" parameterType=\"java.lang.Integer\">\n    delete from user where id = #{id,jdbcType=INTEGER}\n  </delete>\n\n</mapper>"
  },
  {
    "path": "src/main/resources/mybatis-config.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE configuration\n        PUBLIC \"-//mybatis.org//DTD Config 3.0//EN\"\n        \"http://mybatis.org/dtd/mybatis-3-config.dtd\">\n<configuration>\n    <!--settings要放在typeAliases前边-->\n    <settings>\n        <setting name=\"useGeneratedKeys\" value=\"true\" />\n        <setting name=\"cacheEnabled\" value=\"true\" />\n        <setting name=\"defaultStatementTimeout\" value=\"3000\"/>\n        <!--是否使用驼峰转换-->\n        <setting name=\"mapUnderscoreToCamelCase\" value=\"true\"/>\n        <!--<setting name=\"logImpl\" value=\"STDOUT_LOGGING\" />-->\n    </settings>\n    <typeAliases>\n        <package name=\"cn.cie.entity\" />\n    </typeAliases>\n</configuration>"
  },
  {
    "path": "src/main/resources/schema.sql",
    "content": "CREATE DATABASE IF NOT EXISTS `shop` DEFAULT CHARACTER SET UTF8;\nCREATE TABLE IF NOT EXISTS `shop`.`user` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT '用户ID' ,\n  `username` VARCHAR(50) NOT NULL COMMENT '用户名' ,\n  `password` VARCHAR(50) NOT NULL COMMENT '密码(加盐并加密)' ,\n  `nickname` VARCHAR(50) NOT NULL COMMENT '昵称' ,\n  `email` VARCHAR(50) NOT NULL COMMENT '注册邮箱' ,\n  `phone` BIGINT(11) DEFAULT NULL COMMENT '手机号码' ,\n  `ctime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,\n  `utime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' ,\n  `stat` TINYINT NOT NULL DEFAULT 0 COMMENT '用户状态，0为正常，1为未验证，2为受限，3为删除' ,\n  PRIMARY KEY (`id`),\n  INDEX `name`(`username`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '用户表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`token` (\n  `uid` INT NOT NULL COMMENT '用户ID' ,\n  `token` VARCHAR(36) NOT NULL COMMENT 'token' ,\n  `expired_time` TIMESTAMP NOT NULL COMMENT '过期时间' ,\n  `ip` VARCHAR(15) NOT NULL DEFAULT \"\" COMMENT '访问者IP' ,\n  `device` VARCHAR(150) NOT NULL DEFAULT \"\" COMMENT '登录的设备' ,\n  `ctime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '登录时间' ,\n  `stat` TINYINT NOT NULL DEFAULT 0 COMMENT '0表示正常，1表示已过期' ,\n  UNIQUE INDEX`token_index`(`token`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT 'token表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`game` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID' ,\n  `creater` VARCHAR(50) NOT NULL COMMENT '开发者',\n  `name` VARCHAR(100) NOT NULL COMMENT '游戏名字' ,\n  `desc` VARCHAR(500) NOT NULL COMMENT '游戏描述' ,\n  `systemcfg` VARCHAR(500) NOT NULL COMMENT '系统配置要求',\n  `price` DOUBLE NOT NULL COMMENT '正常价格',\n  `discount` DOUBLE DEFAULT NULL COMMENT '打折后价格',\n  `ctime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,\n  `utime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上架时间' ,\n  `stat` TINYINT NOT NULL DEFAULT 0 COMMENT '状态，0为未上架，1为已上架，2为已下架' ,\n  PRIMARY KEY (`id`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '游戏表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`img` (\n  `game` INT NOT NULL COMMENT '游戏ID',\n  `img` VARCHAR(50) NOT NULL COMMENT '图片路径'\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '游戏图片映射表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`code` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID' ,\n  `item` INT NOT NULL COMMENT '订单项ID' ,\n  `uid` INT NOT NULL COMMENT '用户ID',\n  `code` VARCHAR(50) NOT NULL COMMENT '激活码',\n  `stat` TINYINT NOT NULL DEFAULT 0 COMMENT '激活码状态，0表示未使用，1表示已使用',\n  PRIMARY KEY (`id`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '激活码';\n\nCREATE TABLE IF NOT EXISTS `shop`.`order` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID' ,\n  `uid` INT NOT NULL COMMENT '购买者ID' ,\n  `price` DOUBLE NOT NULL DEFAULT 0 COMMENT '订单总价',\n  `ctime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,\n  `utime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' ,\n  `stat` TINYINT NOT NULL DEFAULT 0 COMMENT '订单状态，0为未支付，1为已支付，2为取消订单' ,\n  PRIMARY KEY (`id`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '订单表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`orderitem` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID' ,\n  `gid` INT NOT NULL COMMENT '游戏id',\n  `price` DOUBLE NOT NULL COMMENT '购买时价格',\n  `code` INT DEFAULT NULL COMMENT '激活码' ,\n  `ctime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,\n  `utime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' ,\n  PRIMARY KEY (`id`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '每个订单对应的订单详细内容';\n\nCREATE TABLE IF NOT EXISTS `shop`.`ordermapper` (\n  `order` INT NOT NULL COMMENT '订单ID',\n  `item` INT NOT NULL COMMENT '订单详情ID'\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '订单-订单详情项映射表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`kind` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT '种类ID',\n  `name` VARCHAR(10) NOT NULL COMMENT '种类名字',\n  PRIMARY KEY (`id`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '游戏种类表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`kindmapper` (\n  `game` INT NOT NULL COMMENT '游戏ID',\n  `kind` INT NOT NULL COMMENT '游戏种类ID'\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '游戏-种类详情项映射表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`tag` (\n  `id` INT NOT NULL AUTO_INCREMENT COMMENT '标签ID',\n  `name` VARCHAR(10) NOT NULL COMMENT '标签名字',\n  PRIMARY KEY (`id`)\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '游戏标签表';\n\nCREATE TABLE IF NOT EXISTS `shop`.`tagmapper` (\n  `game` INT NOT NULL COMMENT '游戏ID',\n  `tag` INT NOT NULL COMMENT '标签ID'\n) ENGINE = InnoDB DEFAULT CHARSET = UTF8 COMMENT '游戏-标签映射表';"
  },
  {
    "path": "src/main/resources/spring-dao.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n       xmlns:jdbc=\"http://www.springframework.org/schema/jdbc\"\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\n       http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd\"\n>\n       <!-- 引入配置文件 -->\n       <bean id=\"propertyConfigurer\" class=\"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer\">\n              <property name=\"location\" value=\"classpath:jdbc.properties\" />\n       </bean>\n       <!-- 数据库配置 -->\n       <bean id=\"dataSource\" class=\"org.apache.commons.dbcp.BasicDataSource\" destroy-method=\"close\">\n              <property name=\"driverClassName\" value=\"${jdbc.driver}\" />\n              <property name=\"url\" value=\"${jdbc.url}\" />\n              <property name=\"username\" value=\"${jdbc.username}\" />\n              <property name=\"password\" value=\"${jdbc.password}\" />\n              <property name=\"initialSize\" value=\"${jdbc.initialSize}\" />\n              <property name=\"maxActive\" value=\"${jdbc.maxActive}\" />\n              <property name=\"maxIdle\" value=\"${jdbc.maxIdle}\" />\n              <property name=\"minIdle\" value=\"${jdbc.minIdle}\" />\n              <property name=\"maxWait\" value=\"${jdbc.maxWait}\" />\n       </bean>\n       <!-- 初始化时执行sql语句创建数据库 -->\n       <jdbc:initialize-database data-source=\"dataSource\" ignore-failures=\"NONE\">\n              <jdbc:script location=\"classpath:schema.sql\"/>\n       </jdbc:initialize-database>\n       <!-- spring和MyBatis整合 -->\n       <bean id=\"sqlSessionFactory\" class=\"org.mybatis.spring.SqlSessionFactoryBean\">\n              <property name=\"dataSource\" ref=\"dataSource\" />\n              <!-- MyBatis的配置文件 -->\n              <property name=\"configLocation\" value=\"classpath:mybatis-config.xml\" />\n              <property name=\"mapperLocations\" value=\"classpath:mapper/*.xml\" />\n       </bean>\n       <!-- mapper批量扫描 -->\n       <bean class=\"org.mybatis.spring.mapper.MapperScannerConfigurer\">\n              <property name=\"basePackage\" value=\"cn.cie.mapper\" />\n              <property name=\"sqlSessionFactoryBeanName\" value=\"sqlSessionFactory\"></property>\n       </bean>\n</beans>"
  },
  {
    "path": "src/main/resources/spring-mvc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n       xmlns:mvc=\"http://www.springframework.org/schema/mvc\"\n       xmlns:context=\"http://www.springframework.org/schema/context\"\n       xmlns:aop=\"http://www.springframework.org/schema/aop\"\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\n       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd\n       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd\n       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd\">\n\n    <mvc:annotation-driven />\n    <mvc:default-servlet-handler />\n    <mvc:interceptors>\n        <!--根据token获取用户信息-->\n        <bean class=\"cn.cie.interceptor.AuthInterceptor\" />\n        <!--用户登录拦截-->\n        <mvc:interceptor>\n            <mvc:mapping path=\"/user/*\" />\n            <mvc:mapping path=\"/order/*\"/>\n            <mvc:exclude-mapping path=\"/user/findpassword\" />\n            <mvc:exclude-mapping path=\"/user/sendfetchpwdmail\" />\n            <bean class=\"cn.cie.interceptor.LoginInterceptor\" />\n        </mvc:interceptor>\n        <!--管理员登陆拦截-->\n        <mvc:interceptor>\n            <mvc:mapping path=\"/admin/*\"/>\n            <mvc:exclude-mapping path=\"/admin/login\"/>\n            <bean class=\"cn.cie.interceptor.AdminInterceptor\" />\n        </mvc:interceptor>\n    </mvc:interceptors>\n    <mvc:resources mapping=\"/img/**\" location=\"WEB-INF/image/\" />\n    <mvc:resources mapping=\"/css/**\" location=\"WEB-INF/css/\" />\n    <mvc:resources mapping=\"/js/**\" location=\"WEB-INF/js/\" />\n    <context:component-scan base-package=\"cn.cie.controller, cn.cie.aop\" />\n    <bean class=\"org.springframework.web.servlet.view.InternalResourceViewResolver\" >\n        <property name=\"viewClass\" value=\"org.springframework.web.servlet.view.JstlView\" />\n        <property name=\"prefix\" value=\"/WEB-INF/jsp/\" />\n        <property name=\"suffix\" value=\".jsp\" />\n    </bean>\n    <!--文件上传-->\n    <bean id=\"multipartResolver\" class=\"org.springframework.web.multipart.commons.CommonsMultipartResolver\">\n        <property name=\"defaultEncoding\" value=\"UTF-8\" />\n        <property name=\"maxUploadSizePerFile\" value=\"1024000\" />\n    </bean>\n\n    <aop:aspectj-autoproxy proxy-target-class=\"true\"/>\n\n</beans>"
  },
  {
    "path": "src/main/resources/spring-service.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n       xmlns:context=\"http://www.springframework.org/schema/context\"\n       xmlns:tx=\"http://www.springframework.org/schema/tx\"\n       xmlns:task=\"http://www.springframework.org/schema/task\"\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\n       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd\n       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd\n       http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd\">\n\n    <!-- 配置事务管理器 -->\n    <bean id=\"transactionManager\" class=\"org.springframework.jdbc.datasource.DataSourceTransactionManager\">\n        <property name=\"dataSource\" ref=\"dataSource\" />\n    </bean>\n\n    <!--配置基于注解的声明式事务-->\n    <tx:annotation-driven transaction-manager=\"transactionManager\" />\n    <!--开启定时任务注解扫描-->\n    <task:annotation-driven />\n    <!--指定要扫描的包-->\n    <context:component-scan base-package=\"cn.cie.services, cn.cie.schedule, cn.cie.utils, cn.cie.event\" />\n\n</beans>"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/adminlogin.css",
    "content": "html {\n    font-family: sans-serif;\n    -ms-text-size-adjust: 100%;\n    -webkit-text-size-adjust: 100%\n}\n\nbody {\n    margin: 0\n}\n\narticle, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {\n    display: block\n}\n\naudio, canvas, progress, video {\n    display: inline-block;\n    vertical-align: baseline\n}\n\naudio:not([controls]) {\n    display: none;\n    height: 0\n}\n\n[hidden], template {\n    display: none\n}\n\na {\n    background-color: transparent\n}\n\na:active, a:hover {\n    outline: 0\n}\n\nabbr[title] {\n    border-bottom: 1px dotted\n}\n\nb, strong {\n    font-weight: bold\n}\n\ndfn {\n    font-style: italic\n}\n\nh1 {\n    font-size: 2em;\n    margin: 0.67em 0\n}\n\nmark {\n    background: #ff0;\n    color: #000\n}\n\nsmall {\n    font-size: 80%\n}\n\nsub, sup {\n    font-size: 75%;\n    line-height: 0;\n    position: relative;\n    vertical-align: baseline\n}\n\nsup {\n    top: -0.5em\n}\n\nsub {\n    bottom: -0.25em\n}\n\nimg {\n    border: 0\n}\n\nsvg:not(:root) {\n    overflow: hidden\n}\n\nfigure {\n    margin: 1em 40px\n}\n\nhr {\n    -moz-box-sizing: content-box;\n    -webkit-box-sizing: content-box;\n    box-sizing: content-box;\n    height: 0\n}\n\npre {\n    overflow: auto\n}\n\ncode, kbd, pre, samp {\n    font-family: monospace, monospace;\n    font-size: 1em\n}\n\nbutton, input, optgroup, select, textarea {\n    color: inherit;\n    font: inherit;\n    margin: 0\n}\n\nbutton {\n    overflow: visible\n}\n\nbutton, select {\n    text-transform: none\n}\n\nbutton, html input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"] {\n    -webkit-appearance: button;\n    cursor: pointer\n}\n\nbutton[disabled], html input[disabled] {\n    cursor: default\n}\n\nbutton::-moz-focus-inner, input::-moz-focus-inner {\n    border: 0;\n    padding: 0\n}\n\ninput {\n    line-height: normal\n}\n\ninput[type=\"checkbox\"], input[type=\"radio\"] {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    padding: 0\n}\n\ninput[type=\"number\"]::-webkit-inner-spin-button, input[type=\"number\"]::-webkit-outer-spin-button {\n    height: auto\n}\n\ninput[type=\"search\"] {\n    -webkit-appearance: textfield;\n    -moz-box-sizing: content-box;\n    -webkit-box-sizing: content-box;\n    box-sizing: content-box\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button, input[type=\"search\"]::-webkit-search-decoration {\n    -webkit-appearance: none\n}\n\nfieldset {\n    border: 1px solid #c0c0c0;\n    margin: 0 2px;\n    padding: 0.35em 0.625em 0.75em\n}\n\nlegend {\n    border: 0;\n    padding: 0\n}\n\ntextarea {\n    overflow: auto\n}\n\noptgroup {\n    font-weight: bold\n}\n\ntable {\n    border-collapse: collapse;\n    border-spacing: 0\n}\n\ntd, th {\n    padding: 0\n}\n\n.btn {\n    display: inline-block;\n    *display: inline;\n    *zoom: 1;\n    padding: 4px 10px 4px;\n    margin-bottom: 0;\n    font-size: 13px;\n    line-height: 18px;\n    color: #333333;\n    text-align: center;\n    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);\n    vertical-align: middle;\n    background-color: #f5f5f5;\n    background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);\n    background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);\n    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));\n    background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);\n    background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);\n    background-image: linear-gradient(top, #ffffff, #e6e6e6);\n    background-repeat: repeat-x;\n    filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffffff, endColorstr=#e6e6e6, GradientType=0);\n    border-color: #e6e6e6 #e6e6e6 #e6e6e6;\n    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);\n    border: 1px solid #e6e6e6;\n    -webkit-border-radius: 4px;\n    -moz-border-radius: 4px;\n    border-radius: 4px;\n    -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n    -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n    cursor: pointer;\n    *margin-left: .3em;\n}\n\n.btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {\n    background-color: #e6e6e6;\n}\n\n.btn-large {\n    padding: 9px 14px;\n    font-size: 15px;\n    line-height: normal;\n    -webkit-border-radius: 5px;\n    -moz-border-radius: 5px;\n    border-radius: 5px;\n}\n\n.btn:hover {\n    color: #333333;\n    text-decoration: none;\n    background-color: #e6e6e6;\n    background-position: 0 -15px;\n    -webkit-transition: background-position 0.1s linear;\n    -moz-transition: background-position 0.1s linear;\n    -ms-transition: background-position 0.1s linear;\n    -o-transition: background-position 0.1s linear;\n    transition: background-position 0.1s linear;\n}\n\n.btn-primary, .btn-primary:hover {\n    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n    color: #ffffff;\n}\n\n.btn-primary.active {\n    color: rgba(255, 255, 255, 0.75);\n}\n\n.btn-primary {\n    background-color: #4a77d4;\n    background-image: -moz-linear-gradient(top, #6eb6de, #4a77d4);\n    background-image: -ms-linear-gradient(top, #6eb6de, #4a77d4);\n    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#6eb6de), to(#4a77d4));\n    background-image: -webkit-linear-gradient(top, #6eb6de, #4a77d4);\n    background-image: -o-linear-gradient(top, #6eb6de, #4a77d4);\n    background-image: linear-gradient(top, #6eb6de, #4a77d4);\n    background-repeat: repeat-x;\n    filter: progid:dximagetransform.microsoft.gradient(startColorstr=#6eb6de, endColorstr=#4a77d4, GradientType=0);\n    border: 1px solid #3762bc;\n    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);\n    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.5);\n}\n\n.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] {\n    filter: none;\n    background-color: #4a77d4;\n}\n\n.btn-block {\n    width: 100%;\n    display: block;\n}\n\n* {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    -ms-box-sizing: border-box;\n    -o-box-sizing: border-box;\n    box-sizing: border-box;\n}\n\nhtml {\n    width: 100%;\n    height: 100%;\n    overflow: hidden;\n}\n\nbody {\n    width: 100%;\n    height: 100%;\n    font-family: 'Open Sans', sans-serif;\n    background: #092756;\n    background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(104, 128, 138, .4) 10%, rgba(138, 114, 76, 0) 40%), -moz-linear-gradient(top, rgba(57, 173, 219, .25) 0%, rgba(42, 60, 87, .4) 100%), -moz-linear-gradient(-45deg, #670d10 0%, #092756 100%);\n    background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104, 128, 138, .4) 10%, rgba(138, 114, 76, 0) 40%), -webkit-linear-gradient(top, rgba(57, 173, 219, .25) 0%, rgba(42, 60, 87, .4) 100%), -webkit-linear-gradient(-45deg, #670d10 0%, #092756 100%);\n    background: -o-radial-gradient(0% 100%, ellipse cover, rgba(104, 128, 138, .4) 10%, rgba(138, 114, 76, 0) 40%), -o-linear-gradient(top, rgba(57, 173, 219, .25) 0%, rgba(42, 60, 87, .4) 100%), -o-linear-gradient(-45deg, #670d10 0%, #092756 100%);\n    background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(104, 128, 138, .4) 10%, rgba(138, 114, 76, 0) 40%), -ms-linear-gradient(top, rgba(57, 173, 219, .25) 0%, rgba(42, 60, 87, .4) 100%), -ms-linear-gradient(-45deg, #670d10 0%, #092756 100%);\n    background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104, 128, 138, .4) 10%, rgba(138, 114, 76, 0) 40%), linear-gradient(to bottom, rgba(57, 173, 219, .25) 0%, rgba(42, 60, 87, .4) 100%), linear-gradient(135deg, #670d10 0%, #092756 100%);\n    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3E1D6D', endColorstr='#092756', GradientType=1);\n}\n\n.login {\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    margin: -150px 0 0 -150px;\n    width: 300px;\n    height: 300px;\n}\n\n.login h1 {\n    color: #fff;\n    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);\n    letter-spacing: 1px;\n    text-align: center;\n}\n\ninput {\n    width: 100%;\n    margin-bottom: 10px;\n    background: rgba(0, 0, 0, 0.3);\n    border: none;\n    outline: none;\n    padding: 10px;\n    font-size: 13px;\n    color: #fff;\n    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);\n    border: 1px solid rgba(0, 0, 0, 0.3);\n    border-radius: 4px;\n    box-shadow: inset 0 -5px 45px rgba(100, 100, 100, 0.2), 0 1px 1px rgba(255, 255, 255, 0.2);\n    -webkit-transition: box-shadow .5s ease;\n    -moz-transition: box-shadow .5s ease;\n    -o-transition: box-shadow .5s ease;\n    -ms-transition: box-shadow .5s ease;\n    transition: box-shadow .5s ease;\n}\n\ninput:focus {\n    box-shadow: inset 0 -5px 45px rgba(100, 100, 100, 0.4), 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/adminpage.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\nhtml, body, div, p, form, label, ul, li, dl, dt, dd, ol, img, button, h1, h2, h3, h4, h5, h6, b, em, strong, small {\n    margin: 0;\n    padding: 0;\n    border: 0;\n    list-style: none;\n    font-style: normal;\n    font-weight: normal;\n}\n\ndl, dt, dd {\n    display: block;\n    margin: 0;\n}\n\na {\n    text-decoration: none;\n}\n\nbody {\n    font-family: Microsoft YaHei, Verdana, Arial, SimSun;\n    color: #666;\n    font-size: 14px;\n    background: #f6f6f6;\n    overflow: hidden\n}\n\n.block, #block {\n    display: block;\n}\n\n.none, #none {\n    display: none;\n}\n\n/*****头部和尾部******/\n.top {\n    height: 5px;\n    line-height: 5px;\n    background: #f6f6f6;\n    width: 100%;\n    position: fixed;\n    z-index: 255;\n    top: 79px;\n    text-align: center;\n}\n\n.bottom {\n    height: 5px;\n    line-height: 5px;\n    background: #f6f6f6;\n    width: 100%;\n    position: fixed;\n    z-index: 255;\n    bottom: 50px;\n    text-align: center;\n}\n\n#header {\n    height: 80px;\n    line-height: 80px;\n    background: #00a5a5;\n    width: 100%;\n    position: absolute;\n    z-index: 5;\n    top: 0;\n    text-align: center;\n}\n\n.logo {\n    line-height: 80px;\n    font-size: 30px;\n    color: #fff;\n    letter-spacing: 3px;\n    margin-left: 50px;\n    float: left;\n}\n\n.navigation {\n    float: right;\n    margin: 5px 50px 0 0;\n    color: #fff;\n    font-size: 14px;\n}\n\n.navigation ul li {\n    height: 30px;\n    line-height: 30px;\n    text-align: center;\n    float: left;\n    margin-left: 15px;\n}\n\n.navigation ul li a {\n    color: #fff;\n}\n\n.navigation ul li a:hover {\n    color: #32323a;\n}\n\n#footer {\n    height: 50px;\n    line-height: 50px;\n    background: #5e5e5e;\n    width: 100%;\n    position: absolute;\n    z-index: 200;\n    bottom: 0;\n    text-align: center;\n}\n\n#footer p {\n    text-align: center;\n    line-height: 50px;\n    color: #fbfbfb;\n}\n\n/*****主体部分******/\n#content {\n    width: 100%;\n    top: 80px;\n    position: absolute;\n    z-index: 10;\n    bottom: 50px;\n    overflow-y: auto;\n}\n\n/**左侧菜单***/\n.left_menu {\n    float: left;\n    width: 300px;\n    background: #32323a;\n    height: 120%;\n    position: absolute;\n    top: 0;\n    left: 0;\n    overflow: auto;\n    border-left: 5px solid #f6f6f6;\n}\n\n.left_menu ul li {\n    width: 300px;\n    display: inline;\n}\n\n.left_menu ul li .list-item a {\n    width: 230px;\n    padding-left: 110px;\n    text-decoration: none;\n    font-size: 14px;\n    color: #f5f5f5;\n    line-height: 30px;\n    display: block;\n}\n\n.left_menu ul li a.noline {\n    border-bottom: none;\n}\n\n.left_menu ul li a:hover {\n    color: #fff;\n}\n\n.left_menu ul li a.selected:hover {\n    color: #fff;\n}\n\n.left_menu ul li h4 {\n    cursor: pointer;\n    background: url(/img/static/bg1.png) no-repeat 270px 18px;\n    padding-left: 60px;\n    text-decoration: none;\n    font-size: 16px;\n    color: #f5f5f5;\n    display: block;\n    line-height: 48px;\n    font-weight: normal;\n}\n\n.left_menu ul li.noline {\n    border-bottom: none;\n}\n\n.left_menu ul li.selected h4 {\n    background-position: 270px -45px;\n    background-color: #00a5a5;\n}\n\n.left_menu li .list-item {\n    padding: 5px 0;\n    position: relative;\n    zoom: 1;\n    background: #11b6b6;\n    overflow: hidden;\n}\n\n.left_menu h4 span {\n    display: block;\n    float: left;\n    width: 20px;\n    height: 26px;\n    margin-right: 10px;\n    padding-right: 10px;\n    background-repeat: no-repeat;\n    margin-top: 12px;\n}\n\n.M1 span {\n    background: url(/img/static/ioc.png) 0 -6px;\n}\n\n.M2 span {\n    background: url(/img/static/ioc.png) -36px -6px;\n}\n\n.M3 span {\n    background: url(/img/static/ioc.png) -72px -6px;\n}\n\n.M4 span {\n    background: url(/img/static/ioc.png) -36px -40px;\n}\n\n.M5 span {\n    background: url(/img/static/ioc.png) -72px -40px;\n}\n\n.M6 span {\n    background: url(/img/static/ioc.png) -1px -40px;\n}\n\n.M7 span {\n    background: url(/img/static/ioc.png) -1px -70px;\n}\n\n.M8 span {\n    background: url(/img/static/ioc.png) -36px -70px;\n}\n\n.M9 span {\n    background: url(/img/static/ioc.png) -72px -70px;\n}\n\n.M10 span {\n    background: url(/img/static/ioc.png) -3px -105px;\n}\n\n/***右侧内容****/\n.m-right {\n    margin-left: 300px;\n    height: 100%;\n}\n\n.right-nav {\n    height: 50px;\n    border-bottom: 1px solid #d1d1d1;\n    background: #f6f6f6;\n}\n\n.right-nav li {\n    float: left;\n    margin-left: 5px;\n    line-height: 50px;\n    color: #464646;\n    font-size: 14px;\n}\n\n.right-nav li img {\n    position: relative;\n    top: 17px;\n    left: 15px;\n}\n\n.right-nav li a {\n    color: #464646;\n}\n\n.right-nav li a:hover {\n    color: #00a5a5;\n    text-decoration: underline;\n}\n\nmain {\n    width: 100%;\n    height: 100%;\n    background: #f6f6f6;\n    overflow: auto;\n}\n\n.yema li {\n    display: inline;\n}\n\n.btn {\n    margin-left: 5px;\n    background: #00a5a5;\n}\n\ntr td {\n    text-align: center;\n}\n\ntr th {\n    text-align: center;\n}\n\n.divsetcenter {\n    margin-left: 30%;\n}\n\n.setmargin {\n    margin-left: 1%;\n    margin-top: 1%;\n}\n\n.setmargin_0 {\n    margin-top: 200px;\n}\n\n#right_0 {\n    display: none;\n}\n\n#right_1 {\n    display: none;\n}\n\n#right_2 {\n    display: none;\n}\n\n#right_3 {\n    display: none;\n}\n\n.modal-backdrop {\n    position: static;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    z-index: 1040;\n    background-color: #000;\n}\n\n.inputmargin_1 {\n    margin-left: 10px;\n}\n\n.inputmargin_2 {\n    margin-left: 20px;\n}\n\ninput, textarea {\n    display: inline-block;\n    margin-right: 3px;\n    vertical-align: middle;\n}\n\n#kindgame {\n    height: 200px;\n    overflow-y: scroll;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/base.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\n\nbody {\n    background-color: #183F59;\n}\n\n.headheight {\n    padding-top: 20px;\n    padding-bottom: 10px;\n}\n\n.headmid {\n    margin-left: 500px;\n    margin-top: 100px;\n}\n\n.nav navbar-nav navbar-right {\n    padding: 0px;\n    margin: 0px;\n    font-size: 30px;\n}\n\n.form-control {\n    background-color: #316282;\n    border: 0px;\n    color: #FFF;\n}\n\n.btn {\n    background-color: #316282;\n    border: 0px;\n    padding: 9px 12px;\n}\n\n.daohangyanse {\n    background-color: #356F95;\n    border: none;\n\n}\n\n.navbar-default .navbar-nav > li > a {\n    color: #FFF;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\n.inputmargin {\n    margin-left: 230px;\n}\n\n.gutter_header {\n    color: #66c0f4;\n}\n\n.list-group-item {\n    background-color: #183F59;\n    color: #66c0f4;\n    font-size: 13px;\n    font-family: \"Motiva Sans\", Sans-serif;\n    border: 0px;\n}\n\n.bs:hover {\n    color: #FFF;\n}\n\n.dibu {\n    height: 120px;\n    background-color: #101822;\n    color: #8F98A0;\n    text-align: center;\n    padding-top: 50px;\n    padding-left: 150px;\n    padding-right: 150px;\n}\n\nul li {\n    list-style-type: none;\n}\n\n.yingcang {\n    display: none;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/fenleixiangqing.css",
    "content": ".clx {\n    color: #FFF;\n    font-size: 34px;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\n#fenleixiangqing {\n    padding: 0px;\n}\n\n.imgdx {\n    width: 221px;\n    height: 83px;\n}\n\n.fenleizitiyanse {\n    color: #FFF;\n}\n\n.jutiyouxi {\n    background-color: #16202D;\n    margin-top: 10px;\n}\n\n.youximingzi {\n    margin-top: 10px;\n}\n\n.tags {\n    padding: 2px;\n    background-color: #424242;\n    color: #EEE0E5;\n    margin-right: 4px;\n    font-size: 13px;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\nul, li {\n    list-style: none;\n    margin: 0px;\n    padding: 0px;\n}\n\n.row {\n    margin-left: 0px;\n}\n\n.youxitupian {\n    display: none;\n    position: absolute;\n    height: 150px;\n    width: 300px;\n    margin-left: 5px;\n    background-color: #EEE0E5;\n}\n\n.imgdx_1 {\n    height: 69px;;\n    width: 184px;\n}\n\n.imgdx {\n    height: 150px;\n    width: 260px;\n}\n\n.font {\n    background-color: #A2B5CD;\n    padding-bottom: 5px;\n    padding-top: 5px;\n}\n\n.font_2 {\n    font-size: 15px;\n}\n\n.font_1 {\n    font-size: 20px;\n    text-align: center;\n}\n\n.deletepadding {\n    padding-right: 0px;\n}\n\n.dibu {\n    margin-top: 160px;\n}\n\n.yingcang {\n    display: none;\n}\n\n.pagination {\n    position: relative;\n    left: 120px;\n    bottom: 0px;\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/login.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\n.logowz {\n    margin-right: 100px;\n    margin-left: 350px;\n}\n\n.logoztdx {\n    font-size: 25px;\n}\n\n.bjys {\n    background-color: rgba(0, 0, 0, 0.2);\n}\n\n.ztys {\n    color: #c6d4df;\n}\n\n.btys {\n    color: #67c1f5;\n}\n\n.btnys {\n    background: rgba(103, 193, 245, 0.2);\n    color: #c6d4df;\n    border: none;\n    padding: 5px 15px 0px;\n}\n\n.container {\n    height: 650px;\n}\n\n.dlkwz {\n    margin-top: 90px;\n}\n\n.imgdx {\n    max-height: 100%;;\n    max-width: 100%;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/order.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\n.container {\n    width: 970px !important\n}\n\nbody {\n    background-color: #183F59;\n}\n\n.mar {\n    margin-top: 50px;\n}\n\ntd {\n    color: white;\n    width: 100px;\n}\n\n.smargin {\n    color: white;\n    margin-left: 15px;\n}\n\n.td_1 {\n    color: white;\n    width: 250px;\n}\n\n.btn {\n    background-color: #1E6E93;\n}\n\n.setright {\n    float: right;\n}\n\n.setleft {\n    float: left;\n}\n\n.divwidth {\n    width: 300px;\n}\n\n.divsetcenter {\n    margin-left: 45%;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/personal.css",
    "content": "body {\n    background-color: #1B2839;\n}\n\n.divcolor {\n    background-image: url(/img/static/personalbackground_1.jpg);\n    color: #FFF;\n}\n\n.divcolor_1 {\n    background-color: #192533;\n}\n\n.ziti {\n    color: #8F98A0;\n}\n\n.ziti_1 {\n    color: #FFF;\n}\n\n.setmargin {\n    margin-top: 20px;\n}\n\n.setmargin_1 {\n    margin-left: 10px;\n    border: none;\n}\n\n.setmargin_2 {\n    margin-top: 100px;\n}\n\n.setpadding {\n    background-color: #103651;\n    padding: 5px, 15px, 5px, 5px;\n}\n\n.setbtnpadding {\n    background-color: #103651;\n    font-size: 16px;\n    border: none;\n    color: #FFF;\n}\n\n.dibu {\n    margin-top: 390px;\n    height: 120px;\n    background-color: #101822;\n    color: #8F98A0;\n    text-align: center;\n    padding-top: 50px;\n    padding-left: 150px;\n    padding-right: 150px;\n}\n\n.fenleizitiyanse {\n    color: #FFF;\n}\n\n.jutiyouxi {\n    background-color: #16202D;\n    margin-top: 10px;\n}\n\n.imgdx_1 {\n    height: 69px;;\n    width: 184px;\n}\n\n.youximingzi {\n    margin-top: 10px;\n}\n\nul {\n    padding: 0px;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/regist.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\n.zczt {\n    color: #c6d4df;\n    margin-bottom: 20px;\n}\n\n.inputcolor {\n    background: #0E2A3A;\n    border: none;\n}\n\n.btnsz {\n    border-color: #67c1f5;\n}\n\n#regist_2 {\n    display: block;\n}\n\n#regist_3 {\n    display: none;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/sanji.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\n\nbody {\n    background-color: #183F59;\n}\n\n.headheight {\n    padding-top: 20px;\n    padding-bottom: 10px;\n}\n\n.headmid {\n    margin-left: 500px;\n    margin-top: 100px;\n}\n\n.nav navbar-nav navbar-right {\n    padding: 0px;\n    margin: 0px;\n}\n\n.form-control {\n    background-color: #316282;\n    border: 0px;\n    color: #FFF;\n}\n\n.btn {\n    background-color: #316282;\n    border: 0px;\n}\n\n.daohangyanse {\n    background-color: #356F95;\n    border: none;\n\n}\n\n.navbar-default .navbar-nav > li > a {\n    color: #FFF;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\n.inputmargin {\n    margin-left: 230px;\n}\n\n.gutter_header {\n    color: #66c0f4;\n}\n\n.list-group-item {\n    background-color: #183F59;\n    color: #66c0f4;\n    font-size: 13px;\n    font-family: \"Motiva Sans\", Sans-serif;\n    border: 0px;\n}\n\n.dibu {\n    height: 120px;\n    background-color: #101822;\n    color: #8F98A0;\n    text-align: center;\n    padding-top: 50px;\n    padding-left: 150px;\n    padding-right: 150px;\n}\n\n.table_color {\n    color: red;\n}\n\n.bs:hover {\n    color: #FFF;\n}\n\nul {\n    list-style-type: none;\n    margin: 0;\n    padding: 0;\n}\n\n.deletecolpadding {\n    padding-left: 0px;\n\n}\n\n.tags {\n    margin-right: 10px;\n}\n\n#carousel_3 {\n    width: 500px;\n    height: 75px; /* 定义显示窗口的大小 */\n    border: 1px solid #000;\n    overflow: hidden;\n}\n\n#carousel_3 ul {\n    width: 1000px;\n}\n\n/* 定义全部图片的宽度和 */\n#carousel_3 li {\n    width: 126px;\n    height: 65px;\n    float: left;\n}\n\n/* 单张图片的所在位置的大小，宽度就是图片宽度加左右边距 */\n#carousel_3 img {\n    width: 116px;\n    height: 65px;\n    margin: 5px;\n}\n\n/* 单张图片的尺寸，及外边距 */\n\n.btn_1 {\n    background-color: #316282;\n    border: 0px;\n    width: 15px;\n    padding-left: 5px;\n    padding-top: 28px;;\n    padding-bottom: 28px;\n    margin-top: 2px;\n\n}\n\n.deletelrpadding {\n    padding-left: 0px;\n    padding-right: 0px;\n}\n\n.addmargin {\n    margin-left: 10px;\n    margin-top: 10px;\n}\n\n.yingcang {\n    display: none;\n}\n\n.carousel-inner>.item>img{\n    height:337px;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/self.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\nbody {\n    background-color: #183F59;\n}\n\n.headheight {\n    padding-top: 20px;\n    padding-bottom: 10px;\n}\n\n.headmid {\n    margin-left: 500px;\n    margin-top: 100px;\n}\n\n.nav navbar-nav navbar-right {\n    padding: 0px;\n    margin: 0px;\n}\n\n.form-control {\n    background-color: #316282;\n    border: 0px;\n    color: #FFF;\n}\n\n.btn {\n    background-color: #316282;\n    border: 0px;\n    padding: 9px 12px;\n}\n\n.daohangyanse {\n    background-color: #356F95;\n    border: none;\n\n}\n\n.navbar-default .navbar-nav > li > a {\n    color: #FFF;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\n.inputmargin {\n    margin-left: 230px;\n}\n\n.carousel img {\n    width: 100%;\n}\n\n.gutter_header {\n    color: #66c0f4;\n}\n\n.list-group-item {\n    background-color: #183F59;\n    color: #66c0f4;\n    font-size: 13px;\n    font-family: \"Motiva Sans\", Sans-serif;\n    border: 0px;\n}\n\n.tit {\n    color: #fff;\n    font-size: 17px;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\n.tit_0 {\n\n    margin-bottom: 10px;\n}\n\n.tit_1 {\n    margin-top: 30px;\n    margin-bottom: 10px;\n}\n\n.carousel .item_0 {\n    background-color: #183F59;\n    width: 616px;\n    height: 353px;\n    float: left;\n}\n\n.carousel .item_1 {\n    background-color: #171a21;\n    width: 306px;\n    height: 353px;\n    float: left;\n    font-size: 24px;\n    color: #fff;\n    font-family: \"Motiva Sans\", Sans-serif;\n    text-align: center;\n    line-height: 390px;\n}\n\n.carousel-inner {\n    height: 392px;\n}\n\n.carousel .item_1_1 {\n    background-color: #183F59;\n    width: 306px;\n    height: 203px;\n    float: left;\n}\n\n#carousel-example-generic {\n    width: 925px;\n}\n\n#carousel_1 {\n    width: 920px;\n}\n\n.tit span {\n    font-size: 12px;\n    float: right;\n    color: #fff;\n    border-style: solid;\n    border-width: 1px;\n    border-color: #FFF;\n    padding: 4px;\n}\n\n.zhekou {\n    position: relative;\n    bottom: 50px;\n    left: 1px;\n    width: 35px;\n    height: 15px;\n    background-color: #090;\n    font-size: 12px;\n    font-family: Arial, Helvetica, sans-serif;\n    color: #FFF;\n    line-height: 15px;\n}\n\n.shoujia {\n    position: relative;\n    bottom: 65px;\n    left: 36px;\n    width: 100px;\n    height: 15px;\n    font-size: 12px;\n    font-family: Arial, Helvetica, sans-serif;\n    color: #FFF;\n    line-height: 15px;\n}\n\n.shoujia_1 {\n    position: relative;\n    bottom: 50px;\n    left: 1px;\n}\n\n.zhichi {\n    position: relative;\n    bottom: 95px;\n    left: 250px;\n    width: 35px;\n    height: 15px;\n    line-height: 15px;\n}\n\n.zhichi_1 {\n    position: relative;\n    bottom: 80px;\n    left: 250px;\n}\n\n.zhichi_2 {\n    position: relative;\n    bottom: 115px;\n    left: 215px;\n}\n\n.liulan {\n    width: 226px;\n    height: 58px;\n    background-color: #1E6E93;\n\n    text-align: center;\n    line-height: 58px;\n    color: #66c0f4;\n}\n\n.bs:hover {\n    color: #FFF;\n}\n\n.zx {\n    margin-top: 90px;\n    background-color: #183F59;\n}\n\n.rowpy {\n    margin-left: 0px;\n}\n\n.nav-tabs {\n    border: none;\n}\n\n.dibu {\n    height: 120px;\n    background-color: #101822;\n    color: #8F98A0;\n    text-align: center;\n    padding-top: 50px;\n    padding-left: 150px;\n    padding-right: 150px;\n}\n\n.yingcang {\n    display: none;\n}\n\nul li {\n    list-style-type: none;\n}\n\n.nav nav-tabs {\n    width: 590px;\n}\n\n.imgwh {\n    height: 353px;\n}\n\n.zximgwh {\n    height: 140px;\n    width: 300px;\n}\n\n.zximgwh_1 {\n    height: 140px;\n    width: 295px;\n    margin-top: 2px;\n    text-align: center;\n}\n\n.rowpy {\n    margin-bottom: 2px;\n    background-color: #1D3041;\n    color: white;\n}\n\n.cancelpadding {\n    padding: 0px;\n}\n\n.smargin {\n    margin-top: 15px;\n}\n\n.smargin_1 {\n    float: right;\n    margin-right: 20px;\n    margin-top: 25px;\n}\n\n.smargin_2 {\n    margin-top: 70px;\n}\n\n.smargin_3 {\n    font-size: 20px;\n    color: #183F59;\n}\n\n.smargin_4 {\n    margin-top: 5px;\n    margin-bottom: 5px;\n    font-size: 8px;\n    color: #c6d4df;\n}\n\n.smargin_5 {\n    margin-bottom: 10px;\n}\n\n.spadding {\n    padding-top: 10px;\n    padding-bottom: 10px;\n    background-color: #356F95;\n    margin-top: 40px;\n}\n\n.divHover {\n    color: white;\n}\n\n.all_bg {\n    width: 800px;\n    height: 600px;\n    margin: 0px auto;\n}\n\n#allcanvas {\n    position: relative;\n    width: 800px;\n    height: 600px;\n    margin: 0px;\n}\n\n#canvas1 {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    z-index: 1;\n}\n\n#canvas2 {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    z-index: 0;\n}\n\n#playbtn {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    z-index: 2;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/css/shoppingcart.css",
    "content": "@charset \"utf-8\";\n/* CSS Document */\n\nbody {\n    background-color: #1B2839;\n}\n\n.headheight {\n    padding-top: 20px;\n}\n\n.headmid {\n    margin-left: 500px;\n    margin-top: 100px;\n}\n\n.nav navbar-nav navbar-right {\n    padding: 0px;\n    margin: 0px;\n}\n\n.form-control {\n    background-color: #316282;\n    border: 0px;\n    color: #FFF;\n}\n\n.btn {\n    background-color: #316282;\n    border: 0px;\n}\n\n.daohangyanse {\n    background-color: #356F95;\n    border: none;\n\n}\n\n.navbar-default .navbar-nav > li > a {\n    color: #FFF;\n    font-family: \"Motiva Sans\", Sans-serif;\n}\n\n.inputmargin {\n    margin-left: 230px;\n}\n\n.gutter_header {\n    color: #66c0f4;\n}\n\n.list-group-item {\n    background-color: #183F59;\n    color: #66c0f4;\n    font-size: 13px;\n    font-family: \"Motiva Sans\", Sans-serif;\n    border: 0px;\n}\n\n.dibu {\n    height: 120px;\n    background-color: #101822;\n    color: #8F98A0;\n    text-align: center;\n    padding-top: 50px;\n    padding-left: 150px;\n    padding-right: 150px;\n}\n\n.the0 {\n    font-size: larger;\n    margin-left: 200px;\n}\n\ntr {\n    font-size: 22px;\n    border-bottom-style: solid;\n    border-bottom-width: 20px;\n    height: 60px;\n    border: 20px;\n    border-bottom-color: #FFC;\n}\n\n.yingcang {\n    display: none;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/adminlogin.js",
    "content": "function login() {\n    var username = document.getElementById(\"username\").value;\n    var password = document.getElementById(\"password\").value;\n\n    $.post(\"/admin/login\", {username: username, password: password}, function (result) {\n        if (result.success) {\n            window.location.href = \"/admin/home\"\n        } else {\n            alert(result.msg);\n        }\n    })\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/adminpage.js",
    "content": "// JavaScript Document\n$(\n    function () {\n        // 获取用户信息\n        var userInfo = document.getElementById(\"userInfo\");\n        $.post(\"/admin/getuser\", function (result) {\n            for (i = 0; i < 10; i++) {\n                if (result.data.user[i]) {\n                    var tr = document.createElement(\"tr\");\n                    var j = i + 1;\n                    var uid = result.data.user[i].id;\n                    var stat = result.data.user[i].stat;\n                    var time = new Date(result.data.user[i].ctime).toLocaleString();\n                    if (stat == '0') {\n                        stat = \"未激活\";\n                    }\n                    if (stat == '1') {\n                        stat = \"正常\";\n                    }\n                    if (stat == '2') {\n                        stat = '限制登录';\n                    }\n                    if (stat == '3') {\n                        stat = '删除';\n                    }\n                    tr.innerHTML = \"<td>\" + j + \"</td><td>\"\n                        + result.data.user[i].username + \"</td><td>\"\n                        + result.data.user[i].nickname + \"</td><td>\"\n                        + result.data.user[i].email + \"</td><td>\"\n                        + result.data.user[i].phone + \"</td><td>\"\n                        + time + \"</td><td id='ustat_\" + j + \"'>\"\n                        + stat + \"</td><td><button class='btn' onclick='restrict(\" + uid + \",\" + j + \")'>\"\n                        + \"限制登录\" + \"</button><button class='btn' onclick='del(\" + uid + \",\" + j + \")'>\"\n                        + \"删除\" + \"</button><button class='btn' onclick='relieve(\" + uid + \",\" + j + \")'>\"\n                        + \"恢复\" + \"</button></td>\";\n                    userInfo.appendChild(tr);\n                }\n            }\n            // 用户信息的分页\n            var ul = document.getElementById(\"paging_0\");\n            ul.className = \"pagination\";\n            var pages = result.data.page.pages;\n            var li_first = document.createElement(\"li\");\n            li_first.innerHTML = \"<a href='#'>&laquo;</a>\";\n            ul.appendChild(li_first);\n            for (i = 0; i < pages; i++) {\n                var li = document.createElement(\"li\");\n                var j = i + 1;\n                li.innerHTML = \"<a href='#'>\" + j + \"</a>\";\n                ul.appendChild(li);\n            }\n            var li_last = document.createElement(\"li\");\n            li_last.innerHTML = \"<a href='#'>&raquo;</a>\";\n            ul.appendChild(li_last);\n        })\n\n        // 获取游戏信息\n        var gameInfo = document.getElementById(\"gameInfo\");\n        $.post(\"/admin/getgames\", function (result) {\n            for (i = 0; i < 10; i++) {\n                if (result.data.game[i]) {\n                    var tr = document.createElement(\"tr\");\n                    var j = i + 1;\n                    var gid = result.data.game[i].id;\n                    var stat = result.data.game[i].stat;\n                    if (stat == \"1\") {\n                        stat = \"已上架\";\n                    }\n                    if (stat == \"2\") {\n                        stat = \"已下架\";\n                    }\n                    if (stat == \"0\") {\n                        stat = \"未上架\";\n                    }\n                    tr.innerHTML = \"<td>\" + j + \"</td><td id='gname_\" + gid + \"'>\"\n                        + result.data.game[i].name + \"</td><td id='gprice_\" + gid + \"'>\"\n                        + result.data.game[i].price + \"</td><td id='gstat_\" + j + \"'>\"\n                        + stat + \"</td><td><button class='btn' onclick='upgame(\" + gid + \",\" + j + \")'>\"\n                        + \"上架\" + \"</button><button class='btn' onclick='downgame(\" + gid + \",\" + j + \")'>\"\n                        + \"下架\" + \"</button><button type='button' class='btn' data-toggle='modal' data-target='#myModal_1' onclick='getgamekind(\" + gid + \")'>\"\n                        + \"修改种类\" + \"</button>\" + text_1 +\n                        \"<p>编号\" + \"<input type='text' readOnly='true' class='inputmargin_2'id='gamekindid\" + \"'></p><br>\" +\n                        \"<p><div id='gamekind'>种类\" + \"</div></p><br>\" +\n                        \"</div>\" +\n                        \"<div class='modal-footer' id='savebtn'>\" +\n                        \"<button type='button' class='btn btn-default' data-dismiss='modal'>取消</button>\" +\n                        \"<button type='button' class='btn btn-primary' onclick='savekinds(\" + \")'>保存</button>\" +\n                        \"</div>\" +\n                        \"</div>\" +\n                        \"</div>\" +\n                        \"</div>\" +\n                        \"<button type='button' class='btn' data-toggle='modal' data-target='#myModal' onclick='getgameinfo(\" + gid + \")'>\"\n                        + \"修改信息\" +\n                        \"</button>\" + text +\n                        \"<p>编号\" + \"<input type='text' readOnly='true'class='inputmargin_2'id='gameid\" + \"'></p><br>\" +\n                        \"<p>游戏\" + \"<input type='text' class='inputmargin_2'id='gamename\" + \"'></p><br>\" +\n                        \"<p>价格\" + \"<input type='text'class='inputmargin_2' id='gameprice\" + \"'></p><br>\" +\n                        \"<p>开发商\" + \"<input type='text'class='inputmargin_1' id='gamecreater\" + \"'></p><br>\" +\n                        \"<p>描述\" + \"<textarea  rows='5'  class='inputmargin_2' id='gamedesc\" + \"'></textarea></p><br>\" +\n                        \"<p>配置\" + \"<textarea  rows='5'  class='inputmargin_2' id='sys\" + \"'></textarea></p><br>\" +\n                        \"</div>\" +\n                        \"<div class='modal-footer' id='savebtn'>\" +\n                        \"<button type='button' class='btn btn-default' data-dismiss='modal'>取消</button>\" +\n                        \"<button type='button' class='btn btn-primary' onclick='savegameupdate(\" + \")'>保存</button>\" +\n                        \"</div>\" +\n                        \"</div>\" +\n                        \"</div>\" +\n                        \"</div>\" + \"</td>\";\n                    gameInfo.appendChild(tr);\n                }\n            }\n            // 游戏信息的分页\n            var ul = document.getElementById(\"paging_1\");\n            ul.className = \"pagination\";\n            var pages = result.data.page.pages;\n            var current = result.data.page.current;\n            var last = current - 1;\n            var next = current + 1;\n            if (last < 1) {\n                last = 1\n            }\n            if (next > pages) {\n                next = pages\n            }\n            var li_first = document.createElement(\"li\");\n            li_first.id = \"li_first\";\n            li_first.innerHTML = \"<a href='#'onclick='getgeame(\" + last + \")'>&laquo;</a>\";\n            ul.appendChild(li_first);\n            document.getElementById(\"li_first\").className = \"disabled\";\n            for (i = 0; i < pages; i++) {\n                var j = i + 1;\n                var li = document.createElement(\"li\");\n                li.id = \"li_\" + j;\n                li.innerHTML = \"<a href='#'onclick='getgeame(\" + j + \")'>\" + j + \"</a>\";\n                ul.appendChild(li);\n            }\n            document.getElementById(\"li_\" + current).className = \"active\";\n            var li_last = document.createElement(\"li\");\n            li_last.innerHTML = \"<a href='#'onclick='getgeame(\" + next + \")'>&raquo;</a>\";\n            ul.appendChild(li_last);\n        })\n\n        //种类管理\n        var kind_all = document.getElementById(\"kind_all\");\n        $.post(\"/kind/all\", function (result) {\n            var i = 0;\n            while (result.data[i]) {\n                j = i + 1;\n                var tr = document.createElement(\"tr\");\n                var kid = result.data[i].id;\n                tr.innerHTML = \"<th id='kindid_\" + j + \"'>\"\n                    + result.data[i].id + \"</th><th id='kindname_\" + j + \"'>\"\n                    + result.data[i].name + \"</th><th><button type='button' class='btn' data-toggle='modal' data-target='#myModal_2' onclick='managekind(\" + kid + \")'>\"\n                    + \"管理\" + \"</button>\" + text_2 +\n                    \"<p>种类编号\" + \"<input type='text' readOnly='true' class='inputmargin_2'id='kindgameid\" + \"'></p><br>\" +\n                    \"<p><div id='kindgame'>游戏\" + \"</div></p><br>\" +\n                    \"</div>\" +\n                    \"<div class='modal-footer' id='savebtn'>\" +\n                    \"<button type='button' class='btn btn-default' data-dismiss='modal'>取消</button>\" +\n                    \"<button type='button' class='btn btn-primary' onclick='savekindsgames(\" + \")'>保存</button>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</th>\";\n                i++;\n                kind_all.appendChild(tr);\n            }\n        })\n    }\n)\n//游戏信息分页的函数\nfunction getgeame(pagenum) {\n    var gameInfo = document.getElementById(\"gameInfo\");\n    gameInfo.innerHTML = \"\";\n    $.post(\"/admin/getgames\", {page: pagenum}, function (result) {\n        for (i = 0; i < 10; i++) {\n            if (result.data.game[i]) {\n                var tr = document.createElement(\"tr\");\n                var j = 10 * (pagenum - 1) + i + 1;\n                var gid = result.data.game[i].id;\n                var stat = result.data.game[i].stat;\n                if (stat == \"1\") {\n                    stat = \"已上架\";\n                }\n                if (stat == \"2\") {\n                    stat = \"已下架\";\n                }\n                if (stat == \"0\") {\n                    stat = \"未上架\";\n                }\n                tr.innerHTML = \"<td>\" + j + \"</td><td id='gname_\" + gid + \"'>\"\n                    + result.data.game[i].name + \"</td><td id='gprice_\" + gid + \"'>\"\n                    + result.data.game[i].price + \"</td><td id='gstat_\" + j + \"'>\"\n                    + stat + \"</td><td><button class='btn' onclick='upgame(\" + gid + \",\" + j + \")'>\"\n                    + \"上架\" + \"</button><button class='btn' onclick='downgame(\" + gid + \",\" + j + \")'>\"\n                    + \"下架\" + \"</button><button type='button' class='btn' data-toggle='modal' data-target='#myModal_1' onclick='getgamekind(\" + gid + \")'>\"\n                    + \"修改种类\" + \"</button>\" + text_1 +\n                    \"<p>编号\" + \"<input type='text' readOnly='true' class='inputmargin_2'id='gamekindid\" + \"'></p><br>\" +\n                    \"<p><div id='gamekind'>种类\" + \"</div></p><br>\" +\n                    \"</div>\" +\n                    \"<div class='modal-footer' id='savebtn'>\" +\n                    \"<button type='button' class='btn btn-default' data-dismiss='modal'>取消</button>\" +\n                    \"<button type='button' class='btn btn-primary' onclick='savekinds(\" + \")'>保存</button>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"<button type='button' class='btn' data-toggle='modal' data-target='#myModal' onclick='getgameinfo(\" + gid + \")'>\"\n                    + \"修改信息\" +\n                    \"</button>\" + text +\n                    \"<p>编号\" + \"<input type='text' readOnly='true' class='inputmargin_2'id='gameid\" + \"'></p><br>\" +\n                    \"<p>游戏\" + \"<input type='text' class='inputmargin_2'id='gamename\" + \"'></p><br>\" +\n                    \"<p>价格\" + \"<input type='text'class='inputmargin_2' id='gameprice\" + \"'></p><br>\" +\n                    \"<p>开发商\" + \"<input type='text'class='inputmargin_1' id='gamecreater\" + \"'></p><br>\" +\n                    \"<p>描述\" + \"<textarea  rows='5'  class='inputmargin_2' id='gamedesc\" + \"'></textarea></p><br>\" +\n                    \"<p>配置\" + \"<textarea  rows='5'  class='inputmargin_2' id='sys\" + \"'></textarea></p><br>\" +\n                    \"</div>\" +\n                    \"<div class='modal-footer' id='savebtn'>\" +\n                    \"<button type='button' class='btn btn-default' data-dismiss='modal'>取消</button>\" +\n                    \"<button type='button' class='btn btn-primary' onclick='savegameupdate(\" + \")'>保存</button>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\" + \"</td>\";\n                gameInfo.appendChild(tr);\n            }\n        }\n        var ul = document.getElementById(\"paging_1\");\n        ul.className = \"pagination\";\n        ul.innerHTML = \"\";\n        var pages = result.data.page.pages;\n        var current = result.data.page.current;\n        var last = current - 1;\n        var next = current + 1;\n        if (last < 1) {\n            last = 1\n        }\n        if (next > pages) {\n            next = pages\n        }\n        var li_first = document.createElement(\"li\");\n        li_first.id = \"li_first\";\n        li_first.innerHTML = \"<a href='#'onclick='getgeame(\" + last + \")'>&laquo;</a>\";\n        ul.appendChild(li_first);\n        for (i = 0; i < pages; i++) {\n            var j = i + 1;\n            var li = document.createElement(\"li\");\n            li.id = \"li_\" + j;\n            li.innerHTML = \"<a href='#'onclick='getgeame(\" + j + \")'>\" + j + \"</a>\";\n            ul.appendChild(li);\n        }\n        document.getElementById(\"li_\" + pagenum).className = \"active\";\n        if (current <= \"1\") {\n            document.getElementById(\"li_first\").className = \"disabled\";\n        }\n        var li_last = document.createElement(\"li\");\n        li_last.id = \"li_next\";\n        li_last.innerHTML = \"<a href='#'onclick='getgeame(\" + next + \")'>&raquo;</a>\";\n        ul.appendChild(li_last);\n        if (current >= i) {\n            document.getElementById(\"li_next\").className = \"disabled\";\n        }\n\n    })\n}\n\n//限制用户登录\nfunction restrict(uid, j) {\n    $.post(\"/admin/restrictuser\", {uid: uid}, function (result) {\n        if (result.success) {\n            alert(\"该用户已被限制登录！\");\n            document.getElementById(\"ustat_\" + j).innerHTML = \"限制登录\";\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}\n//恢复用户\nfunction relieve(uid, j) {\n    $.post(\"/admin/relieveuser\", {uid: uid}, function (result) {\n        if (result.success) {\n            alert(\"该用户已被恢复登录！\");\n            document.getElementById(\"ustat_\" + j).innerHTML = \"正常\";\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}\n//删除用户\nfunction del(uid, j) {\n    $.post(\"/admin/deluser\", {uid: uid}, function (result) {\n        if (result.success) {\n            alert(\"该用户已被删除！\");\n            document.getElementById(\"ustat_\" + j).innerHTML = \"删除\";\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}\n//上架游戏\nfunction upgame(gid, j) {\n    $.post(\"/admin/upgame\", {game: gid}, function (result) {\n        if (result.success) {\n            alert(\"游戏已上架！\")\n            document.getElementById(\"gstat_\" + j).innerHTML = \"已上架\";\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}\n//下架游戏\nfunction downgame(gid, j) {\n    $.post(\"/admin/downgame\", {game: gid}, function (result) {\n        if (result.success) {\n            alert(\"游戏已下架！\")\n            document.getElementById(\"gstat_\" + j).innerHTML = \"已下架\";\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}\n//获取游戏种类\nfunction getgamekind(gid) {\n    document.getElementById(\"gamekindid\").value = gid;\n    var kinds = new Array();\n    $.post(\"/kind/all\", function (result) {\n        var i = 0;\n        document.getElementById(\"gamekind\").innerHTML = \"种类\";\n        while (result.data[i]) {\n            document.getElementById(\"gamekind\").innerHTML += \"<br>\" + \"<input type='checkbox' id='kindbox_\" + gid + \"_\" + i + \"'>\" + result.data[i].name;\n            kinds[i] = result.data[i].name;\n            i++;\n        }\n    })\n    $.post(\"/admin/getgamekind\", {game: gid}, function (result) {\n        var i = 0;\n        var j = 0;\n        while (result.data[i]) {\n            while (kinds[j]) {\n                if (result.data[i].name == kinds[j]) {\n                    document.getElementById(\"kindbox_\" + gid + \"_\" + j).checked = \"true\";\n                }\n                j++;\n            }\n            i++;\n            j = 0;\n        }\n        i = 0;\n    })\n}\n//保存游戏种类\nfunction savekinds() {\n    var i = 0;\n    var j = 0;\n    var kid = document.getElementById(\"gamekindid\").value;\n    var check = document.getElementById(\"kindbox_\" + kid + \"_\" + i);\n    var kinds = new Array();\n    while (check) {\n        if (check.checked) {\n            kinds[j] = parseInt(i + 1);\n            j++;\n        }\n        i++;\n        check = document.getElementById(\"kindbox_\" + kid + \"_\" + i);\n    }\n    $.ajax({\n        type: \"post\",\n        url: \"/admin/updategamekind\",\n        traditional: true,\n        data: {game: kid, kinds: kinds},\n        success: function (result) {\n            if (result.success) {\n                alert(\"修改成功！\");\n            } else\n                alert(result.msg);\n        }\n    })\n    $('#myModal_1').modal('hide');\n}\n\n\nfunction managekind(kid) {\n    // var kidpages=2;\n    // var currentpage = 1;\n    document.getElementById(\"kindgameid\").value = kid;\n    var i = 0;\n    $.post(\"/admin/getallgames\", function (result) {\n        document.getElementById(\"kindgame\").innerHTML = \"游戏\";\n        while (result.data[i]) {\n            var j = result.data[i].id;\n            document.getElementById(\"kindgame\").innerHTML += \"<br>\" + \"<input type='checkbox' class='gamebox' id='kind_\" + kid + \"_\" + j + \"'>\" + result.data[i].name;\n            i++;\n        }\n        var j = 0;\n        i = 0;\n        while (result.data[i]) {\n            if (result.data[i].kinds) {\n                while (result.data[i].kinds[j]) {\n                    if (result.data[i].kinds[j].id == kid) {\n                        var gid = result.data[i].id;\n                        document.getElementById(\"kind_\" + kid + \"_\" + gid).checked = true;\n                    }\n                    j++;\n                }\n            }\n            i++;\n            j = 0;\n        }\n    })\n}\n\n\nfunction savekindsgames() {\n    var kid = document.getElementById(\"kindgameid\").value;\n    var i = 0;\n    var games = new Array();\n    var num = 0;\n    var gamebox = document.getElementsByClassName(\"gamebox\");\n    while (gamebox[i]) {\n        if (gamebox[i].checked) {\n            games[num] = (gamebox[i].id).split('_')[2];\n            num++;\n        }\n        i++;\n    }\n    i = 0;\n    $.ajax({\n        type: \"post\",\n        url: \"/admin/managerkind\",\n        traditional: true,\n        data: {kind: kid, games: games},\n        success: function (result) {\n            if (result.success) {\n                alert(\"修改成功！\");\n            } else\n                alert(result.msg);\n        }\n    })\n    $('#myModal_2').modal('hide');\n}\nfunction showright_0() {\n    document.getElementById(\"right_0\").style.display = \"block\";\n    document.getElementById(\"right_1\").style.display = \"none\";\n    document.getElementById(\"right_2\").style.display = \"none\";\n    document.getElementById(\"right_3\").style.display = \"none\";\n}\nfunction showright_1() {\n    document.getElementById(\"right_0\").style.display = \"none\";\n    document.getElementById(\"right_1\").style.display = \"block\";\n    document.getElementById(\"right_2\").style.display = \"none\";\n    document.getElementById(\"right_3\").style.display = \"none\";\n}\nfunction showright_2() {\n    document.getElementById(\"right_0\").style.display = \"none\";\n    document.getElementById(\"right_1\").style.display = \"none\";\n    document.getElementById(\"right_2\").style.display = \"block\";\n    document.getElementById(\"right_3\").style.display = \"none\";\n}\nfunction showright_3() {\n    document.getElementById(\"right_0\").style.display = \"none\";\n    document.getElementById(\"right_1\").style.display = \"none\";\n    document.getElementById(\"right_2\").style.display = \"none\";\n    document.getElementById(\"right_3\").style.display = \"block\";\n}\n\n//导航菜单\nfunction navList(id) {\n    var $obj = $(\"#nav_dot\"), $item = $(\"#J_nav_\" + id);\n    $item.addClass(\"on\").parent().removeClass(\"none\").parent().addClass(\"selected\");\n    $obj.find(\"h4\").hover(function () {\n        $(this).addClass(\"hover\");\n    }, function () {\n        $(this).removeClass(\"hover\");\n    });\n    $obj.find(\"p\").hover(function () {\n        if ($(this).hasClass(\"on\")) {\n            return;\n        }\n        $(this).addClass(\"hover\");\n    }, function () {\n        if ($(this).hasClass(\"on\")) {\n            return;\n        }\n        $(this).removeClass(\"hover\");\n    });\n    $obj.find(\"h4\").click(function () {\n        var $div = $(this).siblings(\".list-item\");\n        if ($(this).parent().hasClass(\"selected\")) {\n            $div.slideUp(600);\n            $(this).parent().removeClass(\"selected\");\n        }\n        if ($div.is(\":hidden\")) {\n            $(\"#nav_dot li\").find(\".list-item\").slideUp(600);\n            $(\"#nav_dot li\").removeClass(\"selected\");\n            $(this).parent().addClass(\"selected\");\n            $div.slideDown(600);\n\n        } else {\n            $div.slideUp(600);\n        }\n    });\n}\n\n/****表格隔行高亮显示*****/\nwindow.onload = function () {\n    oTable = document.getElementById(\"tab\");//找表格\n    aTr = document.getElementsByTagName(\"tr\");//找所有的行\n    for (i = 0; i < aTr.length; i++) {\n        if (i % 2 == 0) {\n            aTr[i].style.background = \"#fff\";\n        } else {\n            aTr[i].style.background = \"#ccc\";\n        }\n        ;\n    }\n    ;\n};\nvar text = \"<div class='modal fade' id='myModal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel'>\" +\n    \"<div class='modal-dialog' role='document'>\" +\n    \"<div class='modal-content'>\" +\n    \"<div class='modal-header'>\" +\n    \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\" +\n    \"<h4 class='modal-title' id='myModalLabel'>游戏信息</h4>\" +\n    \"</div>\" +\n    \"<div class='modal-body'>\"\n\nvar text_1 = \"<div class='modal fade' id='myModal_1' tabindex='-1' role='dialog' aria-labelledby='myModalLabel'>\" +\n    \"<div class='modal-dialog' role='document'>\" +\n    \"<div class='modal-content'>\" +\n    \"<div class='modal-header'>\" +\n    \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\" +\n    \"<h4 class='modal-title' id='myModalLabel'>游戏种类</h4>\" +\n    \"</div>\" +\n    \"<div class='modal-body'>\"\n\nvar text_2 = \"<div class='modal fade' id='myModal_2' tabindex='-1' role='dialog' aria-labelledby='myModalLabel'>\" +\n    \"<div class='modal-dialog' role='document'>\" +\n    \"<div class='modal-content'>\" +\n    \"<div class='modal-header'>\" +\n    \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\" +\n    \"<h4 class='modal-title' id='myModalLabel'>种类管理</h4>\" +\n    \"</div>\" +\n    \"<div class='modal-body'>\"\n\nfunction getgameinfo(gid) {\n    $.post(\"/game/\" + gid, function (result) {\n        document.getElementById(\"gameid\").value = result.data.id;\n        document.getElementById(\"gamename\").value = result.data.name;\n        document.getElementById(\"gameprice\").value = result.data.price;\n        document.getElementById(\"gamecreater\").value = result.data.creater;\n        document.getElementById(\"gamedesc\").value = result.data.desc;\n        document.getElementById(\"sys\").value = result.data.systemcfg;\n    })\n}\n\nfunction savegameupdate() {\n    var gid = document.getElementById(\"gameid\").value;\n    var gamename = document.getElementById(\"gamename\").value;\n    var gameprice = document.getElementById(\"gameprice\").value;\n    var gamedesc = document.getElementById(\"gamedesc\").value;\n    var gamecreater = document.getElementById(\"gamecreater\").value;\n    var sys = document.getElementById(\"sys\").value;\n    $.post(\"/admin/updategameinfo\", {\n        id: gid,\n        creater: gamecreater,\n        name: gamename,\n        desc: gamedesc,\n        systemcfg: sys,\n        price: gameprice\n    }, function (result) {\n        if (result.success) {\n            alert(\"修改成功！\");\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n    document.getElementById(\"gname_\" + gid).innerHTML = gamename;\n    document.getElementById(\"gprice_\" + gid).innerHTML = gameprice;\n    $('#myModal').modal('hide');\n}\n\nfunction setImagePreviews(avalue) {\n    //获取选择图片的对象\n    var docObj = document.getElementById(\"doc\");\n    //后期显示图片区域的对象\n    var dd = document.getElementById(\"dd\");\n    dd.innerHTML = \"\";\n    //得到所有的图片文件\n    var fileList = docObj.files;\n    //循环遍历\n    for (var i = 0; i < fileList.length; i++) {\n        //动态添加html元素\n        dd.innerHTML += \"<div style='float:left' > <img id='img\" + i + \"'  /> </div>\";\n        //获取图片imgi的对象\n        var imgObjPreview = document.getElementById(\"img\" + i);\n\n        if (docObj.files && docObj.files[i]) {\n            //火狐下，直接设img属性\n            imgObjPreview.style.display = 'block';\n            imgObjPreview.style.width = '200px';\n            imgObjPreview.style.height = '180px';\n            //imgObjPreview.src = docObj.files[0].getAsDataURL();\n            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要以下方式\n            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);   //获取上传图片文件的物理路径\n        }\n        else {\n            //IE下，使用滤镜\n            docObj.select();\n            var imgSrc = document.selection.createRange().text;\n            //alert(imgSrc)\n            var localImagId = document.getElementById(\"img\" + i);\n            //必须设置初始大小\n            localImagId.style.width = \"200px\";\n            localImagId.style.height = \"180px\";\n            //图片异常的捕捉，防止用户修改后缀来伪造图片\n            try {\n                localImagId.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)\";\n                localImagId.filters.item(\"DXImageTransform.Microsoft.AlphaImageLoader\").src = imgSrc;\n            }\n            catch (e) {\n                alert(\"您上传的图片格式不正确，请重新选择!\");\n                return false;\n            }\n            imgObjPreview.style.display = 'none';\n            document.selection.empty();\n        }\n    }\n    return true;\n}\nfunction setImagePreviews_0(avalue) {\n    //获取选择图片的对象\n    var docObj = document.getElementById(\"doc_0\");\n    //后期显示图片区域的对象\n    var dd = document.getElementById(\"dd_0\");\n    dd.innerHTML = \"\";\n    //得到所有的图片文件\n    var fileList = docObj.files;\n    //循环遍历\n    for (var i = 0; i < fileList.length; i++) {\n        //动态添加html元素\n        dd.innerHTML += \"<div style='float:left' > <img id='img_\" + i + \"'  /> </div>\";\n        //获取图片imgi的对象\n        var imgObjPreview = document.getElementById(\"img_\" + i);\n\n        if (docObj.files && docObj.files[i]) {\n            //火狐下，直接设img属性\n            imgObjPreview.style.display = 'block';\n            imgObjPreview.style.width = '200px';\n            imgObjPreview.style.height = '180px';\n            //imgObjPreview.src = docObj.files[0].getAsDataURL();\n            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要以下方式\n            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);   //获取上传图片文件的物理路径\n        }\n        else {\n            //IE下，使用滤镜\n            docObj.select();\n            var imgSrc = document.selection.createRange().text;\n            //alert(imgSrc)\n            var localImagId = document.getElementById(\"img_\" + i);\n            //必须设置初始大小\n            localImagId.style.width = \"200px\";\n            localImagId.style.height = \"180px\";\n            //图片异常的捕捉，防止用户修改后缀来伪造图片\n            try {\n                localImagId.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)\";\n                localImagId.filters.item(\"DXImageTransform.Microsoft.AlphaImageLoader\").src = imgSrc;\n            }\n            catch (e) {\n                alert(\"您上传的图片格式不正确，请重新选择!\");\n                return false;\n            }\n            imgObjPreview.style.display = 'none';\n            document.selection.empty();\n        }\n    }\n    return true;\n}\nvar xhr = new XMLHttpRequest();\nfunction addgame() {\n    var form = new FormData();\n    var creater = document.getElementById(\"addgamecreater\").value;\n    var name = document.getElementById(\"addgamename\").value;\n    var desc = document.getElementById(\"addgamedesc\").value;\n    var syscfg = document.getElementById(\"addgamesyscfg\").value;\n    var price = document.getElementById(\"addgameprice\").value;\n    var discount = document.getElementById(\"addgamediscount\").value;\n    var cover = document.getElementById(\"doc_0\").files[0];\n    var i = 0;\n    while (document.getElementById(\"doc\").files[i]) {\n        form.append(\"pics\", document.getElementById(\"doc\").files[i]);\n        i++;\n    }\n\n    form.append(\"creater\", creater);\n    form.append(\"name\", name);\n    form.append(\"desc\", desc);\n    form.append(\"systemcfg\", syscfg);\n    form.append(\"price\", price);\n    form.append(\"discount\", discount);\n    form.append(\"kinds\", '1');\n    form.append(\"header\", cover);\n    xhr.open(\"POST\", \"/admin/addgame\", true);\n    xhr.onreadystatechange = call;\n    xhr.send(form);\n}\nfunction call() {\n    //判断对象的状态是否完成\n    //alert(xmlh.status);\n    if (xhr.readyState == 4) {\n        if (xhr.status == 200) { //等于200表示成功\n            //alert(\"成功了\");\n            //获取服务器端返回的数据\n            //纯文本\n            //var respons = xmlh.responseText;\n            //var text = respons;\n            var result = xhr.responseText;\n            var s = result.substring(result.indexOf(':') + 1, result.indexOf(','));\n            if (s == \"true\") {\n                alert(\"添加成功！\")\n            }\n            else {\n                var s1 = result.substring(result.indexOf(':\"') + 2, result.indexOf('\",'));\n                alert(s1);\n            }\n        }\n    }\n}\n\nfunction cleartext() {\n    var creater = document.getElementById(\"addgamecreater\");\n    var name = document.getElementById(\"addgamename\");\n    var desc = document.getElementById(\"addgamedesc\");\n    var syscfg = document.getElementById(\"addgamesyscfg\");\n    var price = document.getElementById(\"addgameprice\");\n    var discount = document.getElementById(\"addgamediscount\");\n    creater.value = \"\";\n    name.value = \"\";\n    desc.value = \"\";\n    syscfg.value = \"\";\n    price.value = \"\";\n    discount.value = \"\";\n}\n\nfunction addkind() {\n    var kind = document.getElementById(\"addkindinput\").value;\n    $.post(\"/admin/addkind\", {kind: kind}, function (result) {\n        if (result.success) {\n            alert(\"添加成功！\");\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/biaoqian.js",
    "content": "$(\n    function () {\n        var ul = document.getElementById(\"leixing\");\n        $.post(\"/kind/all\",\n            function (result) {\n                var i = 0;\n                var lli = document.createElement(\"lli\");\n                lli.innerHTML = \"<li>浏览分类</li>\"\n                ul.appendChild(lli);\n                while (result.data[i]) {\n                    var li = document.createElement(\"li\");\n                    var id = result.data[i].id;\n                    li.innerHTML = \"<a href='/kind/\" + id + \"/games\" + \"'><li class='list-group-item'><div class='bs'>\" + result.data[i].name + \"</div></li></a>\";\n                    ul.appendChild(li);\n                    i++;\n                }\n\n            })\n    }\n);"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fenlei.js",
    "content": "var url;\n$(\n    function () {\n        getgame(1);\n    }\n);\n\nfunction getgame(page) {\n    var ul = document.getElementById(\"fenleixiangqing\");\n    var ull = document.getElementById(\"fenleiyouxitupian\");\n    ul.innerHTML = \"\";\n    ull.innerHTML = \"\";\n    $.post(url, {page: page}, function (result) {\n        if(result.data){\n            var i = 0;\n            var j = 0;\n            var k = 0;\n            //var tags = new Array();\n            var prices = new Array();\n            while (result.data.game[i]) {\n                // tags[i]=\"\";\n                prices[i] = \"¥\" + result.data.game[i].price;\n                if (prices[i] == \"¥0\")\n                    prices[i] = \"免费\";\n                i++;\n            }\n            while (result.data.game[k]) {\n                var li = document.createElement(\"li\");\n                var gid = k;\n                var u;\n                u = \"<a href='/game/\" + result.data.game[k].id;\n                li.innerHTML = u + \"'><div class='row fenleizitiyanse jutiyouxi'><div class='col-md-4'><img id='xianshitupian_\" + k +\n                    \"'onmouseover='xianshitupian(\" + k + \")'\" +\n                    \"onmouseout='yingcangtupian(+\" + k + \")' src='/img\" + result.data.game[k].img[0] + \"' class='imgdx_1'></div><div class='col-md-8'><div class='row youximingzi'>\" +\n                    result.data.game[k].name + \"</div><div class='row'><div class='col-md-2 col-md-offset-10'>\" + prices[k] + \"</div></div><div class='row youximingzi' id='tags_\" + k + \"'></div></div></div>\"\n                ul.appendChild(li);\n                k++;\n            }\n            k = 0;\n            while (result.data.game[k]) {\n                var li = document.createElement(\"li\");\n                li.innerHTML = \"<div class='row youxitupian' id='yingcangtupian_\" + k + \"'><div class='row'><div class='font font_1'>\" + result.data.game[k].name + \"</div></div><div class='row font'><div class='col-md-offset-1'><img class='imgdx' src='/img\" + result.data.game[k].img[1] + \"'></div></div><div class='row font font_2'>用户标签：</div><div class='row font' id='small_tags_\" + k + \"'>\" + \"</div></div>\";\n                ull.appendChild(li);\n                k++;\n            }\n            i = 0;\n            j = 0;\n            while (result.data.game[i]) {\n                var t = document.getElementById(\"tags_\" + i);\n                if(result.data.game[i].tags){\n                    while (result.data.game[i].tags[j]) {\n                        var l = document.createElement(\"l\");\n                        l.innerHTML = \"<span class='tags img-rounded'>\" + result.data.game[i].tags[j].name + \"</span>\";\n                        t.appendChild(l);\n                        j++;\n                    }\n                }\n                i++;\n                j = 0;\n            }\n            i = 0;\n            j = 0;\n            while (result.data.game[i]) {\n                var tt = document.getElementById(\"small_tags_\" + i);\n                if(result.data.game[i].tags){\n                    while (result.data.game[i].tags[j]) {\n                        var ll = document.createElement(\"ll\");\n                        ll.innerHTML = \"<span class='tags img-rounded'>\" + result.data.game[i].tags[j].name + \"</span>\";\n                        tt.appendChild(ll);\n                        j++;\n                    }\n                }\n                i++;\n                j = 0;\n            }\n            var uul = document.getElementById(\"paging\");\n            uul.className = \"pagination\";\n            uul.innerHTML = \"\";\n            var pages = result.data.page.pages;\n            var current = result.data.page.current;\n            var last = current - 1;\n            var next = current + 1;\n            if (last < 1) {\n                last = 1\n            }\n            if (next > pages) {\n                next = pages\n            }\n            var li_first = document.createElement(\"li\");\n            li_first.id = \"li_first\";\n            li_first.innerHTML = \"<a href='#'onclick='getgame(\" + last + \")'>&laquo;</a>\";\n            uul.appendChild(li_first);\n            for (i = 0; i < pages; i++) {\n                var j = i + 1;\n                var li = document.createElement(\"li\");\n                li.id = \"li_\" + j;\n                li.innerHTML = \"<a href='#'onclick='getgame(\" + j + \")'>\" + j + \"</a>\";\n                uul.appendChild(li);\n            }\n            document.getElementById(\"li_\" + current).className = \"active\";\n            var li_last = document.createElement(\"li\");\n            li_last.innerHTML = \"<a href='#'onclick='getgame(\" + next + \")'>&raquo;</a>\";\n            uul.appendChild(li_last);\n        }\n\n    })\n}\nfunction xianshitupian(k) {\n    document.getElementById(\"yingcangtupian_\" + k).style.display = \"block\";\n    var y = document.getElementById(\"yingcangtupian_\" + k);\n    y.style.top = 69 * k + \"px\";\n}\nfunction yingcangtupian(k) {\n    document.getElementById(\"yingcangtupian_\" + k).style.display = \"none\";\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/findpassword.js",
    "content": "var wait;\n$(function () {\n    wait = 0;\n    time();\n})\n\nfunction schedule() {\n    setTimeout(function () {\n        time()\n    }, 1000)\n}\n\nfunction time() {\n    if (wait == 0) {\n        document.getElementById(\"btna\").removeAttribute(\"disabled\");\n        document.getElementById(\"btna\").value = \"发送邮件\";\n        wait = 60;\n    } else {\n        document.getElementById(\"btna\").setAttribute(\"disabled\", true);\n        document.getElementById(\"btna\").value = wait + \"s后可以重新发送\";\n        wait--;\n        schedule();\n    }\n}\n\nfunction sendMail() {\n    var email = document.getElementById(\"email\").value;\n    $.post(\"/user/sendfetchpwdmail\", {email: email}, function (result) {\n        if (result.success) {\n            alert(\"发送成功！\");\n            time()\n        } else {\n            alert(result.msg);\n        }\n    });\n}\n\nfunction findpassword() {\n    var code = document.getElementById(\"code\").value;\n    var email = document.getElementById(\"email\").value;\n    var password = document.getElementById(\"newpassword\").value;\n    var password_1 = document.getElementById(\"newpassword_1\").value;\n    if (password != password_1) {\n        alert(\"您输入的密码不一致！\");\n    }\n    else {\n        $.post(\"/user/findpassword\", {password: password, email: email, code: code}, function (result) {\n            if (result.success) {\n                alert(\"成功找回！您的用户名是:\" + result.data);\n                window.location.href = \"/login\";\n            }\n            else {\n                alert(result.msg);\n            }\n        })\n    }\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/ane.js",
    "content": "var aneObj = function () {\n    this.rootx = [];\n    this.headx = [];\n    this.heady = [];\n    this.amp = [];\n    this.alpha = 0;\n}\naneObj.prototype.num = 50;\naneObj.prototype.init = function () {\n    for (var i = 0; i < this.num; i++) {\n        this.rootx[i] = i * 16 + Math.random() * 20;\n        this.headx[i] = this.rootx[i];\n        this.heady[i] = canHeight - 250 + Math.random() * 50;\n        this.amp[i] = Math.random() * 50 + 50;\n    }\n}\naneObj.prototype.draw = function () {\n\n    this.alpha += deltaTime * 0.0008;\n    var l = Math.sin(this.alpha);\n    ctx2.save();\n    ctx2.globalAlpha = 0.6;\n    ctx2.lineWidth = 20;\n    ctx2.lineCap = \"round\";\n    ctx2.strokeStyle = \"#3b154e\";\n    for (var i = 0; i < this.num; i++) {\n        ctx2.beginPath();\n        ctx2.moveTo(this.rootx[i], canHeight);\n        this.headx[i] = this.rootx[i] + l * this.amp[i];\n        ctx2.quadraticCurveTo(this.rootx[i], canHeight - 100, this.headx[i], this.heady[i]);\n        ctx2.stroke();\n    }\n    ctx2.restore();\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/baby.js",
    "content": "var babyObj = function () {\n    this.x;\n    this.y;\n    this.angle;\n    this.babyBody = new Image();\n\n    this.babyTailTimer = 0;\n    this.babyTailCount = 0;\n\n    this.babyEyeTimer = 0;\n    this.babyEyeCount = 0;\n    this.babyEyeInterval = 1000;\n\n    this.babyBodyTimer = 0;\n    this.babyBodyCount = 0;\n\n}\nbabyObj.prototype.init = function () {\n    this.x = canWidth * 0.5 - 50;\n    this.y = canHeight * 0.5 + 50;\n    this.angle = 0;\n    this.babyBody.src = \"img/fish/babyFade0.png\";\n}\nbabyObj.prototype.draw = function () {\n    this.x = lerpDistance(mom.x, this.x, 0.98);\n    this.y = lerpDistance(mom.y, this.y, 0.98);\n\n    var deltaY = mom.y - this.y;\n    var deltaX = mom.x - this.x;\n    var beta = Math.atan2(deltaY, deltaX) + Math.PI;\n\n    this.angle = lerpAngle(beta, this.angle, 0.6);\n\n    this.babyTailTimer += deltaTime;\n    if (this.babyTailTimer > 50) {\n        this.babyTailCount = (this.babyTailCount + 1) % 8;\n        this.babyTailCount %= 50;\n    }\n\n    this.babyEyeTimer += deltaTime;\n    if (this.babyEyeTimer > this.babyEyeInterval) {\n        this.babyEyeCount = (this.babyEyeCount + 1) % 2;\n        this.babyEyeTimer %= this.babyEyeInterval;\n\n        if (this.babyEyeCount == 0) {\n            this.babyEyeInterval = Math.random() * 1500 + 2000;\n        } else {\n            this.babyEyeInterval = 200;\n        }\n    }\n\n    this.babyBodyTimer += deltaTime;\n    if (this.babyBodyTimer > 300) {\n        this.babyBodyCount = this.babyBodyCount + 1;\n        this.babyBodyTimer %= 300;\n        if (this.babyBodyCount > 19) {\n            this.babyBodyCount = 19;//game over\n            data.gameOver = true;\n        }\n    }\n    ctx1.save();\n    ctx1.translate(this.x, this.y);\n    ctx1.rotate(this.angle);\n\n    var babyTailCount = this.babyTailCount;\n    ctx1.drawImage(babyTail[babyTailCount], -babyTail[babyTailCount].width * 0.5 + 23, -babyTail[babyTailCount].height * 0.5);\n    var babyBodyCount = this.babyBodyCount;\n    ctx1.drawImage(babyBody[babyBodyCount], -babyBody[babyBodyCount].width * 0.5, -babyBody[babyBodyCount].height * 0.5);\n    var babyEyeCount = this.babyEyeCount;\n    ctx1.drawImage(babyEye[babyEyeCount], -babyEye[babyEyeCount].width * 0.5, -babyEye[babyEyeCount].height * 0.5);\n    ctx1.restore();\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/background.js",
    "content": "function drawBackground(){\n    ctx2.drawImage(bgPic,0,0,canWidth,canHeight);\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/collision.js",
    "content": "//判断大鱼和果实的距离\nfunction momFruitsCollision() {\n    if (!data.gameOver) {\n        for (var i = 0; i < fruit.num; i++) {\n            if (fruit.alive[i]) {\n                var l = calLength2(fruit.x[i], fruit.y[i], mom.x, mom.y);\n                if (l < 900) {\n                    fruit.dead(i);\n                    data.fruitNum++;\n                    mom.momBodyCount++;\n                    if (mom.momBodyCount > 7) {\n                        mom.momBodyCount = 7;\n                    }\n                    if (fruit.fruitType[i] == \"blue\") {\n                        data.double = 2;\n                    }\n                    wave.born(fruit.x[i], fruit.y[i]);\n                }\n            }\n        }\n    }\n\n}\n//喂食\nfunction momBabyCollision() {\n    if (data.fruitNum > 0 && !data.gameOver) {\n        var l = calLength2(mom.x, mom.y, baby.x, baby.y);\n        if (l < 900) {\n            baby.babyBodyCount = 0;\n\n            mom.momBodyCount = 0;\n\n            data.addScore();\n            halo.born(baby.x, baby.y);\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/commonFunctions.js",
    "content": "window.requestAnimFrame = (function () {\n    return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||\n        function (/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {\n            return window.setTimeout(callback, 1000 / 60);\n        };\n})();\n\n\nfunction calLength2(x1, y1, x2, y2) {\n    return Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2);\n}\n\n\nfunction randomColor() {\n    var col = [0, 1, 2];\n    col[0] = Math.random() * 100 + 155;\n    col[0] = col[0].toFixed();\n    col[1] = Math.random() * 100 + 155;\n    col[1] = col[1].toFixed();\n    col[2] = Math.random() * 100 + 155;\n    col[2] = col[2].toFixed();\n    var num = Math.floor(Math.random() * 3);\n    col[num] = 0;\n    return \"rgba(\" + col[0] + \",\" + col[1] + \",\" + col[2] + \",\";\n}\n\n\nfunction lerpAngle(a, b, t) {\n    var d = b - a;\n    if (d > Math.PI) d = d - 2 * Math.PI;\n    if (d < -Math.PI) d = d + 2 * Math.PI;\n    return a + d * t;\n}\n\nfunction lerpDistance(aim, cur, ratio) {\n    var delta = cur - aim;\n    return aim + delta * ratio;\n}\n\nfunction inOboundary(arrX, arrY, l, r, t, b) { //在l r t b范围内的检测\n    return arrX > l && arrX < r && arrY > t && arrY < b;\n}\n\nfunction rgbColor(r, g, b) {\n    r = Math.round(r * 256);\n    g = Math.round(g * 256);\n    b = Math.round(b * 256);\n    return \"rgba(\" + r + \",\" + g + \",\" + b + \",1)\";\n}\n\nfunction rgbNum(r, g, b) {\n    r = Math.round(r * 256);\n    g = Math.round(g * 256);\n    b = Math.round(b * 256);\n    return \"rgba(\" + r + \",\" + g + \",\" + b;\n}\n\nfunction rnd(m) {\n    var n = m || 1;\n    return Math.random() * n;\n}\n\nfunction rateRandom(m, n) {\n    var sum = 0;\n    for (var i = 1; i < (n - m); i++) {\n        sum += i;\n\n    }\n\n    var ran = Math.random() * sum;\n\n    for (var i = 1; i < (n - m); i++) {\n        ran -= i;\n        if (ran < 0) {\n            return i - 1 + m;\n        }\n    }\n}\n\nfunction distance(x1, y1, x2, y2, l) {\n    var x = Math.abs(x1 - x2);\n    var y = Math.abs(y1 - y2);\n    if (x < l && y < l) {\n        return true;\n    }\n    return false;\n}\n\nfunction AABBbox(object1, w1, h1, object2, w2, h2, overlap) {\n    A1 = object1.x + overlap;\n    B1 = object1.x + w1 - overlap;\n    C1 = object1.y + overlap;\n    D1 = object1.y + h1 - overlap;\n\n    A2 = object2.x + overlap;\n    B2 = object2.x + w2 - overlap;\n    C2 = object2.y + overlap;\n    D2 = object2.y + h2 - overlap;\n\n    if (A1 > B2 || B1 < A2 || C1 > D2 || D1 < C2) return false;\n    else return true;\n}\n\n\nfunction dis2(x, y, x0, y0) {\n    var dx = x - x0;\n    var dy = y - y0;\n    return dx * dx + dy * dy;\n}\n\nfunction rndi2(m, n) {\n    var a = Math.random() * (n - m) + m;\n    return Math.floor(a);\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/data.js",
    "content": "var dataObj = function () {\n    this.fruitNum = 0;\n    this.double = 1;\n    this.score = 0;\n    this.gameOver = false;\n    this.alpha = 0;\n}\n\n\ndataObj.prototype.draw = function () {\n    var w = can1.width;\n    var h = can1.height;\n\n    ctx1.save();\n    ctx1.shadowBlur = 10;\n    ctx1.shadowColor = \"white\";\n    ctx1.fillStyle = \"white\";\n    ctx1.fillText(\"SCORE: \" + this.score, w * 0.5, h - 20);\n\n    if (this.gameOver) {\n        this.alpha += deltaTime * 0.0005;\n        if (this.alpha > 1) {\n            this.alpha = 1;\n        }\n        ctx1.fillStyle = \"rgba(255,255,255,\" + this.alpha + \")\";\n        ctx1.fillText(\"GAMEOVER\", w * 0.5, h * 0.5);\n        ctx1.fillText(\"GAMEOVER\", w * 0.5, h * 0.5);\n        playbtn.style.display = \"block\";\n    }\n    ctx1.restore();\n}\n\ndataObj.prototype.addScore = function () {\n    this.score += this.fruitNum * 100 * this.double;\n    this.fruitNum = 0;\n    this.double = 1;\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/dust.js",
    "content": "var dustObj = function () {\n    this.x = [];\n    this.y = [];\n    this.amp = [];\n    this.NO = [];\n    this.alpha;\n}\ndustObj.prototype.num = 30;\ndustObj.prototype.init = function () {\n    for (var i = 0; i < this.num; i++) {\n        this.x[i] = Math.random() * canWidth;\n        this.y[i] = Math.random() * canHeight;\n        this.amp[i] = 20 * Math.random() * 10;\n        this.NO[i] = Math.floor(Math.random() * 7);\n    }\n    this.alpha = 0;\n}\ndustObj.prototype.draw = function () {\n    this.alpha += deltaTime * 0.0008;\n    var l = Math.sin(this.alpha);\n    for (var i = 0; i < this.num; i++) {\n        var no = this.NO[i];\n        ctx1.drawImage(dustPic[no], this.x[i] + this.amp[i] * l, this.y[i]);\n    }\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/fruit.js",
    "content": "var fruitObj = function () {\n    this.alive = [];\n    this.x = [];\n    this.y = [];\n    this.l = [];\n    this.spd = [];\n    this.aneNo = []\n    this.fruitType = [];\n    this.orange = new Image();\n    this.blue = new Image();\n\n}\nfruitObj.prototype.num = 30;\n\nfruitObj.prototype.init = function () {\n    for (var i = 0; i < this.num; i++) {\n        this.alive[i] = false;\n        this.x[i] = 0;\n        this.y[i] = 0;\n        this.aneNo[i] = 0;\n        this.spd[i] = Math.random() * 0.017 + 0.003;\n        this.fruitType[i] = \"\";\n    }\n    this.orange.src = \"img/fish/fruit.png\";\n    this.blue.src = \"img/fish/blue.png\";\n}\nfruitObj.prototype.draw = function () {\n    for (var i = 0; i < this.num; i++) {\n        if (this.alive[i]) {\n            if (this.fruitType[i] == \"blue\") {\n                var pic = this.blue;\n            } else {\n                var pic = this.orange;\n            }\n            if (this.l[i] <= 14) {//grow\n                var NO = this.aneNo[i];\n                this.x[i] = ane.headx[NO];\n                this.y[i] = ane.heady[NO];\n                this.l[i] += this.spd[i] * deltaTime;\n            }\n            else {\n                this.y[i] -= this.spd[i] * 7 * deltaTime;\n            }\n            ctx2.drawImage(pic, this.x[i] - this.l[i] * 0.5, this.y[i] - this.l[i] * 0.5, this.l[i], this.l[i]);\n            if (this.y[i] < 10) {\n                this.alive[i] = false;\n            }\n        }\n\n    }\n}\n\nfruitObj.prototype.born = function (i) {\n    this.aneNo[i] = Math.floor(Math.random() * ane.num);\n    ;\n    this.l[i] = 0;\n    this.alive[i] = true;\n    var ran = Math.random();\n    if (ran < 0.2) {\n        this.fruitType[i] = \"blue\";\n    } else {\n        this.fruitType[i] = \"orange\";\n    }\n\n}\nfruitObj.prototype.dead = function (i) {\n    this.alive[i] = false;\n}\nfunction fruitMonitor() {\n    var num = 0;\n    for (var i = 0; i < fruit.num; i++) {\n        if (fruit.alive[i])\n            num++;\n    }\n    if (num < 15) {\n        sendFruit();\n        return;\n    }\n}\n\nfunction sendFruit() {\n    for (var i = 0; i < fruit.num; i++) {\n        if (!fruit.alive[i]) {\n            fruit.born(i);\n            return;\n        }\n    }\n}\n\n\nfruitObj.prototype.update = function () {\n    var num = 0;\n    for (var i = 0; i < this.num; i++) {\n        if (this.alive[i]) num++;\n    }\n\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/halo.js",
    "content": "var haloObj = function () {\n    this.x = [];\n    this.y = [];\n    this.alive = [];\n    this.r = [];\n}\nhaloObj.prototype.num = 5;\nhaloObj.prototype.init = function () {\n    for (var i = 0; i < this.num; i++) {\n        this.x[i] = 0;\n        this.y[i] = 0;\n        this.alive[i] = false;\n        this.r[i] = 0;\n    }\n}\nhaloObj.prototype.draw = function () {\n    ctx1.save();\n    ctx1.lineWidth = 2;\n    ctx1.shadowBlue = 10;\n    ctx1.shadowColor = \"rgba(134,45,145,1)\";\n    for (var i = 0; i < this.num; i++) {\n        if (this.alive[i]) {\n            this.r[i] += deltaTime * 0.05;\n            if (this.r[i] > 100) {\n                this.alive[i] = false;\n                break;\n            }\n            var alpha = 1 - this.r[i] / 100;\n\n            ctx1.beginPath();\n            ctx1.arc(this.x[i], this.y[i], this.r[i], 0, Math.PI * 2);\n            ctx1.closePath();\n            ctx1.strokeStyle = \"rgba(203,91,0,\" + alpha + \")\";\n            ctx1.stroke();\n        }\n    }\n    ctx1.restore();\n}\nhaloObj.prototype.born = function (x, y) {\n    for (var i = 0; i < this.num; i++) {\n        if (!this.alive[i]) {\n            this.x[i] = x;\n            this.y[i] = y;\n            this.r[i] = 10;\n            this.alive[i] = true;\n\n        }\n    }\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/main.js",
    "content": "var can1;\nvar can2;\n\nvar canWidth;\nvar canHeight;\n\nvar ctx1;\nvar ctx2;\n\nvar lastTime;\nvar deltaTime;\n\nvar bgPic = new Image();\n\nvar ane;\n\nvar fruit;\n\nvar mom;\n\nvar baby;\n\nvar mx;\nvar my;\n\nvar babyTail = [];\nvar babyEye = [];\nvar babyBody = [];\n\nvar momTail = [];\nvar momEye = [];\nvar momBodyOra = [];\nvar momBodyBlue = [];\nvar data;\n\nvar wave;\nvar halo;\n\nvar dust;\nvar dustPic = [];\nvar playbtn = document.getElementById(\"playbtn\");\n\ndocument.body.onload = game;\n\n\nfunction game() {\n    playbtn.style.display = \"none\";\n    init();\n    lastTime = Date.now();\n    deltaTime = 0;\n    gameloop();\n}\n\nfunction init() {\n    //获得canvas context\n    can1 = document.getElementById(\"canvas1\");//fishes,dust,UI,circle\n    ctx1 = can1.getContext('2d');\n    can2 = document.getElementById(\"canvas2\");//background,ane,fruits\n    ctx2 = can2.getContext('2d');\n\n    can1.addEventListener('mousemove', onmouseMove, false);\n\n    bgPic.src = \"img/fish/background.jpg\";\n\n    canWidth = can1.width;\n    canHeight = can1.height;\n\n    ane = new aneObj();\n    ane.init();\n\n    fruit = new fruitObj();\n    fruit.init();\n\n    mom = new momObj();\n    mom.init();\n\n    baby = new babyObj();\n    baby.init();\n\n    mx = canWidth * 0.5;\n    my = canHeight * 0.5;\n\n    for (var i = 0; i < 8; i++) {\n        babyTail[i] = new Image();\n        babyTail[i].src = \"img/fish/babyTail\" + i + \".png\";\n    }\n    for (var i = 0; i < 2; i++) {\n        babyEye[i] = new Image();\n        babyEye[i].src = \"img/fish/babyEye\" + i + \".png\";\n    }\n    for (var i = 0; i < 20; i++) {\n        babyBody[i] = new Image();\n        babyBody[i].src = \"img/fish/babyFade\" + i + \".png\";\n    }\n    for (var i = 0; i < 8; i++) {\n        momTail[i] = new Image();\n        momTail[i].src = \"img/fish/bigTail\" + i + \".png\";\n    }\n    for (var i = 0; i < 2; i++) {\n        momEye[i] = new Image();\n        momEye[i].src = \"img/fish/bigEye\" + i + \".png\";\n    }\n\n    data = new dataObj();\n\n    for (var i = 0; i < 8; i++) {\n        momBodyOra[i] = new Image();\n        momBodyBlue[i] = new Image();\n        momBodyOra[i].src = \"img/fish/bigSwim\" + i + \".png\";\n        momBodyBlue[i].src = \"img/fish/bigSwimBlue\" + i + \".png\";\n\n    }\n    ctx1.font = \"30px Verdana\";\n    ctx1.textAlign = \"center\";\n\n    wave = new waveObj();\n    wave.init();\n\n    halo = new haloObj();\n    halo.init();\n\n    for (var i = 0; i < 7; i++) {\n        dustPic[i] = new Image();\n        dustPic[i].src = \"img/fish/dust\" + i + \".png\";\n    }\n    dust = new dustObj();\n    dust.init();\n}\n\nfunction gameloop() {\n    window.requestAnimationFrame(gameloop);//根据机器的配置来决定延迟多少时间来绘制下一帧\n    var now = Date.now();\n    deltaTime = now - lastTime;\n    lastTime = now;\n    if (deltaTime > 40) {\n        deltaTime = 40;\n    }\n\n    drawBackground();\n    ane.draw();\n    fruitMonitor();\n    fruit.draw();\n\n    ctx1.clearRect(0, 0, canWidth, canHeight);\n    mom.draw();\n    baby.draw();\n    momFruitsCollision();\n    momBabyCollision();\n\n    data.draw();\n    wave.draw();\n    halo.draw();\n    dust.draw();\n}\n\nfunction onmouseMove(e) {\n    if (!data.gameOver) {\n        if (e.offSetX || e.layerX) {\n            mx = e.offSetX == undefined ? e.layerX : e.offSetX;\n            my = e.offSetY == undefined ? e.layerY : e.offSetY;\n        }\n    }\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/mom.js",
    "content": "var momObj = function () {\n    this.x;\n    this.y;\n    this.angle;\n\n    this.momTailTimer = 0;\n    this.momTailcount = 0;\n\n    this.momEyeTimer = 0;\n    this.momEyeCount = 0;\n    this.momEyeInterval = 1000;\n\n    this.momBodyCount = 0;\n}\nmomObj.prototype.init = function () {\n    this.x = canWidth * 0.5;\n    this.y = canHeight * 0.5;\n    this.angle = 0;\n\n}\n\nmomObj.prototype.draw = function () {\n    this.x = lerpDistance(mx, this.x, 0.98);\n    this.y = lerpDistance(my, this.y, 0.99);\n\n    var deltaY = my - this.y;\n    var deltaX = mx - this.x;\n    var beta = Math.atan2(deltaY, deltaX) + Math.PI;\n\n    this.angle = lerpAngle(beta, this.angle, 0.6);\n\n    this.momTailTimer += deltaTime;\n    if (this.momTailTimer > 50) {\n        this.momTailcount = (this.momTailcount + 1) % 8;\n        this.momTailTimer %= 50;\n    }\n\n    this.momEyeTimer += deltaTime;\n    if (this.momEyeTimer > this.momEyeInterval) {\n        this.momEyeCount = (this.momEyeCount + 1) % 2;\n        this.momEyeTimer %= this.momEyeInterval;\n        if (this.momEyeCount == 0) {\n            this.momEyeInterval = Math.random() * 1500 + 2000;\n        } else {\n            this.momEyeInterval = 200;\n        }\n    }\n\n    ctx1.save();\n    ctx1.translate(this.x, this.y);\n    ctx1.rotate(this.angle);\n    var momTailcount = this.momTailcount;\n    ctx1.drawImage(momTail[momTailcount], -momTail[momTailcount].width * 0.5 + 30, -momTail[momTailcount].height * 0.5);\n    var momBodyCount = this.momBodyCount;\n    if (data.double == 1) {\n        ctx1.drawImage(momBodyOra[momBodyCount], -momBodyOra[momBodyCount].width * 0.5, -momBodyOra[momBodyCount].height * 0.5);\n    } else {\n        ctx1.drawImage(momBodyBlue[momBodyCount], -momBodyBlue[momBodyCount].width * 0.5, -momBodyBlue[momBodyCount].height * 0.5);\n    }\n    var momEyeCount = this.momEyeCount;\n    ctx1.drawImage(momEye[momEyeCount], -momEye[momEyeCount].width * 0.5, -momEye[momEyeCount].height * 0.5);\n\n    ctx1.restore();\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/fishjs/wave.js",
    "content": "var waveObj = function () {\n    this.x = [];\n    this.y = [];\n    this.alive = [];\n    this.r = [];\n}\nwaveObj.prototype.num = 10;\nwaveObj.prototype.init = function () {\n    for (var i = 0; i < this.num; i++) {\n        this.alive[i] = false;\n        this.r[i] = 0;\n    }\n}\nwaveObj.prototype.draw = function () {\n    ctx1.save();\n    ctx1.lineWidth = 2;\n    ctx1.shadowBlue = 10;\n    ctx1.shadowColor = \"white\";\n\n    for (var i = 0; i < this.num; i++) {\n        if (this.alive[i]) {\n            this.r[i] += deltaTime * 0.04;\n            if (this.r[i] > 50) {\n                this.alive[i] = false;\n                break;\n            }\n\n            var alpha = 1 - this.r[i] / 50;\n            ctx1.beginPath();\n            ctx1.arc(this.x[i], this.y[i], this.r[i], 0, Math.PI * 2);\n            ctx1.closePath();\n            ctx1.strokeStyle = \"rgba(255,255,255,\" + alpha + \")\";\n            ctx1.stroke();\n        }\n    }\n    ctx1.restore();\n}\nwaveObj.prototype.born = function (x, y) {\n    for (var i = 0; i < this.num; i++) {\n        if (!this.alive[i]) {\n            this.alive[i] = true;\n            this.r[i] = 10;\n            this.x[i] = x;\n            this.y[i] = y;\n            return;\n        }\n    }\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/index.js",
    "content": "$(\n    function () {\n        var j = 1;\n        $.post(\"/everyday\", function (result) {\n            for (i = 0; i < 5; i++) {\n                document.getElementById(\"gameurl_\" + i).href = \"/game/\" + result.data[i].id;\n                document.getElementById(\"gameimg_\" + i).src = \"/img\" + result.data[i].img[0];\n                document.getElementById(\"gamename_\" + i).innerText = result.data[i].name;\n            }\n        })\n        var myTabContent = document.getElementById(\"myTabContent\");\n        $.post(\"/newestgames\", function (result) {\n            var i = 0;\n            var div = document.createElement(\"div\");\n            div.className = \"tab-pane fade in active\";\n            div.id = \"home\";\n            div.innerHTML = \"\";\n            while (result.data[i]) {\n                if (result.data[i].price == '0') {\n                    result.data[i].price = \"免费\"\n                } else {\n                    result.data[i].price = \"¥\" + result.data[i].price;\n                }\n                div.innerHTML += \"<div class='row rowpy'>\" +\n                    \"<div class='col-md-6 cancelpadding'>\" +\n                    \"<a href='/game/\" + result.data[i].id + \"'>\" +\n                    \"<img src='/img\" + result.data[i].img[0] + \"' onmouseover='hoverShowDiv_1(\" + i + \")' class='zximgwh'>\" +\n                    \"</a>\" +\n                    \"</div>\" +\n                    \"<div class='col-md-6 cancelpadding'>\" +\n                    \"<div class='smargin'>游戏名：\" + result.data[i].name + \"</div>\" +\n                    \"<div class='smargin_1'>价格：\" + result.data[i].price + \"</div>\" +\n                    \"<div class='smargin_2'>制造商：\" + result.data[i].creater + \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\";\n                myTabContent.appendChild(div);\n                i++;\n                var divHover = document.getElementById(\"divHover\");\n                divHover.className = \"divHover\";\n                divHover.innerHTML = \"\";\n                divHover.innerHTML += \"<div class='smargin_3'>\" + result.data[0].name + \"</div>\" +\n                    \"<div class='smargin_4'>\" + result.data[0].desc + \"</div> \";\n                j = 1;\n                while (result.data[0].img[j]) {\n                    divHover.innerHTML += \"<img src='/img\" + result.data[0].img[j] + \"'  class='zximgwh_1'>\";\n                    j++;\n                }\n            }\n        })\n        j = 1;\n        var myTabContent = document.getElementById(\"myTabContent\");\n        $.post(\"/preupgames\", function (result) {\n            var i = 0;\n            var div = document.createElement(\"div\");\n            div.className = \"tab-pane fade in\";\n            div.id = \"jijiang\";\n            div.innerHTML = \"\";\n            while (result.data[i]) {\n                if (result.data[i].price == '0') {\n                    result.data[i].price = \"免费\"\n                } else {\n                    result.data[i].price = \"¥\" + result.data[i].price;\n                }\n                div.innerHTML += \"<div class='row rowpy'>\" +\n                    \"<div class='col-md-6 cancelpadding'>\" +\n                    \"<a href='/game/\" + result.data[i].id + \"'>\" +\n                    \"<img src='/img\" + result.data[i].img[0] + \"' onmouseover='hoverShowDiv_2(\" + i + \")' class='zximgwh'>\" +\n                    \"</a>\" +\n                    \"</div>\" +\n                    \"<div class='col-md-6 cancelpadding'>\" +\n                    \"<div class='smargin'>游戏名：\" + result.data[i].name + \"</div>\" +\n                    \"<div class='smargin_1'>价格：\" + result.data[i].price + \"</div>\" +\n                    \"<div class='smargin_2'>制造商：\" + result.data[i].creater + \"</div>\" +\n                    \"</div>\" +\n                    \"</div>\";\n                myTabContent.appendChild(div);\n                i++;\n                var divHover = document.getElementById(\"divHover\");\n                divHover.className = \"divHover\";\n                divHover.innerHTML = \"\";\n                divHover.innerHTML += \"<div class='smargin_3'>\" + result.data[0].name + \"</div>\" +\n                    \"<div class='smargin_4'>\" + result.data[0].desc + \"</div> \";\n                j = 1;\n                while (result.data[0].img[j]) {\n                    divHover.innerHTML += \"<img src='/img\" + result.data[0].img[j] + \"'  class='zximgwh_1'>\";\n                    j++;\n                }\n            }\n        })\n\n        $.post(\"/freegames\", function (result) {\n            var freegames_1 = document.getElementById(\"freegames_1\");\n            for (var i = 0; i < 6; i++) {\n                var div = document.createElement(\"div\");\n                div.className = \"item_1_2\";\n                div.innerHTML = \"<a href='/game/\" + result.data[i].id + \"'><img class='item_1_1' src='/img\" + result.data[i].img[0] + \"'></a>\";\n                freegames_1.appendChild(div);\n            }\n            var freegames_0 = document.getElementById(\"freegames_0\");\n            for (var i = 6; i < 12; i++) {\n                var div = document.createElement(\"div\");\n                div.className = \"item_1_2\";\n                div.innerHTML = \"<a href='/game/\" + result.data[i].id + \"'><img class='item_1_1' src='/img\" + result.data[i].img[0] + \"'></a>\";\n                freegames_0.appendChild(div);\n            }\n        })\n    }\n);\n\nfunction hoverShowDiv_1(i) {\n    var j = 1;\n    var divHover = document.getElementById(\"divHover\");\n    divHover.className = \"divHover\";\n    divHover.innerHTML = \"\";\n    $.post(\"/newestgames\", function (result) {\n        var desc = (result.data[i].desc).substring(0, 100);\n        divHover.innerHTML += \"<div class='smargin_3'>\" + result.data[i].name + \"</div>\" +\n            \"<div class='smargin_4'>\" + desc + \"</div> \";\n        while (result.data[i].img[j]) {\n            divHover.innerHTML += \"<img src='/img\" + result.data[i].img[j] + \"'  class='zximgwh_1'>\";\n            j++;\n        }\n    })\n}\nfunction hoverShowDiv_2(i) {\n    var j = 1;\n    var divHover = document.getElementById(\"divHover\");\n    divHover.className = \"divHover\";\n    divHover.innerHTML = \"\";\n    $.post(\"/preupgames\", function (result) {\n        var desc = (result.data[i].desc).substring(0, 100);\n        divHover.innerHTML += \"<div class='smargin_3'>\" + result.data[i].name + \"</div>\" +\n            \"<div class='smargin_4'>\" + desc + \"</div> \";\n        while (result.data[i].img[j]) {\n            divHover.innerHTML += \"<img src='/img\" + result.data[i].img[j] + \"'  class='zximgwh_1'>\";\n            j++;\n        }\n    })\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/login.js",
    "content": "function login() {\n    var name = document.getElementById(\"name\").value;\n    var password = document.getElementById(\"password\").value;\n    var remember = document.getElementById(\"remember\").checked;\n    $.post(\"/login\", {username: name, password: password, remember: remember},\n        function (result) {\n            if (result.success) {\n                window.location.href = result.data.referer;\n            }\n            else {\n                if (result.msg == \"OK\") {\n                    window.location.href = result.data;\n                } else {\n                    alert(result.msg);\n                }\n            }\n        })\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/order.js",
    "content": "$(\n    function () {\n        getpaid(1);\n        getcancel(1);\n        getnotpay(1);\n    }\n)\nfunction getpaid(pagenum) {\n    $.post(\"/order/paid/\" + pagenum, function (result) {\n            if (result.data.order[0]) {\n                var i = 0;\n                var mytable = document.createElement(\"table\");\n                mytable.id = \"myTable\";\n                mytable.className = \"table\";\n                mytable.innerHTML = \"<thead id='myThead' style='color: #67c1f5'><th width='25%'>序 号</th><th width='35%'>总 价</th><th width='30%'>下单时间</th></thead><tbody id='myTbody' style='color:#630'></tbody>\";\n                var order1 = document.getElementById(\"already\");\n                order1.innerHTML = \"\";\n                order1.appendChild(mytable);\n\n                var orderclass = document.getElementById(\"myTbody\");\n                orderclass.innerHTML = \"\";\n                while (result.data.order[i]) {\n                    var row = document.createElement(\"tr\");\n                    var time = new Date(result.data.order[i].ctime).toLocaleString();\n                    var prices = result.data.order[i].total;\n                    var k = 10 * (pagenum - 1) + i + 1;\n                    row.innerHTML = \"<td>\" + \"<div class='dropdown'> <button type='button' class='btn dropdown-toggle' id='dropdownMenu1' data-toggle='dropdown'>\" + k + \"<span class='caret'></span> </button><ul id = 'ula_\" + i + \"'class='dropdown-menu' role='menu' aria-labelledby='dropdownMenu1'>\" + \"</td><td>\" + prices + \"</td><td>\" + time + \"</td>\";\n                    orderclass.appendChild(row);\n                    i++;\n                }\n                var div = document.createElement(\"div\");\n                div.className = \"pagination pagination-right yema divsetcenter\";\n                div.innerHTML = \"<ul id='paging_1'></ul>\";\n                var orderclass01 = document.getElementById(\"already\");\n                orderclass01.appendChild(div);\n                var k = 0;\n                var j = 0;\n                while (result.data.order[k]) {\n                    var ul = document.getElementById(\"ula_\" + k);\n                    while (result.data.order[k].orderitems[j]) {\n                        var li = document.createElement(\"li\");\n                        var gid = result.data.order[k].orderitems[j].game.id;\n                        var price = result.data.order[k].orderitems[j].game.price;\n                        li.setAttribute(\"role\", \"presentation\");\n                        li.innerHTML = \"<a role='menuitem' tabindex='-1' href='/game/\" + gid + \"'><div class='divwidth'><div class='setleft'>\" + result.data.order[k].orderitems[j].game.name + \"</div><div class='setright'>\" + \"¥\" + price + \"</div></div></a>\";\n                        ul.appendChild(li);\n                        j++;\n                    }\n                    k++;\n                    j = 0;\n                }\n                var ul = document.getElementById(\"paging_1\");\n                ul.className = \"pagination\";\n                var pages = result.data.page.pages;\n                var current = result.data.page.current;\n                var last = current - 1;\n                var next = current + 1;\n                if (last < 1) {\n                    last = 1\n                }\n                if (next > pages) {\n                    next = pages\n                }\n                var li_first = document.createElement(\"li\");\n                li_first.id = \"li1_first\";\n                li_first.innerHTML = \"<a href='#'onclick='getpaid(\" + last + \")'>&laquo;</a>\";\n                ul.appendChild(li_first);\n                for (i = 0; i < pages; i++) {\n                    var j = i + 1;\n                    var li = document.createElement(\"li\");\n                    li.id = \"li1_\" + j;\n                    li.innerHTML = \"<a href='#'onclick='getpaid(\" + j + \")'>\" + j + \"</a>\";\n                    ul.appendChild(li);\n                }\n                document.getElementById(\"li1_\" + pagenum).className = \"active\";\n                var li_last = document.createElement(\"li\");\n                li_last.id = \"li1_next\";\n                li_last.innerHTML = \"<a href='#'onclick='getpaid(\" + next + \")'>&raquo;</a>\";\n                ul.appendChild(li_last);\n            }\n        }\n    )\n}\nfunction getnotpay(pagenum) {\n    $.post(\"/order/notpay/\" + pagenum, function (result) {\n            if (result.data.order[0]) {\n                var i = 0;\n                var oid = result.data.order[i].id;\n                var mytable = document.createElement(\"table\");\n                mytable.id = \"myTable1\";\n                mytable.className = \"table\";\n                mytable.innerHTML = \"<thead id='myThead1' style='color: #67c1f5'><th width='25%'>序 号</th><th width='35%'>总 价</th><th width='30%'>下单时间</th></thead><tbody id='myTbody1' style='color:#630'></tbody>\";\n                var order1 = document.getElementById(\"yet\");\n                order1.innerHTML = \"\";\n                order1.appendChild(mytable);\n\n                var orderclass = document.getElementById(\"myTbody1\");\n                orderclass.innerHTML = \"\";\n                while (result.data.order[i]) {\n                    var row = document.createElement(\"tr\");\n                    var time = new Date(result.data.order[i].ctime).toLocaleString();\n                    var prices = result.data.order[i].total;\n                    var k = 10 * (pagenum - 1) + i + 1;\n                    row.innerHTML = \"<td>\" +\n                        \"<div class='dropdown'> <button type='button' class='btn dropdown-toggle' id='dropdownMenu1' data-toggle='dropdown'>\" + k +\n                        \"<span class='caret'></span> </button><ul id = 'ulb_\" + i + \"'class='dropdown-menu' role='menu' aria-labelledby='dropdownMenu1'>\" +\n                        \"</td><td>\" + prices + \"</td><td>\" + time + \"</td><th><button class='btn smargin' onclick='topay(\" + oid + \")'>去支付</button></th>\" +\n                        \"<th><button class='btn smargin' onclick='cancel(\" + oid + \")'>取消</button></th>\";\n                    orderclass.appendChild(row);\n                    i++;\n                }\n                var div = document.createElement(\"div\");\n                div.className = \"pagination pagination-right yema divsetcenter\";\n                div.innerHTML = \"<ul id='paging_2'></ul>\";\n                var orderclass01 = document.getElementById(\"yet\");\n                orderclass01.appendChild(div);\n                var k = 0;\n                var j = 0;\n                while (result.data.order[k]) {\n                    var ul = document.getElementById(\"ulb_\" + k);\n                    while (result.data.order[k].orderitems[j]) {\n                        var li = document.createElement(\"li\");\n                        var gid = result.data.order[k].orderitems[j].game.id;\n                        var price = result.data.order[k].orderitems[j].game.price;\n                        li.setAttribute(\"role\", \"presentation\");\n                        li.innerHTML = \"<a role='menuitem' tabindex='-1' href='/game/\" + gid + \"'><div class='divwidth'><div class='setleft'>\" + result.data.order[k].orderitems[j].game.name + \"</div><div class='setright'>\" + \"¥\" + price + \"</div></div></a>\";\n                        ul.appendChild(li);\n                        j++;\n                    }\n                    k++;\n                    j = 0;\n                }\n                var ul = document.getElementById(\"paging_2\");\n                ul.className = \"pagination\";\n                var pages = result.data.page.pages;\n                var current = result.data.page.current;\n                var last = current - 1;\n                var next = current + 1;\n                if (last < 1) {\n                    last = 1\n                }\n                if (next > pages) {\n                    next = pages\n                }\n                var li_first = document.createElement(\"li\");\n                li_first.id = \"li2_first\";\n                li_first.innerHTML = \"<a href='#'onclick='getnotpay(\" + last + \")'>&laquo;</a>\";\n                ul.appendChild(li_first);\n                for (i = 0; i < pages; i++) {\n                    var j = i + 1;\n                    var li = document.createElement(\"li\");\n                    li.id = \"li2_\" + j;\n                    li.innerHTML = \"<a href='#'onclick='getnotpay(\" + j + \")'>\" + j + \"</a>\";\n                    ul.appendChild(li);\n                }\n                document.getElementById(\"li2_\" + pagenum).className = \"active\";\n                var li_last = document.createElement(\"li\");\n                li_last.id = \"li2_next\";\n                li_last.innerHTML = \"<a href='#'onclick='getnotpay(\" + next + \")'>&raquo;</a>\";\n                ul.appendChild(li_last);\n            }\n        }\n    )\n}\nfunction getcancel(pagenum) {\n    $.post(\"/order/cancel/\" + pagenum, function (result) {\n            if (result.data.order[0]) {\n                var i = 0;\n                var mytable = document.createElement(\"table\");\n                mytable.id = \"myTable2\";\n                mytable.className = \"table\";\n                mytable.innerHTML = \"<thead id='myThead2' style='color: #67c1f5'><th width='25%'>序 号</th><th width='35%'>总 价</th><th width='30%'>下单时间</th></thead><tbody id='myTbody2' style='color:#630'></tbody>\";\n                var order1 = document.getElementById(\"cancel\");\n                order1.innerHTML = \"\";\n                order1.appendChild(mytable);\n                var orderclass = document.getElementById(\"myTbody2\");\n                orderclass.innerHTML = \"\";\n                while (result.data.order[i]) {\n                    var row = document.createElement(\"tr\");\n                    var time = new Date(result.data.order[i].ctime).toLocaleString();\n                    var prices = result.data.order[i].total;\n                    var k = 10 * (pagenum - 1) + i + 1;\n                    row.innerHTML = \"<td>\" + \"<div class='dropdown'> <button type='button' class='btn dropdown-toggle' id='dropdownMenu1' data-toggle='dropdown'>\" + k + \"<span class='caret'></span> </button><ul id = 'ulc_\" + i + \"'class='dropdown-menu' role='menu' aria-labelledby='dropdownMenu1'>\" + \"</td><td>\" + prices + \"</td><td>\" + time + \"</td>\";\n                    orderclass.appendChild(row);\n                    i++;\n                }\n                var div = document.createElement(\"div\");\n                div.className = \"pagination pagination-right yema divsetcenter\";\n                div.innerHTML = \"<ul id='paging_3'></ul>\";\n                var orderclass01 = document.getElementById(\"cancel\");\n                orderclass01.appendChild(div);\n                var k = 0;\n                var j = 0;\n                while (result.data.order[k]) {\n                    var ul = document.getElementById(\"ulc_\" + k);\n                    while (result.data.order[k].orderitems[j]) {\n                        var li = document.createElement(\"li\");\n                        var gid = result.data.order[k].orderitems[j].game.id;\n                        var price = result.data.order[k].orderitems[j].game.price;\n                        li.setAttribute(\"role\", \"presentation\");\n                        li.innerHTML = \"<a role='menuitem' tabindex='-1' href='/game/\" + gid + \"'><div class='divwidth'><div class='setleft'>\" + result.data.order[k].orderitems[j].game.name + \"</div><div class='setright'>\" + \"¥\" + price + \"</div></div></a>\";\n                        ul.appendChild(li);\n                        j++;\n                    }\n                    k++;\n                    j = 0;\n                }\n                var ul = document.getElementById(\"paging_3\");\n                ul.className = \"pagination\";\n                var pages = result.data.page.pages;\n                var current = result.data.page.current;\n                var last = current - 1;\n                var next = current + 1;\n                if (last < 1) {\n                    last = 1\n                }\n                if (next > pages) {\n                    next = pages\n                }\n                var li_first = document.createElement(\"li\");\n                li_first.id = \"li3_first\";\n                li_first.innerHTML = \"<a href='#'onclick='getcancel(\" + last + \")'>&laquo;</a>\";\n                ul.appendChild(li_first);\n                for (i = 0; i < pages; i++) {\n                    var j = i + 1;\n                    var li = document.createElement(\"li\");\n                    li.id = \"li3_\" + j;\n                    li.innerHTML = \"<a href='#'onclick='getcancel(\" + j + \")'>\" + j + \"</a>\";\n                    ul.appendChild(li);\n                }\n                document.getElementById(\"li3_\" + pagenum).className = \"active\";\n                var li_last = document.createElement(\"li\");\n                li_last.id = \"li3_next\";\n                li_last.innerHTML = \"<a href='#'onclick='getcancel(\" + next + \")'>&raquo;</a>\";\n                ul.appendChild(li_last);\n            }\n        }\n    )\n}\n\nfunction cancel(oid) {\n    $.post(\"/order/\" + oid + \"/cancel\", function () {\n        location.reload();\n    })\n}\nfunction topay(oid) {\n    self.location = '/order/' + oid + '/payway'\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/personal.js",
    "content": "$(\n    function () {\n        $.post(\"/user/personal\", function (result) {\n            document.getElementById(\"userinfo_0\").innerText = \"用户名:   \" + result.data.username;\n            document.getElementById(\"userinfo_1\").innerText = \"昵称:   \" + result.data.nickname;\n            document.getElementById(\"userinfo_2\").innerText = \"邮箱:   \" + result.data.email;\n            document.getElementById(\"userinfo_3\").innerText = \"电话:   \" + result.data.phone;\n        })\n        var ul = document.getElementById(\"fenleixiangqing\");\n        var ull = document.getElementById(\"fenleiyouxitupian\");\n        $.post(\"/order/paid/1\", function (result) {\n                var i = 0;\n                var j = 0;\n                while (result.data.order[i]) {\n                    while (result.data.order[i].orderitems[j]) {\n                        var li = document.createElement(\"li\");\n                        var gid = result.data.order[i].orderitems[j].game.id;\n                        var price = result.data.order[i].orderitems[j].game.price;\n                        if (price == '0') {\n                            price = \"免费\";\n                        } else {\n                            price = \"¥\" + price;\n                        }\n                        var u;\n                        u = \"<a href='/game/\" + gid;\n                        li.innerHTML = u + \"'><div class='row fenleizitiyanse jutiyouxi'><div class='col-md-4'><img src='/img/\" + gid + \"/header.jpg' class='imgdx_1'></div><div class='col-md-8'><div class='row youximingzi'>\" +\n                            result.data.order[i].orderitems[j].game.name + \"</div><div class='row'><div class='col-md-2 col-md-offset-10'>\" + price + \"</div>\" +\n                            \"</div><div class='row youximingzi'>激活码：\" + result.data.order[i].orderitems[j].code + \"</div></div></div>\";\n                        ul.appendChild(li);\n                        j++;\n                    }\n                    console.log(i + \":\" + j);\n                    i++;\n                    j = 0;\n                }\n            }\n        )\n    })"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/regist.js",
    "content": "var wait;\n$(function () {\n    wait = 0;\n    time();\n})\n\nfunction schedule() {\n    setTimeout(function () {\n        time()\n    }, 1000)\n}\n\nvar uid;\nfunction regist() {\n    var yonghuming = document.getElementById(\"yonghuming\").value;\n    var nichen = document.getElementById(\"nichen\").value;\n    var password = document.getElementById(\"password\").value;\n    var email = document.getElementById(\"email\").value;\n    var phone = document.getElementById(\"phone\").value;\n    $.post(\"/register\",\n        {username: yonghuming, password: password, nickname: nichen, email: email, phone: phone}\n        , function (result) {\n            if (!result.success) {\n                alert(result.msg)\n            }\n            else {\n                uid = result.data;\n                //alert(uid);\n                window.location.href = '/user/validate';\n            }\n        });\n};\n\nfunction time() {\n    if (wait == 0) {\n        document.getElementById(\"send\").removeAttribute(\"disabled\");\n        document.getElementById(\"send\").value = \"重新获取验证码\";\n        wait = 60;\n    } else {\n        document.getElementById(\"send\").setAttribute(\"disabled\", true);\n        document.getElementById(\"send\").value = wait + \"s后可以重新发送\";\n        wait--;\n        schedule();\n    }\n}\n\nfunction sendMail() {\n    $.post(\"/user/sendMail\", function (result) {\n        if (result.success) {\n            time()\n        } else {\n            alert(result.msg);\n        }\n    });\n}\n\nfunction validate() {\n    var code = document.getElementById(\"code\").value;\n    $.post(\"/user/validate\", {uid: uid, code: code}, function (result) {\n        if (result.success) {\n            window.location.href = result.data;\n        }\n        else {\n            alert(result.msg);\n        }\n    })\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/sanji.js",
    "content": "// JavaScript Document\nvar url;\nvar ggid;\n$(\n    function () {\n        var loc = location.href;\n        var n4 = loc.indexOf(\"gameid\");\n        n4 = n4 + 7;\n        var gameid = decodeURI(loc.substring(n4));\n        url = \"\";\n\n        var carousel_1 = document.getElementById(\"carousel_1\");\n        var carousel_2 = document.getElementById(\"carousel_2\");\n        var carousel_3 = document.getElementById(\"carousel_3\");\n        var carousel_4 = document.getElementById(\"carousel_4\");\n        var getheader = document.getElementById(\"getheader\");\n        var shoppingcar = document.getElementById(\"shoppingcar\");\n        var systemcfg = document.getElementById(\"systemcfg\");\n        var i = 0;\n        $.post(url, function (result) {\n                document.getElementById(\"gamename\").innerText = result.data.name;\n                ggid = result.data.id;\n                ggname = result.data.name;\n                ggprice = result.data.price;\n\n\n                var li_1 = document.createElement(\"li\");\n                li_1.className = \"'active' data-target='#myCarousel' data-slide-to='\" + i + \"'>\";\n                carousel_1.appendChild(li_1);\n                while (result.data.img[i + 2]) {\n                    var li_1 = document.createElement(\"li\");\n                    li_1.className = \"data-target='#myCarousel' data-slide-to='\" + i + \"'>\";\n                    carousel_1.appendChild(li_1);\n                    i++;\n                }\n                i = 2;\n                var li_2 = document.createElement('div');\n                li_2.className = \"item active\";\n                li_2.innerHTML = \"<img width='600' height='337' src='/img\" + result.data.img[1] + \"'>\";\n                carousel_2.appendChild(li_2);\n                while (result.data.img[i]) {\n                    var li_2 = document.createElement('div');\n                    li_2.className = \"item\";\n                    li_2.innerHTML = \"<img width='600' height='337' src='/img\" + result.data.img[i] + \"'>\";\n                    carousel_2.appendChild(li_2);\n                    i++;\n                }\n                i = 0;\n                while (result.data.img[i + 1]) {\n                    var li_3 = document.createElement(\"li\");\n                    var j = i + 1;\n                    li_3.className = \"col-md-2 deletecolpadding\";\n                    li_3.innerHTML = \"<img src='/img\" + result.data.img[j] + \"' onClick='change(\" + i + \")'>\";\n                    carousel_4.appendChild(li_3);\n                    i++;\n                }\n                var header = document.createElement(\"div\");\n                header.className = \"row\";\n                header.innerHTML = \"<img src='/img\" + result.data.img[0] + \"'width='320' height='151'>\";\n                getheader.appendChild(header);\n\n                var discribe = document.createElement(\"div\");\n                discribe.className = \"row\";\n                discribe.innerHTML = \" <p style='color:#acb2b8'>\" + result.data.desc + \"</p>\";\n                getheader.appendChild(discribe);\n\n                var time = document.createElement(\"div\");\n                var utime = new Date(result.data.utime);\n                utime = utime.toLocaleString();\n                time.className = \"row\";\n                time.innerHTML = \"<p><h6 style='color:white'>发行日期：\" + utime + \"<h6></p><p><h6 style='color:white'>开发商：\" + result.data.creater + \"<h6></p><p> <h6 style='color:gray'>用户自定义标签：</h6><div class='btn-group btn-group-xs' id='tags'></div> </h6></p>\";\n                getheader.appendChild(time);\n\n                var spc = document.createElement(\"p\");\n                spc.className = \"text-left\";\n                var stat;\n                if (result.data.stat == '1') {\n                    spc.innerHTML = \"<h2>购买\" + result.data.name + \":¥\" + result.data.price + \"</h2>\";\n                    shoppingcar.appendChild(spc);\n                } else {\n                    if (result.data.stat == '0') {\n                        stat = \"未上架\"\n                    } else if (result.data.stat == '2') {\n                        stat = \"已下架\"\n                    }\n                    document.getElementById(\"shopingcartbtn\").innerHTML = \"\";\n                    spc.innerHTML = \"<h2>\" + stat + \"</h2>\";\n                    shoppingcar.appendChild(spc);\n                }\n\n                j = 0;\n                if (result.data.tags) {\n                    var tt = document.getElementById(\"tags\");\n                    while (result.data.tags[j]) {\n                        var ll = document.createElement(\"ll\");\n                        var tid = result.data.tags[j].id;\n                        ll.innerHTML = \"<a href='/tag/\" + tid + \"/games\" + \"'><span class='tags'>\" + result.data.tags[j].name + \"</span></a>\";\n                        tt.appendChild(ll);\n                        j++;\n                    }\n                }\n\n                i = 0;\n                var system = result.data.systemcfg;\n                var sys = system.split(\"\\n\");\n                while (sys[i]) {\n                    var s = document.createElement(\"tr\");\n                    s.innerHTML = \"<td style='color:#acb2b8'>\" + sys[i] + \"</td>\";\n                    systemcfg.appendChild(s);\n                    i++;\n                }\n\n\n            }\n        )\n    }\n)\n\n$(function () {\n    // 循环轮播到某个特定的帧 \n    $(\".slide-one\").click(function () {\n        $(\"#myCarousel\").carousel(0);\n    });\n    $(\".slide-two\").click(function () {\n        $(\"#myCarousel\").carousel(1);\n    });\n    $(\".slide-three\").click(function () {\n        $(\"#myCarousel\").carousel(2);\n    })\n    $(\".slide-one\").click(function () {\n        $(\"#myCarousel\").carousel(3);\n    });\n    $(\".slide-one\").click(function () {\n        $(\"#myCarousel\").carousel(4);\n    });\n});\n\nfunction change(i) {\n    console.log(i);\n    $(\"#myCarousel\").carousel(i);\n}\n\nfunction move(to) {\n    var imgList = document.getElementById(\"carousel_3\");\n    if (to == \"left\")\n        imgList.scrollLeft -= 126; //li的宽度\n    else imgList.scrollLeft += 126; //li的宽度\n}\nfunction addshopingcar() {\n    var carInfo = {id: ggid, name: ggname, price: ggprice};\n    var i = JSON.parse(localStorage.getItem(\"i\"));\n    if (i) {\n        localStorage.setItem(\"i\", JSON.stringify(i + 1));\n        i = JSON.parse(localStorage.getItem(\"i\"));\n    }\n    else {\n        localStorage.setItem(\"i\", JSON.stringify(1));\n        i = JSON.parse(localStorage.getItem(\"i\"));\n    }\n    localStorage.setItem(\"data_\" + i, JSON.stringify(carInfo));\n    alert(\"添加成功！\");\n}\n\nDate.prototype.toLocaleString = function () {\n    return this.getFullYear() + \"年\" + (this.getMonth() + 1) + \"月\" + this.getDate() + \"日 \";\n};"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/search.js",
    "content": "$(\n    function () {\n        var prtW = window.opener;\n        var info = prtW.document.getElementById(\"searchbox\").value;\n        document.getElementById(\"xianshineirong\").innerText = \"正在浏览关于\" + info + \"的内容\";\n        var ul = document.getElementById(\"fenleixiangqing\");\n        var ull = document.getElementById(\"fenleiyouxitupian\");\n        $.post(\"/search\", {info: info}, function (result) {\n            var i = 0;\n            var j = 0;\n            var k = 0;\n            var prices = new Array();\n            while (result.data[i]) {\n                prices[i] = \"¥\" + result.data[i].price;\n                if (prices[i] == \"¥0\")\n                    prices[i] = \"免费\";\n                i++;\n            }\n            while (result.data[k]) {\n                var li = document.createElement(\"li\");\n                var gid = k;\n                var u;\n                u = \"<a href='/game/\" + result.data[k].id;\n                li.innerHTML = u + \"'><div class='row fenleizitiyanse jutiyouxi'><div class='col-md-4'><img id='xianshitupian_\" + k +\n                    \"'onmouseover='xianshitupian(\" + k + \")'\" +\n                    \"onmouseout='yingcangtupian(+\" + k + \")' src='/img\" + result.data[k].img[0] + \"' class='imgdx_1'></div><div class='col-md-8'><div class='row youximingzi'>\" +\n                    result.data[k].name + \"</div><div class='row'><div class='col-md-2 col-md-offset-10'>\" + prices[k] + \"</div></div><div class='row youximingzi' id='tags_\" + k + \"'></div></div></div>\"\n                ul.appendChild(li);\n                k++;\n            }\n            k = 0;\n            while (result.data[k]) {\n                var li = document.createElement(\"li\");\n                li.innerHTML = \"<div class='row youxitupian' id='yingcangtupian_\" + k + \"'><div class='row'><div class='font font_1'>\" + result.data[k].name + \"</div></div><div class='row font'><div class='col-md-offset-1'><img class='imgdx' src='/img\" + result.data[k].img[1] + \"'></div></div><div class='row font font_2'>用户标签：</div><div class='row font' id='small_tags_\" + k + \"'>\" + \"</div></div>\";\n                ull.appendChild(li);\n                k++;\n            }\n            i = 0;\n            j = 0;\n            while (result.data[i]) {\n                var t = document.getElementById(\"tags_\" + i);\n                while (result.data[i].tags[j]) {\n                    var l = document.createElement(\"l\");\n                    l.innerHTML = \"<span class='tags img-rounded'>\" + result.data[i].tags[j].name + \"</span>\";\n                    t.appendChild(l);\n                    j++;\n                }\n                i++;\n                j = 0;\n            }\n            i = 0;\n            j = 0;\n            while (result.data[i]) {\n                var tt = document.getElementById(\"small_tags_\" + i);\n                while (result.data[i].tags[j]) {\n                    var ll = document.createElement(\"ll\");\n                    ll.innerHTML = \"<span class='tags img-rounded'>\" + result.data[i].tags[j].name + \"</span>\";\n                    tt.appendChild(ll);\n                    j++;\n                }\n                i++;\n                j = 0;\n            }\n\n\n        });\n    }\n);\n\nfunction xianshitupian(k) {\n    document.getElementById(\"yingcangtupian_\" + k).style.display = \"block\";\n    var y = document.getElementById(\"yingcangtupian_\" + k);\n    y.style.top = 69 * k + \"px\";\n}\nfunction yingcangtupian(k) {\n    document.getElementById(\"yingcangtupian_\" + k).style.display = \"none\";\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/shoppingcart.js",
    "content": "$(\n    function () {\n        var spcar = document.getElementById(\"spcar\");\n        var i = JSON.parse(localStorage.getItem(\"i\"));\n        var k = 1;\n        var prices = 0;\n        for (j = 1; j <= i; j++) {\n            var game = JSON.parse(localStorage.getItem(\"data_\" + j));\n            if (game) {\n                var gname = game.name;\n                var price = game.price;\n                prices += price;\n                var tr = document.createElement(\"tr\");\n                tr.className = \"cart_item\";\n                tr.id = \"game_\" + j;\n                tr.innerHTML = \"<td>\" + k + \"</td><td>\" + gname + \"</td><td id='price_\" + j + \"'>￥\" + price + \"</td><td onclick='del(\" + j + \")'>移除</td>\";\n                spcar.appendChild(tr);\n                k++;\n                document.getElementById(\"prices\").innerText = prices;\n            }\n        }\n    }\n)\n\nfunction del(i) {\n    var t = document.getElementById(\"game_\" + i);\n    t.parentNode.remove(t);\n    var storage = window.localStorage;\n    var ii = storage.getItem(\"i\");\n    storage.removeItem(\"data_\" + i);\n    storage.setItem(\"i\", ii);\n    location.reload(\"true\");\n}\n\nfunction orderadd() {\n    var storage = window.localStorage;\n    var gamesid = new Array();\n    var i = storage.getItem(\"i\");\n    var j = 1;\n    var k = 0;\n    for (j = 1; j <= i; j++) {\n        var game = JSON.parse(localStorage.getItem(\"data_\" + j));\n        if(game){\n            gamesid[k] = parseInt(game.id);\n            k++;\n        }\n    }\n\n    $.post({\n            url: \"/order/order\",\n            traditional: true,\n            data: {games: gamesid},\n            success: function (result) {\n                if (result.success) {\n                    window.localStorage.clear();\n                    self.location = '/order/' + result.data.id + '/payway';\n                }\n            }\n        }\n    )\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/top.js",
    "content": "function outlogin() {\n    $.post(\"/logout\", function (result) {\n            if (result.success) {\n                location.reload(\"true\");\n            } else {\n                alert(result.msg);\n            }\n        }\n    )\n}\nfunction search() {\n    var info = document.getElementById(\"searchbox\").value;\n    $.post(\"/search\", {info: info}, function (result) {\n        if (result.success) {\n            window.open(\"/search\")\n        } else {\n            alert(result.msg);\n        }\n    })\n}"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/updateUserInfo.js",
    "content": "$.post(\"/user/personal\", function (result) {\n    document.getElementById(\"userInfo_0\").value = result.data.nickname;\n    ;\n    document.getElementById(\"userInfo_1\").value = result.data.email;\n    document.getElementById(\"userInfo_2\").value = result.data.phone;\n})\n\nfunction updateUserInfo() {\n    var userInfo_0 = document.getElementById(\"userInfo_0\").value;\n    var userInfo_1 = document.getElementById(\"userInfo_1\").value;\n    var userInfo_2 = document.getElementById(\"userInfo_2\").value;\n    if (userInfo_0) {\n        $.post(\"/user/update\", {nickname: userInfo_0, email: userInfo_1, phone: userInfo_2}, function (result) {\n            if (result.success) {\n                window.location.href = '/user/personal';\n            }\n            else {\n                alert(result.msg);\n            }\n        })\n    }\n    else {\n        alert(\"昵称不能为空\");\n    }\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/js/updatepassword.js",
    "content": "function updatepassword() {\n    var password = document.getElementById(\"newpassword\").value;\n    var password_1 = document.getElementById(\"newpassword_1\").value;\n    if (password != password_1) {\n        alert(\"您输入的密码不一致！\");\n    }\n    else {\n        $.post(\"/user/updatepassword\", {password: password}, function (result) {\n            if (result.success) {\n                window.location.href = \"/user/personal\";\n            }\n            else {\n                alert(result.msg);\n            }\n        })\n    }\n}\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/adminlogin.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <title>后台管理登陆</title>\n    <link rel=\"icon\" href=\"/smile.ico\" type=\"image/x-icon\">\n    <link href=\"/css/adminlogin.css\" rel=\"stylesheet\">\n    <script src=\"https://cdn.bootcss.com/jquery/3.2.0/jquery.min.js\"></script>\n    <script src=\"/js/adminlogin.js\"></script>\n</head>\n\n<body>\n<div class=\"login\">\n    <h1>WePlay 后台管理</h1>\n    <input id=\"username\" type=\"text\" placeholder=\"用户名\" required=\"required\"/>\n    <input id=\"password\" type=\"password\" name=\"p\" placeholder=\"密码\" required=\"required\"/>\n    <button onclick=\"login()\" class=\"btn btn-primary btn-block btn-large\">登录</button>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/adminpage.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <title>Weplay后台管理系统</title>\n    <link rel=\"stylesheet\" href=\"https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css\">\n    <script src=\"http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js\"></script>\n    <script src=\"http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\n    <script type=\"text/javascript\" src=\"/js/adminpage.js\"></script>\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"/css/adminpage.css\"/>\n    <link rel=\"icon\" href=\"/smile.ico\" type=\"image/x-icon\">\n</head>\n\n<body>\n<div class=\"top\"></div>\n<div id=\"header\">\n    <div class=\"logo\">Weplay后台管理系统</div>\n</div>\n<div id=\"content\">\n    <div class=\"left_menu\">\n        <ul id=\"nav_dot\">\n            <li>\n                <h4 class=\"M1\"><span></span>用户管理</h4>\n                <div class=\"list-item none\">\n                    <a href=\"#\" onclick=\"showright_0()\">信息展示</a>\n                </div>\n            </li>\n            <li>\n                <h4 class=\"M2\"><span></span>种类管理</h4>\n                <div class=\"list-item none\">\n                    <a href=\"#\" onclick=\"showright_3()\">信息展示</a>\n                </div>\n            </li>\n            <li>\n                <h4 class=\"M3\"><span></span>游戏管理</h4>\n                <div class=\"list-item none\">\n                    <a href=\"#\" onclick=\"showright_1()\">信息展示</a>\n                </div>\n                <div class=\"list-item none\">\n                    <a href=\"#\" onclick=\"showright_2()\">添加游戏</a>\n                </div>\n            </li>\n\n        </ul>\n    </div>\n    <div class=\"m-right\" id=\"right_0\">\n        <div class=\"main\">\n            <div class=\"container\">\n                <div class=\"row clearfix\">\n                    <div class=\"col-md-12 column\">\n                        <table class=\"table\">\n                            <thead>\n                            <tr>\n                                <th>\n                                    用户编号\n                                </th>\n                                <th>\n                                    用户名\n                                </th>\n                                <%--<th>--%>\n                                <%--密码--%>\n                                <%--</th>--%>\n                                <th>\n                                    昵称\n                                </th>\n                                <th>\n                                    邮箱\n                                </th>\n                                <th>\n                                    手机号\n                                </th>\n                                <th>\n                                    创建时间\n                                </th>\n                                <th>\n                                    用户状态\n                                </th>\n                                <th>\n                                    操作\n                                </th>\n                            </tr>\n                            </thead>\n                            <tbody id=\"userInfo\">\n\n                            </tbody>\n                        </table>\n                    </div>\n                    <div class=\"row-fluid\">\n                        <div class=\"span12\">\n                            <div class=\"pagination pagination-right yema divsetcenter\">\n                                <ul id=\"paging_0\">\n\n                                </ul>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n\n        </div>\n    </div>\n    <div class=\"m-right\" id=\"right_1\">\n        <div class=\"main\">\n            <div class=\"container\">\n                <div class=\"row clearfix\">\n                    <div class=\"col-md-12 column\">\n                        <table class=\"table\">\n                            <thead>\n                            <tr>\n                                <th>\n                                    游戏编号\n                                </th>\n                                <th>\n                                    游戏名\n                                </th>\n                                <th>\n                                    价格\n                                </th>\n                                <th>\n                                    状态\n                                </th>\n                                <th>\n                                    操作\n                                </th>\n\n\n                            </tr>\n                            </thead>\n                            <tbody id=\"gameInfo\">\n\n                            </tbody>\n                        </table>\n                    </div>\n                    <div class=\"row-fluid\">\n                        <div class=\"span12\">\n                            <div class=\"pagination pagination-right yema divsetcenter\">\n                                <ul id=\"paging_1\">\n\n                                </ul>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n\n        </div>\n    </div>\n\n    <div class=\"m-right\" id=\"right_2\">\n        <div class=\"main setmargin\">\n            <form method=\"post\" name=\"game_info\" id=\"game_info\" enctype=\"multipart/form-data\">\n\n\n                <h5>开发商</h5>\n                <input type=\"text \" class=\"form-control\" placeholder=\"Create\" id=\"addgamecreater\" name=\"creater\">\n\n\n                <h5>游戏名称</h5>\n                <input type=\"text\" class=\"form-control\" placeholder=\"Name\" id=\"addgamename\" name=\"name\">\n\n\n                <h5>游戏描述</h5>\n                <textarea class=\"form-control\" placeholder=\"Desc\" id=\"addgamedesc\" name=\"desc\"></textarea>\n\n\n                <h5>系统配置</h5>\n                <textarea class=\"form-control\" placeholder=\"Systemcfg\" id=\"addgamesyscfg\" name=\"systemcfg\"></textarea>\n\n\n                <h5>游戏价格</h5>\n                <input type=\"text\" class=\"form-control\" placeholder=\"Price\" id=\"addgameprice\" name=\"price\">\n\n\n                <h5>游戏折扣后价格</h5>\n                <input type=\"text\" class=\"form-control\" placeholder=\"Discont\" id=\"addgamediscount\" name=\"discount\">\n\n\n                <h5>上传游戏封面(1张)</h5>\n                <input type=\"file\" id=\"doc_0\" style=\"width:150px;\" accept=\"image/*\" onchange=\"setImagePreviews_0();\"\n                       name=\"header\">\n                <div id=\"dd_0\"></div>\n\n\n                <div class=\" setmargin_0\">\n                    <h5>上传游戏截图(至少5张)</h5>\n                    <input type=\"file\" id=\"doc\" multiple=\"multiple\" style=\"width:150px;\" onchange=\"setImagePreviews();\"\n                           accept=\"image/*\" name=\"pics\">\n                    <div id=\"dd\"></div>\n                </div>\n            </form>\n\n            <div class=\" setmargin_0\">\n                <button class=\"btn\" id=\"addgamebtn\" type=\"submit\" onclick=\"addgame()\">确认添加</button>\n                <button class=\"btn\" type=\"reset\" onclick=\"cleartext()\">重置内容</button>\n            </div>\n        </div>\n    </div>\n\n    <div class=\"m-right\" id=\"right_3\">\n        <div class=\"main\">\n            <div class=\"container\">\n                <div class=\"row clearfix\">\n                    <div class=\"col-md-12 column\">\n                        <table class=\"table\">\n                            <thead>\n                            <tr>\n                                <th>\n                                    种类编号\n                                </th>\n                                <th>\n                                    种类名\n                                </th>\n                                <th>\n                                    操作\n                                </th>\n                            </tr>\n                            <tr>\n                                <th>0</th>\n                                <th><input type=\"text\" id=\"addkindinput\"></th>\n                                <th>\n                                    <button class=\"btn\" onclick=\"addkind()\">添加</button>\n                                </th>\n                            </tr>\n                            </thead>\n                            <tbody id=\"kind_all\">\n\n                            </tbody>\n                        </table>\n                    </div>\n                    <div class=\"row-fluid\">\n                        <div class=\"span12\">\n                            <div class=\"pagination pagination-right yema divsetcenter\">\n                                <ul id=\"paging_3\">\n\n                                </ul>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n\n        </div>\n    </div>\n\n</div>\n\n<div class=\"bottom\"></div>\n<div id=\"footer\"><p>最终所有权归<a href=\"\" target=\"_blank\">Weplay</a>所有</p></div>\n<script>navList(12);</script>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/checkemail.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/login.css\" rel=\"stylesheet\">\n    <link href=\"/css/regist.css\" rel=\"stylesheet\">\n    <script src=\"/js/regist.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <title>邮箱验证</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\">\n\n                </ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n\n            <div class=\"row zczt\"><h1>创建账户</h1></div>\n            <div class=\"row zczt\">\n                <div class=\"col-xs-offset-1 col-xs-5\" id=\"regist_2\">\n                    <div class=\"row zczt\">\n                        输入您的验证码：<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"code\"><input type=\"button\" class=\"btnsz\"\n                                                                               value=\"重新发送邮件\"\n                                                                               style=\"background-color:#417a9b;\"\n                                                                               onclick=\"time(this)\"></div>\n                    <div class=\"form-group\">\n                        <div class=\" col-sm-10\">\n                            <button type=\"submit\" class=\"btn btn-default\" style=\"background-color:#417a9b;\"\n                                    onclick=\"zhuce()\">确定\n                            </button>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"col-xs-offset-1 col-xs-5\" id=\"regist_3\">\n                    <div class=\"row zczt\">\n                        恭喜您注册成功，<a href=\"index.jsp\">点此回到首页</a>\n                    </div>\n                </div>\n                <div class=\"col-xs-6\">\n                    <h3>\n                        为什么加入我们？\n                    </h3>\n                    <ul>\n                        <li>\n                            购买和下载完整零售游戏\n                        </li>\n                        <li>\n                            游戏时与好友聊天\n                        </li>\n                        <li>\n                            在任何电脑上都能玩\n                        </li>\n                        <li>\n                            安排游戏、比赛或 LAN 聚会\n                        </li>\n                        <li>\n                            获取自动游戏更新以及更多！\n                        </li>\n                    </ul>\n                    <img src=\"img/static/login_1.png\"/>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/common/bottom.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<footer class=\"footer\" style=\"margin-top: 180px;\">\n    <div class=\"row dibu\">\n        ©2017 WePlay Corporation。保留所有权利。所有商标均为其在美国及其它国家/地区的各自持有者所有。\n        所有的价格均已包含增值税（如适用）。\n        <a href=\"#\">隐私政策</a> | <a href=\"#\">法律信息</a> | <a href=\"#\"> WePlay 用户协议</a> | <a href=\"#\">退款</a>\n    </div>\n</footer>\n\n<script>\n    $('body').css({\n        \"overflow-x\": \"hidden\"\n    });\n</script>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/common/head.jsp",
    "content": "<!DOCTYPE html>\n<meta charset=\"UTF-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<!-- 上述三个标签需要放到最前边 -->\n<meta name=\"description\" content=\"WePlay\">\n<meta name=\"author\" content=\"cie\">\n<link rel=\"icon\" href=\"/smile.ico\" type=\"image/x-icon\" >\n<!-- 引入 Bootstrap的css文件 -->\n<link rel=\"stylesheet\" href=\"https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css\"\n      integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\"\n      crossorigin=\"anonymous\">\n\n<link href=\"/css/base.css\" rel=\"stylesheet\">\n\n<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->\n<script src=\"https://cdn.bootcss.com/jquery/3.2.0/jquery.min.js\"></script>\n<script src=\"/js/top.js\"></script>\n<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n<script src=\"https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/common/top.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>\n<nav class=\"navbar navbar-inverse\">\n    <div class=\"container-fluid headheight\">\n        <div class=\"col-md-offset-3\">\n            <div class=\"navbar-header\">\n                <a href=\"/\">\n                    <img alt=\"Brand\" src=\"/img/logo.jpg\" width=\"90\" height=\"60\">\n                </a>\n            </div>\n            <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"/\">商城</a>\n                    </li>\n                    <li class=\"navbar-form\">\n                        <div class=\"form-group\">\n                            <input type=\"text\" class=\"form-control\" placeholder=\"Search\" id=\"searchbox\">\n                        </div>\n                        <button type=\"submit\" class=\"btn btn-default\" onclick=\"search()\"><span class=\"glyphicon glyphicon-search\" aria-hidden=\"true\"></span></button>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <c:choose>\n                        <c:when test=\"${user == null}\">\n                            <li><a href=\"/login\" methods=\"get\">登录</a></li>\n                            <li><a href=\"/register\" methods=\"get\">注册</a></li>\n                        </c:when>\n                        <c:otherwise>\n                            <li><a href=\"/user/personal\">${user}，您好</a></li>\n                            <li><a href=\"/shoppingcart\">购物车</a></li>\n                            <li><a onclick=\"outlogin()\">退出</a></li>\n                        </c:otherwise>\n                    </c:choose>\n                </ul>\n            </div>\n        </div>\n    </div>\n</nav>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/error/ErrorCode400.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"../common/head.jsp\" %>\n    <title>错误请求</title>\n</head>\n<body>\n<%@ include file=\"../common/top.jsp\" %>\n<h1 style=\"color:#9d9d9d;\">错误的请求，请核对您的输入！</h1>\n<%@ include file=\"../common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/error/ErrorCode404.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"../common/head.jsp\" %>\n    <title>404</title>\n    <script type=\"text/javascript\" src=\"//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js\"\n            charset=\"utf-8\"\n            homePageUrl=\"/\" homePageName=\"回到我的主页\">\n    </script>\n</head>\n<body>\n<%@ include file=\"../common/top.jsp\" %>\n<h1>404 Not Found</h1>\n<%@ include file=\"../common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/error/ErrorCode500.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"../common/head.jsp\" %>\n    <title>服务器内部错误</title>\n</head>\n<body>\n<%@ include file=\"../common/top.jsp\" %>\n<h1 style=\"color:#9d9d9d;\">服务器内部错误，请联系管理员 rojeralone@163.com</h1>\n<%@ include file=\"../common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/findpassword.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/login.css\" rel=\"stylesheet\">\n    <link href=\"/css/regist.css\" rel=\"stylesheet\">\n    <script src=\"/js/findpassword.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <title>邮箱验证</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\">\n\n                </ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n\n            <div class=\"row zczt\"><h1>找回密码</h1></div>\n            <div class=\"row zczt\">\n                <div class=\"col-xs-offset-1 col-xs-5\" id=\"regist_2\">\n                    <div class=\"row zczt\">\n                        输入您的邮箱：<br/>\n                        <input class=\"inputcolor\" id=\"email\"><input id=\"btna\" type=\"button\" class=\"btnsz\" value=\"发送邮件\"\n                                                                    style=\"background-color:#417a9b;\"\n                                                                    onclick=\"sendMail()\"><br>\n                        输入您的验证码：<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"code\"><br>\n                        输入您的新密码：<br/>\n                        <input class=\"inputcolor\" type=\"password\" id=\"newpassword\"><br>\n                        再次输入您的新密码：<br/>\n                        <input class=\"inputcolor\" type=\"password\" id=\"newpassword_1\"><br>\n                    </div>\n                    <div class=\"form-group\">\n                        <div class=\" col-sm-10\">\n                            <button type=\"submit\" class=\"btn btn-default\" style=\"background-color:#417a9b;\"\n                                    onclick=\"findpassword()\">确定\n                            </button>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"col-xs-6\">\n                    <h3>\n                        为什么加入我们？\n                    </h3>\n                    <ul>\n                        <li>\n                            购买和下载完整零售游戏\n                        </li>\n                        <li>\n                            游戏时与好友聊天\n                        </li>\n                        <li>\n                            在任何电脑上都能玩\n                        </li>\n                        <li>\n                            安排游戏、比赛或 LAN 聚会\n                        </li>\n                        <li>\n                            获取自动游戏更新以及更多！\n                        </li>\n                    </ul>\n                    <img src=\"/img/static/login_1.png\"/>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/fishjs.jsp",
    "content": "<!DOCTYPE html>\n<script type=\"text/javascript\" src=\"/js/fishjs/main.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/commonFunctions.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/background.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/ane.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/fruit.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/mom.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/collision.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/baby.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/data.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/wave.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/halo.js\"></script>\n<script type=\"text/javascript\" src=\"/js/fishjs/dust.js\"></script>\n\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/gameInfo.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/sanji.css\" rel=\"stylesheet\" type=\"text/css\">\n    <script src=\"/js/biaoqian.js\"></script>\n    <script src=\"/js/sanji.js\"></script>\n    <title>游戏页</title>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\"></ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <!--游戏详情页-->\n            <div calss=\"row\">\n                <!--游戏名-->\n                <div class=\"row\">\n                    <div class=\"col-md-4\">\n                        <h3 style=\"color:white\" id=\"gamename\"></h3>\n                    </div>\n                </div>\n                <!--游戏视频图片以及文字介绍-->\n                <div class=\"row\">\n                    <div class=\"col-md-8\">\n                        <div class=\"row\">\n                            <div id=\"myCarousel\" class=\"carousel slide\">\n                                <!-- 轮播（Carousel）指标 -->\n                                <ol class=\"carousel-indicators\" id=\"carousel_1\">\n\n                                </ol>\n                                <!-- 轮播（Carousel）项目 -->\n                                <div class=\"carousel-inner\" id=\"carousel_2\">\n\n                                </div>\n                                <!-- 轮播（Carousel）导航 -->\n                            </div>\n\n                        </div>\n                        <div class=\"row addmargin\">\n                            <div class=\"col-md-1 btn_1\" onClick=\"move('left')\">\n                                <span class=\"glyphicon glyphicon-chevron-left\"></span>\n                            </div>\n                            <div class=\"col-md-10 deletelrpadding\" id=\"carousel_3\">\n                                <ul id=\"carousel_4\"></ul>\n                            </div>\n                            <div class=\"col-md-1 btn_1\" onClick=\"move('right')\">\n                                <span class=\"glyphicon glyphicon-chevron-right\"></span>\n                            </div>\n                        </div>\n\n                    </div>\n                    <div class=\"col-md-4\" id=\"getheader\">\n\n                    </div>\n                </div>\n\n                <!--购物车及游戏支持语言-->\n                <div class=\"row\">\n                    <div class=\"col-md-12\" style=\"margin-top:50px;padding-left:0px;padding-right:9px\">\n                        <div class=\"row\"\n                             style=\" background-color:#356F95 ; color:#FFF ; margin-left:0px; margin-right:40px\">\n                            <div class=\"col-md-6\" style=\"padding-left:30px\" id=\"shoppingcar\">\n\n                            </div>\n                            <div class=\"col-md-6\">\n                                <div class=\"row\">\n                                    <p class=\"text-right\" style=\"padding-top:30px;padding-right:30px\"\n                                       id=\"shopingcartbtn\"><a href=\"#\" class=\"btn btn-info btn-lg\"\n                                                              onclick=\"addshopingcar()\"> <span\n                                            class=\"glyphicon glyphicon-shopping-cart\"></span>添加至购物车 </a></p>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\"> &nbsp;</div>\n\n                    </div>\n\n                </div>\n\n                <!--最新更行以及配置需求-->\n                <div class=\"row\">\n                    <div class=\"col-md-4\">\n                        <h4 style=\"color:white\">游戏配置</h4>\n\n                        <table class=\"table table-hover\">\n                            <h4 style=\"color:#4582A5\">最低配置</h4>\n                            <tbody id=\"systemcfg\">\n\n                            </tbody>\n                        </table>\n\n\n                    </div>\n                    <div class=\"col-md-4 col-md-offset-2\" style=\" padding-left:0px; padding-right:0px\">\n                        <table class=\"table table-hover\">\n                            <caption style=\"color:white\">\n                                已支持的语言\n                            </caption>\n                            <thead>\n                            <tr>\n                                <th></th>\n                                <th style=\"color:white\">界面</th>\n                                <th style=\"color:white\">完全音频</th>\n                                <th style=\"color:white\">字幕</th>\n                            </tr>\n                            </thead>\n                            <tbody>\n                            <tr>\n                                <td align=\"center\" style=\"color:#acb2b8\">简体中文</td>\n                                <td align=\"center\" style=\"color:gray\"></td>\n                                <td align=\"center\" style=\"color:gray\">不支持</td>\n                                <td align=\"center\" style=\"color:gray\"></td>\n                            </tr>\n                            <tr>\n                                <td align=\"center\" style=\"color:#acb2b8\">英语</td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                            </tr>\n                            <tr>\n                                <td align=\"center\" style=\"color:#acb2b8\">法语</td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                                <td align=\"center\" style=\"color:#66C0F4\"></td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                            </tr>\n                            <tr>\n                                <td align=\"center\" style=\"color:#acb2b8\">意大利语</td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                                <td align=\"center\" style=\"color:#66C0F4\"></td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                            </tr>\n                            <tr>\n                                <td align=\"center\" style=\"color:#acb2b8\">德语</td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                                <td align=\"center\" style=\"color:#66C0F4\"></td>\n                                <td align=\"center\" style=\"color:#66C0F4\">√</td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                </div>\n\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/index.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/self.css\" rel=\"stylesheet\">\n    <script src=\"/js/biaoqian.js\"></script>\n    <script src=\"/js/index.js\"></script>\n    <title>We Play</title>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\">\n\n                </ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row\">\n                <div class=\"tit tit_0\"> 精 选 和 推 荐</div>\n            </div>\n            <div class=\"row\">\n                <div id=\"carousel-example-generic\" class=\"carousel slide\" data-ride=\"carousel\">\n                    <ol class=\"carousel-indicators\">\n                        <li data-target=\"#carousel-example-generic\" data-slide-to=\"0\" class=\"active\"></li>\n                        <li data-target=\"#carousel-example-generic\" data-slide-to=\"1\"></li>\n                        <li data-target=\"#carousel-example-generic\" data-slide-to=\"2\"></li>\n                        <li data-target=\"#carousel-example-generic\" data-slide-to=\"3\"></li>\n                        <li data-target=\"#carousel-example-generic\" data-slide-to=\"4\"></li>\n                    </ol>\n                    <div class=\"carousel-inner\" role=\"listbox\">\n                        <div class=\"item active\">\n                            <div class=\"item_0\"><a id=\"gameurl_0\"><img class=\"imgwh\" id=\"gameimg_0\"></a></div>\n                            <div class=\"item_1\" id=\"gamename_0\">\n                                <div class=\"shoujia shoujia_1\" id=\"gameprice_0\"></div>\n                            </div>\n                        </div>\n                        <div class=\"item\">\n                            <div class=\"item_0\"><a id=\"gameurl_1\"><img class=\"imgwh\" id=\"gameimg_1\"></a></div>\n                            <div class=\"item_1\" id=\"gamename_1\">\n                                <div class=\"shoujia\" id=\"gameprice_1\"></div>\n                            </div>\n                        </div>\n                        <div class=\"item\">\n                            <div class=\"item_0\"><a id=\"gameurl_2\"><img class=\"imgwh\" id=\"gameimg_2\"></a></div>\n                            <div class=\"item_1\" id=\"gamename_2\">\n                                <div class=\"shoujia\" id=\"gameprice_2\"></div>\n                            </div>\n                        </div>\n                        <div class=\"item\">\n                            <div class=\"item_0\"><a id=\"gameurl_3\"><img class=\"imgwh\" id=\"gameimg_3\"></a></div>\n                            <div class=\"item_1\" id=\"gamename_3\">\n                                <div class=\"shoujia\" id=\"gameprice_3\"></div>\n                            </div>\n                        </div>\n                        <div class=\"item\">\n                            <div class=\"item_0\"><a id=\"gameurl_4\"><img class=\"imgwh\" id=\"gameimg_4\"></a></div>\n                            <div class=\"item_1\" id=\"gamename_4\">\n                                <div class=\"shoujia shoujia_1\" id=\"gameprice_4\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <a class=\"left carousel-control\" href=\"#carousel-example-generic\" role=\"button\" data-slide=\"prev\">\n                        <span class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span>\n                        <span class=\"sr-only\">Previous</span>\n                    </a>\n                    <a class=\"right carousel-control\" href=\"#carousel-example-generic\" role=\"button\"\n                       data-slide=\"next\">\n                        <span class=\"glyphicon glyphicon-chevron-right\" aria-hidden=\"true\"></span>\n                        <span class=\"sr-only\">Next</span>\n                    </a>\n                </div>\n            </div>\n            <div class=\"row\">\n                <div class=\"tit tit_1\"> 免 费 游 戏</div>\n            </div>\n            <div class=\"row\">\n                <div id=\"carousel_1\" class=\"carousel slide\" data-ride=\"carousel\">\n                    <ol class=\"carousel-indicators\">\n                        <li data-target=\"#carousel_1\" data-slide-to=\"0\" class=\"active\"></li>\n                        <li data-target=\"#carousel_1\" data-slide-to=\"1\"></li>\n                    </ol>\n                    <div class=\"carousel-inner\" role=\"listbox\">\n                        <div class=\"item active\" id=\"freegames_0\">\n\n                        </div>\n                        <div class=\"item\" id=\"freegames_1\">\n\n                        </div>\n                    </div>\n                    <a class=\"left carousel-control\" href=\"#carousel_1\" role=\"button\" data-slide=\"prev\"> <span\n                            class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span> <span class=\"sr-only\">Previous</span>\n                    </a>\n                    <a class=\"right carousel-control\" href=\"#carousel_1\" role=\"button\" data-slide=\"next\">\n                        <span class=\"glyphicon glyphicon-chevron-right\" aria-hidden=\"true\"></span>\n                        <span class=\"sr-only\">Next</span>\n                    </a>\n                </div>\n            </div>\n            <div class=\"row\">\n                <div class=\"tit tit_1\"> 休 闲 一 下</div>\n            </div>\n\n            <div class=\"all_bg\">\n                <div id=\"allcanvas\">\n                    <img src=\"img/fish/play.png\" id=\"playbtn\" onclick=\"game()\">\n                    <canvas id=\"canvas1\" width=\"800\" height=\"600\"></canvas>\n                    <canvas id=\"canvas2\" width=\"800\" height=\"600\"></canvas>\n                </div>\n            </div>\n\n\n            <div class=\"row zx\">\n                <div class=\"col-md-8\">\n                    <ul id=\"myTab\" class=\"nav nav-tabs\">\n                        <li role=\"presentation\"><a href=\"#home\" data-toggle=\"tab\">新品与热门商品</a></li>\n                        <li role=\"presentation\"><a href=\"#jijiang\" data-toggle=\"tab\">即将推出</a></li>\n                    </ul>\n                    <div id=\"myTabContent\" class=\"tab-content\" ;>\n\n                    </div>\n                </div>\n                <div class=\"col-md-4 spadding\">\n                    <div id=\"divHover\"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n<%@ include file=\"fishjs.jsp\" %>\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/kinds.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/fenleixiangqing.css\" rel=\"stylesheet\">\n    <script src=\"/js/biaoqian.js\"></script>\n    <script src=\"/js/fenlei.js\"></script>\n    <title>分类</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\">\n\n                </ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row\">\n                <div class=\"row clx\">正在浏览${name}类型的游戏</div>\n                <div class=\"row\">\n                    <div class=\"col-md-8 deletepadding\">\n                        <ul id=\"fenleixiangqing\">\n                        </ul>\n                    </div>\n                    <div class=\"col-md-4 tupianfuji\">\n                        <ul id=\"fenleiyouxitupian\">\n                        </ul>\n                    </div>\n                </div>\n            </div>\n            <div class=\"pagination\">\n                <ul id=\"paging\">\n\n                </ul>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/login.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/login.css\" rel=\"stylesheet\">\n    <script src=\"/js/login.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <title>登陆</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"row bjys ztys dlkwz\">\n            <div class=\"col-xs-4\">\n                <h1 class=\"btys\">登录</h1>\n                <p>到现有的WePlay账户</p> <br>\n                <p>用户名</p>\n                <input type=\"text\" class=\"form-control\" placeholder=\"用户名\" id=\"name\">\n                <h5>密码</h5>\n                <input type=\"password\" class=\"form-control\" placeholder=\"密码\" id=\"password\">\n                <input type=\"checkbox\" id=\"remember\">记住我一周\n                <br/><br/>\n                <button type=\"submit\" class=\"btnys\" onclick=\"login()\"><p class=\"btys\">登录</p></button>\n                <br/><br/>\n                <a href=\"/user/findpassword\">忘记密码？</a>\n            </div>\n            <div class=\"col-xs-4\">\n                <h1 class=\"btys\">创建</h1>\n                <h5>一个免费的Weplay账户</h5>\n                <h5>欢迎免费加入及轻松使用。继续创建Weplay 帐户<br/>\n                    并获取 Weplay - 适合 PC 和 Mac 玩家的前沿数字解决<br/>\n                    方案。</h5>\n                <a href=\"/register\">\n                    <button type=\"submit\" class=\"btnys\"><p class=\"btys\">加入Weplay</p></button>\n                </a>\n            </div>\n            <div class=\"col-xs-4\">\n                <h3 class=\"btys\">为什么加入Weplay？</h3>\n                <ul type=\"disc\">\n                    <li>购买和下载完整零售游戏</li>\n                    <li>加入Weplay社区</li>\n                    <li>游戏时与好友聊天</li>\n                    <li>在任何电脑上都能玩</li>\n                    <li>安排游戏、比赛或 LAN 聚会</li>\n                    <li>获取自动游戏更新以及更多！</li>\n                    <img class=\"imgdx\" src=\"/img/login.png\"/>\n                </ul>\n            </div>\n        </div>\n    </div>\n</div>\n\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/order.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/shoppingcart.css\" rel=\"stylesheet\">\n    <link href=\"/css/order.css\" rel=\"stylesheet\">\n    <script src=\"/js/order.js\"></script>\n    <title>我的订单</title>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<!--左侧导航栏-->\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-8 col-sm-8 col-md-12\">\n            <h2 style=\"color:#FFF\"><span class=\"glyphicon glyphicon-shopping-cart\"></span>您的订单</h2>\n            <div class=\"row zx\">\n                <div id=\"mainContents\">\n                    <ul style=\"font-family: 'Adobe 黑体 Std R';font-weight: bold;font-size: large\" id=\"myTab\"\n                        class=\"nav nav-tabs\">\n                        <li role=\"presentation\"><a href=\"#already\" data-toggle=\"tab\">已支付</a></li>\n                        <li role=\"presentation\"><a href=\"#yet\" data-toggle=\"tab\">未支付</a></li>\n                        <li role=\"presentation\"><a href=\"#cancel\" data-toggle=\"tab\">已取消</a></li>\n                    </ul>\n                    <br>\n                    <div id=\"myTabContent\" class=\"tab-content\">\n                        <div id=\"orderTab\" class=\"tab-content\">\n                            <div class=\"tab-pane fade in active\" id=\"already\"></div>\n                            <div class=\"tab-pane fade\" id=\"yet\"></div>\n                            <div class=\"tab-pane fade\" id=\"cancel\"></div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n\n        </div>\n        <br>\n    </div>\n    <br>\n    <h3 style=\"color:#fff\" align=\"left\">交付</h3>\n    <div style=\"background-color:#000;padding:10px 40px 10px 100px;\">\n        <h4 style=\"color:#FFF\"><a href=\"#\"><img src=\"/img/static/logo.jpg\" width=\"61\" height=\"50\"></a>&nbsp;&nbsp;&nbsp;&nbsp;\n            所有电子商品将会经有WEPLAY桌面应用程序递送给您</h4>\n    </div>\n    <br/>\n    <br/>\n    <div align=\"left\" style=\"border:30px\">\n        <h4><a href=\"/\" class=\"btn btn-info btn-lg\">\n            <span class=\"glyphicon glyphicon-shopping-cart\"></span>\n            继续购物</a></h4>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/order_1.jsp",
    "content": "﻿<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link rel=\"stylesheet\" href=\"/css/order.css\"/>\n    <title>选择支付方式</title>\n    <style>\n        .radio {\n            display: inline-block\n        }\n    </style>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n\n<br/>\n<br/>\n<br/>\n<div class=\"container\">\n    <div class=\"row\" style=\"background-color:#3D6C8D\">\n        <h1 align=\"center\" style=\"color:#C6D4DF\">收银台</h1>\n    </div>\n    <br/>\n    <br/>\n\n    <div class=\"row\">\n        <table class=\"table\">\n            <thead>\n            <th style=\"color:#C6D4DF\">\n                订单编号: ${id}\n            </th>\n            <th style=\"color:#C6D4DF\">\n                收货人: ${user}\n            </th>\n            </thead>\n        </table>\n    </div>\n\n    <div class=\"row\" style=\"background-color:#3D6C8D\">\n        <h3 align=\"center\" style=\"color:#C6D4DF\">请选择支付方式</h3>\n    </div>\n    <br>\n    <br>\n    <div class=\"row\">\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"zhifubao\" class=\"radio\"/><img src=\"/img/static/zhifubao.png\"\n                                                                                   height=\"50\" width=\"100\"\n                                                                                   align=\"middle\"/>\n        </div>\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"weixin\" class=\"radio\"/><img src=\"/img/static/weixin.png\"\n                                                                                 height=\"50\" width=\"100\"\n                                                                                 align=\"middle\"/>\n        </div>\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"zhonghang\" class=\"radio\"/><img src=\"/img/static/yinhang1.png\"\n                                                                                    height=\"50\" width=\"100\"\n                                                                                    align=\"middle\"/>\n        </div>\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"nonghang\" class=\"radio\"/><img src=\"/img/static/yinhang2.png\"\n                                                                                   height=\"50\" width=\"100\"\n                                                                                   align=\"middle\"/>\n        </div>\n    </div>\n    <br/>\n    <div class=\"row\">\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"jiaohang\" class=\"radio\"/><img src=\"/img/static/yinhang3.png\"\n                                                                                   height=\"50\" width=\"100\"\n                                                                                   align=\"middle\"/>\n        </div>\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"jianhang\" class=\"radio\"/><img src=\"/img/static/yinhang4.png\"\n                                                                                   height=\"50\" width=\"100\"\n                                                                                   align=\"middle\"/>\n        </div>\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"gonghang\" class=\"radio\"/><img src=\"/img/static/yinhang5.png\"\n                                                                                   height=\"50\" width=\"100\"\n                                                                                   align=\"middle\"/>\n        </div>\n        <div class=\"col-xs-3\">\n            <input type=\"radio\" name=\"payway\" value=\"gonghang\" class=\"radio\"/><img src=\"/img/static/jianhang.png\"\n                                                                                   height=\"50\" width=\"100\"\n                                                                                   align=\"middle\"/>\n        </div>\n    </div>\n    <br/>\n    <br/>\n    <br/>\n    <div class=\"row\">\n        <div class=\"col-xs-10\" style=\"color:#F00;\">\n            <h4 align=\"left\">请确保你的银行卡已经开通网银支付功能，否则可能无法支付。</h4>\n        </div>\n        <div class=\"col-xs-2\">\n            <a href=\"/order/${id}/pay\">\n                <button type=\"submit\" style=\"height:40px;width:80px\">前去支付</button>\n            </a>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/order_2.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link rel=\"stylesheet\" href=\"/css/order.css\"/>\n    <title>支付结果信息</title>\n    <script type=\"text/javascript\">\n        function show_confirm() {\n            var r = confirm(\"是否确认付款！\");\n            if (r == true) {\n                $.post(\"/order/${id}/pay\", {orderid: ${id}}, function (result) {\n                    if (result.success) {\n                        window.location = \"/order/orders\";\n                    } else {\n                        alert(result.msg);\n                    }\n                })\n            }\n            else {\n                window.location = \"/order/orders\";\n            }\n        }\n    </script>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<br/>\n<br/>\n<div class=\"container\">\n\n    <div style=\" padding:15px; height:60px;background-color:#7A8D96\"><span style=\"background-color:#84CF30\"\n                                                                           class=\"glyphicon glyphicon-ok btn btn-info\"></span>&nbsp;&nbsp;\n        <h4 style=\" font-family:'黑体'; font-weight:bold; display:inline\">您已选择购买的商品，请尽快支付！ </h4>\n    </div>\n    <br/>\n    <hr size=\"5\" color=\"#000000\" width=\"100%\"></hr>\n    <br/>\n    <br/>\n\n    <div class=\"row\">\n        <div class=\"col-xs-4\">\n            <div class=\"row mar\" align=\"center\">\n                <input type=\"button\" onclick=\"show_confirm()\"\n                       class=\"btn btn-default btn-lg\" style=\"width:80px; height:40px;\" value=\"支付\"/>\n            </div>\n        </div>\n        <div class=\"col-xs-2\"></div>\n        <div class=\"col-xs-6\">\n            <table class=\"tishi\" align=\"center\">\n                <tr><h3 style=\"color:#FFF\">在WePlay上购物</h3></tr>\n                <tr><h4 style=\"color:#FFF\">当您提交您的支付信息时，您的资料将得到具有安全套接层（SSL）技术认证的数字证书的保护。\n                    当您完成此笔交易后，我们将向您发送一封电子邮件来确认购物收据。</h4></tr>\n                <tr><h3 style=\"color:#FFF\">客户提示</h3></tr>\n                <tr><h4 style=\"color:#FFF\">该过程可能会长达 60 秒。为了避免购买失败，在交易结束前请不要点击后退按钮或关闭此窗口。</h4></tr>\n            </table>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/personal.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/personal.css\" rel=\"stylesheet\">\n    <script src=\"/js/personal.js\"></script>\n    <title>个人中心</title>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"row\">\n    <div class=\"col-md-6 col-md-offset-3\">\n        <div class=\"row divcolor\" id=\"uname\">\n            <h3>${user} >> 个人资料</h3>\n        </div>\n        <div class=\"row\">\n            <!--左侧资料列-->\n            <div class=\"col-md-7 col-md-offset-1 ziti\">\n                <div class=\"row setmargin\" id=\"userinfo_0\">用户名</div>\n                <div class=\"row setmargin\" id=\"userinfo_1\">昵称</div>\n                <div class=\"row setmargin\" id=\"userinfo_2\">邮箱</div>\n                <div class=\"row setmargin\" id=\"userinfo_3\">电话</div>\n                <div class=\"row setmargin \">\n                    <a href=\"/user/update\">\n                        <button class=\"setbtnpadding\">修改资料</button>\n                    </a>\n                </div>\n            </div>\n            <!--右侧选项列-->\n            <div class=\"col-md-4 setmargin divcolor_1\">\n                <div class=\"row ziti\">编辑</div>\n                <div class=\"row ziti_1 setpadding setmargin\">\n                    <a href=\"/user/personal\">我的个人资料</a>\n                </div>\n                <div class=\"row ziti_1 setmargin\">\n                    <a href=\"/order/orders\">我的订单</a>\n                </div>\n                <div class=\"row ziti_1 setmargin\">\n                    <a href=\"/user/updatepassword\">修改密码</a>\n                </div>\n            </div>\n        </div>\n\n        <div class=\"row\">\n            <div class=\"row divcolor setmargin_2\">\n                <h3>我的游戏</h3>\n            </div>\n            <div class=\"row\">\n                <div class=\"deletepadding\">\n                    <ul id=\"fenleixiangqing\">\n                    </ul>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n</div>\n\n<%@ include file=\"common/bottom.jsp\" %>\n\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/register.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/login.css\" rel=\"stylesheet\">\n    <link href=\"/css/regist.css\" rel=\"stylesheet\">\n    <script src=\"/js/regist.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <title>用户注册</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<!--左侧导航栏-->\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\"></div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row zczt\"><h1>创建账户</h1></div>\n            <div class=\"row zczt\">\n                <div class=\"col-xs-offset-1 col-xs-5\" id=\"regist_1\">\n                    <div class=\"row zczt\">\n                        创建 WePlay 用户名称：<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"yonghuming\"><br/>\n                    </div>\n                    <div class=\"row zczt\">\n                        请输入昵称：<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"nichen\"><br/>\n                    </div>\n                    <div class=\"row zczt\">\n                        请输入密码：<br/>\n                        <input class=\"inputcolor\" type=\"password\" id=\"password\"><br/>\n                    </div>\n                    <div class=\"row zczt\">\n                        请输入邮件地址：<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"email\"><br/>\n                        WePlay 将向此帐户发送一封用于确认的电子邮件。请通过邮件中的验证码验证您的 WePlay 电子邮件帐户。\n                    </div>\n                    <div class=\"row zczt\">\n                        请输入您的手机号:<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"phone\"><br/>\n                    </div>\n                    <div class=\"form-group\" style=\"float:left;clear:both;\">\n                        <div class=\" col-sm-10\">\n                            <button type=\"submit\" class=\"btn btn-default\" style=\"background-color:#417a9b;\"\n                                    onclick=\"regist()\">下一步\n                            </button>\n                        </div>\n                    </div>\n                </div>\n\n                <div class=\"col-xs-6\">\n                    <h3>为什么加入我们？</h3>\n                    <ul>\n                        <li>\n                            购买和下载完整零售游戏\n                        </li>\n                        <li>\n                            游戏时与好友聊天\n                        </li>\n                        <li>\n                            在任何电脑上都能玩\n                        </li>\n                        <li>\n                            安排游戏、比赛或 LAN 聚会\n                        </li>\n                        <li>\n                            获取自动游戏更新以及更多！\n                        </li>\n                    </ul>\n                    <img src=\"/img/login.png\"/>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/search.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/fenleixiangqing.css\" rel=\"stylesheet\">\n    <script src=\"/js/biaoqian.js\"></script>\n    <script src=\"/js/search.js\"></script>\n    <title>分类</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\">\n\n                </ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row\">\n                <div class=\"row clx\" id=\"xianshineirong\"></div>\n                <div class=\"row\">\n                    <div class=\"col-md-8 deletepadding\">\n                        <ul id=\"fenleixiangqing\">\n                        </ul>\n                    </div>\n                    <div class=\"col-md-4 tupianfuji\">\n                        <ul id=\"fenleiyouxitupian\">\n                        </ul>\n                    </div>\n                </div>\n            </div>\n            <div class=\"pagination\">\n                <ul id=\"paging\">\n\n                </ul>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/shoppingcart.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/shoppingcart.css\" rel=\"stylesheet\">\n    <script src=\"/js/shoppingcart.js\"></script>\n    <title>购物车</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-1 col-sm-1 col-md-1\"></div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <h1 style=\"color:#FFF;font-family: 'Adobe 黑体 Std R'\"><span class=\"glyphicon glyphicon-shopping-cart\"></span>您的购物车\n            </h1>\n            <br>\n            <div id=\"grad1\"></div>\n\n            <table style=\"color: #fbfbfb\" class=\"table\">\n                <thead>\n                <tr>\n                    <th width=\"20%\">\n                        序号\n                    </th>\n                    <th width=\"30%\">\n                        游戏名\n                    </th>\n                    <th width=\"25%\">\n                        单价\n                    </th>\n\n                    <th width=\"15%\">\n                        操作\n                    </th>\n                </tr>\n                </thead>\n                <tbody style=\"background-color:#1f486a\" id=\"spcar\">\n\n                </tbody>\n            </table>\n\n            <h2 style=\"color:#CFF\" align=\"right\">总价格：￥<span id=\"prices\"></span></h2>\n\n            <div align=\"right\" style=\" border-top-width:10px;padding:20px\">\n                <button type=\"button\" class=\"btn btn-default btn-lg active\" style=\"background-color:#090\"\n                        onclick=\"orderadd()\">确定购买\n                </button>\n            </div>\n            <br>\n            <br>\n            <h3 style=\"color:#fff\" align=\"left\">交付</h3>\n            <div style=\"background-color:#000;padding:10px 40px 10px 100px;\">\n                <h4 style=\"color:#FFF\"><a href=\"#\"><img src=\"/img/static/logo.jpg\" width=\"61\" height=\"50\"></a>&nbsp;&nbsp;&nbsp;&nbsp;\n                    所有电子商品将会经有WEPLAY桌面应用程序递送给您</h4>\n            </div>\n            <br/>\n            <br/>\n\n            <div align=\"left\" style=\"border:30px\">\n                <h4><a href=\"/\" class=\"btn btn-info btn-lg\">\n                    <span class=\"glyphicon glyphicon-shopping-cart\"></span>\n                    继续购物</a></h4>\n            </div>\n        </div>\n        <div class=\"col-xs-1 col-sm-1 col-md-1\"></div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/taggames.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" isELIgnored=\"false\" %>\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/fenleixiangqing.css\" rel=\"stylesheet\">\n    <script src=\"/js/biaoqian.js\"></script>\n    <script src=\"/js/fenlei.js\"></script>\n    <title>分类</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\">\n            <div class=\"gutter_header\">\n                <ul class=\"list-group\" id=\"leixing\"></ul>\n            </div>\n        </div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row\">\n                <div class=\"row clx\">正在浏览${name}标签的游戏</div>\n                <div class=\"row\">\n                    <div class=\"col-md-8 deletepadding\">\n                        <ul id=\"fenleixiangqing\">\n                        </ul>\n                    </div>\n                    <div class=\"col-md-4 tupianfuji\">\n                        <ul id=\"fenleiyouxitupian\">\n                        </ul>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/updateUserInfo.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/personal.css\" rel=\"stylesheet\">\n    <script src=\"/js/updateUserInfo.js\"></script>\n    <title>个人中心</title>\n</head>\n\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"row\">\n    <div class=\"col-md-6 col-md-offset-3\">\n        <div class=\"row divcolor setmargin_2\"><h3>>>修改个人资料</h3></div>\n        <div class=\"row\">\n            <!--左侧资料列-->\n            <div class=\"col-md-7 col-md-offset-1 ziti\">\n                <div class=\"row setmargin\">用户名</div>\n                <div class=\"row setmargin\">昵称<input class=\"setmargin_1 setpadding\" type=\"text\" id=\"userInfo_0\"></div>\n                <div class=\"row setmargin\">邮箱<input class=\"setmargin_1 setpadding\" type=\"text\" id=\"userInfo_1\"></div>\n                <div class=\"row setmargin\">电话<input class=\"setmargin_1 setpadding\" type=\"text\" id=\"userInfo_2\"></div>\n                <div class=\"row setmargin \">\n                    <button class=\"setbtnpadding\" onclick=\"updateUserInfo()\">确定</button>\n                </div>\n            </div>\n            <!--右侧选项列-->\n            <div class=\"col-md-4 setmargin divcolor_1\">\n                <div class=\"row ziti\">编辑</div>\n                <div class=\"row ziti_1 setpadding setmargin\"><a href=\"/user/personal\">我的个人资料</a></div>\n                <div class=\"row ziti_1 setmargin\"><a href=\"/order/orders\">我的订单</a></div>\n            </div>\n        </div>\n\n    </div>\n</div>\n\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n\n</html>"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/updatepassword.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/login.css\" rel=\"stylesheet\">\n    <link href=\"/css/regist.css\" rel=\"stylesheet\">\n    <script src=\"/js/updatepassword.js\"></script>\n    <title>修改密码</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\"></div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row zczt\">\n                <h1>修改密码</h1>\n            </div>\n            <div class=\"row zczt\">\n                <div class=\"col-xs-offset-1 col-xs-5\" id=\"regist_2\">\n                    <div class=\"row zczt\">\n                        输入您的新密码：<br/>\n                        <input class=\"inputcolor\" type=\"password\" id=\"newpassword\"><br>\n                        再次输入您的新密码：<br/>\n                        <input class=\"inputcolor\" type=\"password\" id=\"newpassword_1\"><br>\n                    </div>\n                    <div class=\"form-group\">\n                        <div class=\" col-sm-10\">\n                            <button type=\"submit\" class=\"btn btn-default\" style=\"background-color:#417a9b;\"\n                                    onclick=\"updatepassword()\">确定\n                            </button>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"col-xs-6\">\n                    <h3>\n                        为什么加入我们？\n                    </h3>\n                    <ul>\n                        <li>\n                            购买和下载完整零售游戏\n                        </li>\n                        <li>\n                            游戏时与好友聊天\n                        </li>\n                        <li>\n                            在任何电脑上都能玩\n                        </li>\n                        <li>\n                            安排游戏、比赛或 LAN 聚会\n                        </li>\n                        <li>\n                            获取自动游戏更新以及更多！\n                        </li>\n                    </ul>\n                    <img src=\"/img/login.png\"/>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/jsp/validate.jsp",
    "content": "<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\n<html>\n<head>\n    <%@ include file=\"common/head.jsp\" %>\n    <link href=\"/css/login.css\" rel=\"stylesheet\">\n    <link href=\"/css/regist.css\" rel=\"stylesheet\">\n    <script src=\"/js/regist.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <title>用户验证</title>\n</head>\n<body>\n<%@ include file=\"common/top.jsp\" %>\n<div class=\"container\">\n    <div class=\"row\">\n        <div class=\"col-xs-2 col-sm-2 col-md-2\"></div>\n        <div class=\"col-xs-10 col-sm-10 col-md-10\">\n            <div class=\"row zczt\">\n                <h1>创建账户</h1>\n            </div>\n            <div class=\"row zczt\">\n                <div class=\"col-xs-offset-1 col-xs-5\" id=\"regist_2\">\n                    <div class=\"row zczt\">\n                        输入您的验证码：<br/>\n                        <input class=\"inputcolor\" type=\"text\" id=\"code\">\n                        <input id=\"send\" type=\"button\" class=\"btnsz\" value=\"重新获取验证码\"\n                               style=\"background-color:#417a9b;\" onclick=\"sendMail()\">\n                    </div>\n                    <div class=\"form-group\">\n                        <div class=\" col-sm-10\">\n                            <button type=\"submit\" class=\"btn btn-default\" style=\"background-color:#417a9b;\"\n                                    onclick=\"validate()\">确定\n                            </button>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"col-xs-6\">\n                    <h3>\n                        为什么加入我们？\n                    </h3>\n                    <ul>\n                        <li>\n                            购买和下载完整零售游戏\n                        </li>\n                        <li>\n                            游戏时与好友聊天\n                        </li>\n                        <li>\n                            在任何电脑上都能玩\n                        </li>\n                        <li>\n                            安排游戏、比赛或 LAN 聚会\n                        </li>\n                        <li>\n                            获取自动游戏更新以及更多！\n                        </li>\n                    </ul>\n                    <img src=\"/img/login.png\"/>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<%@ include file=\"common/bottom.jsp\" %>\n<script src=\"/js/regist.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/web.xml",
    "content": "<!DOCTYPE web-app PUBLIC\n        \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n        \"http://java.sun.com/dtd/web-app_2_3.dtd\" >\n\n<web-app>\n    <display-name>Archetype Created Web Application</display-name>\n\n    <filter>\n        <filter-name>encodingFilter</filter-name>\n        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>\n        <init-param>\n            <param-name>encoding</param-name>\n            <param-value>utf8</param-value>\n        </init-param>\n    </filter>\n    <filter-mapping>\n        <filter-name>encodingFilter</filter-name>\n        <url-pattern>/*</url-pattern>\n    </filter-mapping>\n\n    <servlet>\n        <servlet-name>shop</servlet-name>\n        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>\n        <!-- 配置springMVC需要加载的配置文件\n            spring-dao.xml,spring-service.xml,spring-web.xml\n            Mybatis - > spring -> springmvc\n         -->\n        <init-param>\n            <param-name>contextConfigLocation</param-name>\n            <param-value>classpath:spring-*.xml</param-value>\n        </init-param>\n    </servlet>\n    <servlet-mapping>\n        <servlet-name>shop</servlet-name>\n        <!-- 默认匹配所有的请求 -->\n        <url-pattern>/</url-pattern>\n    </servlet-mapping>\n\n    <error-page>\n        <error-code>404</error-code>\n        <location>/WEB-INF/jsp/error/ErrorCode404.jsp</location>\n    </error-page>\n    <error-page>\n        <error-code>400</error-code>\n        <location>/WEB-INF/jsp/error/ErrorCode400.jsp</location>\n    </error-page>\n    <error-page>\n        <error-code>500</error-code>\n        <location>/WEB-INF/jsp/error/ErrorCode500.jsp</location>\n    </error-page>\n\n</web-app>\n"
  },
  {
    "path": "src/test/java/cn/cie/common/CommonTest.java",
    "content": "package cn.cie.common;\n\nimport cn.cie.event.EventModel;\nimport cn.cie.event.EventType;\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\nimport com.alibaba.fastjson.serializer.SerializerFeature;\nimport org.apache.commons.lang3.StringUtils;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.sql.Timestamp;\nimport java.util.*;\n\n/**\n * Created by RojerAlone on 2017/6/10.\n */\npublic class CommonTest {\n\n    private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n    @Test\n    public void createSql() {\n        int nums = 31;\n        List<Integer> sixPics = new ArrayList<Integer>();\n        sixPics.add(7);\n        sixPics.add(10);\n        sixPics.add(11);\n        sixPics.add(12);\n        sixPics.add(13);\n        sixPics.add(16);\n        sixPics.add(17);\n        sixPics.add(18);\n        sixPics.add(21);\n        sixPics.add(30);\n        sixPics.add(31);\n        for (int i = 1; i <= nums; ++i) {\n            System.out.print(\"(\" + i + \", '/\" + i + \"/header.jpg'), \");\n            if (sixPics.contains(i)) {\n                for (int j = 1; j <= 6; ++j) {\n                    System.out.print(\"(\" + i + \", '/\" + i + \"/\" + j + \".jpg'), \");\n                }\n            } else {\n                for (int j = 1; j <= 5; ++j) {\n                    System.out.print(\"(\" + i + \", '/\" + i + \"/\" + j + \".jpg'), \");\n                }\n            }\n        }\n    }\n\n    @Test\n    public void random() {\n        int num = 31;\n        Random random = new Random();\n        System.out.println(random.nextInt(num));\n    }\n\n    @Test\n    public void zeroTime() {\n        int tmp = 1000 * 3600 * 24;\n        long zero = System.currentTimeMillis() / tmp * tmp + tmp - TimeZone.getDefault().getRawOffset();    //明天零点零分零秒的毫秒数\n        Date zeroTime = new Date(zero);\n        logger.info(String.valueOf(new Timestamp(zero)));\n        logger.info(String.valueOf(new Date().before(zeroTime)));\n    }\n\n    @Test\n    public void strlength() {\n        logger.info(String.valueOf(StringUtils.length(\"rojeralone\")));\n    }\n\n    @Test\n    public void equals() {\n        String type = \"image/png\";\n        logger.info(String.valueOf(type.equalsIgnoreCase(\"image/png\")));\n    }\n\n    /**\n     * 如果对象中的 map 不是 public 的，会无法序列化和反序列化\n     * https://github.com/alibaba/fastjson/issues/1245\n     */\n    @Test\n    public void jsonTest() {\n        EventModel model = new EventModel(EventType.SEND_VALIDATE_EMAIL);\n        String jsonStr = JSON.toJSONString(model);\n        System.out.println(\"toJSONString\" + jsonStr);\n        System.out.println(JSON.parseObject(jsonStr, EventModel.class).getEventType());\n        model.setExts(\"key\", \"value\").setExts(\"key2\", \"value2\");\n        jsonStr = JSON.toJSONString(model);\n        System.out.println(\"toJSONStringWithMap\" + jsonStr);\n        System.out.println(JSON.parseObject(jsonStr, EventModel.class).getExts(\"key\"));\n    }\n}\n"
  },
  {
    "path": "src/test/java/cn/cie/mapper/GameMapperTest.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.Game;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n\n/**\n * Created by RojerAlone on 2017/6/14.\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration(value = {\"classpath:spring-dao.xml\", \"classpath:spring-service.xml\"})\npublic class GameMapperTest {\n\n    private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n    @Autowired\n    private GameMapper gameMapper;\n\n    @Test\n    public void selectByStat() throws Exception {\n        logger.info(\"games={}\" + gameMapper.selectByStat(Game.STAT_OK));\n\n    }\n\n}"
  },
  {
    "path": "src/test/java/cn/cie/mapper/KindmapperMapperTest.java",
    "content": "package cn.cie.mapper;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/19.\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration(value = {\"classpath:spring-dao.xml\", \"classpath:spring-service.xml\"})\npublic class KindmapperMapperTest {\n\n    private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n    @Autowired\n    private KindmapperMapper kindmapperMapper;\n    @Autowired\n    private KindMapper kindMapper;\n\n    @Test\n    public void insertBatch() throws Exception {\n        int game = 1;\n        List<Integer> kinds = new ArrayList<Integer>();\n        kinds.add(1);\n        kinds.add(2);\n        kinds.add(3);\n        kinds.add(4);\n        Integer[] test = new Integer[0];\n        try {\n            kindmapperMapper.insertKindBatch(game, Arrays.asList(test));\n        } catch (Exception e) {\n            logger.error(\"错误\" + e);\n        }\n    }\n\n    @Test\n    public void selectIdByLikeName() throws Exception {\n        String info = \"人\";\n        List<Integer> res = kindMapper.selectIdByLikeName(info);\n        logger.info(String.valueOf(res));\n    }\n\n}"
  },
  {
    "path": "src/test/java/cn/cie/mapper/UserMapperTest.java",
    "content": "package cn.cie.mapper;\n\nimport cn.cie.entity.User;\nimport org.apache.log4j.Logger;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/21.\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration(value = {\"classpath:spring-dao.xml\"})\npublic class UserMapperTest {\n\n    private final Logger logger = Logger.getLogger(this.getClass());\n\n    @Autowired\n    private UserMapper userMapper;\n\n    @Test\n    public void selectByPage() throws Exception {\n\n        List<User> users = userMapper.selectByPage(1, 1);\n        logger.info(users);\n\n    }\n\n}"
  },
  {
    "path": "src/test/java/cn/cie/services/KindServiceTest.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.utils.Result;\nimport cn.cie.entity.dto.GameDTO;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n\nimport java.util.List;\n\n/**\n * Created by RojerAlone on 2017/6/10.\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration(value = {\"classpath:spring-dao.xml\", \"classpath:spring-service.xml\"})\npublic class KindServiceTest {\n\n    private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n    @Autowired\n    private KindService kindService;\n\n    @Test\n    public void getAll() throws Exception {\n    }\n\n    @Test\n    public void getGamesByKind() throws Exception {\n        int kind = 1;\n        try {\n            Result<List<GameDTO>> result = kindService.getGamesByKind(kind, 1);\n            if (result.isSuccess()) {\n                logger.info(\"查询结果为：{}\" + result.getData());\n            } else {\n                logger.info(\"查询失败\");\n            }\n        } catch (Exception e) {\n            logger.error(\"出错：\", e);\n        }\n    }\n\n}"
  },
  {
    "path": "src/test/java/cn/cie/services/UserServiceTest.java",
    "content": "package cn.cie.services;\n\nimport cn.cie.mapper.UserMapper;\nimport cn.cie.utils.Result;\nimport cn.cie.entity.User;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n\n/**\n * Created by RojerAlone on 2017/6/8.\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration({\"classpath:spring-dao.xml\", \"classpath:spring-service.xml\"})\npublic class UserServiceTest {\n\n    private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n    @Autowired\n    private UserService userService;\n    @Autowired\n    private UserMapper userMapper;\n\n    @Test\n    public void register() throws Exception {\n        User user = new User();\n        user.setUsername(\"admin\");\n        user.setPassword(\"123qwe\");\n        user.setNickname(\"管理员\");\n        user.setEmail(\"1091165843@qq.com\");\n        user.setPhone(18392566666L);\n        Result result = userService.register(user);\n        try {\n            if (result.isSuccess()) {\n                logger.info(\"注册成功\");\n            } else {\n                logger.info(\"注册失败: \" + result.getMsg());\n            }\n        } catch (Exception e) {\n            logger.error(\"出错\", e);\n        }\n    }\n\n    @Test\n    public void validate() throws Exception {\n        int uid = 1;\n        String code = \"0c09c363-5919-4da1-93fa-e599491725ba\";\n        try {\n            Result res = userService.validate(uid, code);\n            if (res.isSuccess()) {\n                logger.info(\"验证成功\");\n            } else {\n                logger.info(\"验证失败: \" + res.getMsg());\n            }\n        } catch (Exception e) {\n            logger.error(\"出错\", e);\n        }\n    }\n\n    @Test\n    public void login() throws Exception {\n    }\n\n    @Test\n    public void updateUserInfo() throws Exception {\n        try {\n            User user = userMapper.selectById(54);\n//            user.setStat(null);\n            user.setNickname(null);\n            logger.info(\"user:\" + user);\n            logger.info(String.valueOf(userMapper.update(user)));\n            logger.info(\"user:\" + user);\n        } catch (Exception e) {\n            logger.error(\"error:\" + e);\n        }\n    }\n\n    @Test\n    public void restrict() throws Exception {\n    }\n\n    @Test\n    public void relieve() throws Exception {\n    }\n\n}"
  },
  {
    "path": "src/test/java/cn/cie/utils/RedisUtilTest.java",
    "content": "package cn.cie.utils;\n\nimport cn.cie.entity.User;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.test.context.ContextConfiguration;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n\n/**\n * Created by RojerAlone on 2017/6/14.\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@ContextConfiguration(value = {\"classpath:spring-dao.xml\", \"classpath:spring-service.xml\"})\npublic class RedisUtilTest {\n\n    private final Logger logger = LoggerFactory.getLogger(RedisUtil.class);\n\n    @Autowired\n    private RedisUtil redis;\n\n    @Test\n    public void put() throws Exception {\n        logger.info(redis.put(\"key\", \"value\"));\n    }\n\n    @Test\n    public void putEx() throws Exception {\n        logger.info(redis.putEx(\"ex\", \"exvalue\", 10));\n    }\n\n    @Test\n    public void get() throws Exception {\n        logger.info(redis.get(\"key\"));\n        logger.info(redis.get(\"ex\"));\n//        logger.info(redis.get(\"kinds\"));\n    }\n\n    @Test\n    public void putObject() throws Exception {\n        User user = new User();\n        user.setNickname(\"rojeralone\");\n        user.setPassword(\"alsdjflasdhflsdahnfklnsdaf\");\n        user.setPhone(18392566666L);\n        logger.info(redis.putObject(\"alone\", user));\n    }\n\n    @Test\n    public void putObjectEx() throws Exception {\n    }\n\n    @Test\n    public void getObject() throws Exception {\n        User user = (User) redis.getObject(\"alone\", User.class);\n        logger.info(\"user={}\", user);\n    }\n\n    @Test\n    public void delete() throws Exception {\n        logger.info(\"delete : \" + redis.delete(\"ex\"));\n    }\n\n    @Test\n    public void lall() throws Exception {\n\n    }\n\n}"
  }
]