feat: add tenant admin invite management, ledger overview, order details, and order management features
- Implemented Invite management with creation, searching, and disabling functionalities. - Added Ledger overview for financial transactions with filtering options. - Developed Order Detail view for individual order insights and refund capabilities. - Created Orders management page with search, reset, and pagination features. - Enhanced user experience with toast notifications for actions and error handling.
This commit is contained in:
16
backend/app/http/web/dto/auth.go
Normal file
16
backend/app/http/web/dto/auth.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package dto
|
||||
|
||||
// LoginForm 平台侧用户登录表单(用于获取 JWT 访问凭证)。
|
||||
// 注意:此登录是“用户身份”登录(非超级管理员),用于进入租户管理后台前的身份校验与租户列表查询。
|
||||
type LoginForm struct {
|
||||
// Username 用户名;必须与数据库 users.username 精确匹配。
|
||||
Username string `json:"username,omitempty"`
|
||||
// Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// LoginResponse 登录响应。
|
||||
type LoginResponse struct {
|
||||
// Token JWT 访问令牌;前端应以 `Authorization: Bearer <token>` 方式携带。
|
||||
Token string `json:"token"`
|
||||
}
|
||||
51
backend/app/http/web/dto/me.go
Normal file
51
backend/app/http/web/dto/me.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"quyun/v2/pkg/consts"
|
||||
|
||||
"go.ipao.vip/gen/types"
|
||||
)
|
||||
|
||||
// MeResponse 当前登录用户信息(脱敏)。
|
||||
type MeResponse struct {
|
||||
// ID 用户ID(全局唯一)。
|
||||
ID int64 `json:"id"`
|
||||
// Username 用户名。
|
||||
Username string `json:"username"`
|
||||
// Roles 用户全局角色数组(如 user/super_admin 等)。
|
||||
Roles types.Array[consts.Role] `json:"roles"`
|
||||
// Status 用户状态(active/verified/banned 等)。
|
||||
Status consts.UserStatus `json:"status"`
|
||||
// StatusDescription 用户状态描述(便于前端展示)。
|
||||
StatusDescription string `json:"status_description"`
|
||||
// CreatedAt 用户创建时间。
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// UpdatedAt 用户更新时间。
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// MyTenantItem 当前用户可进入的租户条目(用于“选择租户进入后台”页面)。
|
||||
type MyTenantItem struct {
|
||||
// TenantID 租户ID(数值型主键)。
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
// TenantCode 租户Code(路由使用:/t/:tenantCode/...)。
|
||||
TenantCode string `json:"tenant_code"`
|
||||
// TenantName 租户名称。
|
||||
TenantName string `json:"tenant_name"`
|
||||
// TenantStatus 租户状态(pending/verified/expired 等)。
|
||||
TenantStatus consts.TenantStatus `json:"tenant_status"`
|
||||
// TenantStatusDescription 租户状态描述(便于前端展示)。
|
||||
TenantStatusDescription string `json:"tenant_status_description"`
|
||||
|
||||
// IsOwner 是否为租户Owner(tenants.user_id == 当前用户)。
|
||||
// 说明:Owner 通常也在 tenant_users 里具备 tenant_admin 角色,但此字段更直观。
|
||||
IsOwner bool `json:"is_owner"`
|
||||
// MemberRoles 当前用户在该租户下的角色(tenant_admin/member 等)。
|
||||
MemberRoles types.Array[consts.TenantUserRole] `json:"member_roles"`
|
||||
// MemberStatus 当前用户在该租户下的成员状态。
|
||||
MemberStatus consts.UserStatus `json:"member_status"`
|
||||
// JoinedAt 加入租户时间(tenant_users.created_at)。
|
||||
JoinedAt time.Time `json:"joined_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user