feat:增加额度对应需求字段

This commit is contained in:
jiaji.H 2025-09-03 11:33:05 +08:00
parent 81e5d2f440
commit 0c7f70af93
8 changed files with 4029 additions and 1884 deletions

33
.vscode/launch.json vendored Normal file
View 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
View 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"
}

View File

@ -198,6 +198,9 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
Language: in.Language,
PriceType: in.PriceType,
Options: options,
QuotaType: in.QuotaType,
QuotaValue: in.QuotaValue,
IsExpired: in.IsExpired,
}
if in.Uuid == "" && in.Language != msg.ZH_CN {
return res, errors.New("请先创建中文版本增值服务")
@ -259,6 +262,9 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
Language: lang,
PriceType: valueAddServiceLang.PriceType,
Options: valueAddServiceLang.Options,
QuotaType: valueAddServiceLang.QuotaType,
QuotaValue: valueAddServiceLang.QuotaValue,
IsExpired: valueAddServiceLang.IsExpired,
}
otherLang.Language = lang
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
@ -297,6 +303,9 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
"price_type": in.PriceType,
"options": options,
"language": in.Language,
"quota_type": in.QuotaType,
"quota_value": in.QuotaValue,
"is_expired": in.IsExpired,
}
if err := dao.UpdateValueAddServiceLang(tx, updateLangService); err != nil {
return res, errors.New("更新增值服务失败")
@ -348,6 +357,9 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
Language: serviceLang.Language,
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"),
QuotaType: serviceLang.QuotaType,
QuotaValue: serviceLang.QuotaValue,
IsExpired: serviceLang.IsExpired,
}
if len(serviceLang.Options) > 0 {
var options []*bundle.ValueAddPriceOptions

View File

@ -52,13 +52,16 @@ type ValueAddServiceLang struct {
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:原单价"`
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(中繁英德日)"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:币种 1:人民币 2:美元 3:日元 4:欧元"`
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
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 {

View File

@ -507,15 +507,18 @@ message ValueAddService {
message ValueAddServiceLang {
string uuid = 1 [json_name = "uuid"];
string serviceName = 2 [json_name = "serviceName"]; //
int32 serviceType = 3 [json_name = "serviceType"];
int32 priceMode = 4 [json_name = "priceMode"];
string originalPrice = 5 [json_name = "originalPrice"];
string unit = 6 [json_name = "unit"];
int64 priceType = 7 [json_name = "priceType"];
string language = 8 [json_name = "language"];
int32 serviceType = 3 [json_name = "serviceType"]; // 1: 2: 3: 4: 5:
int32 priceMode = 4 [json_name = "priceMode"]; // 1: 2:
string originalPrice = 5 [json_name = "originalPrice"];//
string unit = 6 [json_name = "unit"];// 1: 2: 3: 4: 5:
int64 priceType = 7 [json_name = "priceType"];// 1: 2: 3: 4:
string language = 8 [json_name = "language"];// zh-CN zh-TW EN de-DE ja-JP()
string createdAt = 9 [json_name = "createdAt"];
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 {

File diff suppressed because it is too large Load Diff

View File

@ -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

3
protocBundle.bat Normal file
View 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