feat:增加额度对应需求字段
This commit is contained in:
parent
81e5d2f440
commit
0c7f70af93
33
.vscode/launch.json
vendored
Normal file
33
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
// 使用 IntelliSense 了解相关属性。
|
||||||
|
// 悬停以查看现有属性的描述。
|
||||||
|
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Launch Package",
|
||||||
|
"type": "go",
|
||||||
|
"request": "launch",
|
||||||
|
"mode": "auto",
|
||||||
|
"env": {
|
||||||
|
"GOPATH":"C:\\Users\\lenovo\\go",
|
||||||
|
"GOOS":"windows"
|
||||||
|
},
|
||||||
|
"program": "${workspaceFolder}\\cmd",
|
||||||
|
"args":[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Run app.go",
|
||||||
|
"type": "go",
|
||||||
|
"request": "launch",
|
||||||
|
"mode": "debug",
|
||||||
|
"program": "${workspaceFolder}/cmd/app.go",
|
||||||
|
"cwd": "${workspaceFolder}/cmd",
|
||||||
|
"env": {
|
||||||
|
"DEBUG": "true",
|
||||||
|
"DUBBO_GO_CONFIG_PATH": "${workspaceFolder}/conf/dubbogo.yaml"
|
||||||
|
},
|
||||||
|
"dlvFlags": ["--check-go-version=false"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
22
.vscode/settings.json
vendored
Normal file
22
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"workbench.colorCustomizations": {
|
||||||
|
"activityBar.activeBackground": "#fa1b49",
|
||||||
|
"activityBar.background": "#fa1b49",
|
||||||
|
"activityBar.foreground": "#e7e7e7",
|
||||||
|
"activityBar.inactiveForeground": "#e7e7e799",
|
||||||
|
"activityBarBadge.background": "#155e02",
|
||||||
|
"activityBarBadge.foreground": "#e7e7e7",
|
||||||
|
"commandCenter.border": "#e7e7e799",
|
||||||
|
"sash.hoverBorder": "#fa1b49",
|
||||||
|
"statusBar.background": "#dd0531",
|
||||||
|
"statusBar.foreground": "#e7e7e7",
|
||||||
|
"statusBarItem.hoverBackground": "#fa1b49",
|
||||||
|
"statusBarItem.remoteBackground": "#dd0531",
|
||||||
|
"statusBarItem.remoteForeground": "#e7e7e7",
|
||||||
|
"titleBar.activeBackground": "#dd0531",
|
||||||
|
"titleBar.activeForeground": "#e7e7e7",
|
||||||
|
"titleBar.inactiveBackground": "#dd053199",
|
||||||
|
"titleBar.inactiveForeground": "#e7e7e799"
|
||||||
|
},
|
||||||
|
"peacock.color": "#dd0531"
|
||||||
|
}
|
@ -198,6 +198,9 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
Language: in.Language,
|
Language: in.Language,
|
||||||
PriceType: in.PriceType,
|
PriceType: in.PriceType,
|
||||||
Options: options,
|
Options: options,
|
||||||
|
QuotaType: in.QuotaType,
|
||||||
|
QuotaValue: in.QuotaValue,
|
||||||
|
IsExpired: in.IsExpired,
|
||||||
}
|
}
|
||||||
if in.Uuid == "" && in.Language != msg.ZH_CN {
|
if in.Uuid == "" && in.Language != msg.ZH_CN {
|
||||||
return res, errors.New("请先创建中文版本增值服务")
|
return res, errors.New("请先创建中文版本增值服务")
|
||||||
@ -259,6 +262,9 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
Language: lang,
|
Language: lang,
|
||||||
PriceType: valueAddServiceLang.PriceType,
|
PriceType: valueAddServiceLang.PriceType,
|
||||||
Options: valueAddServiceLang.Options,
|
Options: valueAddServiceLang.Options,
|
||||||
|
QuotaType: valueAddServiceLang.QuotaType,
|
||||||
|
QuotaValue: valueAddServiceLang.QuotaValue,
|
||||||
|
IsExpired: valueAddServiceLang.IsExpired,
|
||||||
}
|
}
|
||||||
otherLang.Language = lang
|
otherLang.Language = lang
|
||||||
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
|
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
|
||||||
@ -297,6 +303,9 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
"price_type": in.PriceType,
|
"price_type": in.PriceType,
|
||||||
"options": options,
|
"options": options,
|
||||||
"language": in.Language,
|
"language": in.Language,
|
||||||
|
"quota_type": in.QuotaType,
|
||||||
|
"quota_value": in.QuotaValue,
|
||||||
|
"is_expired": in.IsExpired,
|
||||||
}
|
}
|
||||||
if err := dao.UpdateValueAddServiceLang(tx, updateLangService); err != nil {
|
if err := dao.UpdateValueAddServiceLang(tx, updateLangService); err != nil {
|
||||||
return res, errors.New("更新增值服务失败")
|
return res, errors.New("更新增值服务失败")
|
||||||
@ -348,6 +357,9 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
|||||||
Language: serviceLang.Language,
|
Language: serviceLang.Language,
|
||||||
CreatedAt: time.Unix(serviceLang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
CreatedAt: time.Unix(serviceLang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||||
UpdatedAt: time.Unix(serviceLang.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
|
UpdatedAt: time.Unix(serviceLang.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
|
||||||
|
QuotaType: serviceLang.QuotaType,
|
||||||
|
QuotaValue: serviceLang.QuotaValue,
|
||||||
|
IsExpired: serviceLang.IsExpired,
|
||||||
}
|
}
|
||||||
if len(serviceLang.Options) > 0 {
|
if len(serviceLang.Options) > 0 {
|
||||||
var options []*bundle.ValueAddPriceOptions
|
var options []*bundle.ValueAddPriceOptions
|
||||||
|
@ -52,13 +52,16 @@ type ValueAddServiceLang struct {
|
|||||||
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:增值服务总价"`
|
||||||
Unit string `json:"unit" gorm:"column:unit;type:varchar(50);comment:单位 1:个 2:条 3:天 4:月 5:年"`
|
Unit string `json:"unit" gorm:"column:unit;type:varchar(50);comment:单位 1:个 2:条 3:天 4:月 5:年 6:自然月 7:自然季度 8:半年 9:自然年"`
|
||||||
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
||||||
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:币种 1:人民币 2:美元 3:日元 4:欧元"`
|
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:币种 1:人民币 2:美元 3:日元 4:欧元"`
|
||||||
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
|
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
|
||||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
||||||
DeletedAt soft_delete.DeletedAt
|
DeletedAt soft_delete.DeletedAt
|
||||||
|
QuotaType int32 `json:"quotaType" gorm:"column:quota_type;type:int;comment:额度类型 0:不限额度 1:每天限额度 2:每月限额度 3:每季度限额度 4:每半年限额度 5:每年限额度"`
|
||||||
|
QuotaValue int32 `json:"quotaValue" gorm:"column:quota_value;type:int;comment:额度值"`
|
||||||
|
IsExpired bool `json:"isExpired" gorm:"column:is_expired;default:false;comment:是否过期作废 false:不作废 true:作废"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValueAddServiceHistory struct {
|
type ValueAddServiceHistory struct {
|
||||||
|
@ -507,15 +507,18 @@ message ValueAddService {
|
|||||||
message ValueAddServiceLang {
|
message ValueAddServiceLang {
|
||||||
string uuid = 1 [json_name = "uuid"];
|
string uuid = 1 [json_name = "uuid"];
|
||||||
string serviceName = 2 [json_name = "serviceName"]; //服务名称
|
string serviceName = 2 [json_name = "serviceName"]; //服务名称
|
||||||
int32 serviceType = 3 [json_name = "serviceType"];
|
int32 serviceType = 3 [json_name = "serviceType"]; //服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长
|
||||||
int32 priceMode = 4 [json_name = "priceMode"];
|
int32 priceMode = 4 [json_name = "priceMode"]; //套餐价格类型 1:单价 2:总价
|
||||||
string originalPrice = 5 [json_name = "originalPrice"];
|
string originalPrice = 5 [json_name = "originalPrice"];//原单价
|
||||||
string unit = 6 [json_name = "unit"];
|
string unit = 6 [json_name = "unit"];//单位 1:个 2:条 3:天 4:月 5:年
|
||||||
int64 priceType = 7 [json_name = "priceType"];
|
int64 priceType = 7 [json_name = "priceType"];//币种 1:人民币 2:美元 3:日元 4:欧元
|
||||||
string language = 8 [json_name = "language"];
|
string language = 8 [json_name = "language"];//套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)
|
||||||
string createdAt = 9 [json_name = "createdAt"];
|
string createdAt = 9 [json_name = "createdAt"];
|
||||||
string updatedAt = 10 [json_name = "updatedAt"];
|
string updatedAt = 10 [json_name = "updatedAt"];
|
||||||
repeated ValueAddPriceOptions options = 12 [json_name = "options"];
|
repeated ValueAddPriceOptions options = 11 [json_name = "options"];
|
||||||
|
int32 quotaType = 12 [json_name = "quotaType"]; //额度类型 0;不限额度 1:每天限额度 2:每月限额度 3:每季度限额度 4:每半年限额度 5:每年限额度
|
||||||
|
int32 quotaValue = 13 [json_name = "quotaValue"]; //额度值
|
||||||
|
bool isExpired = 14 [json_name = "isExpired"]; //是否过期作废 false:不作废 true:作废
|
||||||
}
|
}
|
||||||
//增值服务价格选项
|
//增值服务价格选项
|
||||||
message ValueAddPriceOptions {
|
message ValueAddPriceOptions {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-triple v1.0.5
|
// - protoc-gen-go-triple v1.0.5
|
||||||
// - protoc v6.32.0
|
// - protoc v5.26.0
|
||||||
// source: pb/bundle.proto
|
// source: pb/bundle.proto
|
||||||
|
|
||||||
package bundle
|
package bundle
|
||||||
|
3
protocBundle.bat
Normal file
3
protocBundle.bat
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
protoc -I . -I ./pb --proto_path=./pb --go_out=./pb --go-triple_out=./pb --govalidators_out=./pb ./pb/bundle.proto
|
||||||
|
.\clear.sh
|
Loading…
Reference in New Issue
Block a user