Guest User

Пачему крашнулся роутер?

a guest
Aug 17th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 18.67 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "generais/app/type/DataBaseType"
  6.     _ "github.com/go-sql-driver/mysql"
  7.     "github.com/jinzhu/gorm"
  8.     "github.com/julienschmidt/httprouter"
  9.     _ "github.com/lib/pq"
  10.     _ "github.com/mattn/go-sqlite3"
  11.     "log"
  12.     "net/http"
  13. )
  14.  
  15. /*
  16. Мы создадим глобальную переменную db для конекта с бд.
  17. Потом в main создадим конект и передадим его переменной db
  18. Все функции что вызиваються в роутере сохраняем в этом файле.
  19. С них передаём данные в функции модулей.
  20. */
  21.  
  22. //обьявление глобаьной переменной
  23. var db gorm.DB
  24.  
  25. //обработчики роутов.
  26.  
  27. func Auth(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  28.     UserLogin := ps.ByName("login")
  29.     KeyApi := ps.ByName("keyApi")
  30.     HashHttp := ps.ByName("hash")
  31.     fmt.Fprintf(w, "hello, %s! Твой ключ апи %s Хеш запроса %s \n", UserLogin, KeyApi, HashHttp)
  32. }
  33. func BattlesInvasion(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  34.  
  35. }
  36.  
  37. func BattlesInvasionNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  38.  
  39. }
  40.  
  41. func BattlesSanction(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  42.  
  43. }
  44.  
  45. func BattlesSanctionNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  46.  
  47. }
  48.  
  49. func BattlesSanctionNewProtectorate(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  50.  
  51. }
  52.  
  53. func BattlesSanctionNewLegion(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  54.  
  55. }
  56.  
  57. func Battleground(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  58.  
  59. }
  60.  
  61. func BattlegroundDispley(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  62.  
  63. }
  64.  
  65. func BattlegroundChangeRole(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  66.  
  67. }
  68.  
  69. func BattlegroundStart(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  70.  
  71. }
  72.  
  73. func BattlegroundReady(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  74.  
  75. }
  76.  
  77. func BattlegroundDeseration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  78.  
  79. }
  80.  
  81. func BattlegroundAttak(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  82.  
  83. }
  84.  
  85. func BattlegroundHospital(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  86.  
  87. }
  88.  
  89. func BattlegroundDefeense(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  90.  
  91. }
  92.  
  93. func MissionsLocation(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  94.  
  95. }
  96.  
  97. func MissionsLocationId(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  98.  
  99. }
  100.  
  101. func MissionsLocationOk(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  102.  
  103. }
  104.  
  105. func MissionHq(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  106.  
  107. }
  108.  
  109. func MissionOk(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  110.  
  111. }
  112.  
  113. func MissionDelete(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  114.  
  115. }
  116.  
  117. func MissionMany(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  118.  
  119. }
  120.  
  121. func UnitsGround(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  122.  
  123. }
  124.  
  125. func UnitsMarine(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  126.  
  127. }
  128.  
  129. func UnitsAviation(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  130.  
  131. }
  132.  
  133. func UnitsUnique(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  134.  
  135. }
  136.  
  137. func BlackmarketMercenaries(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  138.  
  139. }
  140.  
  141. func BlackmarketMercenariesNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  142.  
  143. }
  144.  
  145. func BlackmarketSaboteursNewDiver(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  146.  
  147. }
  148.  
  149. func BlackmarketSaboteursNewKazarm(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  150.  
  151. }
  152.  
  153. func BlackmarketLaboratory(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  154.  
  155. }
  156.  
  157. func BlackmarketLaboratoryNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  158.  
  159. }
  160.  
  161. func BlackmarketContraband(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  162.  
  163. }
  164.  
  165. func BlackmarketContrabandNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  166.  
  167. }
  168.  
  169. func BlackmarketDocuments(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  170.  
  171. }
  172.  
  173. func BlackmarketDocumentsUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  174.  
  175. }
  176.  
  177. func BlackmarketAuction(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  178.  
  179. }
  180.  
  181. func BlackmarketAuctionUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  182.  
  183. }
  184.  
  185. func ManufacturingFactory(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  186.  
  187. }
  188.  
  189. func ManufacturingEvolve(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  190.  
  191. }
  192.  
  193. func ManufacturingNewEvolve(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  194.  
  195. }
  196.  
  197. func ManufacturingNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  198.  
  199. }
  200.  
  201. func ManufacturingMines(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  202.  
  203. }
  204.  
  205. func ManufacturingMinesSp(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  206.  
  207. }
  208.  
  209. func ManufacturingMinesTerorAttak(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  210.  
  211. }
  212. func ManufacturingMinesSpContinue(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  213.  
  214. }
  215. func ManufacturingMinesNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  216.  
  217. }
  218. func BuildingsProfitable(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  219.  
  220. }
  221. func BuildingsProfitableNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  222.  
  223. }
  224. func BuildingsDefense(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  225.  
  226. }
  227. func BuildingsDefenseNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  228.  
  229. }
  230. func BuildingsEnergy(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  231.  
  232. }
  233. func BuildingsEnergyNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  234.  
  235. }
  236. func OfficerscResling(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  237.  
  238. }
  239. func OfficerscRoulette(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  240.  
  241. }
  242. func OfficerscSpyInterrogation(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  243.  
  244. }
  245. func OfficerscVeteransRiddle(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  246.  
  247. }
  248. func OfficerscWallNewspaper(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  249.  
  250. }
  251. func ProfileInfo(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  252.  
  253. }
  254. func ProfileInfoId(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  255.  
  256. }
  257. func ProfileSkills(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  258.  
  259. }
  260. func ProfileAchievements(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  261.  
  262. }
  263. func ProfileProperty(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  264.  
  265. }
  266. func ProfileBooty(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  267.  
  268. }
  269. func ProfileGifts(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  270.  
  271. }
  272. func ProfileVipMode(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  273.  
  274. }
  275. func ProfileStatistic(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  276.  
  277. }
  278. func HalloffameRating(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  279.  
  280. }
  281. func HalloffameStatistic(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  282.  
  283. }
  284. func HalloffameHeroes(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  285.  
  286. }
  287. func HalloffameLegions(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  288.  
  289. }
  290. func AllianceIndex(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  291.  
  292. }
  293. func AllianceRequests(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  294.  
  295. }
  296. func AllianceReferrals(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  297.  
  298. }
  299. func AllianceReinforcement(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  300.  
  301. }
  302. func AllianceUnderDefense(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  303.  
  304. }
  305. func ChatPublic(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  306.  
  307. }
  308. func ChatAlliance(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  309.  
  310. }
  311. func ChatLegions(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  312.  
  313. }
  314. func ChatBootcamp(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  315.  
  316. }
  317. func BankStorage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  318.  
  319. }
  320. func BankGold(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  321.  
  322. }
  323. func BankСredit(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  324.  
  325. }
  326. func BankExchanger(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  327.  
  328. }
  329. func MailIndex(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  330.  
  331. }
  332. func MailWrite(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  333.  
  334. }
  335. func MailContacts(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  336.  
  337. }
  338. func MailIgnore(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  339.  
  340. }
  341. func News(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  342.  
  343. }
  344. func NewsAddCommen(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  345.  
  346. }
  347. func dailyBonus(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  348.  
  349. }
  350.  
  351. func SystemMigration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  352.     //db.CreateTable(&DataBaseType.UserPassport{})
  353.     db.Set("gorm:table_options", "ENGINE=InnoDB").CreateTable(&DataBaseType.UserPassport{})
  354.     db.Set("gorm:table_options", "ENGINE=MyISAM").CreateTable(&DataBaseType.UseApi{})
  355. }
  356.  
  357. func UserAuthViews(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  358.  
  359. }
  360. func UserSekurity(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  361.  
  362. }
  363. func UserAuth(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  364.  
  365. }
  366.  
  367. func UserRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  368.  
  369. }
  370.  
  371. func BlackmarketSaboteurs(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
  372.  
  373. }
  374.  
  375. //магазин техники
  376.  
  377. //точка входа
  378. func main() {
  379.     //Конектим с бд
  380.     dbConnect, err := gorm.Open("mysql", "root:parsh888@/generais?charset=utf8&parseTime=True&loc=Local")
  381.     dbConnect.DB()
  382.     dbConnect.DB().Ping()
  383.     dbConnect.DB().SetMaxIdleConns(10)
  384.     dbConnect.DB().SetMaxOpenConns(100)
  385.     dbConnect.SingularTable(true)
  386.     //проверяем ошибки
  387.     if err != nil {
  388.         log.Fatal(err)
  389.     }
  390.     //ошибок нет. Делаем конект глобальным.
  391.     db = dbConnect
  392.  
  393.     //Создаём экземпляр оутера
  394.     router := httprouter.New()
  395.  
  396.     //Авторизация, регистрация, доступ//
  397.     router.GET("/auth/:keyApi/:login/:hash", UserAuthViews)
  398.     router.GET("/sekurity/:keyAPI", UserSekurity)
  399.     router.POST("/auth/", UserAuth)
  400.     router.POST("/registration", UserRegistration)
  401.     //Война//
  402.     router.GET("/Battles/Invasion/:keyApi/:token/:hash", BattlesInvasion)
  403.     router.POST("/Battles/Invasion/new/:keyApi/:token/:hash", BattlesInvasionNew)
  404.     router.GET("/Battles/Sanctions/:keyApi/:token/:hash", BattlesSanction)
  405.     router.POST("/Battles/Sanctions/new/:keyApi/:token/:hash", BattlesSanctionNew)
  406.     router.POST("/Battles/Sanction/newProtectorate", BattlesSanctionNewProtectorate)
  407.     router.POST("/Battles/Sanction/newLegion", BattlesSanctionNewLegion)
  408.     /******************************Груповые бои****************************************/
  409.     router.GET("/battleground/:keyApi/:token/:hash", Battleground)
  410.     router.GET("/battleground/main/:keyApi/:token/:hash", BattlegroundDispley)
  411.     router.GET("/battleground/changeRole/:role/:keyApi/:token/:hash", BattlegroundChangeRole)
  412.     router.GET("/battleground/start/:keyApi/:token/:hash", BattlegroundStart)
  413.     router.GET("/battleground/ready/:keyApi/:token/:hash", BattlegroundReady)
  414.     router.GET("/battleground/deseration/:keyApi/:token/:hash", BattlegroundDeseration)
  415.     router.GET("/battleground/attak/:user_attak/:keyApi/:token/:hash", BattlegroundAttak)
  416.     router.GET("/battleground/defense/:user_hospital/:keyApi/:token/:hash", BattlegroundHospital)
  417.     router.GET("/battleground/defense/:user_defense/:keyApi/:token/:hash", BattlegroundDefeense)
  418.     //Мисии//
  419.     router.GET("/Missions/location/:keyApi/:token/:hash", MissionsLocation)
  420.     router.GET("/Missions/location/:id/:keyApi/:token/:hash", MissionsLocationId)
  421.     router.GET("/Missions/location/:id_location/:id_missions/:keyApi/:token/:hash", MissionsLocationOk)
  422.     router.GET("/Missions/hq/:keyApi/:token/:hash", MissionHq)
  423.     router.GET("/Missions/hq/ok/:hqId/:keyApi/:token/:hash", MissionOk)
  424.     router.GET("/Missions/hq/delete/:hqID/:keyApi/:token/:hash", MissionDelete)
  425.     router.GET("/Missions/hq/many/:hqID/:keyApi/:token/:hash", MissionMany)
  426.     //Магазин техники//
  427.     router.GET("/units/index/ground/:page/:keyApi/:token/:hash", UnitsGround)
  428.     router.GET("/units/index/marine/:page/:keyApi/:token/:hash", UnitsMarine)
  429.     router.GET("/units/index/aviation/:page/:keyApi/:token/:hash", UnitsAviation)
  430.     router.GET("/units/index/unique/:page/:keyApi/:token/:hash", UnitsUnique)
  431.     //Чёрный рынок//
  432.     router.GET("/Blackmarket/Mercenaries/:keyApi/:token/:hash", BlackmarketMercenaries)
  433.     router.GET("/Blackmarket/Mercenaries/:id/:time/:keyApi/:token/:hash", BlackmarketMercenariesNew) //
  434.     router.GET("/Blackmarket/Saboteurs/:keyApi/:token/:hash", BlackmarketSaboteurs)
  435.     router.GET("/Blackmarket/Saboteurs/newDiver/:diverId/:keyApi/:token/:hash", BlackmarketSaboteursNewDiver)
  436.     router.GET("/Blackmarket/Saboteurs/newKazarm/:diverId/:keyApi/:token/:hash", BlackmarketSaboteursNewKazarm)
  437.     router.GET("/Blackmarket/Laboratory/:keyApi/:token/:hash", BlackmarketLaboratory)
  438.     router.GET("/Blackmarket/Laboratory/:id/:time/:keyApi/:token/:hash", BlackmarketLaboratoryNew)
  439.     router.GET("/Blackmarket/Contraband/:keyApi/:token/:hash", BlackmarketContraband)
  440.     router.GET("/Blackmarket/Contraband/:id/:keyApi/:token/:hash", BlackmarketContrabandNew)
  441.     router.GET("/Blackmarket/Documents/:keyApi/:token/:hash", BlackmarketDocuments)
  442.     router.GET("/Blackmarket/Documents/:ava/:flags/:keyApi/:token/:hash", BlackmarketDocumentsUpdate)
  443.     router.GET("/Blackmarket/Auction/:keyApi/:token/:hash", BlackmarketAuction)
  444.     router.GET("/Blackmarket/Auction/:gold/:keyApi/:token/:hash", BlackmarketAuctionUpdate)
  445.     //Производство//
  446.     router.GET("/Manufacturing/Factory/:keyApi/:token/:hash", ManufacturingFactory)
  447.     router.GET("/Manufacturing/Factory/evolve/:keyApi/:token/:hash", ManufacturingEvolve)
  448.     router.GET("/Manufacturing/Factory/NewEvolve/:units/:keyApi/:token/:hash", ManufacturingNewEvolve)
  449.     router.GET("/Manufacturing/Factory/New/:keyApi/:token/:hash", ManufacturingNew)
  450.     router.GET("/Manufacturing/Mines/:keyApi/:token/:hash", ManufacturingMines)
  451.     router.GET("/Manufacturing/Mines/Sp/:keyApi/:token/:hash", ManufacturingMinesSp)
  452.     router.GET("/Manufacturing/Mines/TerorAttak/:keyApi/:token/:hash", ManufacturingMinesTerorAttak)
  453.     router.GET("/Manufacturing/Mines/SpContinue/:keyApi/:token/:hash", ManufacturingMinesSpContinue)
  454.     router.GET("/Manufacturing/Mines/new/:keyApi/:token/:hash", ManufacturingMinesNew)
  455.     //Постройки//
  456.     router.GET("/Buildings/Profitable/:keyApi/:token/:hash", BuildingsProfitable)
  457.     router.GET("/Buildings/Profitable/:id/:keyApi/:token/:hash", BuildingsProfitableNew)
  458.     router.GET("/Buildings/Defense/:keyApi/:token/:hash", BuildingsDefense)
  459.     router.GET("/Buildings/Defense/:id/:keyApi/:token/:hash", BuildingsDefenseNew)
  460.     router.GET("/Buildings/Energy/:keyApi/:token/:hash", BuildingsEnergy)
  461.     router.GET("/Buildings/Energy/:id/:keyApi/:token/:hash", BuildingsEnergyNew)
  462.     //Клуб офицеров//
  463.     router.GET("Officerscclub/Resling/:keyApi/:token/:hash", OfficerscResling)
  464.     router.GET("Officerscclub/Roulette/:keyApi/:token/:hash", OfficerscRoulette)
  465.     router.GET("Officerscclub/SpyInterrogation/:keyApi/:token/:hash", OfficerscSpyInterrogation)
  466.     router.GET("Officerscclub/VeteransRiddle/:keyApi/:token/:hash", OfficerscVeteransRiddle)
  467.     router.GET("Officerscclub/WallNewspaper/:keyApi/:token/:hash", OfficerscWallNewspaper)
  468.     //Профиль//
  469.     router.GET("/Profile/Info/:keyApi/:token/:hash", ProfileInfo)
  470.     router.GET("/Profile/Info/:id/:keyApi/:token/:hash", ProfileInfoId)
  471.     router.GET("/Profile/Skills/:keyApi/:token/:hash", ProfileSkills)
  472.     router.GET("/Profile/Achievements/:keyApi/:token/:hash", ProfileAchievements)
  473.     router.GET("/Profile/Property/:keyApi/:token/:hash", ProfileProperty)
  474.     router.GET("/Profile/Booty/:keyApi/:token/:hash", ProfileBooty)
  475.     router.GET("/Profile/Gifts/:keyApi/:token/:hash", ProfileGifts)
  476.     router.GET("/Profile/VipMode/:keyApi/:token/:hash", ProfileVipMode)
  477.     router.GET("/Profile/Statistic/:keyApi/:token/:hash", ProfileStatistic)
  478.     //Зал славы//
  479.     router.GET("/Halloffame/Rating/:keyApi/:token/:hash", HalloffameRating)
  480.     router.GET("/Halloffame/Statistic/:keyApi/:token/:hash", HalloffameStatistic)
  481.     router.GET("/Halloffame/Heroes/:keyApi/:token/:hash", HalloffameHeroes)
  482.     router.GET("/Halloffame/Legions/:keyApi/:token/:hash", HalloffameLegions)
  483.     //Альянс//
  484.     router.GET("/Alliance/Index/:keyApi/:token/:hash", AllianceIndex)
  485.     router.GET("/Alliance/Requests/:keyApi/:token/:hash", AllianceRequests)
  486.     router.GET("/Alliance/Referrals/:keyApi/:token/:hash", AllianceReferrals)
  487.     router.GET("/Alliance/Reinforcement/:keyApi/:token/:hash", AllianceReinforcement)
  488.     router.GET("/Alliance/UnderDefense/:keyApi/:token/:hash", AllianceUnderDefense)
  489.     //Чаты//
  490.     router.GET("/Chat/Public/:keyApi/:token/:hash", ChatPublic)
  491.     router.GET("/Chat/Alliance/:keyApi/:token/:hash", ChatAlliance)
  492.     router.GET("/Chat/Legions/:keyApi/:token/:hash", ChatLegions)
  493.     router.GET("/Chat/Bootcamp/:keyApi/:token/:hash", ChatBootcamp)
  494.     //Банк//
  495.     router.GET("/Bank/Storage/:keyApi/:token/:hash", BankStorage)
  496.     router.GET("/Bank/Gold/:keyApi/:token/:hash", BankGold)
  497.     router.GET("/Bank/Сredit/:keyApi/:token/:hash", BankСredit)
  498.     router.GET("/Bank/Exchanger/:keyApi/:token/:hash", BankExchanger)
  499.     //Почта//
  500.     router.GET("/Mail/Index/:keyApi/:token/:hash", MailIndex)
  501.     router.GET("/Mail/Write/:keyApi/:token/:hash", MailWrite)
  502.     router.GET("/Mail/Contacts/:keyApi/:token/:hash", MailContacts)
  503.     router.GET("/Mail/Ignore/:keyApi/:token/:hash", MailIgnore)
  504.     //Новости//
  505.     router.GET("/News/:keyApi/:token/:hash", News)
  506.     router.GET("/News/AddCommen/:keyApi/:token/:hash", NewsAddCommen)
  507.     //Ежедневный бонус//
  508.     router.GET("/dailyBonus/:keyApi/:token/:hash", dailyBonus)
  509.     //Системные вызовы//
  510.     router.GET("/system/migration", SystemMigration)
  511.  
  512.     //стартуем сервер на 8080 порту.
  513.     log.Fatal(http.ListenAndServe(":8080", router))
  514. }
Add Comment
Please, Sign In to add comment