소스 검색

add json tags

abhishek9686 1 년 전
부모
커밋
9a65631bbf
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      models/structs.go

+ 5 - 5
models/structs.go

@@ -103,8 +103,8 @@ type SuccessfulLoginResponse struct {
 
 // ErrorResponse is struct for error
 type ErrorResponse struct {
-	Code    int
-	Message string
+	Code    int    `json:"code"`
+	Message string `json:"message"`
 }
 
 // NodeAuth - struct for node auth
@@ -117,9 +117,9 @@ type NodeAuth struct {
 
 // SuccessResponse is struct for sending error message with code.
 type SuccessResponse struct {
-	Code     int
-	Message  string
-	Response interface{}
+	Code     int         `json:"code"`
+	Message  string      `json:"message"`
+	Response interface{} `json:"response"`
 }
 
 // DisplayKey - what is displayed for key