Merge branch 'feat-hjj-Paylater' into feat-cjy-Paylater
# Conflicts: # pb/bundle/bundle.pb.go
This commit is contained in:
commit
4a867d2a97
@ -27,6 +27,11 @@ func (b *BundleProvider) GetBundleBalanceByUserId(_ context.Context, req *bundle
|
|||||||
return logic.GetBundleBalanceByUserId(req)
|
return logic.GetBundleBalanceByUserId(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据用户ID查询套餐订单列表(过期的套餐订单不展示)
|
||||||
|
func (b *BundleProvider) GetBundleOrderListByUserId(_ context.Context, req *bundle.GetBundleOrderListByUserIdReq) (*bundle.GetBundleOrderListByUserIdResp, error) {
|
||||||
|
return logic.GetBundleOrderListByUserId(req)
|
||||||
|
}
|
||||||
|
|
||||||
func (b *BundleProvider) GetBundleBalanceByOrderUUID(_ context.Context, req *bundle.GetBundleBalanceByOrderUUIDReq) (*bundle.GetBundleBalanceByOrderUUIDResp, error) {
|
func (b *BundleProvider) GetBundleBalanceByOrderUUID(_ context.Context, req *bundle.GetBundleBalanceByOrderUUIDReq) (*bundle.GetBundleBalanceByOrderUUIDResp, error) {
|
||||||
startTime, status, err := logic.GetBundleBalanceByOrderUUID(req.OrderUUID)
|
startTime, status, err := logic.GetBundleBalanceByOrderUUID(req.OrderUUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -23,6 +23,7 @@ func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err err
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 测试注释
|
||||||
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
|
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
|
||||||
res = new(bundle.CommonResponse)
|
res = new(bundle.CommonResponse)
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? and language= ?", req.UUID, req.Language).Updates(req).Error
|
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? and language= ?", req.UUID, req.Language).Updates(req).Error
|
||||||
@ -64,6 +65,10 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
|
|||||||
query = query.Where("language like ?", req.Language)
|
query = query.Where("language like ?", req.Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.BundleType != 0 {
|
||||||
|
query = query.Where("bundle_type = ?", req.BundleType)
|
||||||
|
}
|
||||||
|
|
||||||
count := *query
|
count := *query
|
||||||
|
|
||||||
if req.PageSize != 0 && req.Page != 0 {
|
if req.PageSize != 0 && req.Page != 0 {
|
||||||
@ -88,6 +93,8 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
|
|||||||
CompanySign: bundleProfile.CompanySign,
|
CompanySign: bundleProfile.CompanySign,
|
||||||
ContractDuration: int64(bundleProfile.ContractDuration),
|
ContractDuration: int64(bundleProfile.ContractDuration),
|
||||||
BundleCommonUid: bundleProfile.BundleCommonUid,
|
BundleCommonUid: bundleProfile.BundleCommonUid,
|
||||||
|
BundleType: int64(bundleProfile.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfile.PayLaterTime),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,6 +134,8 @@ func BundleDetail(uuid string) (res *bundle.BundleProfile, err error) {
|
|||||||
CompanySign: bundleProfile.CompanySign,
|
CompanySign: bundleProfile.CompanySign,
|
||||||
ContractDuration: int64(bundleProfile.ContractDuration),
|
ContractDuration: int64(bundleProfile.ContractDuration),
|
||||||
BundleCommonUid: bundleProfile.BundleCommonUid,
|
BundleCommonUid: bundleProfile.BundleCommonUid,
|
||||||
|
BundleType: int64(bundleProfile.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfile.PayLaterTime),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -150,6 +159,10 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
baseQuery = baseQuery.Where("language like ?", req.Language)
|
baseQuery = baseQuery.Where("language like ?", req.Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.BundleType != 0 {
|
||||||
|
baseQuery = baseQuery.Where("bundle_type = ?", req.BundleType)
|
||||||
|
}
|
||||||
|
|
||||||
var total int64
|
var total int64
|
||||||
if err = baseQuery.Count(&total).Error; err != nil {
|
if err = baseQuery.Count(&total).Error; err != nil {
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐总数失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐总数失败: ")
|
||||||
@ -224,6 +237,8 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
BundleProfileLang: bundleProfileLang,
|
BundleProfileLang: bundleProfileLang,
|
||||||
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
||||||
FontColor: bundleProfile.FontColor,
|
FontColor: bundleProfile.FontColor,
|
||||||
|
BundleType: int64(bundleProfile.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfile.PayLaterTime),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -378,7 +393,7 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
res.Bundles = make([]*bundle.BundleProfile, 0)
|
res.Bundles = make([]*bundle.BundleProfile, 0)
|
||||||
bundles := make([]*model.BundleProfile, 0)
|
bundles := make([]*model.BundleProfile, 0)
|
||||||
|
|
||||||
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("shelf_status = ?", 1).Preload("BundleProfileLang")
|
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("shelf_status = ?", model.BundleShelfStatusUp).Preload("BundleProfileLang")
|
||||||
//query = query.Where("shelf_status = ?", 1) //上架的
|
//query = query.Where("shelf_status = ?", 1) //上架的
|
||||||
|
|
||||||
if req.Name != "" {
|
if req.Name != "" {
|
||||||
@ -393,6 +408,10 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
query = query.Where("language like ?", req.Language)
|
query = query.Where("language like ?", req.Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.BundleType != 0 {
|
||||||
|
query = query.Where("bundle_type = ?", req.BundleType)
|
||||||
|
}
|
||||||
|
|
||||||
count := *query
|
count := *query
|
||||||
|
|
||||||
// 排序:sort 升序,相同 sort 按 created_at 倒序
|
// 排序:sort 升序,相同 sort 按 created_at 倒序
|
||||||
@ -451,6 +470,8 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
BundleProfileLang: bundleProfileLang,
|
BundleProfileLang: bundleProfileLang,
|
||||||
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
||||||
FontColor: bundleProfile.FontColor,
|
FontColor: bundleProfile.FontColor,
|
||||||
|
BundleType: int64(bundleProfile.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfile.PayLaterTime),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,10 +174,23 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data mod
|
|||||||
Where("u.id = ?", req.UserId).
|
Where("u.id = ?", req.UserId).
|
||||||
Where("bb.month = ?", time.Now().Format("2006-01")).
|
Where("bb.month = ?", time.Now().Format("2006-01")).
|
||||||
Order("bor.expiration_time desc")
|
Order("bor.expiration_time desc")
|
||||||
|
if req.OrderUUID != "" {
|
||||||
|
session = session.Where("bb.order_uuid = ?", req.OrderUUID)
|
||||||
|
}
|
||||||
err = session.First(&data).Error
|
err = session.First(&data).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetBundleOrderListByUserId(userId int32) (orderList []string, err error) {
|
||||||
|
currentMonth := time.Now().Format("2006-01")
|
||||||
|
timeNow := time.Now().Format("2006-01-02 15:04:05")
|
||||||
|
err = app.ModuleClients.BundleDB.Table("bundle_balance").Where("user_id = ? and expired_at >= ?", userId, timeNow).Where("month = ?", currentMonth).Where("deleted_at is null").Select("order_uuid").Find(&orderList).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return orderList, nil
|
||||||
|
}
|
||||||
|
|
||||||
func GetBundleBalanceByOrderUuid(orderUuid string) (data model.BundleBalance, err error) {
|
func GetBundleBalanceByOrderUuid(orderUuid string) (data model.BundleBalance, err error) {
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Where("order_uuid = ?", orderUuid).First(&data).Error
|
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Where("order_uuid = ?", orderUuid).First(&data).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -262,6 +262,19 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetBundleOrderListByUserId(req *bundle.GetBundleOrderListByUserIdReq) (*bundle.GetBundleOrderListByUserIdResp, error) {
|
||||||
|
orderList, err := dao.GetBundleOrderListByUserId(req.UserId)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(err)
|
||||||
|
return nil, errors.New("查询订单列表失败")
|
||||||
|
}
|
||||||
|
resp := &bundle.GetBundleOrderListByUserIdResp{}
|
||||||
|
resp.OrderUuid = lo.Map(orderList, func(m string, _ int) string {
|
||||||
|
return m
|
||||||
|
})
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
// 获取最初非续费套餐订单的开始时间
|
// 获取最初非续费套餐订单的开始时间
|
||||||
// 查询失败返回2 和 默认事件
|
// 查询失败返回2 和 默认事件
|
||||||
func GetBundleBalanceByOrderUUID(orderUUID string) (time.Time, int, error) {
|
func GetBundleBalanceByOrderUUID(orderUUID string) (time.Time, int, error) {
|
||||||
@ -286,6 +299,7 @@ func GetBundleBalanceByOrderUUID(orderUUID string) (time.Time, int, error) {
|
|||||||
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
|
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
|
||||||
data := model.BundleBalanceUsePo{
|
data := model.BundleBalanceUsePo{
|
||||||
UserId: int(req.UserId),
|
UserId: int(req.UserId),
|
||||||
|
OrderUUID: req.OrderUUID,
|
||||||
AccountNumber: int(req.AccountConsumptionNumber),
|
AccountNumber: int(req.AccountConsumptionNumber),
|
||||||
ImageNumber: int(req.ImageConsumptionNumber),
|
ImageNumber: int(req.ImageConsumptionNumber),
|
||||||
VideoNumber: int(req.VideoConsumptionNumber),
|
VideoNumber: int(req.VideoConsumptionNumber),
|
||||||
|
|||||||
@ -68,17 +68,19 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
}
|
}
|
||||||
//套餐主表数据
|
//套餐主表数据
|
||||||
bundleProfile := &model.BundleProfile{
|
bundleProfile := &model.BundleProfile{
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
Sort: req.Sort,
|
Sort: req.Sort,
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
Price: req.Price,
|
Price: req.Price,
|
||||||
PriceType: req.PriceType,
|
PriceType: req.PriceType,
|
||||||
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf",
|
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf",
|
||||||
ImgOption: int8(req.ImgOption),
|
ImgOption: int8(req.ImgOption),
|
||||||
BgImg1: req.BgImg1,
|
BgImg1: req.BgImg1,
|
||||||
BgImg2: req.BgImg2,
|
BgImg2: req.BgImg2,
|
||||||
ShelfStatus: 2, //默认初始状态为2-下架
|
ShelfStatus: model.BundleShelfStatusDown, //默认初始状态为2-下架
|
||||||
FontColor: req.FontColor,
|
FontColor: req.FontColor,
|
||||||
|
BundleType: req.BundleType,
|
||||||
|
PayLaterTime: req.PayLaterTime,
|
||||||
}
|
}
|
||||||
bundleLang := &model.BundleProfileLang{
|
bundleLang := &model.BundleProfileLang{
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
@ -202,6 +204,8 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
serviceName = "账号数"
|
serviceName = "账号数"
|
||||||
case msg.AvailableTimeService:
|
case msg.AvailableTimeService:
|
||||||
serviceName = "可用时长"
|
serviceName = "可用时长"
|
||||||
|
case msg.CompetitiveService:
|
||||||
|
serviceName = "竞品数"
|
||||||
}
|
}
|
||||||
return res, fmt.Errorf("服务类型%s的额度不兼容:套餐权益额度为%d,附加权益额度为%d",
|
return res, fmt.Errorf("服务类型%s的额度不兼容:套餐权益额度为%d,附加权益额度为%d",
|
||||||
serviceName, benefitsQuota.QuotaValue, optionalQuota.QuotaValue)
|
serviceName, benefitsQuota.QuotaValue, optionalQuota.QuotaValue)
|
||||||
@ -288,15 +292,17 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
}
|
}
|
||||||
if req.Language == msg.ZH_CN {
|
if req.Language == msg.ZH_CN {
|
||||||
updateBundle := map[string]interface{}{
|
updateBundle := map[string]interface{}{
|
||||||
"name": req.Name,
|
"name": req.Name,
|
||||||
"sort": req.Sort,
|
"sort": req.Sort,
|
||||||
"content": req.Content,
|
"content": req.Content,
|
||||||
"price": req.Price,
|
"price": req.Price,
|
||||||
"price_type": req.PriceType,
|
"price_type": req.PriceType,
|
||||||
"img_option": req.ImgOption,
|
"img_option": req.ImgOption,
|
||||||
"bg_img1": req.BgImg1,
|
"bg_img1": req.BgImg1,
|
||||||
"bg_img2": req.BgImg2,
|
"bg_img2": req.BgImg2,
|
||||||
"font_color": req.FontColor,
|
"font_color": req.FontColor,
|
||||||
|
"bundle_type": req.BundleType,
|
||||||
|
"pay_later_time": req.PayLaterTime,
|
||||||
}
|
}
|
||||||
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
|
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
|
||||||
return res, errors.New("更新套餐信息失败")
|
return res, errors.New("更新套餐信息失败")
|
||||||
@ -333,6 +339,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
||||||
res = new(bundle.BundleDetailResponseV2)
|
res = new(bundle.BundleDetailResponseV2)
|
||||||
bundleProfile := &bundle.BundleProfile{}
|
bundleProfile := &bundle.BundleProfile{}
|
||||||
|
var bundleProfileLang *bundle.BundleProfileLang
|
||||||
|
|
||||||
if req.Uuid == "" {
|
if req.Uuid == "" {
|
||||||
return res, errors.New("缺少套餐UUID")
|
return res, errors.New("缺少套餐UUID")
|
||||||
@ -341,22 +348,55 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, errors.New("获取套餐信息失败")
|
return res, errors.New("获取套餐信息失败")
|
||||||
}
|
}
|
||||||
|
if req.Language != "" {
|
||||||
|
for _, lang := range detail.BundleProfileLang {
|
||||||
|
if lang.Language == req.Language {
|
||||||
|
bundleProfileLang = &bundle.BundleProfileLang{
|
||||||
|
Uuid: lang.UUID,
|
||||||
|
Name: lang.Name,
|
||||||
|
Price: lang.Price,
|
||||||
|
PriceType: lang.PriceType,
|
||||||
|
Content: lang.Content,
|
||||||
|
PayLaterTime: lang.PayLaterTime,
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//默认返回中文数据
|
||||||
|
for _, lang := range detail.BundleProfileLang {
|
||||||
|
if lang.Language == msg.ZH_CN {
|
||||||
|
bundleProfileLang = &bundle.BundleProfileLang{
|
||||||
|
Uuid: lang.UUID,
|
||||||
|
Name: lang.Name,
|
||||||
|
Price: lang.Price,
|
||||||
|
PriceType: lang.PriceType,
|
||||||
|
Content: lang.Content,
|
||||||
|
PayLaterTime: lang.PayLaterTime,
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if detail != nil {
|
if detail != nil {
|
||||||
bundleProfile = &bundle.BundleProfile{
|
bundleProfile = &bundle.BundleProfile{
|
||||||
Uuid: detail.UUID,
|
Uuid: detail.UUID,
|
||||||
Name: detail.Name,
|
Name: bundleProfileLang.Name,
|
||||||
Content: detail.Content,
|
Content: bundleProfileLang.Content,
|
||||||
Price: detail.Price,
|
Price: bundleProfileLang.Price,
|
||||||
PriceType: detail.PriceType,
|
PriceType: bundleProfileLang.PriceType,
|
||||||
ImgOption: int32(detail.ImgOption),
|
ImgOption: int32(detail.ImgOption),
|
||||||
BgImg1: detail.BgImg1,
|
BgImg1: detail.BgImg1,
|
||||||
BgImg2: detail.BgImg2,
|
BgImg2: detail.BgImg2,
|
||||||
FontColor: detail.FontColor,
|
FontColor: detail.FontColor,
|
||||||
Sort: detail.Sort,
|
Sort: detail.Sort,
|
||||||
ShelfStatus: detail.ShelfStatus,
|
ShelfStatus: detail.ShelfStatus,
|
||||||
CreatedAt: detail.CreatedAt.Format("2006-01-02 15:04:05"),
|
CreatedAt: detail.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||||
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
|
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
|
||||||
Contract: detail.Contract,
|
Contract: detail.Contract,
|
||||||
|
BundleType: int64(detail.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfileLang.PayLaterTime),
|
||||||
}
|
}
|
||||||
if len(detail.BundleToValueAddService) > 0 {
|
if len(detail.BundleToValueAddService) > 0 {
|
||||||
var valueUuids []string
|
var valueUuids []string
|
||||||
@ -421,20 +461,22 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0, len(detail.BundleProfileLang))
|
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0, len(detail.BundleProfileLang))
|
||||||
for _, lang := range detail.BundleProfileLang {
|
for _, lang := range detail.BundleProfileLang {
|
||||||
bundleProfileLangs = append(bundleProfileLangs, &bundle.BundleProfileLang{
|
bundleProfileLangs = append(bundleProfileLangs, &bundle.BundleProfileLang{
|
||||||
Uuid: lang.UUID,
|
Uuid: lang.UUID,
|
||||||
Name: lang.Name,
|
Name: lang.Name,
|
||||||
Price: lang.Price,
|
Price: lang.Price,
|
||||||
PriceType: lang.PriceType,
|
PriceType: lang.PriceType,
|
||||||
Content: lang.Content,
|
Content: lang.Content,
|
||||||
Language: lang.Language,
|
Language: lang.Language,
|
||||||
ImgOption: int32(detail.ImgOption),
|
PayLaterTime: int64(lang.PayLaterTime),
|
||||||
BgImg1: detail.BgImg1,
|
ImgOption: int32(detail.ImgOption),
|
||||||
BgImg2: detail.BgImg2,
|
BgImg1: detail.BgImg1,
|
||||||
FontColor: detail.FontColor,
|
BgImg2: detail.BgImg2,
|
||||||
Sort: detail.Sort,
|
FontColor: detail.FontColor,
|
||||||
ShelfStatus: detail.ShelfStatus,
|
Sort: detail.Sort,
|
||||||
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
ShelfStatus: detail.ShelfStatus,
|
||||||
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
|
BundleType: int64(detail.BundleType),
|
||||||
|
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||||
|
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
bundleProfile.BundleProfileLang = bundleProfileLangs
|
bundleProfile.BundleProfileLang = bundleProfileLangs
|
||||||
@ -469,6 +511,8 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
|
|||||||
res.Sort = detail.Sort
|
res.Sort = detail.Sort
|
||||||
res.ShelfStatus = detail.ShelfStatus
|
res.ShelfStatus = detail.ShelfStatus
|
||||||
res.Contract = detail.Contract
|
res.Contract = detail.Contract
|
||||||
|
res.BundleType = int64(detail.BundleType)
|
||||||
|
res.PayLaterTime = int64(detail.PayLaterTime)
|
||||||
if len(detail.BundleToValueAddService) > 0 {
|
if len(detail.BundleToValueAddService) > 0 {
|
||||||
var serviceLangInfos []*bundle.ServiceLangInfo
|
var serviceLangInfos []*bundle.ServiceLangInfo
|
||||||
for _, service := range detail.BundleToValueAddService {
|
for _, service := range detail.BundleToValueAddService {
|
||||||
@ -486,6 +530,7 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
|
|||||||
res.PriceType = lang.PriceType
|
res.PriceType = lang.PriceType
|
||||||
res.Content = lang.Content
|
res.Content = lang.Content
|
||||||
res.Language = lang.Language
|
res.Language = lang.Language
|
||||||
|
res.PayLaterTime = int64(lang.PayLaterTime)
|
||||||
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
|
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
|
||||||
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
|
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,16 @@ import (
|
|||||||
"gorm.io/plugin/soft_delete"
|
"gorm.io/plugin/soft_delete"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BundleTypeBasic = 1 // 基础套餐
|
||||||
|
BundleTypePostpaid = 2 // 先用后付套餐
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BundleShelfStatusUp = 1 // 上架
|
||||||
|
BundleShelfStatusDown = 2 // 下架
|
||||||
|
)
|
||||||
|
|
||||||
type BundleProfile struct {
|
type BundleProfile struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
||||||
@ -28,20 +38,22 @@ type BundleProfile struct {
|
|||||||
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
|
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
|
||||||
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"`
|
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"`
|
||||||
BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"`
|
BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"`
|
||||||
|
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
|
||||||
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
|
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
|
||||||
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
|
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
|
||||||
}
|
}
|
||||||
type BundleProfileLang struct {
|
type BundleProfileLang struct {
|
||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||||
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
||||||
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
|
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
|
||||||
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
|
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
|
||||||
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
|
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
|
||||||
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
|
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
|
||||||
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
|
||||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
||||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||||
DeletedAt soft_delete.DeletedAt
|
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
||||||
|
DeletedAt soft_delete.DeletedAt
|
||||||
}
|
}
|
||||||
type BundleToValueAddService struct {
|
type BundleToValueAddService struct {
|
||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||||
@ -349,6 +361,7 @@ func (*BundleActivate) TableName() string {
|
|||||||
|
|
||||||
type BundleBalanceUsePo struct {
|
type BundleBalanceUsePo struct {
|
||||||
UserId int
|
UserId int
|
||||||
|
OrderUUID string
|
||||||
AccountNumber int
|
AccountNumber int
|
||||||
VideoNumber int
|
VideoNumber int
|
||||||
ImageNumber int
|
ImageNumber int
|
||||||
|
|||||||
@ -35,7 +35,7 @@ type ValueAddService struct {
|
|||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||||
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
|
||||||
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
|
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
|
||||||
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"`
|
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数"`
|
||||||
ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"`
|
ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"`
|
||||||
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
|
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
|
||||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||||
@ -48,7 +48,7 @@ type ValueAddServiceLang struct {
|
|||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||||
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
|
||||||
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
|
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
|
||||||
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"`
|
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数"`
|
||||||
PriceMode int32 `json:"priceMode" gorm:"column:price_mode;type:int;comment:套餐价格类型 1:单价 2:总价"`
|
PriceMode int32 `json:"priceMode" gorm:"column:price_mode;type:int;comment:套餐价格类型 1:单价 2:总价"`
|
||||||
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
|
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
|
||||||
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //总价模式不合理,该字段暂时无用
|
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //总价模式不合理,该字段暂时无用
|
||||||
|
|||||||
@ -64,6 +64,7 @@ service Bundle {
|
|||||||
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询
|
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询
|
||||||
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息
|
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息
|
||||||
rpc GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} // 余量信息
|
rpc GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} // 余量信息
|
||||||
|
rpc GetBundleOrderListByUserId(GetBundleOrderListByUserIdReq) returns (GetBundleOrderListByUserIdResp) {} // 根据用户ID查询订单列表(包含订单基本信息和订单对应的余量信息)
|
||||||
rpc GetBundleBalanceByOrderUUID(GetBundleBalanceByOrderUUIDReq) returns (GetBundleBalanceByOrderUUIDResp) {}
|
rpc GetBundleBalanceByOrderUUID(GetBundleBalanceByOrderUUIDReq) returns (GetBundleBalanceByOrderUUIDResp) {}
|
||||||
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息
|
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息
|
||||||
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 修改余量信息
|
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 修改余量信息
|
||||||
@ -381,6 +382,7 @@ message BundleProfile {
|
|||||||
int32 imgOption = 20 [json_name = "imgOption"];
|
int32 imgOption = 20 [json_name = "imgOption"];
|
||||||
string fontColor = 21 [json_name = "fontColor"];
|
string fontColor = 21 [json_name = "fontColor"];
|
||||||
int64 bundleType = 22 [json_name = "bundleType"];
|
int64 bundleType = 22 [json_name = "bundleType"];
|
||||||
|
int64 payLaterTime = 23 [json_name = "payLaterTime"]; //先用后付套餐的后付时间,单位为天
|
||||||
}
|
}
|
||||||
message BundleProfileLang {
|
message BundleProfileLang {
|
||||||
string uuid = 1 [json_name = "uuid"];
|
string uuid = 1 [json_name = "uuid"];
|
||||||
@ -400,7 +402,9 @@ message BundleProfileLang {
|
|||||||
string bgImg2 = 15 [json_name = "bgImg2"];
|
string bgImg2 = 15 [json_name = "bgImg2"];
|
||||||
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
||||||
int32 imgOption = 17 [json_name = "imgOption"];
|
int32 imgOption = 17 [json_name = "imgOption"];
|
||||||
repeated ServiceLangInfo serviceLangInfo = 18 [json_name = "serviceLangInfo"];//增值服务信息
|
int64 bundleType = 18 [json_name = "bundleType"];
|
||||||
|
int64 payLaterTime = 19 [json_name = "payLaterTime"]; //先用后付套餐的后付时间,单位为天
|
||||||
|
repeated ServiceLangInfo serviceLangInfo = 20 [json_name = "serviceLangInfo"];//增值服务信息
|
||||||
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
|
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,6 +453,7 @@ message BundleListRequest {
|
|||||||
string name = 3 [json_name = "name"];
|
string name = 3 [json_name = "name"];
|
||||||
string content = 4 [json_name = "content"];
|
string content = 4 [json_name = "content"];
|
||||||
string language = 5 [json_name = "language"];
|
string language = 5 [json_name = "language"];
|
||||||
|
int32 bundleType = 6 [json_name = "bundleType"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BundleListResponse {
|
message BundleListResponse {
|
||||||
@ -1179,6 +1184,7 @@ message ToBeComfirmedWorksResp{
|
|||||||
|
|
||||||
message GetBundleBalanceByUserIdReq{
|
message GetBundleBalanceByUserIdReq{
|
||||||
int32 userId = 1;
|
int32 userId = 1;
|
||||||
|
string orderUUID = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBundleBalanceByUserIdResp{
|
message GetBundleBalanceByUserIdResp{
|
||||||
@ -1220,6 +1226,14 @@ message GetBundleBalanceByUserIdResp{
|
|||||||
string renewalOrderUuid = 36;
|
string renewalOrderUuid = 36;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetBundleOrderListByUserIdReq{
|
||||||
|
int32 userId = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetBundleOrderListByUserIdResp{
|
||||||
|
repeated string orderUuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message GetBundleBalanceByOrderUUIDReq{
|
message GetBundleBalanceByOrderUUIDReq{
|
||||||
string orderUUID = 1;
|
string orderUUID = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
10887
pb/bundle/bundle.pb.go
10887
pb/bundle/bundle.pb.go
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@ import (
|
|||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
math "math"
|
math "math"
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
_ "github.com/mwitkow/go-proto-validators"
|
|
||||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -493,6 +493,12 @@ func (this *GetBundleBalanceByUserIdReq) Validate() error {
|
|||||||
func (this *GetBundleBalanceByUserIdResp) Validate() error {
|
func (this *GetBundleBalanceByUserIdResp) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *GetBundleOrderListByUserIdReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetBundleOrderListByUserIdResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *GetBundleBalanceByOrderUUIDReq) Validate() error {
|
func (this *GetBundleBalanceByOrderUUIDReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,7 @@ type BundleClient interface {
|
|||||||
BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, 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)
|
GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment)
|
||||||
GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, 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)
|
GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment)
|
||||||
CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment)
|
CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment)
|
||||||
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
|
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
|
||||||
@ -199,6 +200,7 @@ type BundleClientImpl struct {
|
|||||||
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||||
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
||||||
GetBundleBalanceByUserId func(ctx context.Context, in *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, 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)
|
GetBundleBalanceByOrderUUID func(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
||||||
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
||||||
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
||||||
@ -520,6 +522,12 @@ func (c *bundleClient) GetBundleBalanceByUserId(ctx context.Context, in *GetBund
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceByUserId", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceByUserId", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) GetBundleOrderListByUserId(ctx context.Context, in *GetBundleOrderListByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleOrderListByUserIdResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetBundleOrderListByUserIdResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleOrderListByUserId", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment) {
|
func (c *bundleClient) GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetBundleBalanceByOrderUUIDResp)
|
out := new(GetBundleBalanceByOrderUUIDResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -1004,6 +1012,7 @@ type BundleServer interface {
|
|||||||
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||||
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
||||||
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
||||||
|
GetBundleOrderListByUserId(context.Context, *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error)
|
||||||
GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
||||||
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
||||||
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
||||||
@ -1212,6 +1221,9 @@ func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundl
|
|||||||
func (UnimplementedBundleServer) GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error) {
|
func (UnimplementedBundleServer) GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByUserId not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByUserId not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) GetBundleOrderListByUserId(context.Context, *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetBundleOrderListByUserId not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error) {
|
func (UnimplementedBundleServer) GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByOrderUUID not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByOrderUUID not implemented")
|
||||||
}
|
}
|
||||||
@ -2590,6 +2602,35 @@ func _Bundle_GetBundleBalanceByUserId_Handler(srv interface{}, ctx context.Conte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_GetBundleOrderListByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetBundleOrderListByUserIdReq)
|
||||||
|
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("GetBundleOrderListByUserId", 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_GetBundleBalanceByOrderUUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_GetBundleBalanceByOrderUUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetBundleBalanceByOrderUUIDReq)
|
in := new(GetBundleBalanceByOrderUUIDReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -4870,6 +4911,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "GetBundleBalanceByUserId",
|
MethodName: "GetBundleBalanceByUserId",
|
||||||
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetBundleOrderListByUserId",
|
||||||
|
Handler: _Bundle_GetBundleOrderListByUserId_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetBundleBalanceByOrderUUID",
|
MethodName: "GetBundleBalanceByOrderUUID",
|
||||||
Handler: _Bundle_GetBundleBalanceByOrderUUID_Handler,
|
Handler: _Bundle_GetBundleBalanceByOrderUUID_Handler,
|
||||||
|
|||||||
@ -58,7 +58,7 @@ func loadMysqlConn(conn string) *gorm.DB {
|
|||||||
&model.ValueAddServiceHistory{},
|
&model.ValueAddServiceHistory{},
|
||||||
&model.BundleOrderValueAdd{},
|
&model.BundleOrderValueAdd{},
|
||||||
&model.BundleExtensionRecords{},
|
&model.BundleExtensionRecords{},
|
||||||
&model.BundleBalance{},
|
// &model.BundleBalance{},
|
||||||
// &model.Reconciliation{},
|
// &model.Reconciliation{},
|
||||||
&model.BundleActivate{},
|
&model.BundleActivate{},
|
||||||
&model.BundleBalanceLayout{},
|
&model.BundleBalanceLayout{},
|
||||||
|
|||||||
@ -119,6 +119,7 @@ const (
|
|||||||
DataReportService = 3 //数据报表
|
DataReportService = 3 //数据报表
|
||||||
AccountService = 4 //账号数
|
AccountService = 4 //账号数
|
||||||
AvailableTimeService = 5 //可用时长
|
AvailableTimeService = 5 //可用时长
|
||||||
|
CompetitiveService = 6 //竞品数
|
||||||
)
|
)
|
||||||
|
|
||||||
// 套餐状态
|
// 套餐状态
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user