Coder Social home page Coder Social logo

test's Introduction

COMP3278 API

main.py contains all flask functions needed Take a Look

########### IMPORTANT: changes to public SQL file ###########

  • Change time_zone to "+08:00"
    • originally "+00:00"
  • Change Table "Student": replace "name.first" and "name.last" with "student_name"
    • Seems that MySQL does not support composite attributes link

Login

GET Response description example
/ text/html load index.html N/A
/faceLogin.html text/html load faceLogin.html N/A
/faceRegister.html text/html load faceRegister.html N/A
/faceLogin application/json start face recognition; return studentName if face recoginized, else "None" {"value": "None"} or {"value": "Loridy"}
/homepage/<studentName>/logout application/json logout (used to store logout time) {"result": "Log out successfully"}
/loginRecord/<studentName> application/json get the last user login information {"studentID":studentID, "total_login_times":total_login_times, "last_login_time":last_login_time, "last_logout_time":last_logout_time, "duration":duration}

Welcome message when user login (student name, login time)
Done with JS?

Register

POST Request example Response description example
/faceRegister application/json {"studentName": str, "studentId": str, "email": str, "department": str, "moodle": str} text register a new account; after fill in all info, start face capture "OK"

Show Homepage

GET Response description example
/schedule/<studentName> text/html return an html template with reference [course, tutorial, DDL] {{course}} ---- [['COMP3278-1A', 'Mon', '14:30:00', '15:20:00'], ['COMP3278-1A', 'Thu', '13:30:00', '15:20:00'], ['ECON2280-1A', 'Mon', '09:30:00', '12:20:00']]

(Use {{course}} in .html to get course data)

Add Course

GET Response description example
schedule/<studentName>/add.html text/html return an html template with reference [choice] {{course}} ---- [('MATH2211-1A',), ('STAT2602-1A',)]
schedule/<studentName>add application/json

Drop Course

GET Response description example
schedule/<studentName>/drop.html text/html return an html template with reference [choice] {{course}} ---- [('COMP3278-1A',), ('ECON2280-1A',)]
`schedule/studentName/drop application/json

Upcoming

GET Response description example
/upcoming/<studentName> application/json get upcoming events including upcoming course, upcoming deadline, and other upcomings {"upcomingcourse": {"course": [], "tutorial": []}, "upcomingDDL": {"DDL": []}, "other": {"course": [["COMP3278-1A", "Mon", "14:30:00", "15:20:00"], ["COMP3278-1A", "Thu", "13:30:00", "15:20:00"], ["ECON2280-1A", "Mon", "09:30:00", "12:20:00"]], "tutorial": [["COMP3278-1A", "Tue", "16:30:00", "17:20:00"], ["COMP3278-1A", "Tue", "16:30:00", "17:20:00"], ["COMP3278-1A", "Tue", "16:30:00", "17:20:00"], ["ECON2280-1A", "Wed", "10:30:00", "11:20:00"], ["ECON2280-1A", "Wed", "10:30:00", "11:20:00"], ["ECON2280-1A", "Wed", "10:30:00", "11:20:00"]], "DDL": [["COMP3278-1A", "2022-11-15", "12:00:00"], ["ECON2280-1A", "2022-11-14", "23:59:00"]]}}

test's People

Contributors

loridy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.