diff --git a/APIServer.go b/APIServer.go index 633c8df..0af390d 100644 --- a/APIServer.go +++ b/APIServer.go @@ -585,7 +585,6 @@ func handleRacsGetFailList(w http.ResponseWriter, r *http.Request) { "[]{", "[", "}},", "}],", ) - if rst["List"] != nil { jsonData, err := json.MarshalIndent(rst, "", "\t") if err != nil { @@ -600,7 +599,11 @@ func handleRacsGetFailList(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "%v", rpl.Replace(string(jsonData))) return } - w.WriteHeader(http.StatusOK) + if rst["Result"] != "OK" { + w.WriteHeader(http.StatusInternalServerError) + } else { + w.WriteHeader(http.StatusOK) + } fmt.Fprintf(w, "%v", rpl.Replace(fmt.Sprintf("%#v", rst))) } diff --git a/APIServer.yml b/APIServer.yml index 90fe696..dac17dd 100644 --- a/APIServer.yml +++ b/APIServer.yml @@ -18,8 +18,4 @@ MySQL: OfflineView: v_offline StorageTable: racs GetFailListSQL: SELECT * FROM v_racs -Remark: - Columns_UutInfo: [usn,mac,ipaddr,status,message,first_ack,last_ack,last_change] - Columns_LocInfo: [mac,line,col,row,num,last_found] - USER_RO: ewsv3:ewsv3 - USER_RW: apisvc:wcqte +