feat:修改服务列表额度字段逻辑
This commit is contained in:
parent
2280cc40d9
commit
2461bb8a93
@ -340,14 +340,15 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
||||
return res, errors.New("查询增值服务列表失败")
|
||||
}
|
||||
for _, valueAddService := range list {
|
||||
var quotaInfo string
|
||||
var isExpired bool
|
||||
serviceInfo := &bundle.ValueAddService{
|
||||
Uuid: valueAddService.UUID,
|
||||
ServiceName: valueAddService.ServiceName,
|
||||
ServiceType: valueAddService.ServiceType,
|
||||
}
|
||||
for _, serviceLang := range valueAddService.ValueAddServiceLang {
|
||||
if serviceLang.QuotaType == 0 && serviceInfo.ServiceType != 5 && serviceInfo.ServiceType != 4 {
|
||||
serviceLang.QuotaType = 1
|
||||
}
|
||||
serviceLangInfo := &bundle.ValueAddServiceLang{
|
||||
Uuid: valueAddService.UUID,
|
||||
ServiceName: serviceLang.ServiceName,
|
||||
@ -363,24 +364,10 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
||||
QuotaValue: serviceLang.QuotaValue,
|
||||
IsExpired: serviceLang.IsExpired,
|
||||
}
|
||||
if serviceLangInfo.Language == "zh-CN" {
|
||||
switch serviceLangInfo.QuotaType {
|
||||
case 0:
|
||||
quotaInfo = "不限额度"
|
||||
case 1:
|
||||
quotaInfo = fmt.Sprintf("每天%d个", serviceLangInfo.QuotaValue)
|
||||
case 2:
|
||||
quotaInfo = fmt.Sprintf("每月%d个", serviceLangInfo.QuotaValue)
|
||||
case 3:
|
||||
quotaInfo = fmt.Sprintf("每季度%d个", serviceLangInfo.QuotaValue)
|
||||
case 4:
|
||||
quotaInfo = fmt.Sprintf("每半年%d个", serviceLangInfo.QuotaValue)
|
||||
case 5:
|
||||
quotaInfo = fmt.Sprintf("每年%d个", serviceLangInfo.QuotaValue)
|
||||
default:
|
||||
quotaInfo = ""
|
||||
}
|
||||
isExpired = serviceLangInfo.IsExpired
|
||||
if serviceLangInfo.Language == "zh-CN" && serviceInfo.ServiceType != 5 && serviceInfo.ServiceType != 4 {
|
||||
serviceInfo.QuotaType = serviceLangInfo.QuotaType
|
||||
serviceInfo.QuotaValue = serviceLangInfo.QuotaValue
|
||||
serviceInfo.IsExpired = serviceLangInfo.IsExpired
|
||||
}
|
||||
if len(serviceLang.Options) > 0 {
|
||||
var options []*bundle.ValueAddPriceOptions
|
||||
@ -410,10 +397,6 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
||||
serviceLangInfo.Options = options
|
||||
}
|
||||
serviceInfo.ServiceLang = append(serviceInfo.ServiceLang, serviceLangInfo)
|
||||
if quotaInfo != "" && serviceInfo.ServiceType != 5 {
|
||||
serviceInfo.ServiceQuota = quotaInfo
|
||||
serviceInfo.IsExpired = isExpired
|
||||
}
|
||||
}
|
||||
res.ValueAddServiceList = append(res.ValueAddServiceList, serviceInfo)
|
||||
}
|
||||
|
@ -503,8 +503,9 @@ message ValueAddService {
|
||||
string serviceName = 2 [json_name = "serviceName"]; //服务名称
|
||||
int32 serviceType = 3 [json_name = "serviceType"]; //服务类型
|
||||
repeated ValueAddServiceLang serviceLang = 4 [json_name = "serviceLang"]; //不太语言的服务详细
|
||||
string serviceQuota = 5 [json_name = "serviceQuota"];//服务额度
|
||||
bool isExpired = 6 [json_name = "isExpired"];//是否过期作废
|
||||
int32 quotaType = 5 [json_name = "quotaType"];//额度类型
|
||||
int32 quotaValue = 6 [json_name = "quotaValue"];//额度值
|
||||
bool isExpired = 7 [json_name = "isExpired"];//是否过期作废
|
||||
}
|
||||
message ValueAddServiceLang {
|
||||
string uuid = 1 [json_name = "uuid"];
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.5
|
||||
// - protoc v5.26.0
|
||||
// - protoc v4.22.0
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
|
Loading…
Reference in New Issue
Block a user