Skip to content

Commit a028e2b

Browse files
committed
fix: swagger response docs
1 parent ab55364 commit a028e2b

File tree

6 files changed

+45
-15
lines changed

6 files changed

+45
-15
lines changed

internal/types/userExample_types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ type CreateUserExampleReply struct {
6464

6565
// DeleteUserExampleByIDReply only for api docs
6666
type DeleteUserExampleByIDReply struct {
67-
Result
67+
Code int `json:"code"` // return code
68+
Msg string `json:"msg"` // return information description
69+
Data struct{} `json:"data"` // return data
6870
}
6971

7072
// UpdateUserExampleByIDReply only for api docs
7173
type UpdateUserExampleByIDReply struct {
72-
Result
74+
Code int `json:"code"` // return code
75+
Msg string `json:"msg"` // return information description
76+
Data struct{} `json:"data"` // return data
7377
}
7478

7579
// GetUserExampleByIDReply only for api docs

internal/types/userExample_types.go.exp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ type CreateUserExampleReply struct {
6464

6565
// UpdateUserExampleByIDReply only for api docs
6666
type UpdateUserExampleByIDReply struct {
67-
Result
67+
Code int `json:"code"` // return code
68+
Msg string `json:"msg"` // return information description
69+
Data struct{} `json:"data"` // return data
6870
}
6971

7072
// GetUserExampleByIDReply only for api docs
@@ -78,12 +80,16 @@ type GetUserExampleByIDReply struct {
7880

7981
// DeleteUserExampleByIDReply only for api docs
8082
type DeleteUserExampleByIDReply struct {
81-
Result
83+
Code int `json:"code"` // return code
84+
Msg string `json:"msg"` // return information description
85+
Data struct{} `json:"data"` // return data
8286
}
8387

8488
// DeleteUserExamplesByIDsReply only for api docs
8589
type DeleteUserExamplesByIDsReply struct {
86-
Result
90+
Code int `json:"code"` // return code
91+
Msg string `json:"msg"` // return information description
92+
Data struct{} `json:"data"` // return data
8793
}
8894

8995
// ListUserExamplesRequest request params

internal/types/userExample_types.go.exp.tpl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ type Create{{.TableNameCamel}}Reply struct {
6464

6565
// Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply only for api docs
6666
type Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply struct {
67-
Result
67+
Code int `json:"code"` // return code
68+
Msg string `json:"msg"` // return information description
69+
Data struct{} `json:"data"` // return data
6870
}
6971

7072
// Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply only for api docs
@@ -78,12 +80,16 @@ type Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply struct {
7880

7981
// Delete{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply only for api docs
8082
type Delete{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply struct {
81-
Result
83+
Code int `json:"code"` // return code
84+
Msg string `json:"msg"` // return information description
85+
Data struct{} `json:"data"` // return data
8286
}
8387

8488
// Delete{{.TableNamePluralCamel}}By{{.ColumnNamePluralCamel}}Reply only for api docs
8589
type Delete{{.TableNamePluralCamel}}By{{.ColumnNamePluralCamel}}Reply struct {
86-
Result
90+
Code int `json:"code"` // return code
91+
Msg string `json:"msg"` // return information description
92+
Data struct{} `json:"data"` // return data
8793
}
8894

8995
// List{{.TableNamePluralCamel}}Request request params

internal/types/userExample_types.go.mgo

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ type CreateUserExampleReply struct {
6767

6868
// UpdateUserExampleByIDReply only for api docs
6969
type UpdateUserExampleByIDReply struct {
70-
Result
70+
Code int `json:"code"` // return code
71+
Msg string `json:"msg"` // return information description
72+
Data struct{} `json:"data"` // return data
7173
}
7274

7375
// GetUserExampleByIDReply only for api docs
@@ -81,7 +83,9 @@ type GetUserExampleByIDReply struct {
8183

8284
// DeleteUserExampleByIDReply only for api docs
8385
type DeleteUserExampleByIDReply struct {
84-
Result
86+
Code int `json:"code"` // return code
87+
Msg string `json:"msg"` // return information description
88+
Data struct{} `json:"data"` // return data
8589
}
8690

8791
// ListUserExamplesRequest request params

internal/types/userExample_types.go.mgo.exp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@ type CreateUserExampleReply struct {
6767

6868
// DeleteUserExampleByIDReply only for api docs
6969
type DeleteUserExampleByIDReply struct {
70-
Result
70+
Code int `json:"code"` // return code
71+
Msg string `json:"msg"` // return information description
72+
Data struct{} `json:"data"` // return data
7173
}
7274

7375
// UpdateUserExampleByIDReply only for api docs
7476
type UpdateUserExampleByIDReply struct {
75-
Result
77+
Code int `json:"code"` // return code
78+
Msg string `json:"msg"` // return information description
79+
Data struct{} `json:"data"` // return data
7680
}
7781

7882
// GetUserExampleByIDReply only for api docs
@@ -105,7 +109,9 @@ type DeleteUserExamplesByIDsRequest struct {
105109

106110
// DeleteUserExamplesByIDsReply only for api docs
107111
type DeleteUserExamplesByIDsReply struct {
108-
Result
112+
Code int `json:"code"` // return code
113+
Msg string `json:"msg"` // return information description
114+
Data struct{} `json:"data"` // return data
109115
}
110116

111117
// GetUserExampleByConditionRequest request params

internal/types/userExample_types.go.tpl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ type Create{{.TableNameCamel}}Reply struct {
6464

6565
// Delete{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply only for api docs
6666
type Delete{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply struct {
67-
Result
67+
Code int `json:"code"` // return code
68+
Msg string `json:"msg"` // return information description
69+
Data struct{} `json:"data"` // return data
6870
}
6971

7072
// Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply only for api docs
7173
type Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply struct {
72-
Result
74+
Code int `json:"code"` // return code
75+
Msg string `json:"msg"` // return information description
76+
Data struct{} `json:"data"` // return data
7377
}
7478

7579
// Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply only for api docs

0 commit comments

Comments
 (0)