-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
154 lines (127 loc) · 5.44 KB
/
app.py
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
from flask import Flask
from flask_restful import Api
from services.common_service.authentication import *
from services.event_service.event_info_services import *
from services.event_service.event_request_services import *
from services.event_service.comment_services import *
from services.friend_service.friend_request_services import *
from services.friend_service.friend_services import *
from services.user_service.block_user_services import *
from services.user_service.ignore_user_services import *
from services.user_service.user_info_services import *
from services.user_service.user_request_services import *
from services.channel_service.channel_info_services import *
app = Flask(__name__)
api = Api(app)
jwt = jwt_init(app)
mlab.connect()
'''########################################
IDENTIFIED USER SERVICES APIs:
@ finished features:
+ register/authenticate user
+ update user information
@ future features:
########################################'''
api.add_resource(Register, "/api/register")
api.add_resource(CheckUsernameAvailability, "/api/user/username/check")
api.add_resource(CheckNicknameAvailability, "/api/user/nickname/check")
api.add_resource(UpdateUserInfo, "/api/user/update/info")
api.add_resource(UpdatePassword, "/api/user/update/password")
api.add_resource(UpdateDisplayName, "/api/user/update/display_name")
api.add_resource(UpdateNickname, "/api/user/update/nickname")
api.add_resource(UpdateProfileUrl, "/api/user/update/profile_url")
api.add_resource(UpdateBirthday, "/api/user/update/birthday")
api.add_resource(UpdateGender, "/api/user/update/gender")
api.add_resource(GetCurrentUserInfo, "/api/user/get/info")
'''########################################
USERS SERVICES APIs:
@ finished features:
+ Share/Clear Location
+ Get user around
+ Block/Unblock other user
+ Ignore/Un-ignore other user
@ future features:
########################################'''
api.add_resource(ResetPasswordRequest, "/api/user/put/password")
api.add_resource(ShareLocationRequest, "/api/user/post/location")
api.add_resource(ClearLocationRequest, "/api/user/remove/location")
api.add_resource(GetUserAroundRequest, "/api/user/get/around")
api.add_resource(BlockUserRequest, "/api/user/block")
api.add_resource(UnblockUserRequest, "/api/user/unblock")
api.add_resource(IgnoreUserRequest, "/api/user/ignore")
'''########################################
FRIENDS SERVICES APIs:
@ finished features:
+ Request friend
+ Accept/Deny friend request
+ Un-Friend
+ Get friend sublist
@ future features:
+ get friend-request-received sublist
+ get friend-request-sent sublist
########################################'''
api.add_resource(SendFriendRequest, "/api/friend/request/send")
api.add_resource(AcceptFriendRequest, "/api/friend/request/accept")
api.add_resource(DeclineFriendRequest, "/api/friend/request/decline")
api.add_resource(UnfriendRequest, "/api/friend/request/remove")
api.add_resource(GetSubFriendList, "/api/friend/get/sublist")
'''########################################
EVENTS SERVICES APIs:
@ finished features:
+ Create/Delete event
+ Update event details
+ Like/Unlike event
+ Report event
+ get created-event sublist
@ future features:
+ get friend's events sublist
########################################'''
api.add_resource(CreateEventRequest, "/api/event/create")
api.add_resource(UpdateEventRequest, "/api/event/update")
api.add_resource(UpdateTextEventRequest, "/api/event/update/text")
api.add_resource(UpdateLocationEventRequest, "/api/event/update/location")
api.add_resource(UpdateTagsEvent, "/api/event/update/tags")
api.add_resource(DeleteEventRequest, "/api/event/delete")
api.add_resource(ReportEvent, "/api/event/report")
api.add_resource(GetCreatedEvent, "/api/event/get/<_from>/<_to>")
api.add_resource(LikeEventRequest, "/api/event/like")
api.add_resource(UnlikeEventRequest, "/api/event/unlike")
'''########################################
COMMENT SERVICES APIs:
@ finished features:
+ add comment to an event
+ delete comment to an event
+ like/unlike comment
+ get comment sublist by time
@ future features:
+ reply to a comment
########################################'''
api.add_resource(CreateCommentRequest, "/api/event/comment/create")
api.add_resource(DeleteCommentRequest, "/api/event/comment/delete")
api.add_resource(LikeCommentRequest, "/api/event/comment/like")
api.add_resource(UnlikeCommentRequest, "/api/event/comment/unlike")
api.add_resource(GetCommentRequest, "/api/comment/get/<_from>/<_to>")
'''########################################
CHANNEL SERVICES APIs:
@ finished features:
+ create new channel
@ future features:
+ delete channel
+ like/follow/report channel
+ transfer ownership
+ setting admin
+ get followers
+ get user who likes
+ get threads belong to this channel
+ delete thread from a channel
+ create thread to a channel
########################################'''
api.add_resource(CreateChannelRequest, "/api/channel/create")
'''########################################
DANGER-ZONE SERVICES APIs:
***** THESE API BELOW HERE NEED TO BE RE-IMPLEMENTED
BEFORE GOING TO BE USED IN CLIENTS
########################################'''
api.add_resource(DeleteUserAccount, "/api/user/delete")
if __name__ == '__main__':
app.run()