Update:解决冲突
This commit is contained in:
commit
e4222aea79
@ -22,6 +22,11 @@ func (b *BundleProvider) GetBundleBalanceList(_ context.Context, req *bundle.Get
|
||||
return logic.GetBundleBalanceList(req)
|
||||
}
|
||||
|
||||
// 先用后付套餐余量信息列表
|
||||
func (b *BundleProvider) GetPayLaterBundleBalanceList(_ context.Context, req *bundle.GetPayLaterBundleBalanceListReq) (*bundle.GetPayLaterBundleBalanceListResp, error) {
|
||||
return logic.GetPayLaterBundleBalanceList(req)
|
||||
}
|
||||
|
||||
// 根据用户ID查询套餐余额
|
||||
func (b *BundleProvider) GetBundleBalanceByUserId(_ context.Context, req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
|
||||
return logic.GetBundleBalanceByUserId(req)
|
||||
|
||||
@ -73,6 +73,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
Joins(`INNER JOIN (
|
||||
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||
FROM bundle_order_records
|
||||
WHERE order_type = 1 AND deleted_at is NULL
|
||||
GROUP BY customer_id
|
||||
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
||||
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
|
||||
@ -90,7 +91,8 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
Where("rn.name IS NOT NULL").
|
||||
Where("u.deleted_at = 0").
|
||||
Where("bor.deleted_at IS NULL").
|
||||
Where("bor.status = 2").
|
||||
Where("((bor.order_mode = 2 AND bor.pay_later_status > 0 ) OR (bor.order_mode = 1 AND bor.status = 2 ))").
|
||||
Where("bb.bundle_type = ?", model.BundleTypeBasic).
|
||||
Order("bor.expiration_time desc")
|
||||
if req.UserName != "" {
|
||||
if utils.IsPhoneNumber(req.UserName) {
|
||||
@ -120,9 +122,6 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
if req.Bought == 1 {
|
||||
session = session.Where("bb.user_id IS NULL")
|
||||
}
|
||||
if req.BundleType != 0 {
|
||||
session = session.Where("bb.bundle_type = ?", req.BundleType)
|
||||
}
|
||||
t := time.Now()
|
||||
if req.StatusType != 0 {
|
||||
if req.ExpiredTimeStart > time.Now().UnixMilli() {
|
||||
@ -155,15 +154,98 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
return
|
||||
}
|
||||
|
||||
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data model.UserBundleBalancePo, err error) {
|
||||
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
|
||||
// 查询先用后付套餐余量列表 (bundle_type = 2)
|
||||
// 每个艺人一行:视频字段对该艺人所有未过期且 bundle_type=2 的套餐的"无限制增值视频"列求和
|
||||
// (每个 order_uuid 取最新 month 的快照去重),下单时间/过期时间取最新一笔套餐
|
||||
func GetPayLaterBundleBalanceList(req *bundle.GetPayLaterBundleBalanceListReq) (data []model.PayLaterBundleBalancePo, total int64, err error) {
|
||||
// 1. 每个未过期 bundle_type=2 套餐取最新 month 的那条快照(去重)
|
||||
latestMonthPerPkg := app.ModuleClients.BundleDB.Table("bundle_balance").
|
||||
Select("user_id, order_uuid, MAX(month) AS month").
|
||||
Where("bundle_type = ?", model.BundleTypePostpaid).
|
||||
Where("deleted_at IS NULL").
|
||||
Where("expired_at > NOW()").
|
||||
Group("user_id, order_uuid")
|
||||
|
||||
// 2. 按用户聚合:对去重后的套餐快照求和无限制增值视频相关列
|
||||
aggQuery := app.ModuleClients.BundleDB.Table("bundle_balance AS bb").
|
||||
Select(`bb.user_id,
|
||||
SUM(bb.increase_video_number) AS bundle_video_sum_number,
|
||||
SUM(bb.increase_video_consumption_number) AS bundle_video_consumption_number,
|
||||
SUM(bb.increase_video_number) - SUM(bb.increase_video_consumption_number) AS bundle_video_number,
|
||||
SUM(bb.invalid_increase_video_number) AS bundle_video_invalid_number,
|
||||
SUM(bb.monthly_increase_video_consumption_number) AS monthly_bundle_video_consumption_number,
|
||||
SUM(bb.monthly_invalid_increase_video_number) AS monthly_bundle_video_invalid_number,
|
||||
SUM(bb.increase_video_number) - SUM(bb.increase_video_consumption_number) AS monthly_bundle_video_number`).
|
||||
Joins("INNER JOIN (?) AS lp ON bb.user_id = lp.user_id AND bb.order_uuid = lp.order_uuid AND bb.month = lp.month", latestMonthPerPkg).
|
||||
Where("bb.deleted_at IS NULL").
|
||||
Group("bb.user_id")
|
||||
|
||||
// 3. 最新一笔订单(用于展示套餐名/下单时间/客户编号)
|
||||
latestOrder := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
|
||||
Select("bor1.*").
|
||||
Joins(`INNER JOIN (
|
||||
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||
FROM bundle_order_records
|
||||
WHERE status = 2 AND deleted_at is NULL
|
||||
WHERE order_type = 2 AND deleted_at is NULL AND bor.pay_later_status > 0
|
||||
GROUP BY customer_id
|
||||
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
||||
|
||||
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
|
||||
Select(`u.id as user_id, rn.name as user_name, u.tel_num as user_phone_number,
|
||||
bor.customer_num, bor.bundle_name, bor.uuid as order_uuid, bor.created_at as pay_time, bc.activate,
|
||||
lb.expired_at,
|
||||
agg.bundle_video_sum_number,
|
||||
agg.bundle_video_consumption_number,
|
||||
agg.bundle_video_number,
|
||||
agg.bundle_video_invalid_number,
|
||||
agg.monthly_bundle_video_consumption_number,
|
||||
agg.monthly_bundle_video_invalid_number,
|
||||
agg.monthly_bundle_video_number`).
|
||||
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id and rn.deleted_at = 0").
|
||||
Joins("INNER JOIN (?) AS agg ON agg.user_id = u.id", aggQuery).
|
||||
Joins("LEFT JOIN (?) as bor ON bor.customer_id = u.id", latestOrder).
|
||||
Joins(`LEFT JOIN bundle_balance lb ON lb.user_id = u.id AND lb.order_uuid = bor.uuid AND lb.deleted_at IS NULL
|
||||
AND lb.month = (SELECT MAX(month) FROM bundle_balance WHERE user_id = u.id AND order_uuid = bor.uuid AND deleted_at IS NULL)`).
|
||||
Joins("LEFT JOIN bundle_activate bc on bc.user_id = u.id").
|
||||
Where("rn.name IS NOT NULL").
|
||||
Where("u.deleted_at = 0").
|
||||
Order("bor.created_at desc")
|
||||
if req.UserName != "" {
|
||||
if utils.IsPhoneNumber(req.UserName) {
|
||||
session = session.Where("u.tel_num = ?", req.UserName)
|
||||
} else {
|
||||
session = session.Where("rn.name LIKE ? OR bor.customer_num LIKE ?", "%"+req.UserName+"%", "%"+req.UserName+"%")
|
||||
}
|
||||
}
|
||||
if req.BundleName != "" {
|
||||
session = session.Where("bor.bundle_name like ?", "%"+req.BundleName+"%")
|
||||
}
|
||||
if req.ExpiredTimeEnd != 0 {
|
||||
session = session.Where("lb.expired_at <= ?", time.UnixMilli(req.ExpiredTimeEnd))
|
||||
}
|
||||
if req.ExpiredTimeStart != 0 {
|
||||
session = session.Where("lb.expired_at >= ?", time.UnixMilli(req.ExpiredTimeStart))
|
||||
}
|
||||
err = session.Count(&total).Error
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if req.Page != 0 && req.PageSize != 0 {
|
||||
session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
|
||||
}
|
||||
err = session.Find(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data model.UserBundleBalancePo, err error) {
|
||||
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
|
||||
Select("bor1.*").
|
||||
Joins(`INNER JOIN (
|
||||
SELECT customer_id
|
||||
FROM bundle_order_records
|
||||
WHERE ((order_mode = 2 AND pay_later_status > 0 ) OR (order_mode = 1 AND status = 2 )) AND deleted_at is NULL
|
||||
GROUP BY customer_id
|
||||
) bor2 ON bor1.customer_id = bor2.customer_id`)
|
||||
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
|
||||
Select(`bb.*, bor.bundle_name, bor.status,bor.amount AS payment_amount,bor.amount_type AS payment_type,bor.customer_num,
|
||||
bor.uuid as order_uuid, rn.name as user_name,bc.activate,bor.created_at as pay_time,
|
||||
@ -176,10 +258,9 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data mod
|
||||
Where("u.deleted_at = 0").
|
||||
Where("u.id = ?", req.UserId).
|
||||
Where("bb.month = ?", time.Now().Format("2006-01")).
|
||||
Order("bor.expiration_time desc")
|
||||
if req.OrderUUID != "" {
|
||||
session = session.Where("bb.order_uuid = ?", req.OrderUUID)
|
||||
}
|
||||
Where("bb.expired_at >= ?", time.Now()).
|
||||
Order("bor.expiration_time desc").
|
||||
Where("bor.uuid = ?", req.OrderUUID).Where("bb.order_uuid = ?", req.OrderUUID)
|
||||
err = session.First(&data).Error
|
||||
return
|
||||
}
|
||||
@ -499,7 +580,9 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLogPo, to
|
||||
Table("cast_cost_log ccl").
|
||||
Select("ccl.*,cwe.cost_type").
|
||||
Joins("left join cast_work_extra cwe on cwe.work_uuid = ccl.work_uuid").
|
||||
Where("cwe.deleted_at = 0 and ccl.deleted_at = 0")
|
||||
Joins("left join bundle_order_record bor on bor.uuid = ccl.order_uuid").
|
||||
Where("bor.order_type = ?", req.BundleType).
|
||||
Where("cwe.deleted_at = 0 and ccl.deleted_at = 0 and bor.deleted_at is null")
|
||||
if req.WorkTitle != "" {
|
||||
session = session.Where("ccl.work_title like ?", "%"+req.WorkTitle+"%")
|
||||
}
|
||||
@ -951,7 +1034,7 @@ left join (
|
||||
|
||||
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, error) {
|
||||
data := &model.BundleBalanceLayout{}
|
||||
if err := app.ModuleClients.BundleDB.Model(&model.BundleBalanceLayout{}).Where("user_id = ?", req.UserId).First(data).Error; err != nil {
|
||||
if err := app.ModuleClients.BundleDB.Model(&model.BundleBalanceLayout{}).Where("user_id = ? AND bundle_type = ?", req.UserId, req.BundleType).First(data).Error; err != nil {
|
||||
return "nil", err
|
||||
}
|
||||
return data.Data, nil
|
||||
@ -959,7 +1042,7 @@ func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, erro
|
||||
|
||||
func SetBundleBalanceLayout(req *bundle.SetBundleBalanceLayoutReq) error {
|
||||
return app.ModuleClients.BundleDB.Clauses(clause.OnConflict{
|
||||
Columns: []clause.Column{{Name: "user_id"}},
|
||||
Columns: []clause.Column{{Name: "user_id"}, {Name: "bundle_type"}},
|
||||
DoUpdates: clause.AssignmentColumns([]string{"data"}),
|
||||
}).Create(&model.BundleBalanceLayout{Data: req.Data, UserId: uint64(req.UserId)}).Error
|
||||
}).Create(&model.BundleBalanceLayout{Data: req.Data, UserId: uint64(req.UserId), BundleType: req.BundleType}).Error
|
||||
}
|
||||
|
||||
@ -997,7 +997,9 @@ func manualIncreaseBundleBalance(startTime string, endTime string, bundleUUID st
|
||||
// 通过 order_uuid 联表 bundle_order_records 获取 bundle_uuid
|
||||
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.deleted_at is null and bor.status = 2").
|
||||
// 支持 bundle_uuid 过滤
|
||||
Where("bor.bundle_uuid = ?", bundleUUID)
|
||||
Where("bor.bundle_uuid = ?", bundleUUID).
|
||||
// 只统计订单类型为基础套餐的数据,避免统计到先用后付订单
|
||||
Where("bor.order_type = 1")
|
||||
}
|
||||
if err = quary.Scan(&data).Error; err != nil {
|
||||
return
|
||||
@ -1032,7 +1034,7 @@ func balanceInfoWithShop(startMonth string, endMonth string, startTime string, e
|
||||
bb.monthly_bundle_limit_expired_competitive_number
|
||||
) AS competitive
|
||||
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 = 新增待上传数量
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
|
||||
Joins(`INNER JOIN (
|
||||
SELECT order_uuid, MIN(created_at) AS min_created_at
|
||||
FROM bundle_balance
|
||||
@ -1041,6 +1043,7 @@ func balanceInfoWithShop(startMonth string, endMonth string, startTime string, e
|
||||
) AS bb_min ON bb.order_uuid = bb_min.order_uuid AND bb.created_at = bb_min.min_created_at`).
|
||||
Where("bor.deleted_at is null and bor.status=2").
|
||||
Where("bb.month = DATE_FORMAT(bb.start_at, '%Y-%m')").
|
||||
Where("bor.order_type = ?", model.BundleTypeBasic).
|
||||
Where("bb.deleted_at IS NULL")
|
||||
if bundleUUID != "" {
|
||||
subQuery = subQuery.Where("bor.bundle_uuid = ?", bundleUUID)
|
||||
@ -1093,7 +1096,7 @@ func IncreasealanceInfoWithShop(startMonth string, endMonth string, startTime st
|
||||
bb.monthly_increase_limit_expired_competitive_number
|
||||
) AS competitive
|
||||
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 = 新增待上传数量
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
|
||||
Joins(`INNER JOIN (
|
||||
SELECT order_uuid, MIN(created_at) AS min_created_at
|
||||
FROM bundle_balance
|
||||
@ -1184,7 +1187,7 @@ func getBundleBalanceInfo(month string, bundleUUID string, endTime string) (data
|
||||
bb.monthly_bundle_limit_competitive_consumption_number
|
||||
) AS competitive
|
||||
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 + 限制不过期类型的总共已用 + 限制过期类型的总共已用 + 已过期的数量 = 总发放数
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
|
||||
Where("bor.deleted_at is null and bor.status=2").
|
||||
Joins(`INNER JOIN (
|
||||
SELECT
|
||||
@ -1270,7 +1273,7 @@ func getIncreaseBalanceInfo(month string, bundleUUID string, endTime string) (da
|
||||
bb.monthly_increase_limit_competitive_consumption_number
|
||||
) AS competitive
|
||||
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 + 限制不过期类型的总共已用 + 限制过期类型的总共已用 + 已过期的数量 = 总发放数
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
|
||||
Joins(`INNER JOIN (
|
||||
SELECT
|
||||
bb_inner.user_id,
|
||||
@ -1459,7 +1462,7 @@ func MetricsBundlePurchaseExport(req *bundle.MetricsBundlePurchaseExportReq) (*b
|
||||
where a1.deleted_at is null and a1.status = 2 and a1.total_amount > 300 and a2.deleted_at is null
|
||||
group by a1.order_no
|
||||
) t4 on t1.order_no = t4.order_no
|
||||
where t1.deleted_at is null and t1.status = 2 and t1.total_amount > 300
|
||||
where t1.deleted_at is null and t1.status = 2 and t1.total_amount > 300 and t1.order_type = 1
|
||||
order by t2.sub_num asc`,
|
||||
"`micro-account`.`user`",
|
||||
"`micro-account`.`real_name`")
|
||||
|
||||
@ -209,6 +209,41 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundl
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func GetPayLaterBundleBalanceList(req *bundle.GetPayLaterBundleBalanceListReq) (*bundle.GetPayLaterBundleBalanceListResp, error) {
|
||||
data, total, err := dao.GetPayLaterBundleBalanceList(req)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
resp := &bundle.GetPayLaterBundleBalanceListResp{}
|
||||
resp.Total = total
|
||||
resp.Data = lo.Map(data, func(m model.PayLaterBundleBalancePo, _ int) *bundle.PayLaterBundleBalanceItem {
|
||||
result := &bundle.PayLaterBundleBalanceItem{
|
||||
UserId: int32(m.UserId),
|
||||
Activate: int32(m.Activate),
|
||||
UserName: m.UserName,
|
||||
UserPhoneNumber: m.UserPhoneNumber,
|
||||
CustomerNum: m.CustomerNum,
|
||||
PayTime: m.PayTime,
|
||||
BundleName: m.BundleName,
|
||||
ExpiredTime: m.ExpiredAt.UnixMilli(),
|
||||
// 无限制增值视频统计(所有未过期 bundle_type=2 套餐求和)
|
||||
BundleVideoSumNumber: m.BundleVideoSumNumber, // 视频总数
|
||||
BundleVideoNumber: m.BundleVideoNumber, // 可用视频数
|
||||
BundleVideoConsumptionNumber: m.BundleVideoConsumptionNumber, // 已用视频数
|
||||
BundleVideoInvalidNumber: m.BundleVideoInvalidNumber, // 作废视频数
|
||||
MonthlyBundleVideoNumber: m.MonthlyBundleVideoNumber, // 当月可用视频数
|
||||
MonthlyBundleVideoConsumptionNumber: m.MonthlyBundleVideoConsumptionNumber, // 当月已用视频数
|
||||
MonthlyBundleVideoInvalidNumber: m.MonthlyBundleVideoInvalidNumber, // 当月作废视频数
|
||||
}
|
||||
if result.Activate != 2 { // 除了等于2(已激活)的情况统一为1
|
||||
result.Activate = 1
|
||||
}
|
||||
return result
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
|
||||
data, err := dao.GetBundleBalanceByUserId(req)
|
||||
if err != nil {
|
||||
|
||||
@ -172,6 +172,25 @@ type BundleBalancePo struct {
|
||||
BundleBalance
|
||||
}
|
||||
|
||||
type PayLaterBundleBalancePo struct {
|
||||
UserId int `gorm:"column:user_id"`
|
||||
UserName string `gorm:"column:user_name"`
|
||||
UserPhoneNumber string `gorm:"column:user_phone_number"`
|
||||
BundleName string `gorm:"column:bundle_name"`
|
||||
OrderUUID string `gorm:"column:order_uuid"`
|
||||
Activate int `gorm:"column:activate"`
|
||||
CustomerNum string `gorm:"column:customer_num"`
|
||||
PayTime string `gorm:"column:pay_time"`
|
||||
ExpiredAt time.Time `gorm:"column:expired_at"`
|
||||
BundleVideoSumNumber int32 `gorm:"column:bundle_video_sum_number"` // 视频总数
|
||||
BundleVideoConsumptionNumber int32 `gorm:"column:bundle_video_consumption_number"` // 已用视频数
|
||||
BundleVideoNumber int32 `gorm:"column:bundle_video_number"` // 可用视频数
|
||||
BundleVideoInvalidNumber int32 `gorm:"column:bundle_video_invalid_number"` // 作废视频数
|
||||
MonthlyBundleVideoConsumptionNumber int32 `gorm:"column:monthly_bundle_video_consumption_number"` // 当月已用视频数
|
||||
MonthlyBundleVideoInvalidNumber int32 `gorm:"column:monthly_bundle_video_invalid_number"` // 当月作废视频数
|
||||
MonthlyBundleVideoNumber int32 `gorm:"column:monthly_bundle_video_number"` // 当月可用视频数
|
||||
}
|
||||
|
||||
type UserBundleBalancePo struct {
|
||||
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
|
||||
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid"`
|
||||
@ -420,8 +439,9 @@ type BundleExport struct {
|
||||
|
||||
type BundleBalanceLayout struct {
|
||||
gorm.Model
|
||||
UserId uint64 `gorm:"column:user_id;not null;unique"`
|
||||
Data string `gorm:"column:data;type:longtext;not null"`
|
||||
UserId uint64 `gorm:"column:user_id;not null;unique"`
|
||||
Data string `gorm:"column:data;type:longtext;not null"`
|
||||
BundleType int32 `gorm:"column:bundle_type;not null"`
|
||||
}
|
||||
|
||||
// 总销售情况
|
||||
|
||||
@ -67,7 +67,8 @@ service Bundle {
|
||||
rpc UpdateBundleBalance(UpdateBundleBalanceReq) returns (UpdateBundleBalanceResp) {} // 更新余量表数据(用于每月定时任务,谨慎调用)
|
||||
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} // 套餐扩展
|
||||
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询
|
||||
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息
|
||||
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息列表
|
||||
rpc GetPayLaterBundleBalanceList(GetPayLaterBundleBalanceListReq) returns (GetPayLaterBundleBalanceListResp) {} // 先用后付套餐余量信息列表
|
||||
rpc GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} // 余量信息
|
||||
rpc GetBundleOrderListByUserId(GetBundleOrderListByUserIdReq) returns (GetBundleOrderListByUserIdResp) {} // 根据用户ID查询订单列表(包含订单基本信息和订单对应的余量信息)
|
||||
rpc GetBundleBalanceByOrderUUID(GetBundleBalanceByOrderUUIDReq) returns (GetBundleBalanceByOrderUUIDResp) {}
|
||||
@ -896,6 +897,44 @@ message GetBundleBalanceListReq{
|
||||
int32 bundleType = 13;
|
||||
}
|
||||
|
||||
message GetPayLaterBundleBalanceListReq{
|
||||
string userName = 1;
|
||||
int32 status = 2;
|
||||
string bundleName = 3;
|
||||
int32 bought = 4;
|
||||
int64 startTimeStart = 5;
|
||||
int64 startTimeEnd = 6;
|
||||
int64 expiredTimeStart = 7;
|
||||
int64 expiredTimeEnd = 8;
|
||||
int32 page = 9;
|
||||
int32 pageSize = 10;
|
||||
repeated string month = 11;
|
||||
int32 statusType = 12;
|
||||
int32 bundleType = 13;
|
||||
}
|
||||
message PayLaterBundleBalanceItem {
|
||||
// 基本信息
|
||||
int32 userId = 1;
|
||||
int32 activate = 2; // 是否激活
|
||||
string userName = 3; // 艺人
|
||||
string userPhoneNumber = 4; // 艺人手机号
|
||||
string customerNum = 5; // 用户编号
|
||||
string bundleName = 7; // 最后购买的套餐
|
||||
string payTime = 8; // 最后下单时间
|
||||
int64 expiredTime = 10; // 最后过期时间
|
||||
int32 bundleVideoSumNumber = 11; // 视频总数
|
||||
int32 bundleVideoNumber = 12; // 可用视频数
|
||||
int32 bundleVideoConsumptionNumber = 13; // 已用视频数
|
||||
int32 bundleVideoInvalidNumber = 14; // 作废视频数
|
||||
int32 monthlyBundleVideoNumber = 15; // 当月可用视频数
|
||||
int32 monthlyBundleVideoConsumptionNumber = 16; // 当月已用视频数
|
||||
int32 monthlyBundleVideoInvalidNumber = 17; // 当月作废视频数
|
||||
}
|
||||
message GetPayLaterBundleBalanceListResp{
|
||||
int64 total = 1;
|
||||
repeated PayLaterBundleBalanceItem data = 2;
|
||||
}
|
||||
|
||||
message GetBundleBalanceReq{
|
||||
string userName = 1;
|
||||
int32 status = 2;
|
||||
@ -1141,6 +1180,7 @@ message GetBundleBalanceListResp{
|
||||
repeated BundleBalanceItem data = 2;
|
||||
}
|
||||
|
||||
|
||||
message CreateBundleBalanceReq{
|
||||
int32 userId = 1;
|
||||
string orderUUID = 2;
|
||||
@ -1192,6 +1232,7 @@ message GetUsedRecordListReq{
|
||||
int32 page = 9;
|
||||
int32 pageSize = 10;
|
||||
int32 costType = 11;
|
||||
int32 bundleType = 12;
|
||||
}
|
||||
|
||||
message GetUsedRecordListResp {
|
||||
@ -1828,6 +1869,7 @@ message ArtistBundleBalanceResponse {
|
||||
message SetBundleBalanceLayoutReq{
|
||||
uint32 userId = 1;
|
||||
string data = 2;
|
||||
int32 bundleType = 3; // 1: 普通套餐类型 2: 先用后付套餐
|
||||
}
|
||||
|
||||
message SetBundleBalanceLayoutResp{
|
||||
@ -1836,6 +1878,7 @@ message SetBundleBalanceLayoutResp{
|
||||
|
||||
message GetBundleBalanceLayoutReq{
|
||||
uint32 userId = 1;
|
||||
int32 bundleType = 2;
|
||||
}
|
||||
|
||||
message GetBundleBalanceLayoutResp{
|
||||
|
||||
18892
pb/bundle/bundle.pb.go
18892
pb/bundle/bundle.pb.go
File diff suppressed because it is too large
Load Diff
@ -423,6 +423,22 @@ func (this *BundleExtendRecordItem) Validate() error {
|
||||
func (this *GetBundleBalanceListReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetPayLaterBundleBalanceListReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *PayLaterBundleBalanceItem) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetPayLaterBundleBalanceListResp) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetBundleBalanceReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.5
|
||||
// - protoc v6.32.0
|
||||
// - protoc v5.26.0
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
@ -74,6 +74,7 @@ type BundleClient interface {
|
||||
BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment)
|
||||
BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment)
|
||||
GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment)
|
||||
GetPayLaterBundleBalanceList(ctx context.Context, in *GetPayLaterBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetPayLaterBundleBalanceListResp, common.ErrorWithAttachment)
|
||||
GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment)
|
||||
GetBundleOrderListByUserId(ctx context.Context, in *GetBundleOrderListByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleOrderListByUserIdResp, common.ErrorWithAttachment)
|
||||
GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment)
|
||||
@ -209,6 +210,7 @@ type BundleClientImpl struct {
|
||||
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
|
||||
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
||||
GetPayLaterBundleBalanceList func(ctx context.Context, in *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error)
|
||||
GetBundleBalanceByUserId func(ctx context.Context, in *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
||||
GetBundleOrderListByUserId func(ctx context.Context, in *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error)
|
||||
GetBundleBalanceByOrderUUID func(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
||||
@ -556,6 +558,12 @@ func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBa
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetPayLaterBundleBalanceList(ctx context.Context, in *GetPayLaterBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetPayLaterBundleBalanceListResp, common.ErrorWithAttachment) {
|
||||
out := new(GetPayLaterBundleBalanceListResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPayLaterBundleBalanceList", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment) {
|
||||
out := new(GetBundleBalanceByUserIdResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -1056,6 +1064,7 @@ type BundleServer interface {
|
||||
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
|
||||
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
||||
GetPayLaterBundleBalanceList(context.Context, *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error)
|
||||
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
||||
GetBundleOrderListByUserId(context.Context, *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error)
|
||||
GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
||||
@ -1278,6 +1287,9 @@ func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *Bundl
|
||||
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetPayLaterBundleBalanceList(context.Context, *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPayLaterBundleBalanceList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByUserId not implemented")
|
||||
}
|
||||
@ -2778,6 +2790,35 @@ func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetPayLaterBundleBalanceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPayLaterBundleBalanceListReq)
|
||||
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("GetPayLaterBundleBalanceList", 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_GetBundleBalanceByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBundleBalanceByUserIdReq)
|
||||
if err := dec(in); err != nil {
|
||||
@ -5132,6 +5173,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "GetBundleBalanceList",
|
||||
Handler: _Bundle_GetBundleBalanceList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPayLaterBundleBalanceList",
|
||||
Handler: _Bundle_GetPayLaterBundleBalanceList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBundleBalanceByUserId",
|
||||
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user