swagger

package
v0.0.0-...-d5f948f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

README

Go API Server for swagger

ITU REST API

Overview

This server was generated by the [swagger-codegen] (https://github.com/swagger-api/swagger-codegen) project.
By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 1.0.0
  • Build date: 2021-09-28T12:24:12.782Z
Running the server

To run the server, follow these simple steps:

go run main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCourse

func AddCourse(w http.ResponseWriter, r *http.Request)

func AddStudent

func AddStudent(w http.ResponseWriter, r *http.Request)

func AddTeacher

func AddTeacher(w http.ResponseWriter, r *http.Request)

func CourseIdExists

func CourseIdExists(id int64) bool

func CreateDB

func CreateDB()

func DBAddCourse

func DBAddCourse(c Course) bool

func DBDeleteCourse

func DBDeleteCourse(cid int64) bool

func DBUpdateCourse

func DBUpdateCourse(cid int64, c Course) error

func DeleteCourse

func DeleteCourse(w http.ResponseWriter, r *http.Request)

func DeleteStudent

func DeleteStudent(w http.ResponseWriter, r *http.Request)

func DeleteTeacher

func DeleteTeacher(w http.ResponseWriter, r *http.Request)

func FindStudentByStatus

func FindStudentByStatus(w http.ResponseWriter, r *http.Request)

func FindTeacherByStatus

func FindTeacherByStatus(w http.ResponseWriter, r *http.Request)

func GetCourseById

func GetCourseById(w http.ResponseWriter, r *http.Request)

func GetOverview

func GetOverview(w http.ResponseWriter, r *http.Request)

func GetStudentById

func GetStudentById(w http.ResponseWriter, r *http.Request)

func GetTeacherById

func GetTeacherById(w http.ResponseWriter, r *http.Request)

func Index

func Index(w http.ResponseWriter, r *http.Request)

func IndexFromId

func IndexFromId(id int64) int

func Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter() *mux.Router

func UpdateCourse

func UpdateCourse(w http.ResponseWriter, r *http.Request)

func UpdateStudent

func UpdateStudent(w http.ResponseWriter, r *http.Request)

func UpdateTeacher

func UpdateTeacher(w http.ResponseWriter, r *http.Request)

func UploadStudentPhoto

func UploadStudentPhoto(w http.ResponseWriter, r *http.Request)

func UploadTeacherPhoto

func UploadTeacherPhoto(w http.ResponseWriter, r *http.Request)

Types

type Course

type Course struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

func DBGetCourse

func DBGetCourse(cid int64) (Course, error)

func DBGetCourseOverview

func DBGetCourseOverview() []Course

type Database

type Database struct {
	// contains filtered or unexported fields
}

func GetDB

func GetDB() *Database

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type Student

type Student struct {
	Id int64 `json:"id,omitempty"`

	Username string `json:"username,omitempty"`

	FirstName string `json:"firstName,omitempty"`

	LastName string `json:"lastName,omitempty"`

	Email string `json:"email,omitempty"`

	Password string `json:"password,omitempty"`

	Phone string `json:"phone,omitempty"`

	Course *Course `json:"course,omitempty"`

	PhotoUrls []string `json:"photoUrls,omitempty"`

	// student status
	Status string `json:"status,omitempty"`
}

type Teacher

type Teacher struct {
	Id int64 `json:"id,omitempty"`

	Username string `json:"username,omitempty"`

	FirstName string `json:"firstName,omitempty"`

	LastName string `json:"lastName,omitempty"`

	Email string `json:"email,omitempty"`

	Password string `json:"password,omitempty"`

	Phone string `json:"phone,omitempty"`

	Courses []Course `json:"courses,omitempty"`

	PhotoUrls []string `json:"photoUrls,omitempty"`

	// teacher status
	Status string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL