f
This commit is contained in:
@@ -48,6 +48,7 @@ type (
|
|||||||
ApiId string `json:"api_id"` // API标识
|
ApiId string `json:"api_id"` // API标识
|
||||||
Name string `json:"name"` // 描述
|
Name string `json:"name"` // 描述
|
||||||
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价(单位:元)
|
||||||
}
|
}
|
||||||
// 创建功能响应
|
// 创建功能响应
|
||||||
AdminCreateFeatureResp {
|
AdminCreateFeatureResp {
|
||||||
@@ -59,6 +60,7 @@ type (
|
|||||||
ApiId *string `json:"api_id,optional"` // API标识
|
ApiId *string `json:"api_id,optional"` // API标识
|
||||||
Name *string `json:"name,optional"` // 描述
|
Name *string `json:"name,optional"` // 描述
|
||||||
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价(单位:元)
|
||||||
}
|
}
|
||||||
// 更新功能响应
|
// 更新功能响应
|
||||||
AdminUpdateFeatureResp {
|
AdminUpdateFeatureResp {
|
||||||
@@ -85,6 +87,7 @@ type (
|
|||||||
ApiId string `json:"api_id"` // API标识
|
ApiId string `json:"api_id"` // API标识
|
||||||
Name string `json:"name"` // 描述
|
Name string `json:"name"` // 描述
|
||||||
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice float64 `json:"cost_price"` // 天远API调用成本价(单位:元)
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
}
|
}
|
||||||
@@ -103,6 +106,7 @@ type (
|
|||||||
ApiId string `json:"api_id"` // API标识
|
ApiId string `json:"api_id"` // API标识
|
||||||
Name string `json:"name"` // 描述
|
Name string `json:"name"` // 描述
|
||||||
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice float64 `json:"cost_price"` // 天远API调用成本价(单位:元)
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ type (
|
|||||||
ProductEn string `json:"product_en"` // 英文名
|
ProductEn string `json:"product_en"` // 英文名
|
||||||
Description string `json:"description"` // 描述
|
Description string `json:"description"` // 描述
|
||||||
Notes string `json:"notes,optional"` // 备注
|
Notes string `json:"notes,optional"` // 备注
|
||||||
CostPrice float64 `json:"cost_price"` // 成本
|
|
||||||
SellPrice float64 `json:"sell_price"` // 售价
|
SellPrice float64 `json:"sell_price"` // 售价
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +64,6 @@ type (
|
|||||||
ProductEn *string `json:"product_en,optional"` // 英文名
|
ProductEn *string `json:"product_en,optional"` // 英文名
|
||||||
Description *string `json:"description,optional"` // 描述
|
Description *string `json:"description,optional"` // 描述
|
||||||
Notes *string `json:"notes,optional"` // 备注
|
Notes *string `json:"notes,optional"` // 备注
|
||||||
CostPrice *float64 `json:"cost_price,optional"` // 成本
|
|
||||||
SellPrice *float64 `json:"sell_price,optional"` // 售价
|
SellPrice *float64 `json:"sell_price,optional"` // 售价
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +97,6 @@ type (
|
|||||||
ProductEn string `json:"product_en"` // 英文名
|
ProductEn string `json:"product_en"` // 英文名
|
||||||
Description string `json:"description"` // 描述
|
Description string `json:"description"` // 描述
|
||||||
Notes string `json:"notes"` // 备注
|
Notes string `json:"notes"` // 备注
|
||||||
CostPrice float64 `json:"cost_price"` // 成本
|
|
||||||
SellPrice float64 `json:"sell_price"` // 售价
|
SellPrice float64 `json:"sell_price"` // 售价
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
@@ -123,7 +120,6 @@ type (
|
|||||||
ProductEn string `json:"product_en"` // 英文名
|
ProductEn string `json:"product_en"` // 英文名
|
||||||
Description string `json:"description"` // 描述
|
Description string `json:"description"` // 描述
|
||||||
Notes string `json:"notes"` // 备注
|
Notes string `json:"notes"` // 备注
|
||||||
CostPrice float64 `json:"cost_price"` // 成本
|
|
||||||
SellPrice float64 `json:"sell_price"` // 售价
|
SellPrice float64 `json:"sell_price"` // 售价
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ func (l *AdminCreateFeatureLogic) AdminCreateFeature(req *types.AdminCreateFeatu
|
|||||||
if req.WhitelistPrice != nil {
|
if req.WhitelistPrice != nil {
|
||||||
data.WhitelistPrice = *req.WhitelistPrice
|
data.WhitelistPrice = *req.WhitelistPrice
|
||||||
}
|
}
|
||||||
|
// 设置成本价
|
||||||
|
if req.CostPrice != nil {
|
||||||
|
data.CostPrice = *req.CostPrice
|
||||||
|
}
|
||||||
|
|
||||||
// 2. 数据库操作
|
// 2. 数据库操作
|
||||||
result, err := l.svcCtx.FeatureModel.Insert(l.ctx, nil, data)
|
result, err := l.svcCtx.FeatureModel.Insert(l.ctx, nil, data)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ func (l *AdminGetFeatureDetailLogic) AdminGetFeatureDetail(req *types.AdminGetFe
|
|||||||
ApiId: record.ApiId,
|
ApiId: record.ApiId,
|
||||||
Name: record.Name,
|
Name: record.Name,
|
||||||
WhitelistPrice: record.WhitelistPrice,
|
WhitelistPrice: record.WhitelistPrice,
|
||||||
|
CostPrice: record.CostPrice,
|
||||||
CreateTime: record.CreateTime.Format("2006-01-02 15:04:05"),
|
CreateTime: record.CreateTime.Format("2006-01-02 15:04:05"),
|
||||||
UpdateTime: record.UpdateTime.Format("2006-01-02 15:04:05"),
|
UpdateTime: record.UpdateTime.Format("2006-01-02 15:04:05"),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ func (l *AdminGetFeatureListLogic) AdminGetFeatureList(req *types.AdminGetFeatur
|
|||||||
ApiId: item.ApiId,
|
ApiId: item.ApiId,
|
||||||
Name: item.Name,
|
Name: item.Name,
|
||||||
WhitelistPrice: item.WhitelistPrice,
|
WhitelistPrice: item.WhitelistPrice,
|
||||||
|
CostPrice: item.CostPrice,
|
||||||
CreateTime: item.CreateTime.Format("2006-01-02 15:04:05"),
|
CreateTime: item.CreateTime.Format("2006-01-02 15:04:05"),
|
||||||
UpdateTime: item.UpdateTime.Format("2006-01-02 15:04:05"),
|
UpdateTime: item.UpdateTime.Format("2006-01-02 15:04:05"),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ func (l *AdminUpdateFeatureLogic) AdminUpdateFeature(req *types.AdminUpdateFeatu
|
|||||||
if req.WhitelistPrice != nil {
|
if req.WhitelistPrice != nil {
|
||||||
record.WhitelistPrice = *req.WhitelistPrice
|
record.WhitelistPrice = *req.WhitelistPrice
|
||||||
}
|
}
|
||||||
|
if req.CostPrice != nil {
|
||||||
|
record.CostPrice = *req.CostPrice
|
||||||
|
}
|
||||||
|
|
||||||
// 4. 执行更新操作
|
// 4. 执行更新操作
|
||||||
err = l.svcCtx.FeatureModel.UpdateWithVersion(l.ctx, nil, record)
|
err = l.svcCtx.FeatureModel.UpdateWithVersion(l.ctx, nil, record)
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ func (l *AdminCreateProductLogic) AdminCreateProduct(req *types.AdminCreateProdu
|
|||||||
ProductEn: req.ProductEn,
|
ProductEn: req.ProductEn,
|
||||||
Description: req.Description,
|
Description: req.Description,
|
||||||
Notes: sql.NullString{String: req.Notes, Valid: req.Notes != ""},
|
Notes: sql.NullString{String: req.Notes, Valid: req.Notes != ""},
|
||||||
CostPrice: req.CostPrice,
|
|
||||||
SellPrice: req.SellPrice,
|
SellPrice: req.SellPrice,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ func (l *AdminGetProductDetailLogic) AdminGetProductDetail(req *types.AdminGetPr
|
|||||||
ProductEn: record.ProductEn,
|
ProductEn: record.ProductEn,
|
||||||
Description: record.Description,
|
Description: record.Description,
|
||||||
Notes: record.Notes.String,
|
Notes: record.Notes.String,
|
||||||
CostPrice: record.CostPrice,
|
|
||||||
SellPrice: record.SellPrice,
|
SellPrice: record.SellPrice,
|
||||||
CreateTime: record.CreateTime.Format("2006-01-02 15:04:05"),
|
CreateTime: record.CreateTime.Format("2006-01-02 15:04:05"),
|
||||||
UpdateTime: record.UpdateTime.Format("2006-01-02 15:04:05"),
|
UpdateTime: record.UpdateTime.Format("2006-01-02 15:04:05"),
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ func (l *AdminGetProductListLogic) AdminGetProductList(req *types.AdminGetProduc
|
|||||||
ProductEn: item.ProductEn,
|
ProductEn: item.ProductEn,
|
||||||
Description: item.Description,
|
Description: item.Description,
|
||||||
Notes: item.Notes.String,
|
Notes: item.Notes.String,
|
||||||
CostPrice: item.CostPrice,
|
|
||||||
SellPrice: item.SellPrice,
|
SellPrice: item.SellPrice,
|
||||||
CreateTime: item.CreateTime.Format("2006-01-02 15:04:05"),
|
CreateTime: item.CreateTime.Format("2006-01-02 15:04:05"),
|
||||||
UpdateTime: item.UpdateTime.Format("2006-01-02 15:04:05"),
|
UpdateTime: item.UpdateTime.Format("2006-01-02 15:04:05"),
|
||||||
|
|||||||
@@ -47,9 +47,6 @@ func (l *AdminUpdateProductLogic) AdminUpdateProduct(req *types.AdminUpdateProdu
|
|||||||
if req.Notes != nil {
|
if req.Notes != nil {
|
||||||
record.Notes = sql.NullString{String: *req.Notes, Valid: *req.Notes != ""}
|
record.Notes = sql.NullString{String: *req.Notes, Valid: *req.Notes != ""}
|
||||||
}
|
}
|
||||||
if req.CostPrice != nil {
|
|
||||||
record.CostPrice = *req.CostPrice
|
|
||||||
}
|
|
||||||
if req.SellPrice != nil {
|
if req.SellPrice != nil {
|
||||||
record.SellPrice = *req.SellPrice
|
record.SellPrice = *req.SellPrice
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ type AdminCreateFeatureReq struct {
|
|||||||
ApiId string `json:"api_id"` // API标识
|
ApiId string `json:"api_id"` // API标识
|
||||||
Name string `json:"name"` // 描述
|
Name string `json:"name"` // 描述
|
||||||
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价(单位:元)
|
||||||
}
|
}
|
||||||
|
|
||||||
type AdminCreateFeatureResp struct {
|
type AdminCreateFeatureResp struct {
|
||||||
@@ -37,6 +38,7 @@ type AdminGetFeatureDetailResp struct {
|
|||||||
ApiId string `json:"api_id"` // API标识
|
ApiId string `json:"api_id"` // API标识
|
||||||
Name string `json:"name"` // 描述
|
Name string `json:"name"` // 描述
|
||||||
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice float64 `json:"cost_price"` // 天远API调用成本价(单位:元)
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
}
|
}
|
||||||
@@ -71,6 +73,7 @@ type AdminUpdateFeatureReq struct {
|
|||||||
ApiId *string `json:"api_id,optional"` // API标识
|
ApiId *string `json:"api_id,optional"` // API标识
|
||||||
Name *string `json:"name,optional"` // 描述
|
Name *string `json:"name,optional"` // 描述
|
||||||
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价(单位:元)
|
||||||
}
|
}
|
||||||
|
|
||||||
type AdminUpdateFeatureResp struct {
|
type AdminUpdateFeatureResp struct {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ type AdminCreateProductReq struct {
|
|||||||
ProductEn string `json:"product_en"` // 英文名
|
ProductEn string `json:"product_en"` // 英文名
|
||||||
Description string `json:"description"` // 描述
|
Description string `json:"description"` // 描述
|
||||||
Notes string `json:"notes,optional"` // 备注
|
Notes string `json:"notes,optional"` // 备注
|
||||||
CostPrice float64 `json:"cost_price"` // 成本
|
|
||||||
SellPrice float64 `json:"sell_price"` // 售价
|
SellPrice float64 `json:"sell_price"` // 售价
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +31,6 @@ type AdminGetProductDetailResp struct {
|
|||||||
ProductEn string `json:"product_en"` // 英文名
|
ProductEn string `json:"product_en"` // 英文名
|
||||||
Description string `json:"description"` // 描述
|
Description string `json:"description"` // 描述
|
||||||
Notes string `json:"notes"` // 备注
|
Notes string `json:"notes"` // 备注
|
||||||
CostPrice float64 `json:"cost_price"` // 成本
|
|
||||||
SellPrice float64 `json:"sell_price"` // 售价
|
SellPrice float64 `json:"sell_price"` // 售价
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
@@ -82,7 +80,6 @@ type AdminUpdateProductReq struct {
|
|||||||
ProductEn *string `json:"product_en,optional"` // 英文名
|
ProductEn *string `json:"product_en,optional"` // 英文名
|
||||||
Description *string `json:"description,optional"` // 描述
|
Description *string `json:"description,optional"` // 描述
|
||||||
Notes *string `json:"notes,optional"` // 备注
|
Notes *string `json:"notes,optional"` // 备注
|
||||||
CostPrice *float64 `json:"cost_price,optional"` // 成本
|
|
||||||
SellPrice *float64 `json:"sell_price,optional"` // 售价
|
SellPrice *float64 `json:"sell_price,optional"` // 售价
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ type FeatureListItem struct {
|
|||||||
ApiId string `json:"api_id"` // API标识
|
ApiId string `json:"api_id"` // API标识
|
||||||
Name string `json:"name"` // 描述
|
Name string `json:"name"` // 描述
|
||||||
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
|
||||||
|
CostPrice float64 `json:"cost_price"` // 天远API调用成本价(单位:元)
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
}
|
}
|
||||||
@@ -512,7 +513,6 @@ type ProductListItem struct {
|
|||||||
ProductEn string `json:"product_en"` // 英文名
|
ProductEn string `json:"product_en"` // 英文名
|
||||||
Description string `json:"description"` // 描述
|
Description string `json:"description"` // 描述
|
||||||
Notes string `json:"notes"` // 备注
|
Notes string `json:"notes"` // 备注
|
||||||
CostPrice float64 `json:"cost_price"` // 成本
|
|
||||||
SellPrice float64 `json:"sell_price"` // 售价
|
SellPrice float64 `json:"sell_price"` // 售价
|
||||||
CreateTime string `json:"create_time"` // 创建时间
|
CreateTime string `json:"create_time"` // 创建时间
|
||||||
UpdateTime string `json:"update_time"` // 更新时间
|
UpdateTime string `json:"update_time"` // 更新时间
|
||||||
|
|||||||
Reference in New Issue
Block a user