github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/fixtures/goparsing/bookings/api.go (about) 1 // Package booking API. 2 // 3 // the purpose of this application is to provide an application 4 // that is using plain go code to define an API 5 // 6 // Schemes: https 7 // Host: localhost 8 // Version: 0.0.1 9 // 10 // Consumes: 11 // - application/json 12 // 13 // Produces: 14 // - application/json 15 // 16 // swagger:meta 17 package booking 18 19 import ( 20 "net/http" 21 22 "github.com/go-swagger/scan-repo-boundary/makeplans" 23 ) 24 25 // Customer of the site. 26 // 27 // swagger:model Customer 28 type Customer struct { 29 Name string `json:"name"` 30 } 31 32 // IgnoreMe should not be added to definitions since it is not annotated. 33 type IgnoreMe struct { 34 Name string `json:"name"` 35 } 36 37 // DateRange represents a scheduled appointments time 38 // DateRange should be in definitions since it's being used in a response 39 type DateRange struct { 40 Start string `json:"start"` 41 End string `json:"end"` 42 } 43 44 // BookingResponse represents a scheduled appointment 45 // 46 // swagger:response BookingResponse 47 type BookingResponse struct { 48 // Booking struct 49 // 50 // in: body 51 // required: true 52 Body struct { 53 Booking makeplans.Booking `json:"booking"` 54 Customer Customer `json:"customer"` 55 Dates DateRange `json:"dates"` 56 } 57 } 58 59 // Bookings swagger:route GET /admin/bookings/ booking Bookings 60 // 61 // Bookings lists all the appointments that have been made on the site. 62 // 63 // Consumes: 64 // application/json 65 // 66 // Schemes: http, https 67 // 68 // Produces: 69 // application/json 70 // 71 // Responses: 72 // 200: BookingResponse 73 func bookings(w http.ResponseWriter, r *http.Request) { 74 75 }