-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
69 lines (58 loc) · 2.66 KB
/
main.py
File metadata and controls
69 lines (58 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import tornado.ioloop
import tornado.web
import tornado.httpserver
import os,MySQLdb,dbapi,util,score
from handler import *
from push import *
from xml.dom.minidom import parse,parseString
class app(tornado.web.Application):
def __init__(self):
settings = {
"static_path": os.path.join(os.path.dirname(__file__), "static"),
"debug": True
}
handlers=[
(r"/api/login",UserHandler.LoginHandler),
(r"/api/register",UserHandler.RegisterHandler),
(r"/api/userauthentication",UserHandler.AuthenHandler),
(r"/api/logout",UserHandler.LogoutHandler),
(r"/api/cancel",UserHandler.CancelHandler),
(r"/api/updatecid",UserHandler.UpdateCid),
(r"/api/search",UserHandler.SearchHandler),
(r"/api/getavatar",UserHandler.GetAvatarHandler),
(r"/api/checkrelatives",RelativesHandler.CheckrelativesHandler),
(r"/api/deleterelatives",RelativesHandler.DeleterelativesHandler),
(r"/api/addrelatives",RelativesHandler.AddrelativesHandler),
(r"/api/agreerelatives",RelativesHandler.AgreerelativesHandler),
(r"/api/getvalidation",RelativesHandler.ValidationHandler),
(r"/api/history",HistoryHandler.HistoryHandler),
(r"/api/helpmessage",EventHandler.HelpmessageHandler),
(r"/api/supportmessage",EventHandler.SupportmessageHandler),
(r"/api/finish",EventHandler.FinishHandler),
(r"/api/givecredit",EventHandler.GivecreditHandler),
(r"/api/addaid",EventHandler.AddaidHandler),
(r"/api/sendsupport",EventHandler.SendsupportHandler),
(r"/api/quitaid",EventHandler.QuitaidHandler),
(r"/api/event",EventHandler.EventHandler),
(r"/api/getuserinfo",UserInfoHandler.GetUserInfoHandler),
(r"/api/updateuserinfo",UserInfoHandler.UpdateUserInfoHandler),
(r"/api/getAround",GetArroundEvent.GetArroundEvent),
(r"/api/startfollow",FollowHandler.startFollowHandler),
(r"/api/cancelfollow",FollowHandler.cancelFollowHandler),
(r"/api/thirdpartylogin",ThirdPartHandlers.ThirdPartyLoginHandler),
(r"/api/thirdpartyremoveaccount",ThirdPartHandlers.ThirdPartyRemoveAccountHandler),
(r"/api/thirdpartyfilluserinfo",ThirdPartHandlers.ThirdPartyFillUserInfoHandler),
(r"/api/authstate", Authorize.AuthStateHandler),
(r"/api/requestemailauth", Authorize.RequestEmailAuthHandler),
(r"/api/authemail", Authorize.AuthEmailHandler),
(r"/api/requestphoneauth", Authorize.RequestPhoneAuthHandler),
(r"/api/authphone", Authorize.AuthPhoneHandler)]
tornado.web.Application.__init__(self,handlers,**settings)
self.dbapi=dbapi.dbapi()
self.util=util.util()
self.push = Push()
self.score=score.score()
if __name__=="__main__":
server=tornado.httpserver.HTTPServer(app())
server.listen(8080)
tornado.ioloop.IOLoop.instance().start()