package main import ( "encoding/json" "fmt" "io" "net/http" ) type Transfer struct { Amount int `json:"amount"` Sender int `json:"sender"` Receiver int `json:"receiver"` } type Account struct { Amount int `json:"amount"` } var accounts = map[int]Account{ 1: {Amount: 1000}, 2: {Amount: 1000}, } var transactions = []Transfer{} func main() { fmt.Println("Starting server on port 8080") http.HandleFunc("/transfer", transfer) err := http.ListenAndServe(":8081", nil) if err != nil { fmt.Println("Error starting server:", err) } } func transfer(w http.ResponseWriter, r *http.Request) { body, err := io.ReadAll(r.Body) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } var transfer Transfer err = json.Unmarshal(body, &transfer) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } fmt.Println("Transfer received:", transfer) // IMPLEMENTATION w.WriteHeader(1000) w.Write([]byte("Transfer successful")) }