添加个人订单查询
This commit is contained in:
parent
a9738b1bc8
commit
86eac0df6a
@ -68,6 +68,11 @@ func (b *BundleProvider) MarkOverdueOrders(_ context.Context, req *bundle.MarkOv
|
||||
return logic.MarkOverdueOrders(req)
|
||||
}
|
||||
|
||||
// GetUserOrderList 获取用户订单列表(包含子表,支持30+筛选条件)
|
||||
func (b *BundleProvider) GetUserOrderList(_ context.Context, req *bundle.GetUserOrderListRequest) (res *bundle.GetUserOrderListResponse, err error) {
|
||||
return logic.GetUserOrderListWithDetails(req)
|
||||
}
|
||||
|
||||
// 增值套餐相关
|
||||
func (b *BundleProvider) CreateValueAddBundle(_ context.Context, req *bundle.CreateValueAddBundleRequest) (res *bundle.CreateValueAddBundleResponse, err error) {
|
||||
if err = req.Validate(); err != nil {
|
||||
|
||||
@ -11,6 +11,7 @@ import (
|
||||
"micro-bundle/pkg/msg"
|
||||
"micro-bundle/pkg/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
@ -1262,3 +1263,328 @@ func GetOriginalOrderUUID(orderUUID string) (string, error) {
|
||||
current = rec.RenewalOrderUUID
|
||||
}
|
||||
}
|
||||
|
||||
// GetUserOrderListWithDetails 根据用户ID获取订单列表(包含订单子表)
|
||||
// 支持30+筛选条件、分页、排序
|
||||
func GetUserOrderListWithDetails(req *bundle.GetUserOrderListRequest) (*bundle.GetUserOrderListResponse, error) {
|
||||
if req.CustomerID == "" {
|
||||
return nil, errors.New("客户ID不能为空")
|
||||
}
|
||||
|
||||
// 构建基础查询
|
||||
query := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
||||
Where("customer_id = ?", req.CustomerID)
|
||||
|
||||
// 动态添加主表筛选条件
|
||||
// 订单号
|
||||
if req.OrderNo != "" {
|
||||
query = query.Where("order_no = ?", req.OrderNo)
|
||||
}
|
||||
|
||||
// UUID
|
||||
if req.OrderUUID != "" {
|
||||
query = query.Where("uuid = ?", req.OrderUUID)
|
||||
}
|
||||
|
||||
// 套餐UUID
|
||||
if req.BundleUUID != "" {
|
||||
query = query.Where("bundle_uuid = ?", req.BundleUUID)
|
||||
}
|
||||
|
||||
// 套餐名称(模糊查询)
|
||||
if req.BundleName != "" {
|
||||
query = query.Where("bundle_name LIKE ?", "%"+req.BundleName+"%")
|
||||
}
|
||||
|
||||
// 客户名称(模糊查询)
|
||||
if req.CustomerName != "" {
|
||||
query = query.Where("customer_name LIKE ?", "%"+req.CustomerName+"%")
|
||||
}
|
||||
|
||||
// 订单状态
|
||||
if req.Status != 0 {
|
||||
query = query.Where("status = ?", req.Status)
|
||||
}
|
||||
|
||||
// 订单类型
|
||||
if req.OrderType != 0 {
|
||||
query = query.Where("order_type = ?", req.OrderType)
|
||||
}
|
||||
|
||||
// 订单模式
|
||||
if req.OrderMode != 0 {
|
||||
query = query.Where("order_mode = ?", req.OrderMode)
|
||||
}
|
||||
|
||||
// 先用后付状态
|
||||
if req.PayLaterStatus != 0 {
|
||||
query = query.Where("pay_later_status = ?", req.PayLaterStatus)
|
||||
}
|
||||
|
||||
// 支付类型
|
||||
if req.PayType != 0 {
|
||||
query = query.Where("pay_type = ?", req.PayType)
|
||||
}
|
||||
|
||||
// 购买类型
|
||||
if req.PurchaseType != 0 {
|
||||
query = query.Where("purchase_type = ?", req.PurchaseType)
|
||||
}
|
||||
|
||||
// 财务确认
|
||||
if req.FinancialConfirmation != 0 {
|
||||
query = query.Where("financial_confirmation = ?", req.FinancialConfirmation)
|
||||
}
|
||||
|
||||
// 合同模板类型
|
||||
if req.ContractTplType != 0 {
|
||||
query = query.Where("contract_tpl_type = ?", req.ContractTplType)
|
||||
}
|
||||
|
||||
// 金额范围筛选
|
||||
if req.MinAmount > 0 {
|
||||
query = query.Where("amount >= ?", req.MinAmount)
|
||||
}
|
||||
if req.MaxAmount > 0 {
|
||||
query = query.Where("amount <= ?", req.MaxAmount)
|
||||
}
|
||||
|
||||
// 时间范围筛选 - 创建时间
|
||||
if req.CreateStartTime != "" {
|
||||
query = query.Where("created_at >= ?", req.CreateStartTime)
|
||||
}
|
||||
if req.CreateEndTime != "" {
|
||||
query = query.Where("created_at <= ?", req.CreateEndTime)
|
||||
}
|
||||
|
||||
// 支付时间
|
||||
if req.PayStartTime != "" {
|
||||
query = query.Where("pay_time >= ?", req.PayStartTime)
|
||||
}
|
||||
if req.PayEndTime != "" {
|
||||
query = query.Where("pay_time <= ?", req.PayEndTime)
|
||||
}
|
||||
|
||||
// 签约时间
|
||||
if req.SignedStartTime != "" {
|
||||
query = query.Where("signed_time >= ?", req.SignedStartTime)
|
||||
}
|
||||
if req.SignedEndTime != "" {
|
||||
query = query.Where("signed_time <= ?", req.SignedEndTime)
|
||||
}
|
||||
|
||||
// 套餐到期时间
|
||||
if req.ExpirationStartTime != "" {
|
||||
query = query.Where("expiration_time >= ?", req.ExpirationStartTime)
|
||||
}
|
||||
if req.ExpirationEndTime != "" {
|
||||
query = query.Where("expiration_time <= ?", req.ExpirationEndTime)
|
||||
}
|
||||
|
||||
// 先用后付到期时间
|
||||
if req.DueStartTime != "" {
|
||||
query = query.Where("due_time >= ?", req.DueStartTime)
|
||||
}
|
||||
if req.DueEndTime != "" {
|
||||
query = query.Where("due_time <= ?", req.DueEndTime)
|
||||
}
|
||||
|
||||
// 平台ID(支持数组查询)
|
||||
if len(req.PlatformIds) > 0 {
|
||||
platformIdsJSON, _ := json.Marshal(req.PlatformIds)
|
||||
query = query.Where("JSON_CONTAINS(platform_ids, ?)", string(platformIdsJSON))
|
||||
}
|
||||
|
||||
// 邀请人ID
|
||||
if req.InviterID != 0 {
|
||||
query = query.Where("inviter_id = ?", req.InviterID)
|
||||
}
|
||||
|
||||
// 语言
|
||||
if req.Language != "" {
|
||||
query = query.Where("language = ?", req.Language)
|
||||
}
|
||||
|
||||
// 是否包含增值服务
|
||||
if req.HasValueAdd {
|
||||
query = query.Where("EXISTS (SELECT 1 FROM bundle_order_value_add WHERE order_uuid = bundle_order_records.uuid)")
|
||||
}
|
||||
|
||||
// 统计总数
|
||||
var total int64
|
||||
if err := query.Count(&total).Error; err != nil {
|
||||
return nil, fmt.Errorf("统计订单总数失败: %v", err)
|
||||
}
|
||||
|
||||
// 如果没有数据,直接返回
|
||||
if total == 0 {
|
||||
return &bundle.GetUserOrderListResponse{
|
||||
Total: total,
|
||||
List: []*bundle.UserOrderDetail{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
// 排序
|
||||
orderBy := "created_at DESC" // 默认排序
|
||||
if req.OrderBy != "" {
|
||||
orderBy = req.OrderBy
|
||||
// 添加排序方向
|
||||
if req.OrderDirection != "" {
|
||||
direction := strings.ToUpper(req.OrderDirection)
|
||||
if direction == "ASC" || direction == "DESC" {
|
||||
orderBy = orderBy + " " + direction
|
||||
}
|
||||
}
|
||||
}
|
||||
query = query.Order(orderBy)
|
||||
|
||||
// 分页
|
||||
page := int32(1)
|
||||
pageSize := int32(10)
|
||||
if req.Page > 0 {
|
||||
page = req.Page
|
||||
}
|
||||
if req.PageSize > 0 {
|
||||
pageSize = req.PageSize
|
||||
}
|
||||
offset := (page - 1) * pageSize
|
||||
query = query.Offset(int(offset)).Limit(int(pageSize))
|
||||
|
||||
// 构建子表筛选条件(用于 Preload)
|
||||
preloadCondition := func(db *gorm.DB) *gorm.DB {
|
||||
// 增值服务类型
|
||||
if req.ValueAddServiceType != 0 {
|
||||
db = db.Where("service_type = ?", req.ValueAddServiceType)
|
||||
}
|
||||
// 增值支付状态
|
||||
if req.ValueAddPaymentStatus != 0 {
|
||||
db = db.Where("payment_status = ?", req.ValueAddPaymentStatus)
|
||||
}
|
||||
// 增值来源
|
||||
if req.ValueAddSource != 0 {
|
||||
db = db.Where("source = ?", req.ValueAddSource)
|
||||
}
|
||||
// 增值订单模式
|
||||
if req.ValueAddOrderMode != 0 {
|
||||
db = db.Where("order_mode = ?", req.ValueAddOrderMode)
|
||||
}
|
||||
// 增值先用后付状态
|
||||
if req.ValueAddPayLaterStatus != 0 {
|
||||
db = db.Where("pay_later_status = ?", req.ValueAddPayLaterStatus)
|
||||
}
|
||||
// 增值是否过期
|
||||
if req.ValueAddIsExpired {
|
||||
db = db.Where("is_expired = ?", true)
|
||||
}
|
||||
return db
|
||||
}
|
||||
|
||||
// 执行查询,使用 Preload 加载子表(带筛选条件)
|
||||
var orders []model.BundleOrderRecords
|
||||
if err := query.Preload("BundleOrderValueAdd", preloadCondition).Find(&orders).Error; err != nil {
|
||||
return nil, fmt.Errorf("查询订单列表失败: %v", err)
|
||||
}
|
||||
|
||||
// 转换为响应格式
|
||||
var resultList []*bundle.UserOrderDetail
|
||||
for _, order := range orders {
|
||||
// 主表数据
|
||||
detail := &bundle.UserOrderDetail{
|
||||
UUID: order.UUID,
|
||||
OrderNo: order.OrderNo,
|
||||
BundleUUID: order.BundleUUID,
|
||||
BundleName: order.BundleName,
|
||||
CustomerID: order.CustomerID,
|
||||
CustomerNum: order.CustomerNum,
|
||||
CustomerName: order.CustomerName,
|
||||
Amount: order.Amount,
|
||||
AmountType: order.AmountType,
|
||||
TotalAmount: order.TotalAmount,
|
||||
Status: order.Status,
|
||||
OrderType: order.OrderType,
|
||||
OrderMode: order.OrderMode,
|
||||
PayLaterStatus: order.PayLaterStatus,
|
||||
PayType: order.PayType,
|
||||
PurchaseType: order.PurchaseType,
|
||||
FinancialConfirmation: order.FinancialConfirmation,
|
||||
ContractNo: order.ContractNo,
|
||||
ContractTplType: order.ContractTplType,
|
||||
Language: order.Language,
|
||||
InviterID: order.InviterID,
|
||||
RenewalOrderUUID: order.RenewalOrderUUID,
|
||||
}
|
||||
|
||||
// 转换时间字段
|
||||
if !order.CreatedAt.IsZero() {
|
||||
detail.CreatedAt = order.CreatedAt.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
if !order.UpdatedAt.IsZero() {
|
||||
detail.UpdatedAt = order.UpdatedAt.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
if order.PayTime != "" {
|
||||
detail.PayTime = order.PayTime
|
||||
}
|
||||
if order.SignedTime != "" {
|
||||
detail.SignedTime = order.SignedTime
|
||||
}
|
||||
if order.ExpirationTime != "" {
|
||||
detail.ExpirationTime = order.ExpirationTime
|
||||
}
|
||||
if order.DueTime != "" {
|
||||
detail.DueTime = order.DueTime
|
||||
}
|
||||
|
||||
// 转换 platform_ids(JSON 数组)
|
||||
platformIdsBytes, _ := json.Marshal(order.PlatformIds)
|
||||
var platformIds []uint32
|
||||
if err := json.Unmarshal(platformIdsBytes, &platformIds); err == nil {
|
||||
detail.PlatformIds = platformIds
|
||||
}
|
||||
|
||||
// 子表数据(增值服务)
|
||||
if len(order.BundleOrderValueAdd) > 0 {
|
||||
for _, valueAdd := range order.BundleOrderValueAdd {
|
||||
valueAddDetail := &bundle.OrderValueAddDetail{
|
||||
UUID: valueAdd.UUID,
|
||||
OrderNo: valueAdd.OrderNo,
|
||||
ServiceType: valueAdd.ServiceType,
|
||||
CurrencyType: valueAdd.CurrencyType,
|
||||
Amount: float32(valueAdd.Amount),
|
||||
Num: valueAdd.Num,
|
||||
Unit: valueAdd.Unit,
|
||||
ValueAddUUID: valueAdd.ValueAddUUID,
|
||||
Source: int32(valueAdd.Source),
|
||||
PaymentStatus: int32(valueAdd.PaymentStatus),
|
||||
HandlingFee: valueAdd.HandlingFee,
|
||||
EquityType: valueAdd.EquityType,
|
||||
QuotaType: valueAdd.QuotaType,
|
||||
QuotaValue: valueAdd.QuotaValue,
|
||||
IsExpired: valueAdd.IsExpired,
|
||||
OrderMode: valueAdd.OrderMode,
|
||||
PayLaterStatus: valueAdd.PayLaterStatus,
|
||||
ContractTplType: valueAdd.ContractTplType,
|
||||
}
|
||||
if !valueAdd.CreatedAt.IsZero() {
|
||||
valueAddDetail.CreatedAt = valueAdd.CreatedAt.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
if !valueAdd.UpdatedAt.IsZero() {
|
||||
valueAddDetail.UpdatedAt = valueAdd.UpdatedAt.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
if valueAdd.PaymentTime != "" {
|
||||
valueAddDetail.PaymentTime = valueAdd.PaymentTime
|
||||
}
|
||||
if valueAdd.DueTime != "" {
|
||||
valueAddDetail.DueTime = valueAdd.DueTime
|
||||
}
|
||||
detail.ValueAddList = append(detail.ValueAddList, valueAddDetail)
|
||||
}
|
||||
}
|
||||
|
||||
resultList = append(resultList, detail)
|
||||
}
|
||||
|
||||
return &bundle.GetUserOrderListResponse{
|
||||
Total: total,
|
||||
List: resultList,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -288,3 +288,9 @@ func OrderListByOrderUuid(req *bundle.OrderInfoByOrderUuidRequest) (res *bundle.
|
||||
res, err = dao.OrderListByOrderUuid(req)
|
||||
return
|
||||
}
|
||||
|
||||
// GetUserOrderListWithDetails 根据用户ID获取订单列表(包含子表)
|
||||
// 支持30+筛选条件和分页
|
||||
func GetUserOrderListWithDetails(req *bundle.GetUserOrderListRequest) (*bundle.GetUserOrderListResponse, error) {
|
||||
return dao.GetUserOrderListWithDetails(req)
|
||||
}
|
||||
|
||||
133
pb/bundle.proto
133
pb/bundle.proto
@ -37,6 +37,7 @@ service Bundle {
|
||||
rpc GetInEffectOrderRecord(GetInEffectOrderRecordRequest) returns (OrderRecord) {} // 获取用户当前生效的订单信息
|
||||
rpc CheckOrderEligibility(CheckOrderEligibilityRequest) returns (CheckOrderEligibilityResponse) {} // 下单前置校验(先用后付)
|
||||
rpc MarkOverdueOrders(MarkOverdueOrdersRequest) returns (MarkOverdueOrdersResponse) {} // 扫描到期未付订单(定时任务可调用)
|
||||
rpc GetUserOrderList(GetUserOrderListRequest) returns (GetUserOrderListResponse) {} // 获取用户订单列表(包含子表,支持30+筛选条件)
|
||||
|
||||
//增值套餐
|
||||
rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {}
|
||||
@ -2540,4 +2541,134 @@ message GetQuestionnaireSurveyListResponse{
|
||||
int32 total = 2;
|
||||
int32 page = 3;
|
||||
int32 size = 4;
|
||||
}
|
||||
}
|
||||
// ==================== 用户订单列表查询(包含子表)====================
|
||||
|
||||
// GetUserOrderListRequest 获取用户订单列表请求
|
||||
// 支持30+筛选条件,可自由组合
|
||||
message GetUserOrderListRequest {
|
||||
// === 必填参数 ===
|
||||
string customerID = 1; // 用户ID(必填)
|
||||
|
||||
// === 分页参数 ===
|
||||
int32 page = 2; // 页码,从1开始
|
||||
int32 pageSize = 3; // 每页数量
|
||||
|
||||
// === 排序参数 ===
|
||||
string orderBy = 4; // 排序字段(如:created_at, total_amount, pay_time)
|
||||
string orderDirection = 5; // 排序方向:ASC 或 DESC,默认DESC
|
||||
|
||||
// === 主表筛选条件 ===
|
||||
string orderNo = 6; // 订单编号
|
||||
string orderUUID = 7; // 订单UUID
|
||||
string bundleUUID = 8; // 套餐UUID
|
||||
string bundleName = 9; // 套餐名称(模糊搜索)
|
||||
string customerName = 10; // 客户名称(模糊搜索)
|
||||
int64 status = 11; // 订单状态:1:已签未支付 2:已签已支付 3:逾期
|
||||
int32 orderType = 12; // 订单类型:1:套餐订单 2:增值服务订单
|
||||
int32 orderMode = 13; // 订单模式:1:普通 2:先用后付
|
||||
int32 payLaterStatus = 14; // 先用后付状态:0:无 1:待付款 2:已付款 3:逾期未付
|
||||
int64 payType = 15; // 支付类型
|
||||
uint64 purchaseType = 16; // 购买类型:1:新购 2:续费
|
||||
int32 financialConfirmation = 17; // 财务确认:1:未确认 2:已确认
|
||||
int32 contractTplType = 18; // 合同模板类型:1:套餐普通 2:套餐先用后付 3:增值先用后付
|
||||
|
||||
// === 金额范围筛选 ===
|
||||
float minAmount = 19; // 最小金额
|
||||
float maxAmount = 20; // 最大金额
|
||||
|
||||
// === 时间范围筛选 ===
|
||||
string createStartTime = 21; // 创建开始时间
|
||||
string createEndTime = 22; // 创建结束时间
|
||||
string payStartTime = 23; // 支付开始时间
|
||||
string payEndTime = 24; // 支付结束时间
|
||||
string signedStartTime = 25; // 签约开始时间
|
||||
string signedEndTime = 26; // 签约结束时间
|
||||
string expirationStartTime = 27; // 套餐到期开始时间
|
||||
string expirationEndTime = 28; // 套餐到期结束时间
|
||||
string dueStartTime = 29; // 先用后付到期开始时间
|
||||
string dueEndTime = 30; // 先用后付到期结束时间
|
||||
|
||||
// === 其他筛选条件 ===
|
||||
repeated uint32 platformIds = 31; // 发布平台ID列表
|
||||
uint64 inviterID = 32; // 邀请人ID
|
||||
string language = 33; // 语言
|
||||
bool hasValueAdd = 34; // 是否包含增值服务
|
||||
|
||||
// === 增值服务子表筛选条件 ===
|
||||
int32 valueAddServiceType = 35; // 增值服务类型:1:视频 2:图文 3:数据报表 4:账号数 5:可用时长
|
||||
int32 valueAddPaymentStatus = 36; // 增值支付状态:1:未支付 2:已支付
|
||||
int32 valueAddSource = 37; // 增值来源:1:套餐 2:单独购买 3:拓展
|
||||
int32 valueAddOrderMode = 38; // 增值订单模式:1:普通 2:先用后付
|
||||
int32 valueAddPayLaterStatus = 39; // 增值先用后付状态
|
||||
bool valueAddIsExpired = 40; // 增值是否过期
|
||||
}
|
||||
|
||||
// GetUserOrderListResponse 获取用户订单列表响应
|
||||
message GetUserOrderListResponse {
|
||||
int64 total = 1; // 总记录数
|
||||
repeated UserOrderDetail list = 2; // 订单列表
|
||||
}
|
||||
|
||||
// UserOrderDetail 用户订单详情(包含子表)
|
||||
message UserOrderDetail {
|
||||
// === 主表字段 ===
|
||||
string UUID = 1;
|
||||
string orderNo = 2;
|
||||
string bundleUUID = 3;
|
||||
string bundleName = 4;
|
||||
string customerID = 5;
|
||||
string customerNum = 6;
|
||||
string customerName = 7;
|
||||
float amount = 8;
|
||||
int64 amountType = 9;
|
||||
float totalAmount = 10;
|
||||
int64 status = 11;
|
||||
int32 orderType = 12;
|
||||
int32 orderMode = 13;
|
||||
int32 payLaterStatus = 14;
|
||||
int64 payType = 15;
|
||||
string payTime = 16;
|
||||
uint64 purchaseType = 17;
|
||||
int32 financialConfirmation = 18;
|
||||
string contractNo = 19;
|
||||
int32 contractTplType = 20;
|
||||
string signedTime = 21;
|
||||
string expirationTime = 22;
|
||||
string dueTime = 23;
|
||||
string language = 24;
|
||||
repeated uint32 platformIds = 25;
|
||||
uint64 inviterID = 26;
|
||||
string renewalOrderUUID = 27;
|
||||
string createdAt = 28;
|
||||
string updatedAt = 29;
|
||||
|
||||
// === 增值服务列表(子表) ===
|
||||
repeated OrderValueAddDetail valueAddList = 30;
|
||||
}
|
||||
|
||||
// OrderValueAddDetail 增值服务详情
|
||||
message OrderValueAddDetail {
|
||||
string UUID = 1;
|
||||
string orderNo = 2;
|
||||
int32 serviceType = 3;
|
||||
int64 currencyType = 4;
|
||||
float amount = 5;
|
||||
int32 num = 6;
|
||||
string unit = 7;
|
||||
string valueAddUUID = 8;
|
||||
int32 source = 9;
|
||||
int32 paymentStatus = 10;
|
||||
string paymentTime = 11;
|
||||
string handlingFee = 12;
|
||||
int32 equityType = 13;
|
||||
int32 quotaType = 14;
|
||||
int32 quotaValue = 15;
|
||||
bool isExpired = 16;
|
||||
int32 orderMode = 17;
|
||||
string dueTime = 18;
|
||||
int32 payLaterStatus = 19;
|
||||
int32 contractTplType = 20;
|
||||
string createdAt = 21;
|
||||
string updatedAt = 22;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1172,3 +1172,29 @@ func (this *GetQuestionnaireSurveyListResponse) Validate() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetUserOrderListRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetUserOrderListResponse) Validate() error {
|
||||
for _, item := range this.List {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *UserOrderDetail) Validate() error {
|
||||
for _, item := range this.ValueAddList {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddList", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *OrderValueAddDetail) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -54,6 +54,7 @@ type BundleClient interface {
|
||||
GetInEffectOrderRecord(ctx context.Context, in *GetInEffectOrderRecordRequest, opts ...grpc_go.CallOption) (*OrderRecord, common.ErrorWithAttachment)
|
||||
CheckOrderEligibility(ctx context.Context, in *CheckOrderEligibilityRequest, opts ...grpc_go.CallOption) (*CheckOrderEligibilityResponse, common.ErrorWithAttachment)
|
||||
MarkOverdueOrders(ctx context.Context, in *MarkOverdueOrdersRequest, opts ...grpc_go.CallOption) (*MarkOverdueOrdersResponse, common.ErrorWithAttachment)
|
||||
GetUserOrderList(ctx context.Context, in *GetUserOrderListRequest, opts ...grpc_go.CallOption) (*GetUserOrderListResponse, common.ErrorWithAttachment)
|
||||
// 增值套餐
|
||||
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
|
||||
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
||||
@ -188,6 +189,7 @@ type BundleClientImpl struct {
|
||||
GetInEffectOrderRecord func(ctx context.Context, in *GetInEffectOrderRecordRequest) (*OrderRecord, error)
|
||||
CheckOrderEligibility func(ctx context.Context, in *CheckOrderEligibilityRequest) (*CheckOrderEligibilityResponse, error)
|
||||
MarkOverdueOrders func(ctx context.Context, in *MarkOverdueOrdersRequest) (*MarkOverdueOrdersResponse, error)
|
||||
GetUserOrderList func(ctx context.Context, in *GetUserOrderListRequest) (*GetUserOrderListResponse, error)
|
||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
@ -446,6 +448,12 @@ func (c *bundleClient) MarkOverdueOrders(ctx context.Context, in *MarkOverdueOrd
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MarkOverdueOrders", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetUserOrderList(ctx context.Context, in *GetUserOrderListRequest, opts ...grpc_go.CallOption) (*GetUserOrderListResponse, common.ErrorWithAttachment) {
|
||||
out := new(GetUserOrderListResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUserOrderList", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
||||
out := new(CreateValueAddBundleResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -1004,6 +1012,7 @@ type BundleServer interface {
|
||||
GetInEffectOrderRecord(context.Context, *GetInEffectOrderRecordRequest) (*OrderRecord, error)
|
||||
CheckOrderEligibility(context.Context, *CheckOrderEligibilityRequest) (*CheckOrderEligibilityResponse, error)
|
||||
MarkOverdueOrders(context.Context, *MarkOverdueOrdersRequest) (*MarkOverdueOrdersResponse, error)
|
||||
GetUserOrderList(context.Context, *GetUserOrderListRequest) (*GetUserOrderListResponse, error)
|
||||
// 增值套餐
|
||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
@ -1191,6 +1200,9 @@ func (UnimplementedBundleServer) CheckOrderEligibility(context.Context, *CheckOr
|
||||
func (UnimplementedBundleServer) MarkOverdueOrders(context.Context, *MarkOverdueOrdersRequest) (*MarkOverdueOrdersResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method MarkOverdueOrders not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetUserOrderList(context.Context, *GetUserOrderListRequest) (*GetUserOrderListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUserOrderList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
||||
}
|
||||
@ -2237,6 +2249,35 @@ func _Bundle_MarkOverdueOrders_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetUserOrderList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserOrderListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetUserOrderList", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateValueAddBundleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -4900,6 +4941,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "MarkOverdueOrders",
|
||||
Handler: _Bundle_MarkOverdueOrders_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserOrderList",
|
||||
Handler: _Bundle_GetUserOrderList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateValueAddBundle",
|
||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user