feat: sale manager

This commit is contained in:
zzw
2026-08-28 10:49:09 +08:00
parent 97eba7ad48
commit 6f567319be
82 changed files with 4491 additions and 182 deletions
+1 -1
View File
@@ -52,5 +52,5 @@ func (l *CreateLogic) Create(in *ad.CreateReq) (*ad.Response, error) {
return failResponse(utils.Fail), nil
}
return okResponse(utils.StringEmpty), nil
return okResponse(nil), nil
}
+1 -1
View File
@@ -64,5 +64,5 @@ func (l *EditLogic) Edit(in *ad.EditReq) (*ad.Response, error) {
return failResponse(utils.Fail), nil
}
return okResponse(utils.StringEmpty), nil
return okResponse(nil), nil
}
+2 -2
View File
@@ -62,8 +62,8 @@ func (l *ItemsLogic) Items(in *ad.ItemsReq) (*ad.Response, error) {
items = append(items, toAdItem(row))
}
return okResponse(utils.StructToJson(&ad.ItemsData{
return okResponse(&ad.ItemsData{
Count: result.Count,
Items: items,
})), nil
}), nil
}
+5 -2
View File
@@ -3,13 +3,16 @@ package logic
import (
"lone-services/pkg/utils"
ad "lone-services/rpc/ad/pb"
jsoniter "github.com/json-iterator/go"
)
func okResponse(data string) *ad.Response {
func okResponse(data any) *ad.Response {
buf, _ := jsoniter.Marshal(data)
return &ad.Response{
Code: utils.Ok.Code,
Msg: utils.Ok.Msg,
Data: data,
Data: string(buf),
}
}
+1 -1
View File
@@ -62,5 +62,5 @@ func (l *StatusLogic) Status(in *ad.StatusReq) (*ad.Response, error) {
return failResponse(utils.Fail), nil
}
return okResponse(utils.StringEmpty), nil
return okResponse(nil), nil
}
+1 -1
View File
@@ -64,5 +64,5 @@ func (l *WebItemsLogic) WebItems(in *ad.WebItemsReq) (*ad.Response, error) {
items = append(items, toAdWebItem(row))
}
return okResponse(utils.StructToJson(items)), nil
return okResponse(items), nil
}