Merge branch 'develop' of git.ailuowan.com:zzw/lone-services into develop
CI / changes (push) Successful in 5s
CI / docker-bff (push) Successful in 3m9s
CI / docker-product (push) Successful in 3m31s
CI / docker-admin (push) Successful in 16s
CI / docker-user (push) Successful in 3m23s
CI / docker-ad (push) Successful in 3m25s
CI / changes (push) Successful in 5s
CI / docker-bff (push) Successful in 3m9s
CI / docker-product (push) Successful in 3m31s
CI / docker-admin (push) Successful in 16s
CI / docker-user (push) Successful in 3m23s
CI / docker-ad (push) Successful in 3m25s
This commit is contained in:
@@ -12,7 +12,7 @@ type ActionLog struct {
|
||||
ModuleName string `gorm:"column:module_name;type:varchar(255);comment:操作模块名,如管理员;NOT NULL" json:"module_name"`
|
||||
Ip string `gorm:"column:ip;type:varchar(20);comment:IP;NOT NULL" json:"ip"`
|
||||
BrowserInfo string `gorm:"column:browser_info;type:varchar(255);comment:浏览器详细信息" json:"browser_info"`
|
||||
BrowserName string `gorm:"column:browser_name;type:varchar(50);comment:浏览器名称" json:"browser_name"`
|
||||
BrowserName string `gorm:"column:browser_name;type:varchar(255);comment:浏览器名称" json:"browser_name"`
|
||||
BrowserVersion string `gorm:"column:browser_version;type:varchar(50);comment:版本" json:"browser_version"`
|
||||
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`
|
||||
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:NULL;comment:添加时间;NOT NULL" json:"create_time"`
|
||||
|
||||
@@ -8,7 +8,7 @@ type LoginLog struct {
|
||||
AdminName string `gorm:"column:admin_name;type:varchar(255);comment:登录人姓名" json:"admin_name"`
|
||||
Ip string `gorm:"column:ip;type:varchar(50);comment:IP;NOT NULL" json:"ip"`
|
||||
BrowserInfo string `gorm:"column:browser_info;type:varchar(255);comment:浏览器详细信息" json:"browser_info"`
|
||||
BrowserName string `gorm:"column:browser_name;type:varchar(50);comment:浏览器名称" json:"browser_name"`
|
||||
BrowserName string `gorm:"column:browser_name;type:varchar(255);comment:浏览器名称" json:"browser_name"`
|
||||
BrowserVersion string `gorm:"column:browser_version;type:varchar(50);comment:浏览器版本" json:"browser_version"`
|
||||
Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为成功,2为失败" json:"status"`
|
||||
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;comment:添加时间;NOT NULL" json:"create_time"`
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/lonelog/internal/dao"
|
||||
"lone-services/services/lonelog/internal/model"
|
||||
"strconv"
|
||||
|
||||
"lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type LoginItemsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
BaseLogic
|
||||
}
|
||||
|
||||
func NewLoginItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LoginItemsLogic {
|
||||
return &LoginItemsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LoginItemsLogic) LoginItems(in *lonelog.ItemsRequest) (*lonelog.Response, error) {
|
||||
modelObj := model.LoginModel{}.Init()
|
||||
w := modelbase.Params{
|
||||
Page: int(in.Page),
|
||||
Size: int(in.Size),
|
||||
Order: "id desc",
|
||||
}
|
||||
w.Like = make(map[string]string)
|
||||
eq := make(map[string]string)
|
||||
w.Other = make(map[string]string)
|
||||
if in.AdminId > utils.NumberZero {
|
||||
eq["admin_id"] = strconv.FormatInt(in.AdminId, utils.NumberTen)
|
||||
}
|
||||
|
||||
if len(in.Ip) > utils.NumberZero {
|
||||
w.Like["ip LIKE ? "] = "%%" + in.Ip + "%%"
|
||||
}
|
||||
|
||||
if len(in.Time) > utils.NumberZero {
|
||||
w.Other["create_time > ?"] = in.Time[utils.NumberZero]
|
||||
w.Other["create_time < ?"] = in.Time[utils.NumberOne]
|
||||
}
|
||||
|
||||
w.Eq = eq
|
||||
var data []dao.LoginLog
|
||||
items, err := modelObj.Page(w, &data)
|
||||
if err != nil {
|
||||
l.Logger.Error(err)
|
||||
return l.fail(utils.Fail)
|
||||
}
|
||||
|
||||
return l.ok(items)
|
||||
}
|
||||
@@ -28,6 +28,11 @@ func (s *LonelogServer) Items(ctx context.Context, in *lonelog.ItemsRequest) (*l
|
||||
return l.Items(in)
|
||||
}
|
||||
|
||||
func (s *LonelogServer) LoginItems(ctx context.Context, in *lonelog.ItemsRequest) (*lonelog.Response, error) {
|
||||
l := logic.NewLoginItemsLogic(ctx, s.svcCtx)
|
||||
return l.LoginItems(in)
|
||||
}
|
||||
|
||||
func (s *LonelogServer) ActionAdd(ctx context.Context, in *lonelog.ActionLog) (*lonelog.Response, error) {
|
||||
l := logic.NewActionAddLogic(ctx, s.svcCtx)
|
||||
return l.ActionAdd(in)
|
||||
|
||||
@@ -81,7 +81,6 @@ func (w *LogWatcher) loopActionLog() {
|
||||
continue
|
||||
}
|
||||
|
||||
ctxBg := context.Background()
|
||||
logTime, _ := utils.ParseCustomTime(action.CreateTime)
|
||||
edit := dao.ActionLog{
|
||||
Content: action.Content,
|
||||
@@ -100,7 +99,7 @@ func (w *LogWatcher) loopActionLog() {
|
||||
err = model.ActionModel{}.Init().Create(&edit)
|
||||
if err != nil {
|
||||
logx.Errorf("insert actionlog mysql err=%v payload=%s", err, payload)
|
||||
_ = logRedis.LogRedisClient.LPush(ctxBg, utils.LogActionQueueKey, payload).Err()
|
||||
// 删除 LPush 重试逻辑,报错仅打印日志直接丢弃,不再回写队列
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
@@ -147,8 +146,6 @@ func (w *LogWatcher) loopLoginLog() {
|
||||
continue
|
||||
}
|
||||
|
||||
ctxBg := context.Background()
|
||||
|
||||
logTime, _ := utils.ParseCustomTime(login.CreateTime)
|
||||
edit := dao.LoginLog{
|
||||
AdminId: login.AdminId,
|
||||
@@ -164,7 +161,7 @@ func (w *LogWatcher) loopLoginLog() {
|
||||
err = model.LoginModel{}.Init().Create(&edit)
|
||||
if err != nil {
|
||||
logx.Errorf("insert loginlog mysql err=%v payload=%s", err, payload)
|
||||
_ = logRedis.LogRedisClient.LPush(ctxBg, utils.LogLoginQueueKey, payload).Err()
|
||||
// 删除 LPush 重试逻辑,报错仅打印日志直接丢弃,不再回写队列
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,15 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ActionLog = lonelog.ActionLog
|
||||
ItemsRequest = lonelog.ItemsRequest
|
||||
LoginLog = lonelog.LoginLog
|
||||
Response = lonelog.Response
|
||||
ActionLog = lonelog.ActionLog
|
||||
ItemsLoginRequest = lonelog.ItemsLoginRequest
|
||||
ItemsRequest = lonelog.ItemsRequest
|
||||
LoginLog = lonelog.LoginLog
|
||||
Response = lonelog.Response
|
||||
|
||||
Lonelog interface {
|
||||
Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
@@ -41,6 +43,11 @@ func (m *defaultLonelog) Items(ctx context.Context, in *ItemsRequest, opts ...gr
|
||||
return client.Items(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultLonelog) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := lonelog.NewLonelogClient(m.cli.Conn())
|
||||
return client.LoginItems(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultLonelog) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := lonelog.NewLonelogClient(m.cli.Conn())
|
||||
return client.ActionAdd(ctx, in, opts...)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type AddressItemLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewAddressItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddressItemLogic {
|
||||
return &AddressItemLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *AddressItemLogic) AddressItem(in *order.AddressItemsRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type OrderAuditingItemsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewOrderAuditingItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderAuditingItemsLogic {
|
||||
return &OrderAuditingItemsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *OrderAuditingItemsLogic) OrderAuditingItems(in *order.OrderAuditingItemsRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type OrderAuditingLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewOrderAuditingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderAuditingLogic {
|
||||
return &OrderAuditingLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *OrderAuditingLogic) OrderAuditing(in *order.OrderAuditingRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type OrderCreateLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewOrderCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderCreateLogic {
|
||||
return &OrderCreateLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *OrderCreateLogic) OrderCreate(in *order.AdminCreateOrderRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebAddressCreateLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebAddressCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressCreateLogic {
|
||||
return &WebAddressCreateLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebAddressCreateLogic) WebAddressCreate(in *order.EditAddressRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebAddressDefLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebAddressDefLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressDefLogic {
|
||||
return &WebAddressDefLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebAddressDefLogic) WebAddressDef(in *order.IdRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebAddressEditLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebAddressEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressEditLogic {
|
||||
return &WebAddressEditLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebAddressEditLogic) WebAddressEdit(in *order.EditAddressRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebAddressItemsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebAddressItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressItemsLogic {
|
||||
return &WebAddressItemsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebAddressItemsLogic) WebAddressItems(in *order.EmptyRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebAddressStatusLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebAddressStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressStatusLogic {
|
||||
return &WebAddressStatusLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebAddressStatusLogic) WebAddressStatus(in *order.StatusAddressRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebCartEditLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebCartEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebCartEditLogic {
|
||||
return &WebCartEditLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebCartEditLogic) WebCartEdit(in *order.EditCartRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebCartLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebCartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebCartLogic {
|
||||
return &WebCartLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebCartLogic) WebCart(in *order.EmptyRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/order/pb"
|
||||
"lone-services/services/order/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type WebCreateLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewWebCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebCreateLogic {
|
||||
return &WebCreateLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *WebCreateLogic) WebCreate(in *order.CreateOrderRequest) (*order.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &order.Response{}, nil
|
||||
}
|
||||
@@ -23,7 +23,67 @@ func NewOrderServer(svcCtx *svc.ServiceContext) *OrderServer {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *OrderServer) Items(ctx context.Context, in *order.ItemsRequest) (*order.Response, error) {
|
||||
func (s *OrderServer) Items(ctx context.Context, in *order.OrderItemsRequest) (*order.Response, error) {
|
||||
l := logic.NewItemsLogic(ctx, s.svcCtx)
|
||||
return l.Items(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebCreate(ctx context.Context, in *order.CreateOrderRequest) (*order.Response, error) {
|
||||
l := logic.NewWebCreateLogic(ctx, s.svcCtx)
|
||||
return l.WebCreate(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebAddressCreate(ctx context.Context, in *order.EditAddressRequest) (*order.Response, error) {
|
||||
l := logic.NewWebAddressCreateLogic(ctx, s.svcCtx)
|
||||
return l.WebAddressCreate(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebAddressEdit(ctx context.Context, in *order.EditAddressRequest) (*order.Response, error) {
|
||||
l := logic.NewWebAddressEditLogic(ctx, s.svcCtx)
|
||||
return l.WebAddressEdit(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebAddressStatus(ctx context.Context, in *order.StatusAddressRequest) (*order.Response, error) {
|
||||
l := logic.NewWebAddressStatusLogic(ctx, s.svcCtx)
|
||||
return l.WebAddressStatus(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebAddressDef(ctx context.Context, in *order.IdRequest) (*order.Response, error) {
|
||||
l := logic.NewWebAddressDefLogic(ctx, s.svcCtx)
|
||||
return l.WebAddressDef(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebAddressItems(ctx context.Context, in *order.EmptyRequest) (*order.Response, error) {
|
||||
l := logic.NewWebAddressItemsLogic(ctx, s.svcCtx)
|
||||
return l.WebAddressItems(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebCart(ctx context.Context, in *order.EmptyRequest) (*order.Response, error) {
|
||||
l := logic.NewWebCartLogic(ctx, s.svcCtx)
|
||||
return l.WebCart(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) WebCartEdit(ctx context.Context, in *order.EditCartRequest) (*order.Response, error) {
|
||||
l := logic.NewWebCartEditLogic(ctx, s.svcCtx)
|
||||
return l.WebCartEdit(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) AddressItem(ctx context.Context, in *order.AddressItemsRequest) (*order.Response, error) {
|
||||
l := logic.NewAddressItemLogic(ctx, s.svcCtx)
|
||||
return l.AddressItem(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) OrderAuditingItems(ctx context.Context, in *order.OrderAuditingItemsRequest) (*order.Response, error) {
|
||||
l := logic.NewOrderAuditingItemsLogic(ctx, s.svcCtx)
|
||||
return l.OrderAuditingItems(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) OrderAuditing(ctx context.Context, in *order.OrderAuditingRequest) (*order.Response, error) {
|
||||
l := logic.NewOrderAuditingLogic(ctx, s.svcCtx)
|
||||
return l.OrderAuditing(in)
|
||||
}
|
||||
|
||||
func (s *OrderServer) OrderCreate(ctx context.Context, in *order.AdminCreateOrderRequest) (*order.Response, error) {
|
||||
l := logic.NewOrderCreateLogic(ctx, s.svcCtx)
|
||||
return l.OrderCreate(in)
|
||||
}
|
||||
|
||||
@@ -14,11 +14,33 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ItemsRequest = order.ItemsRequest
|
||||
Response = order.Response
|
||||
AddressItemsRequest = order.AddressItemsRequest
|
||||
AdminCreateOrderRequest = order.AdminCreateOrderRequest
|
||||
CreateOrderRequest = order.CreateOrderRequest
|
||||
EditAddressRequest = order.EditAddressRequest
|
||||
EditCartRequest = order.EditCartRequest
|
||||
EmptyRequest = order.EmptyRequest
|
||||
IdRequest = order.IdRequest
|
||||
OrderAuditingItemsRequest = order.OrderAuditingItemsRequest
|
||||
OrderAuditingRequest = order.OrderAuditingRequest
|
||||
OrderItemsRequest = order.OrderItemsRequest
|
||||
Response = order.Response
|
||||
StatusAddressRequest = order.StatusAddressRequest
|
||||
|
||||
Order interface {
|
||||
Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebAddressCreate(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebAddressEdit(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebAddressStatus(ctx context.Context, in *StatusAddressRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebAddressDef(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebAddressItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebCart(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
WebCartEdit(ctx context.Context, in *EditCartRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
AddressItem(ctx context.Context, in *AddressItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
OrderAuditingItems(ctx context.Context, in *OrderAuditingItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
defaultOrder struct {
|
||||
@@ -32,7 +54,67 @@ func NewOrder(cli zrpc.Client) Order {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultOrder) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
func (m *defaultOrder) Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.Items(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebCreate(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebAddressCreate(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebAddressCreate(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebAddressEdit(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebAddressEdit(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebAddressStatus(ctx context.Context, in *StatusAddressRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebAddressStatus(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebAddressDef(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebAddressDef(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebAddressItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebAddressItems(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebCart(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebCart(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) WebCartEdit(ctx context.Context, in *EditCartRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.WebCartEdit(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) AddressItem(ctx context.Context, in *AddressItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.AddressItem(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) OrderAuditingItems(ctx context.Context, in *OrderAuditingItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.OrderAuditingItems(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.OrderAuditing(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrder) OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := order.NewOrderClient(m.cli.Conn())
|
||||
return client.OrderCreate(ctx, in, opts...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user