Coding Challenge
- Golang 19+
- MySQL (or provide details if using a different database)
- Docker
- golang-migrate
- Makefile GNU
Use the following command to init an instance database, and create tables
make init-db
make migrate-up
- MySQL as our database, the schema will be stored in migrations
- We use migrate read migrations from sources and apply them in correct order to a database.
To start the SampleService Server, use the following command:
go run main.go server
- The service will be available at http://localhost:9090
- Swagger docs: http://localhost:9090/swagger/index.html#/
GET /parents/:id/students
: List all students of parent, base on parent_idPOST /parents/register
: Register a new schedule pick up
{
"parent_id": "1BX7NAJ",
"student_ids": [
"17E8ZIN",
"1YZB7F4"
],
"register_time": "2024-01-20 16:00:00"
}
PUT /parents/registers/:id/waiting
: Confirm that parents is ready for pik upPUT /parents/registers/:id/cancel
: Confirm that parents want to cancel registerPUT /parents/registers/{id}/confirm
: Confirm that parents have completed pick upPUT /teachers/registers/{id}/confirm
: Confirm that their student has left the classPUT /teachers/registers/{id}/reject
: Confirm that this teacher want to reject the register schedulePUT /teachers/registers/{id}/reject
: Confirm that this teacher want to reject the register schedulePUT /students/:id/leave
: Confirm that this student left this classPUT /students/:id/out
: Confirm that this student left this school
We welcome contributions. To contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch for your feature: git checkout -b feature/your-feature-name
- Commit your changes: git commit -m 'Added a new feature'
- Push to the branch: git push origin feature/your-feature-name
- Create a pull request
Please follow our code of conduct and coding style guidelines.