30 lines
467 B
Go
30 lines
467 B
Go
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,
|
|
}
|
|
}
|