feat: 添加租户创建功能,支持设置管理员及有效期,新增订单统计接口
This commit is contained in:
17
backend/app/http/super/dto/order.go
Normal file
17
backend/app/http/super/dto/order.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package dto
|
||||
|
||||
import "quyun/v2/pkg/consts"
|
||||
|
||||
type OrderStatisticsRow struct {
|
||||
Status consts.OrderStatus `json:"status"`
|
||||
StatusDescription string `json:"status_description"`
|
||||
|
||||
Count int64 `json:"count"`
|
||||
AmountPaidSum int64 `json:"amount_paid_sum"`
|
||||
}
|
||||
|
||||
type OrderStatisticsResponse struct {
|
||||
TotalCount int64 `json:"total_count"`
|
||||
TotalAmountPaidSum int64 `json:"total_amount_paid_sum"`
|
||||
ByStatus []*OrderStatisticsRow `json:"by_status"`
|
||||
}
|
||||
@@ -25,6 +25,14 @@ type TenantItem struct {
|
||||
StatusDescription string `json:"status_description"`
|
||||
}
|
||||
|
||||
type TenantCreateForm struct {
|
||||
Code string `json:"code" validate:"required,max=64"`
|
||||
Name string `json:"name" validate:"required,max=128"`
|
||||
AdminUserID int64 `json:"admin_user_id" validate:"required,gt=0"`
|
||||
// Duration 租户有效期(天),从“创建时刻”起算;与续期接口保持一致。
|
||||
Duration int `json:"duration" validate:"required,oneof=7 30 90 180 365"`
|
||||
}
|
||||
|
||||
type TenantExpireUpdateForm struct {
|
||||
Duration int `json:"duration" validate:"required,oneof=7 30 90 180 365"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user