feat: bff resp string to json
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"product/product"
|
||||
|
||||
"pkg.local/utils"
|
||||
)
|
||||
|
||||
func okResponse(data string) *product.Response {
|
||||
return &product.Response{
|
||||
Code: utils.Ok.Code,
|
||||
Msg: utils.Ok.Msg,
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
|
||||
func failResponse(err utils.Error) *product.Response {
|
||||
return &product.Response{
|
||||
Code: int32(err.GetCode()),
|
||||
Msg: err.GetMsg(),
|
||||
}
|
||||
}
|
||||
|
||||
func msgResponse(code int32, msg string) *product.Response {
|
||||
return &product.Response{
|
||||
Code: code,
|
||||
Msg: msg,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user