WriteResultInfo 返回信息
(w http.ResponseWriter, resultType string, resultKey string, result interface{})
| 68 | |
| 69 | //WriteResultInfo 返回信息 |
| 70 | func WriteResultInfo(w http.ResponseWriter, resultType string, resultKey string, result interface{}) { |
| 71 | |
| 72 | if result != nil { |
| 73 | if t := reflect.TypeOf(result); t.Kind() == reflect.Slice { |
| 74 | |
| 75 | WriteResultInfoWithPage(w, resultType, resultKey, result, NewItemNum(reflect.ValueOf(result).Len())) |
| 76 | return |
| 77 | } |
| 78 | } |
| 79 | WriteResultInfoWithPage(w, resultType, resultKey, result, nil) |
| 80 | } |
| 81 | |
| 82 | //WriteResultInfoWithCode 返回带状态信息的响应 |
| 83 | func WriteResultInfoWithCode(w http.ResponseWriter, code string, resultType, resultKey string, result interface{}) { |
no test coverage detected