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