This commit is contained in:
renzhiyuan 2024-11-06 18:00:56 +08:00
parent 4497011eba
commit ffe83f9757
26 changed files with 11974 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalAddressListLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalAddressListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalAddressListLogic {
return &PhysicalAddressListLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalAddressListLogic) PhysicalAddressList(in *transfer.PhysicalAddressListReq) (*transfer.PhysicalAddressListRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).AddressList()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalCusBalanceLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalCusBalanceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalCusBalanceLogic {
return &PhysicalCusBalanceLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalCusBalanceLogic) PhysicalCusBalance(in *transfer.EmptyReqs) (*transfer.PhysicalCusBalanceRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).CusBalance()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalCusLogsLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalCusLogsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalCusLogsLogic {
return &PhysicalCusLogsLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalCusLogsLogic) PhysicalCusLogs(in *transfer.PhysicalCusLogsReq) (*transfer.PhysicalCusLogsRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).CusBalanceHis()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalExpressListLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalExpressListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalExpressListLogic {
return &PhysicalExpressListLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalExpressListLogic) PhysicalExpressList(in *transfer.PhysicalExpressListReq) (*transfer.PhysicalExpressListRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).ExpressList()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalFinanceBillLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalFinanceBillLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalFinanceBillLogic {
return &PhysicalFinanceBillLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalFinanceBillLogic) PhysicalFinanceBill(in *transfer.PhysicalFinanceBillReq) (*transfer.PhysicalFinanceBillRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).FinanceBill()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalGoodsDetailLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalGoodsDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalGoodsDetailLogic {
return &PhysicalGoodsDetailLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalGoodsDetailLogic) PhysicalGoodsDetail(in *transfer.PhysicalGoodsDetailReq) (*transfer.GoodsStructWithChild, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).GoodsDetail()
return res, err
}

View File

@ -0,0 +1,32 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalGoodsListLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalGoodsListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalGoodsListLogic {
return &PhysicalGoodsListLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalGoodsListLogic) PhysicalGoodsList(in *transfer.PhysicalGoodsListReq) (*transfer.PhysicalGoodsListRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).GoodsList()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalGoodsStockLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalGoodsStockLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalGoodsStockLogic {
return &PhysicalGoodsStockLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalGoodsStockLogic) PhysicalGoodsStock(in *transfer.PhysicalGoodsStockReq) (*transfer.PhysicalGoodsStockRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).GoodsStock()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderAfterApplyLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderAfterApplyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderAfterApplyLogic {
return &PhysicalOrderAfterApplyLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderAfterApplyLogic) PhysicalOrderAfterApply(in *transfer.PhysicalOrderAfterApplyReq) (*transfer.PhysicalOrderAfterApplyRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderAfterApply()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderAfterReturnLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderAfterReturnLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderAfterReturnLogic {
return &PhysicalOrderAfterReturnLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderAfterReturnLogic) PhysicalOrderAfterReturn(in *transfer.PhysicalOrderAfterReturnReq) (*transfer.PhysicalOrderAfterReturnRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderAfterReturn()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderCloseLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderCloseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderCloseLogic {
return &PhysicalOrderCloseLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderCloseLogic) PhysicalOrderClose(in *transfer.PhysicalOrderCloseReq) (*transfer.PhysicalOrderCloseRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderClose()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderInfoLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderInfoLogic {
return &PhysicalOrderInfoLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderInfoLogic) PhysicalOrderInfo(in *transfer.PhysicalOrderInfoReq) (*transfer.PhysicalOrderInfoRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderInfo()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderListLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderListLogic {
return &PhysicalOrderListLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderListLogic) PhysicalOrderList(in *transfer.PhysicalOrderListReq) (*transfer.PhysicalOrderListRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderList()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderLogisticsLogsLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderLogisticsLogsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderLogisticsLogsLogic {
return &PhysicalOrderLogisticsLogsLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderLogisticsLogsLogic) PhysicalOrderLogisticsLogs(in *transfer.PhysicalOrderLogisticsLogsReq) (*transfer.PhysicalOrderLogisticsLogsRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderLogisticsLogs()
return res, err
}

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderSubLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderSubLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderSubLogic {
return &PhysicalOrderSubLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderSubLogic) PhysicalOrderSub(in *transfer.PhysicalOrderSubReq) (*transfer.PhysicalOrderSubRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderSubmit()
return res, err
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,302 @@
// Code generated by goctl. DO NOT EDIT.
// Source: transfer.proto
package transferClient
import (
"context"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
Address = transfer.Address
BillCus = transfer.BillCus
DefaultReq = transfer.DefaultReq
DefaultRes = transfer.DefaultRes
EmptyReqs = transfer.EmptyReqs
Express = transfer.Express
ExpressData = transfer.ExpressData
ExpressList = transfer.ExpressList
GoodsChild = transfer.GoodsChild
GoodsStructWithChild = transfer.GoodsStructWithChild
GoodsStructWithChildData = transfer.GoodsStructWithChildData
GoodsStructWithChildData_Media = transfer.GoodsStructWithChildData_Media
List = transfer.List
MarketKeyDiscardReq = transfer.MarketKeyDiscardReq
MarketKeyDiscardRes = transfer.MarketKeyDiscardRes
MarketKeyDiscardRes_Data = transfer.MarketKeyDiscardRes_Data
MarketKeySendReq = transfer.MarketKeySendReq
MarketKeySendRes = transfer.MarketKeySendRes
MarketKeySendRes_Data = transfer.MarketKeySendRes_Data
MarketQueryReq = transfer.MarketQueryReq
MarketQueryRes = transfer.MarketQueryRes
MarketQueryRes_Data = transfer.MarketQueryRes_Data
NewMarketDiscardReq = transfer.NewMarketDiscardReq
NewMarketDiscardRes = transfer.NewMarketDiscardRes
NewMarketOrderReq = transfer.NewMarketOrderReq
NewMarketOrderRes = transfer.NewMarketOrderRes
NewMarketOrderRes_Data = transfer.NewMarketOrderRes_Data
NewMarketQueryReq = transfer.NewMarketQueryReq
OrderAfterOpBasic = transfer.OrderAfterOpBasic
OrderAfterOpGoodsInfo = transfer.OrderAfterOpGoodsInfo
OrderOpBasicInfo = transfer.OrderOpBasicInfo
OrderOpGoodsInfo = transfer.OrderOpGoodsInfo
OrderOpLogistics = transfer.OrderOpLogistics
OrderOpSubmitGoodsInfo = transfer.OrderOpSubmitGoodsInfo
PhysicalAddressListReq = transfer.PhysicalAddressListReq
PhysicalAddressListRes = transfer.PhysicalAddressListRes
PhysicalCusBalanceRes = transfer.PhysicalCusBalanceRes
PhysicalCusBalanceResData = transfer.PhysicalCusBalanceResData
PhysicalCusLogsReq = transfer.PhysicalCusLogsReq
PhysicalCusLogsRes = transfer.PhysicalCusLogsRes
PhysicalCusLogsRes_BalanceLog = transfer.PhysicalCusLogsRes_BalanceLog
PhysicalCusLogsRes_PhysicalCusLogsResDataList = transfer.PhysicalCusLogsRes_PhysicalCusLogsResDataList
PhysicalExpressListReq = transfer.PhysicalExpressListReq
PhysicalExpressListRes = transfer.PhysicalExpressListRes
PhysicalExpressListResData = transfer.PhysicalExpressListResData
PhysicalFinanceBillReq = transfer.PhysicalFinanceBillReq
PhysicalFinanceBillRes = transfer.PhysicalFinanceBillRes
PhysicalFinanceBillResData = transfer.PhysicalFinanceBillResData
PhysicalGoodsDetailReq = transfer.PhysicalGoodsDetailReq
PhysicalGoodsListReq = transfer.PhysicalGoodsListReq
PhysicalGoodsListRes = transfer.PhysicalGoodsListRes
PhysicalGoodsStockReq = transfer.PhysicalGoodsStockReq
PhysicalGoodsStockRes = transfer.PhysicalGoodsStockRes
PhysicalGoodsStockResData = transfer.PhysicalGoodsStockResData
PhysicalGoodsStockResData_GoodsStock = transfer.PhysicalGoodsStockResData_GoodsStock
PhysicalOrderAfterApplyReq = transfer.PhysicalOrderAfterApplyReq
PhysicalOrderAfterApplyRes = transfer.PhysicalOrderAfterApplyRes
PhysicalOrderAfterApplyResData = transfer.PhysicalOrderAfterApplyResData
PhysicalOrderAfterApplyResData_ApplyOrderAfterByOpenapiReply = transfer.PhysicalOrderAfterApplyResData_ApplyOrderAfterByOpenapiReply
PhysicalOrderAfterReturnReq = transfer.PhysicalOrderAfterReturnReq
PhysicalOrderAfterReturnRes = transfer.PhysicalOrderAfterReturnRes
PhysicalOrderAfterReturnResData = transfer.PhysicalOrderAfterReturnResData
PhysicalOrderCloseReq = transfer.PhysicalOrderCloseReq
PhysicalOrderCloseRes = transfer.PhysicalOrderCloseRes
PhysicalOrderCloseResData = transfer.PhysicalOrderCloseResData
PhysicalOrderInfoReq = transfer.PhysicalOrderInfoReq
PhysicalOrderInfoRes = transfer.PhysicalOrderInfoRes
PhysicalOrderInfoRes_PhysicalOrderInfoResData = transfer.PhysicalOrderInfoRes_PhysicalOrderInfoResData
PhysicalOrderInfoRes_PhysicalOrderInfoResData_OrderInfoData = transfer.PhysicalOrderInfoRes_PhysicalOrderInfoResData_OrderInfoData
PhysicalOrderListReq = transfer.PhysicalOrderListReq
PhysicalOrderListRes = transfer.PhysicalOrderListRes
PhysicalOrderListResData = transfer.PhysicalOrderListResData
PhysicalOrderLogisticsLogsReq = transfer.PhysicalOrderLogisticsLogsReq
PhysicalOrderLogisticsLogsRes = transfer.PhysicalOrderLogisticsLogsRes
PhysicalOrderLogisticsLogsResData = transfer.PhysicalOrderLogisticsLogsResData
PhysicalOrderSubReq = transfer.PhysicalOrderSubReq
PhysicalOrderSubRes = transfer.PhysicalOrderSubRes
PhysicalOrderSubResData = transfer.PhysicalOrderSubResData
RsCouponGrantReq = transfer.RsCouponGrantReq
RsCouponGrantRes = transfer.RsCouponGrantRes
RsCouponGrantRes_Data = transfer.RsCouponGrantRes_Data
RsCouponGrantRes_Data_VoucherInfo = transfer.RsCouponGrantRes_Data_VoucherInfo
ZltxOrderCardQueryReq = transfer.ZltxOrderCardQueryReq
ZltxOrderCardQueryRes = transfer.ZltxOrderCardQueryRes
ZltxOrderCardReq = transfer.ZltxOrderCardReq
ZltxOrderRechargeQueryReq = transfer.ZltxOrderRechargeQueryReq
ZltxOrderRechargeQueryRes = transfer.ZltxOrderRechargeQueryRes
ZltxOrderRechargeReq = transfer.ZltxOrderRechargeReq
ZltxOrderSmsReq = transfer.ZltxOrderSmsReq
ZltxOrderSmsRes = transfer.ZltxOrderSmsRes
ZltxRechargeInfoRes = transfer.ZltxRechargeInfoRes
ZltxRechargeProductRes = transfer.ZltxRechargeProductRes
ZltxRechargeProductRes_Product = transfer.ZltxRechargeProductRes_Product
Transfer interface {
ZltxOrderRecharge(ctx context.Context, in *ZltxOrderRechargeReq, opts ...grpc.CallOption) (*DefaultRes, error)
ZltxOrderRechargeQuery(ctx context.Context, in *ZltxOrderRechargeQueryReq, opts ...grpc.CallOption) (*ZltxOrderRechargeQueryRes, error)
ZltxOrderCard(ctx context.Context, in *ZltxOrderCardReq, opts ...grpc.CallOption) (*DefaultRes, error)
ZltxOrderCardQuery(ctx context.Context, in *ZltxOrderCardQueryReq, opts ...grpc.CallOption) (*ZltxOrderCardQueryRes, error)
ZltxOrderSms(ctx context.Context, in *ZltxOrderSmsReq, opts ...grpc.CallOption) (*ZltxOrderSmsRes, error)
ZltxRechargeInfo(ctx context.Context, in *DefaultReq, opts ...grpc.CallOption) (*ZltxRechargeInfoRes, error)
ZltxRechargeProduct(ctx context.Context, in *DefaultReq, opts ...grpc.CallOption) (*ZltxRechargeProductRes, error)
ZltxRsMiXue(ctx context.Context, in *RsCouponGrantReq, opts ...grpc.CallOption) (*RsCouponGrantRes, error)
MarketKeySend(ctx context.Context, in *MarketKeySendReq, opts ...grpc.CallOption) (*MarketKeySendRes, error)
MarketKeyDiscard(ctx context.Context, in *MarketKeyDiscardReq, opts ...grpc.CallOption) (*MarketKeyDiscardRes, error)
MarketQuery(ctx context.Context, in *MarketQueryReq, opts ...grpc.CallOption) (*MarketQueryRes, error)
RsCouponGrant(ctx context.Context, in *RsCouponGrantReq, opts ...grpc.CallOption) (*RsCouponGrantRes, error)
NewMarketOrder(ctx context.Context, in *NewMarketOrderReq, opts ...grpc.CallOption) (*NewMarketOrderRes, error)
NewMarketQuery(ctx context.Context, in *NewMarketQueryReq, opts ...grpc.CallOption) (*NewMarketOrderRes, error)
NewMarketDiscard(ctx context.Context, in *NewMarketDiscardReq, opts ...grpc.CallOption) (*NewMarketDiscardRes, error)
PhysicalGoodsList(ctx context.Context, in *PhysicalGoodsListReq, opts ...grpc.CallOption) (*PhysicalGoodsListRes, error)
PhysicalGoodsDetail(ctx context.Context, in *PhysicalGoodsDetailReq, opts ...grpc.CallOption) (*GoodsStructWithChild, error)
PhysicalGoodsStock(ctx context.Context, in *PhysicalGoodsStockReq, opts ...grpc.CallOption) (*PhysicalGoodsStockRes, error)
PhysicalCusLogs(ctx context.Context, in *PhysicalCusLogsReq, opts ...grpc.CallOption) (*PhysicalCusLogsRes, error)
PhysicalCusBalance(ctx context.Context, in *EmptyReqs, opts ...grpc.CallOption) (*PhysicalCusBalanceRes, error)
PhysicalExpressList(ctx context.Context, in *PhysicalExpressListReq, opts ...grpc.CallOption) (*PhysicalExpressListRes, error)
PhysicalAddressList(ctx context.Context, in *PhysicalAddressListReq, opts ...grpc.CallOption) (*PhysicalAddressListRes, error)
PhysicalFinanceBill(ctx context.Context, in *PhysicalFinanceBillReq, opts ...grpc.CallOption) (*PhysicalFinanceBillRes, error)
PhysicalOrderInfo(ctx context.Context, in *PhysicalOrderInfoReq, opts ...grpc.CallOption) (*PhysicalOrderInfoRes, error)
PhysicalOrderList(ctx context.Context, in *PhysicalOrderListReq, opts ...grpc.CallOption) (*PhysicalOrderListRes, error)
PhysicalOrderSub(ctx context.Context, in *PhysicalOrderSubReq, opts ...grpc.CallOption) (*PhysicalOrderSubRes, error)
PhysicalOrderClose(ctx context.Context, in *PhysicalOrderCloseReq, opts ...grpc.CallOption) (*PhysicalOrderCloseRes, error)
PhysicalOrderLogisticsLogs(ctx context.Context, in *PhysicalOrderLogisticsLogsReq, opts ...grpc.CallOption) (*PhysicalOrderLogisticsLogsRes, error)
PhysicalOrderAfterApply(ctx context.Context, in *PhysicalOrderAfterApplyReq, opts ...grpc.CallOption) (*PhysicalOrderAfterApplyRes, error)
PhysicalOrderAfterReturn(ctx context.Context, in *PhysicalOrderAfterReturnReq, opts ...grpc.CallOption) (*PhysicalOrderAfterReturnRes, error)
}
defaultTransfer struct {
cli zrpc.Client
}
)
func NewTransfer(cli zrpc.Client) Transfer {
return &defaultTransfer{
cli: cli,
}
}
func (m *defaultTransfer) ZltxOrderRecharge(ctx context.Context, in *ZltxOrderRechargeReq, opts ...grpc.CallOption) (*DefaultRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxOrderRecharge(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxOrderRechargeQuery(ctx context.Context, in *ZltxOrderRechargeQueryReq, opts ...grpc.CallOption) (*ZltxOrderRechargeQueryRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxOrderRechargeQuery(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxOrderCard(ctx context.Context, in *ZltxOrderCardReq, opts ...grpc.CallOption) (*DefaultRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxOrderCard(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxOrderCardQuery(ctx context.Context, in *ZltxOrderCardQueryReq, opts ...grpc.CallOption) (*ZltxOrderCardQueryRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxOrderCardQuery(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxOrderSms(ctx context.Context, in *ZltxOrderSmsReq, opts ...grpc.CallOption) (*ZltxOrderSmsRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxOrderSms(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxRechargeInfo(ctx context.Context, in *DefaultReq, opts ...grpc.CallOption) (*ZltxRechargeInfoRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxRechargeInfo(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxRechargeProduct(ctx context.Context, in *DefaultReq, opts ...grpc.CallOption) (*ZltxRechargeProductRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxRechargeProduct(ctx, in, opts...)
}
func (m *defaultTransfer) ZltxRsMiXue(ctx context.Context, in *RsCouponGrantReq, opts ...grpc.CallOption) (*RsCouponGrantRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.ZltxRsMiXue(ctx, in, opts...)
}
func (m *defaultTransfer) MarketKeySend(ctx context.Context, in *MarketKeySendReq, opts ...grpc.CallOption) (*MarketKeySendRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.MarketKeySend(ctx, in, opts...)
}
func (m *defaultTransfer) MarketKeyDiscard(ctx context.Context, in *MarketKeyDiscardReq, opts ...grpc.CallOption) (*MarketKeyDiscardRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.MarketKeyDiscard(ctx, in, opts...)
}
func (m *defaultTransfer) MarketQuery(ctx context.Context, in *MarketQueryReq, opts ...grpc.CallOption) (*MarketQueryRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.MarketQuery(ctx, in, opts...)
}
func (m *defaultTransfer) RsCouponGrant(ctx context.Context, in *RsCouponGrantReq, opts ...grpc.CallOption) (*RsCouponGrantRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.RsCouponGrant(ctx, in, opts...)
}
func (m *defaultTransfer) NewMarketOrder(ctx context.Context, in *NewMarketOrderReq, opts ...grpc.CallOption) (*NewMarketOrderRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.NewMarketOrder(ctx, in, opts...)
}
func (m *defaultTransfer) NewMarketQuery(ctx context.Context, in *NewMarketQueryReq, opts ...grpc.CallOption) (*NewMarketOrderRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.NewMarketQuery(ctx, in, opts...)
}
func (m *defaultTransfer) NewMarketDiscard(ctx context.Context, in *NewMarketDiscardReq, opts ...grpc.CallOption) (*NewMarketDiscardRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.NewMarketDiscard(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalGoodsList(ctx context.Context, in *PhysicalGoodsListReq, opts ...grpc.CallOption) (*PhysicalGoodsListRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalGoodsList(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalGoodsDetail(ctx context.Context, in *PhysicalGoodsDetailReq, opts ...grpc.CallOption) (*GoodsStructWithChild, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalGoodsDetail(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalGoodsStock(ctx context.Context, in *PhysicalGoodsStockReq, opts ...grpc.CallOption) (*PhysicalGoodsStockRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalGoodsStock(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalCusLogs(ctx context.Context, in *PhysicalCusLogsReq, opts ...grpc.CallOption) (*PhysicalCusLogsRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalCusLogs(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalCusBalance(ctx context.Context, in *EmptyReqs, opts ...grpc.CallOption) (*PhysicalCusBalanceRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalCusBalance(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalExpressList(ctx context.Context, in *PhysicalExpressListReq, opts ...grpc.CallOption) (*PhysicalExpressListRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalExpressList(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalAddressList(ctx context.Context, in *PhysicalAddressListReq, opts ...grpc.CallOption) (*PhysicalAddressListRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalAddressList(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalFinanceBill(ctx context.Context, in *PhysicalFinanceBillReq, opts ...grpc.CallOption) (*PhysicalFinanceBillRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalFinanceBill(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderInfo(ctx context.Context, in *PhysicalOrderInfoReq, opts ...grpc.CallOption) (*PhysicalOrderInfoRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderInfo(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderList(ctx context.Context, in *PhysicalOrderListReq, opts ...grpc.CallOption) (*PhysicalOrderListRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderList(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderSub(ctx context.Context, in *PhysicalOrderSubReq, opts ...grpc.CallOption) (*PhysicalOrderSubRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderSub(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderClose(ctx context.Context, in *PhysicalOrderCloseReq, opts ...grpc.CallOption) (*PhysicalOrderCloseRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderClose(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderLogisticsLogs(ctx context.Context, in *PhysicalOrderLogisticsLogsReq, opts ...grpc.CallOption) (*PhysicalOrderLogisticsLogsRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderLogisticsLogs(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderAfterApply(ctx context.Context, in *PhysicalOrderAfterApplyReq, opts ...grpc.CallOption) (*PhysicalOrderAfterApplyRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderAfterApply(ctx, in, opts...)
}
func (m *defaultTransfer) PhysicalOrderAfterReturn(ctx context.Context, in *PhysicalOrderAfterReturnReq, opts ...grpc.CallOption) (*PhysicalOrderAfterReturnRes, error) {
client := transfer.NewTransferClient(m.cli.Conn())
return client.PhysicalOrderAfterReturn(ctx, in, opts...)
}

View File

@ -0,0 +1,29 @@
package genModel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ ServerMiddleNewMarketLogsModel = (*customServerMiddleNewMarketLogsModel)(nil)
type (
// ServerMiddleNewMarketLogsModel is an interface to be customized, add more methods here,
// and implement the added methods in customServerMiddleNewMarketLogsModel.
ServerMiddleNewMarketLogsModel interface {
serverMiddleNewMarketLogsModel
withSession(session sqlx.Session) ServerMiddleNewMarketLogsModel
}
customServerMiddleNewMarketLogsModel struct {
*defaultServerMiddleNewMarketLogsModel
}
)
// NewServerMiddleNewMarketLogsModel returns a model for the database table.
func NewServerMiddleNewMarketLogsModel(conn sqlx.SqlConn) ServerMiddleNewMarketLogsModel {
return &customServerMiddleNewMarketLogsModel{
defaultServerMiddleNewMarketLogsModel: newServerMiddleNewMarketLogsModel(conn),
}
}
func (m *customServerMiddleNewMarketLogsModel) withSession(session sqlx.Session) ServerMiddleNewMarketLogsModel {
return NewServerMiddleNewMarketLogsModel(sqlx.NewSqlConnFromSession(session))
}

View File

@ -0,0 +1,91 @@
// Code generated by goctl. DO NOT EDIT.
package genModel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
serverMiddleNewMarketLogsFieldNames = builder.RawFieldNames(&ServerMiddleNewMarketLogs{})
serverMiddleNewMarketLogsRows = strings.Join(serverMiddleNewMarketLogsFieldNames, ",")
serverMiddleNewMarketLogsRowsExpectAutoSet = strings.Join(stringx.Remove(serverMiddleNewMarketLogsFieldNames, "`log_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
serverMiddleNewMarketLogsRowsWithPlaceHolder = strings.Join(stringx.Remove(serverMiddleNewMarketLogsFieldNames, "`log_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
serverMiddleNewMarketLogsModel interface {
Insert(ctx context.Context, data *ServerMiddleNewMarketLogs) (sql.Result, error)
FindOne(ctx context.Context, logId uint64) (*ServerMiddleNewMarketLogs, error)
Update(ctx context.Context, data *ServerMiddleNewMarketLogs) error
Delete(ctx context.Context, logId uint64) error
}
defaultServerMiddleNewMarketLogsModel struct {
conn sqlx.SqlConn
table string
}
ServerMiddleNewMarketLogs struct {
LogId uint64 `db:"log_id"`
Url string `db:"url"`
Type string `db:"type"`
Code int64 `db:"code"`
Data string `db:"data"`
Resp string `db:"resp"`
CreateTime time.Time `db:"create_time"`
UpdateTime time.Time `db:"update_time"`
Status int64 `db:"status"`
}
)
func newServerMiddleNewMarketLogsModel(conn sqlx.SqlConn) *defaultServerMiddleNewMarketLogsModel {
return &defaultServerMiddleNewMarketLogsModel{
conn: conn,
table: "`server_middle_new_market_logs`",
}
}
func (m *defaultServerMiddleNewMarketLogsModel) Delete(ctx context.Context, logId uint64) error {
query := fmt.Sprintf("delete from %s where `log_id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, logId)
return err
}
func (m *defaultServerMiddleNewMarketLogsModel) FindOne(ctx context.Context, logId uint64) (*ServerMiddleNewMarketLogs, error) {
query := fmt.Sprintf("select %s from %s where `log_id` = ? limit 1", serverMiddleNewMarketLogsRows, m.table)
var resp ServerMiddleNewMarketLogs
err := m.conn.QueryRowCtx(ctx, &resp, query, logId)
switch err {
case nil:
return &resp, nil
case sqlx.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultServerMiddleNewMarketLogsModel) Insert(ctx context.Context, data *ServerMiddleNewMarketLogs) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?)", m.table, serverMiddleNewMarketLogsRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Url, data.Type, data.Code, data.Data, data.Resp, data.Status)
return ret, err
}
func (m *defaultServerMiddleNewMarketLogsModel) Update(ctx context.Context, data *ServerMiddleNewMarketLogs) error {
query := fmt.Sprintf("update %s set %s where `log_id` = ?", m.table, serverMiddleNewMarketLogsRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Url, data.Type, data.Code, data.Data, data.Resp, data.Status, data.LogId)
return err
}
func (m *defaultServerMiddleNewMarketLogsModel) tableName() string {
return m.table
}

View File

@ -0,0 +1,29 @@
package genModel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ ServerMiddlePhysicalLogsModel = (*customServerMiddlePhysicalLogsModel)(nil)
type (
// ServerMiddlePhysicalLogsModel is an interface to be customized, add more methods here,
// and implement the added methods in customServerMiddlePhysicalLogsModel.
ServerMiddlePhysicalLogsModel interface {
serverMiddlePhysicalLogsModel
withSession(session sqlx.Session) ServerMiddlePhysicalLogsModel
}
customServerMiddlePhysicalLogsModel struct {
*defaultServerMiddlePhysicalLogsModel
}
)
// NewServerMiddlePhysicalLogsModel returns a model for the database table.
func NewServerMiddlePhysicalLogsModel(conn sqlx.SqlConn) ServerMiddlePhysicalLogsModel {
return &customServerMiddlePhysicalLogsModel{
defaultServerMiddlePhysicalLogsModel: newServerMiddlePhysicalLogsModel(conn),
}
}
func (m *customServerMiddlePhysicalLogsModel) withSession(session sqlx.Session) ServerMiddlePhysicalLogsModel {
return NewServerMiddlePhysicalLogsModel(sqlx.NewSqlConnFromSession(session))
}

View File

@ -0,0 +1,90 @@
// Code generated by goctl. DO NOT EDIT.
package genModel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
serverMiddlePhysicalLogsFieldNames = builder.RawFieldNames(&ServerMiddlePhysicalLogs{})
serverMiddlePhysicalLogsRows = strings.Join(serverMiddlePhysicalLogsFieldNames, ",")
serverMiddlePhysicalLogsRowsExpectAutoSet = strings.Join(stringx.Remove(serverMiddlePhysicalLogsFieldNames, "`log_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
serverMiddlePhysicalLogsRowsWithPlaceHolder = strings.Join(stringx.Remove(serverMiddlePhysicalLogsFieldNames, "`log_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
serverMiddlePhysicalLogsModel interface {
Insert(ctx context.Context, data *ServerMiddlePhysicalLogs) (sql.Result, error)
FindOne(ctx context.Context, logId uint64) (*ServerMiddlePhysicalLogs, error)
Update(ctx context.Context, data *ServerMiddlePhysicalLogs) error
Delete(ctx context.Context, logId uint64) error
}
defaultServerMiddlePhysicalLogsModel struct {
conn sqlx.SqlConn
table string
}
ServerMiddlePhysicalLogs struct {
LogId uint64 `db:"log_id"`
Url string `db:"url"`
Code int64 `db:"code"`
Data string `db:"data"`
Resp string `db:"resp"`
CreateTime time.Time `db:"create_time"`
UpdateTime time.Time `db:"update_time"`
Status int64 `db:"status"`
}
)
func newServerMiddlePhysicalLogsModel(conn sqlx.SqlConn) *defaultServerMiddlePhysicalLogsModel {
return &defaultServerMiddlePhysicalLogsModel{
conn: conn,
table: "`server_middle_physical_logs`",
}
}
func (m *defaultServerMiddlePhysicalLogsModel) Delete(ctx context.Context, logId uint64) error {
query := fmt.Sprintf("delete from %s where `log_id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, logId)
return err
}
func (m *defaultServerMiddlePhysicalLogsModel) FindOne(ctx context.Context, logId uint64) (*ServerMiddlePhysicalLogs, error) {
query := fmt.Sprintf("select %s from %s where `log_id` = ? limit 1", serverMiddlePhysicalLogsRows, m.table)
var resp ServerMiddlePhysicalLogs
err := m.conn.QueryRowCtx(ctx, &resp, query, logId)
switch err {
case nil:
return &resp, nil
case sqlx.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultServerMiddlePhysicalLogsModel) Insert(ctx context.Context, data *ServerMiddlePhysicalLogs) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?)", m.table, serverMiddlePhysicalLogsRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Url, data.Code, data.Data, data.Resp, data.Status)
return ret, err
}
func (m *defaultServerMiddlePhysicalLogsModel) Update(ctx context.Context, data *ServerMiddlePhysicalLogs) error {
query := fmt.Sprintf("update %s set %s where `log_id` = ?", m.table, serverMiddlePhysicalLogsRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Url, data.Code, data.Data, data.Resp, data.Status, data.LogId)
return err
}
func (m *defaultServerMiddlePhysicalLogsModel) tableName() string {
return m.table
}

View File

@ -0,0 +1,29 @@
package genModel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ ServerOrderNewMarketModel = (*customServerOrderNewMarketModel)(nil)
type (
// ServerOrderNewMarketModel is an interface to be customized, add more methods here,
// and implement the added methods in customServerOrderNewMarketModel.
ServerOrderNewMarketModel interface {
serverOrderNewMarketModel
withSession(session sqlx.Session) ServerOrderNewMarketModel
}
customServerOrderNewMarketModel struct {
*defaultServerOrderNewMarketModel
}
)
// NewServerOrderNewMarketModel returns a model for the database table.
func NewServerOrderNewMarketModel(conn sqlx.SqlConn) ServerOrderNewMarketModel {
return &customServerOrderNewMarketModel{
defaultServerOrderNewMarketModel: newServerOrderNewMarketModel(conn),
}
}
func (m *customServerOrderNewMarketModel) withSession(session sqlx.Session) ServerOrderNewMarketModel {
return NewServerOrderNewMarketModel(sqlx.NewSqlConnFromSession(session))
}

View File

@ -0,0 +1,110 @@
// Code generated by goctl. DO NOT EDIT.
package genModel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
serverOrderNewMarketFieldNames = builder.RawFieldNames(&ServerOrderNewMarket{})
serverOrderNewMarketRows = strings.Join(serverOrderNewMarketFieldNames, ",")
serverOrderNewMarketRowsExpectAutoSet = strings.Join(stringx.Remove(serverOrderNewMarketFieldNames, "`order_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
serverOrderNewMarketRowsWithPlaceHolder = strings.Join(stringx.Remove(serverOrderNewMarketFieldNames, "`order_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
serverOrderNewMarketModel interface {
Insert(ctx context.Context, data *ServerOrderNewMarket) (sql.Result, error)
FindOne(ctx context.Context, orderId uint64) (*ServerOrderNewMarket, error)
Update(ctx context.Context, data *ServerOrderNewMarket) error
Delete(ctx context.Context, orderId uint64) error
FindByOutBizId(ctx context.Context, outBizId string) (*ServerOrderNewMarket, error)
}
defaultServerOrderNewMarketModel struct {
conn sqlx.SqlConn
table string
}
ServerOrderNewMarket struct {
OrderId uint64 `db:"order_id"`
OutBizNo string `db:"out_biz_no"` // 用户侧流水号
ActivityNo string `db:"activity_no"` // 活动id
Number int64 `db:"number"` // 数量
AppId string `db:"app_id"` // 平台提供商品id
TradeNo string `db:"trade_no"` // 平台订单号
Key string `db:"key"`
Url string `db:"url"` // 地址
ReqTime time.Time `db:"req_time"` // 请求时间
CreateTime time.Time `db:"create_time"`
UpdateTime time.Time `db:"update_time"`
Status int64 `db:"status"` // 状态
LogId int64 `db:"log_id"` // 对应的日志id
}
)
func newServerOrderNewMarketModel(conn sqlx.SqlConn) *defaultServerOrderNewMarketModel {
return &defaultServerOrderNewMarketModel{
conn: conn,
table: "`server_order_new_market`",
}
}
func (m *defaultServerOrderNewMarketModel) Delete(ctx context.Context, orderId uint64) error {
query := fmt.Sprintf("delete from %s where `order_id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, orderId)
return err
}
func (m *defaultServerOrderNewMarketModel) FindOne(ctx context.Context, orderId uint64) (*ServerOrderNewMarket, error) {
query := fmt.Sprintf("select %s from %s where `order_id` = ? limit 1", serverOrderNewMarketRows, m.table)
var resp ServerOrderNewMarket
err := m.conn.QueryRowCtx(ctx, &resp, query, orderId)
switch err {
case nil:
return &resp, nil
case sqlx.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultServerOrderNewMarketModel) Insert(ctx context.Context, data *ServerOrderNewMarket) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, serverOrderNewMarketRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.OutBizNo, data.ActivityNo, data.Number, data.AppId, data.TradeNo, data.Key, data.Url, data.ReqTime, data.Status, data.LogId)
return ret, err
}
func (m *defaultServerOrderNewMarketModel) Update(ctx context.Context, data *ServerOrderNewMarket) error {
query := fmt.Sprintf("update %s set %s where `order_id` = ?", m.table, serverOrderNewMarketRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.OutBizNo, data.ActivityNo, data.Number, data.AppId, data.TradeNo, data.Key, data.Url, data.ReqTime, data.Status, data.LogId, data.OrderId)
return err
}
func (m *defaultServerOrderNewMarketModel) FindByOutBizId(ctx context.Context, outBizId string) (*ServerOrderNewMarket, error) {
query := fmt.Sprintf("select %s from %s where `out_biz_no` = ? limit 1", serverOrderNewMarketRows, m.table)
var resp ServerOrderNewMarket
err := m.conn.QueryRowCtx(ctx, &resp, query, outBizId)
switch err {
case nil:
return &resp, nil
case sqlx.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultServerOrderNewMarketModel) tableName() string {
return m.table
}

View File

@ -0,0 +1,29 @@
package genModel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ ServerOrderPhysicalModel = (*customServerOrderPhysicalModel)(nil)
type (
// ServerOrderPhysicalModel is an interface to be customized, add more methods here,
// and implement the added methods in customServerOrderPhysicalModel.
ServerOrderPhysicalModel interface {
serverOrderPhysicalModel
withSession(session sqlx.Session) ServerOrderPhysicalModel
}
customServerOrderPhysicalModel struct {
*defaultServerOrderPhysicalModel
}
)
// NewServerOrderPhysicalModel returns a model for the database table.
func NewServerOrderPhysicalModel(conn sqlx.SqlConn) ServerOrderPhysicalModel {
return &customServerOrderPhysicalModel{
defaultServerOrderPhysicalModel: newServerOrderPhysicalModel(conn),
}
}
func (m *customServerOrderPhysicalModel) withSession(session sqlx.Session) ServerOrderPhysicalModel {
return NewServerOrderPhysicalModel(sqlx.NewSqlConnFromSession(session))
}

View File

@ -0,0 +1,107 @@
// Code generated by goctl. DO NOT EDIT.
package genModel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
serverOrderPhysicalFieldNames = builder.RawFieldNames(&ServerOrderPhysical{})
serverOrderPhysicalRows = strings.Join(serverOrderPhysicalFieldNames, ",")
serverOrderPhysicalRowsExpectAutoSet = strings.Join(stringx.Remove(serverOrderPhysicalFieldNames, "`order_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
serverOrderPhysicalRowsWithPlaceHolder = strings.Join(stringx.Remove(serverOrderPhysicalFieldNames, "`order_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
serverOrderPhysicalModel interface {
Insert(ctx context.Context, data *ServerOrderPhysical) (sql.Result, error)
FindOne(ctx context.Context, orderId uint64) (*ServerOrderPhysical, error)
Update(ctx context.Context, data *ServerOrderPhysical) error
Delete(ctx context.Context, orderId uint64) error
FindByOutBizId(ctx context.Context, outBizId string) (*ServerOrderPhysical, error)
}
defaultServerOrderPhysicalModel struct {
conn sqlx.SqlConn
table string
}
ServerOrderPhysical struct {
OrderId uint64 `db:"order_id"`
CustomerOrderNum string `db:"customer_order_num"` // 用户侧流水号
OrderNum string `db:"order_num"` // 平台订单号
Num int64 `db:"num"` // 购买数量
AppId string `db:"app_id"` // 平台商户号
LogId int64 `db:"log_id"` // 对应的日志id
ReqTime time.Time `db:"req_time"` // 请求时间
CreateTime time.Time `db:"create_time"`
UpdateTime time.Time `db:"update_time"`
Status int64 `db:"status"` // 状态
}
)
func newServerOrderPhysicalModel(conn sqlx.SqlConn) *defaultServerOrderPhysicalModel {
return &defaultServerOrderPhysicalModel{
conn: conn,
table: "`server_order_physical`",
}
}
func (m *defaultServerOrderPhysicalModel) Delete(ctx context.Context, orderId uint64) error {
query := fmt.Sprintf("delete from %s where `order_id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, orderId)
return err
}
func (m *defaultServerOrderPhysicalModel) FindOne(ctx context.Context, orderId uint64) (*ServerOrderPhysical, error) {
query := fmt.Sprintf("select %s from %s where `order_id` = ? limit 1", serverOrderPhysicalRows, m.table)
var resp ServerOrderPhysical
err := m.conn.QueryRowCtx(ctx, &resp, query, orderId)
switch err {
case nil:
return &resp, nil
case sqlx.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultServerOrderPhysicalModel) Insert(ctx context.Context, data *ServerOrderPhysical) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?)", m.table, serverOrderPhysicalRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.CustomerOrderNum, data.OrderNum, data.Num, data.AppId, data.LogId, data.ReqTime, data.Status)
return ret, err
}
func (m *defaultServerOrderPhysicalModel) Update(ctx context.Context, data *ServerOrderPhysical) error {
query := fmt.Sprintf("update %s set %s where `order_id` = ?", m.table, serverOrderPhysicalRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.CustomerOrderNum, data.OrderNum, data.Num, data.AppId, data.LogId, data.ReqTime, data.Status, data.OrderId)
return err
}
func (m *defaultServerOrderPhysicalModel) FindByOutBizId(ctx context.Context, outBizId string) (*ServerOrderPhysical, error) {
query := fmt.Sprintf("select %s from %s where `customer_order_num` = ? limit 1", serverOrderPhysicalRows, m.table)
var resp ServerOrderPhysical
err := m.conn.QueryRowCtx(ctx, &resp, query, outBizId)
switch err {
case nil:
return &resp, nil
case sqlx.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultServerOrderPhysicalModel) tableName() string {
return m.table
}