http status code of api racs/getfaillist base on return result
This commit is contained in:
parent
7a3a282c71
commit
802d301cb5
@ -585,7 +585,6 @@ func handleRacsGetFailList(w http.ResponseWriter, r *http.Request) {
|
|||||||
"[]{", "[",
|
"[]{", "[",
|
||||||
"}},", "}],",
|
"}},", "}],",
|
||||||
)
|
)
|
||||||
|
|
||||||
if rst["List"] != nil {
|
if rst["List"] != nil {
|
||||||
jsonData, err := json.MarshalIndent(rst, "", "\t")
|
jsonData, err := json.MarshalIndent(rst, "", "\t")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -600,7 +599,11 @@ func handleRacsGetFailList(w http.ResponseWriter, r *http.Request) {
|
|||||||
fmt.Fprintf(w, "%v", rpl.Replace(string(jsonData)))
|
fmt.Fprintf(w, "%v", rpl.Replace(string(jsonData)))
|
||||||
return
|
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)))
|
fmt.Fprintf(w, "%v", rpl.Replace(fmt.Sprintf("%#v", rst)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,4 @@ MySQL:
|
|||||||
OfflineView: v_offline
|
OfflineView: v_offline
|
||||||
StorageTable: racs
|
StorageTable: racs
|
||||||
GetFailListSQL: SELECT * FROM v_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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user