mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-21 15:09:21 +00:00
Replace iframe-based external payment with native implementation: Backend (Go): - 5 new Ent schemas: PaymentOrder, PaymentAuditLog, PaymentChannel, SubscriptionPlan, PaymentProviderInstance - 5 SQL migrations (090-094) - Payment provider interface + registry + load balancer - 4 provider implementations (EasyPay, Alipay, WxPay, Stripe) - PaymentService (order lifecycle, fulfillment, refund 3-phase) - PaymentConfigService (settings, instance/channel/plan CRUD) - 31 API endpoints (9 user + 4 webhook + 18 admin) - Wire DI integration Frontend (Vue3): - Payment types, API modules, store, router changes - Sidebar: payment_enabled controls visibility, new menu items - User pages: PaymentView (replace iframe), QR payment, Stripe, result page, order list - Admin pages: Order management (4 tabs), provider instance mgmt - Settings: new payment tab, removed old purchase iframe config - i18n: full payment namespace (en + zh) Docs: - PAYMENT_FRONTEND_MIGRATION_PLAN.md - PAYMENT_BACKEND_MIGRATION_PLAN.md - PAYMENT_IMPLEMENTATION_ROADMAP.md
157 lines
5.6 KiB
Go
157 lines
5.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package paymentchannel
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the paymentchannel type in the database.
|
|
Label = "payment_channel"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldGroupID holds the string denoting the group_id field in the database.
|
|
FieldGroupID = "group_id"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldPlatform holds the string denoting the platform field in the database.
|
|
FieldPlatform = "platform"
|
|
// FieldRateMultiplier holds the string denoting the rate_multiplier field in the database.
|
|
FieldRateMultiplier = "rate_multiplier"
|
|
// FieldDescription holds the string denoting the description field in the database.
|
|
FieldDescription = "description"
|
|
// FieldModels holds the string denoting the models field in the database.
|
|
FieldModels = "models"
|
|
// FieldFeatures holds the string denoting the features field in the database.
|
|
FieldFeatures = "features"
|
|
// FieldSortOrder holds the string denoting the sort_order field in the database.
|
|
FieldSortOrder = "sort_order"
|
|
// FieldEnabled holds the string denoting the enabled field in the database.
|
|
FieldEnabled = "enabled"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// Table holds the table name of the paymentchannel in the database.
|
|
Table = "payment_channels"
|
|
)
|
|
|
|
// Columns holds all SQL columns for paymentchannel fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldGroupID,
|
|
FieldName,
|
|
FieldPlatform,
|
|
FieldRateMultiplier,
|
|
FieldDescription,
|
|
FieldModels,
|
|
FieldFeatures,
|
|
FieldSortOrder,
|
|
FieldEnabled,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
NameValidator func(string) error
|
|
// DefaultPlatform holds the default value on creation for the "platform" field.
|
|
DefaultPlatform string
|
|
// PlatformValidator is a validator for the "platform" field. It is called by the builders before save.
|
|
PlatformValidator func(string) error
|
|
// DefaultRateMultiplier holds the default value on creation for the "rate_multiplier" field.
|
|
DefaultRateMultiplier float64
|
|
// DefaultDescription holds the default value on creation for the "description" field.
|
|
DefaultDescription string
|
|
// DefaultModels holds the default value on creation for the "models" field.
|
|
DefaultModels string
|
|
// DefaultFeatures holds the default value on creation for the "features" field.
|
|
DefaultFeatures string
|
|
// DefaultSortOrder holds the default value on creation for the "sort_order" field.
|
|
DefaultSortOrder int
|
|
// DefaultEnabled holds the default value on creation for the "enabled" field.
|
|
DefaultEnabled bool
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the PaymentChannel queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByGroupID orders the results by the group_id field.
|
|
func ByGroupID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldGroupID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByName orders the results by the name field.
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPlatform orders the results by the platform field.
|
|
func ByPlatform(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPlatform, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRateMultiplier orders the results by the rate_multiplier field.
|
|
func ByRateMultiplier(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRateMultiplier, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDescription orders the results by the description field.
|
|
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDescription, opts...).ToFunc()
|
|
}
|
|
|
|
// ByModels orders the results by the models field.
|
|
func ByModels(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldModels, opts...).ToFunc()
|
|
}
|
|
|
|
// ByFeatures orders the results by the features field.
|
|
func ByFeatures(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFeatures, opts...).ToFunc()
|
|
}
|
|
|
|
// BySortOrder orders the results by the sort_order field.
|
|
func BySortOrder(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSortOrder, opts...).ToFunc()
|
|
}
|
|
|
|
// ByEnabled orders the results by the enabled field.
|
|
func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEnabled, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|