29 lines
1.9 KiB
Go
29 lines
1.9 KiB
Go
package service
|
|
|
|
import "xk-of-api/internal/model"
|
|
|
|
// PricingService 负责 SaaS 套餐展示和套餐查询。
|
|
type PricingService struct{}
|
|
|
|
// Pricing 暴露定价服务单例。
|
|
var Pricing = PricingService{}
|
|
|
|
// Plans 返回官网定价套餐,后续可由 nl_saas_plan 和 nl_saas_plan_feature 驱动。
|
|
func (s PricingService) Plans() []model.Plan {
|
|
return []model.Plan{
|
|
{Id: 1, Code: "starter", Name: "基础版", Description: "适合单店诊所快速上线线上预约和基础经营管理。", MonthlyFee: 19900, YearlyFee: 199000, Recommended: false, Features: []model.PlanFeature{{Name: "患者端小程序", Value: "基础预约与提醒", Highlight: true}, {Name: "PC后台", Value: "线索与订单管理", Highlight: true}, {Name: "账号数量", Value: "5个员工账号"}}},
|
|
{Id: 2, Code: "growth", Name: "增长版", Description: "适合需要推广员获客、医生协同和经营分析的成长型诊所。", MonthlyFee: 39900, YearlyFee: 399000, Recommended: true, Features: []model.PlanFeature{{Name: "四端小程序", Value: "患者/医生/老板/推广员", Highlight: true}, {Name: "经营看板", Value: "收入、转化、复购分析", Highlight: true}, {Name: "账号数量", Value: "20个员工账号"}}},
|
|
{Id: 3, Code: "enterprise", Name: "连锁版", Description: "适合连锁门店和需要深度配置的诊所集团。", MonthlyFee: 89900, YearlyFee: 899000, Recommended: false, Features: []model.PlanFeature{{Name: "多门店能力", Value: "预留扩展与独立配置", Highlight: true}, {Name: "专属服务", Value: "部署辅导和运营顾问", Highlight: true}, {Name: "账号数量", Value: "不限账号数量"}}},
|
|
}
|
|
}
|
|
|
|
// FindByCode 根据套餐编码查找套餐。
|
|
func (s PricingService) FindByCode(code string) (model.Plan, bool) {
|
|
for _, plan := range s.Plans() {
|
|
if plan.Code == code {
|
|
return plan, true
|
|
}
|
|
}
|
|
return model.Plan{}, false
|
|
}
|