- 前端: 所有界面显示、i18n 文本、组件中的品牌名称 - 后端: 服务层、设置默认值、邮件模板、安装向导 - 数据库: 迁移脚本注释 - 保持功能完全一致,仅更改品牌名称 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
package service
|
|
|
|
import "time"
|
|
|
|
type Group struct {
|
|
ID int64
|
|
Name string
|
|
Description string
|
|
Platform string
|
|
RateMultiplier float64
|
|
IsExclusive bool
|
|
Status string
|
|
|
|
SubscriptionType string
|
|
DailyLimitUSD *float64
|
|
WeeklyLimitUSD *float64
|
|
MonthlyLimitUSD *float64
|
|
DefaultValidityDays int
|
|
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
|
|
AccountGroups []AccountGroup
|
|
AccountCount int64
|
|
}
|
|
|
|
func (g *Group) IsActive() bool {
|
|
return g.Status == StatusActive
|
|
}
|
|
|
|
func (g *Group) IsSubscriptionType() bool {
|
|
return g.SubscriptionType == SubscriptionTypeSubscription
|
|
}
|
|
|
|
func (g *Group) IsFreeSubscription() bool {
|
|
return g.IsSubscriptionType() && g.RateMultiplier == 0
|
|
}
|
|
|
|
func (g *Group) HasDailyLimit() bool {
|
|
return g.DailyLimitUSD != nil && *g.DailyLimitUSD > 0
|
|
}
|
|
|
|
func (g *Group) HasWeeklyLimit() bool {
|
|
return g.WeeklyLimitUSD != nil && *g.WeeklyLimitUSD > 0
|
|
}
|
|
|
|
func (g *Group) HasMonthlyLimit() bool {
|
|
return g.MonthlyLimitUSD != nil && *g.MonthlyLimitUSD > 0
|
|
}
|