Skip to content

Commit a78f9d2

Browse files
committed
fix: rename msg to message
1 parent 4ca957c commit a78f9d2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pkg/console/model/common.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import (
2323
)
2424

2525
type CommonResp struct {
26-
Code string `json:"code"`
27-
Msg string `json:"msg"`
28-
Data any `json:"data"`
26+
Code string `json:"code"`
27+
Message string `json:"message"`
28+
Data any `json:"data"`
2929
}
3030

3131
func (r *CommonResp) WithCode(code string) *CommonResp {
@@ -34,7 +34,7 @@ func (r *CommonResp) WithCode(code string) *CommonResp {
3434
}
3535

3636
func (r *CommonResp) WithMsg(msg string) *CommonResp {
37-
r.Msg = msg
37+
r.Message = msg
3838
return r
3939
}
4040

@@ -45,26 +45,26 @@ func (r *CommonResp) WithData(data any) *CommonResp {
4545

4646
func NewSuccessResp(data any) *CommonResp {
4747
return &CommonResp{
48-
Code: "Success",
49-
Msg: "success",
50-
Data: data,
48+
Code: "Success",
49+
Message: "success",
50+
Data: data,
5151
}
5252
}
5353

5454
// NewErrorResp TODO replace with NewBizErrorResp
5555
func NewErrorResp(msg string) *CommonResp {
5656
return &CommonResp{
57-
Code: string(bizerror.UnknownError),
58-
Msg: msg,
59-
Data: nil,
57+
Code: string(bizerror.UnknownError),
58+
Message: msg,
59+
Data: nil,
6060
}
6161
}
6262

6363
func NewBizErrorResp(err bizerror.Error) *CommonResp {
6464
return &CommonResp{
65-
Code: string(err.Code()),
66-
Msg: err.Message(),
67-
Data: nil,
65+
Code: string(err.Code()),
66+
Message: err.Message(),
67+
Data: nil,
6868
}
6969
}
7070

0 commit comments

Comments
 (0)