File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
backend/PyMatcha/routes/api Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 99from PyMatcha import redis
1010from PyMatcha .models .like import Like
1111from PyMatcha .models .match import Match
12+ from PyMatcha .models .message import Message
1213from PyMatcha .models .report import Report
1314from PyMatcha .models .tag import Tag
1415from PyMatcha .models .user import get_user
@@ -141,11 +142,27 @@ def delete_matches():
141142 View .drop_table ()
142143 User .drop_table ()
143144 Tag .drop_table ()
145+ Message .drop_table ()
144146
145147 Match .create_table ()
146148 Like .create_table ()
147149 Report .create_table ()
148150 View .create_table ()
149151 User .create_table ()
150152 Tag .create_table ()
153+ Message .create_table ()
154+ return "" , 204
155+
156+
157+ DEBUG_SEND_MESSAGE = {"from_uid" : str , "to_uid" : str , "content" : str }
158+
159+
160+ @debug_bp .route ("/debug/messages/send" , methods = ["POST" ])
161+ @debug_token_required
162+ @validate_params (DEBUG_SEND_MESSAGE )
163+ def debug_send_message ():
164+ data = request .get_json ()
165+ from_id = get_user (data ["from_uid" ]).id
166+ to_id = get_user (data ["to_uid" ]).id
167+ Message .create (from_id = from_id , to_id = to_id , content = data ["content" ])
151168 return "" , 204
You can’t perform that action at this time.
0 commit comments