|
|
|
@ -59,42 +59,3 @@ func (s *Service) GetExplorerBlock(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
func (s *Service) GetExplorerAddress(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
json.NewEncoder(w).Encode(s.data.Address) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// // GetPersonEndpoint is the specific person end point.
|
|
|
|
|
// func (s *Service) GetPersonEndpoint(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
// params := mux.Vars(r)
|
|
|
|
|
// for _, item := range s.people {
|
|
|
|
|
// if item.ID == params["id"] {
|
|
|
|
|
// json.NewEncoder(w).Encode(item)
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// json.NewEncoder(w).Encode(&Person{})
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // GetPeopleEndpoint is the people end point.
|
|
|
|
|
// func (s *Service) GetPeopleEndpoint(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
// json.NewEncoder(w).Encode(s.people)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // CreatePersonEndpoint is post people/{id} end point.
|
|
|
|
|
// func (s *Service) CreatePersonEndpoint(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
// params := mux.Vars(r)
|
|
|
|
|
// var person Person
|
|
|
|
|
// _ = json.NewDecoder(r.Body).Decode(&person)
|
|
|
|
|
// person.ID = params["id"]
|
|
|
|
|
// s.people = append(s.people, person)
|
|
|
|
|
// json.NewEncoder(w).Encode(s.people)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // DeletePersonEndpoint is delete people/{id} end point.
|
|
|
|
|
// func (s *Service) DeletePersonEndpoint(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
// params := mux.Vars(r)
|
|
|
|
|
// for index, item := range s.people {
|
|
|
|
|
// if item.ID == params["id"] {
|
|
|
|
|
// s.people = append(s.people[:index], s.people[index+1:]...)
|
|
|
|
|
// break
|
|
|
|
|
// }
|
|
|
|
|
// json.NewEncoder(w).Encode(s.people)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|