user.py 537 B

12345678910111213141516171819202122
  1. from flask import request,jsonify
  2. class User:
  3. def __init__(self, action, data,logger):
  4. self.action = action
  5. self.data = data
  6. self.logger = logger
  7. def user_router(self):
  8. if self.action == "register":
  9. return self.register()
  10. elif self.action == "login":
  11. return self.login()
  12. def register(self):
  13. print("---register---")
  14. return "register"
  15. def login(self):
  16. print("---login----")
  17. self.logger.log("😂")
  18. return self.data