Skip to content

(Backend): Add DAO for database #3

@Lianting-Wang

Description

@Lianting-Wang

Here's the specific data Schema.

{
  "_id": "",
  "courseId": "String",
  "courseName": "String",
  "tags": [],
  "previous": [],
  "next": [],
  "versions": [
    {
      "timestamp": "Number",
      "editor": "Number",
      "contents": [
        {
          "lang": ""
          "info": "",
          "outline": "",
          "professor":  "",
          "difficulty": ""
        }
      ],
      "approved": "bool"
    }
  ]
}

Here's the specific course DAO structure.

class CourseDAO {
  createCourse(courseId, courseName, tags, previous, next);
  updateCourse(courseId, courseName, tags, previous, next);
  addNewVersion(courseId, editor, contents);
  approveVersion(courseId, timestamp);
  findAll();
  findOne(courseId);
  findByKeyWord(str);
  deleteVersion(courseId, timestamp);
  deleteCourse(courseId);
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions