Files
chat-deploy/pkg/common/db/table/chat/withdraw_application.go
kim.dev.6789 b7f8db7d08 复制项目
2026-01-14 22:35:45 +08:00

69 lines
3.6 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright © 2023 OpenIM open source community. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package chat
import (
"context"
"time"
"github.com/openimsdk/tools/db/pagination"
)
// WithdrawApplicationStatus 提现申请状态
const (
WithdrawApplicationStatusPending = 1 // 待审核
WithdrawApplicationStatusApproved = 2 // 已通过
WithdrawApplicationStatusRejected = 3 // 已拒绝
WithdrawApplicationStatusProcessing = 4 // 处理中
WithdrawApplicationStatusCompleted = 5 // 已完成
)
// WithdrawApplication 提现申请
type WithdrawApplication struct {
ID string `bson:"_id"` // 申请ID
UserID string `bson:"user_id"` // 用户ID
Amount int64 `bson:"amount"` // 提现金额(单位:分)
WithdrawAccount string `bson:"withdraw_account"` // 提现账号
WithdrawAccountType int32 `bson:"withdraw_account_type"` // 提现账号类型1-支付宝2-微信3-银行卡
Status int32 `bson:"status"` // 申请状态1-待审核2-已通过3-已拒绝4-处理中5-已完成
AuditorID string `bson:"auditor_id"` // 审核人ID管理员ID
AuditTime time.Time `bson:"audit_time"` // 审核时间
AuditRemark string `bson:"audit_remark"` // 审核备注
IP string `bson:"ip"` // 申请IP
DeviceID string `bson:"device_id"` // 设备ID
Platform string `bson:"platform"` // 平台iOS、Android、Web等
DeviceModel string `bson:"device_model"` // 设备型号iPhone 14 Pro、Samsung Galaxy S23等
DeviceBrand string `bson:"device_brand"` // 设备品牌Apple、Samsung、Huawei等
OSVersion string `bson:"os_version"` // 操作系统版本iOS 17.0、Android 13等
AppVersion string `bson:"app_version"` // 应用版本
Remark string `bson:"remark"` // 申请备注
CreateTime time.Time `bson:"create_time"` // 创建时间
UpdateTime time.Time `bson:"update_time"` // 更新时间
}
func (WithdrawApplication) TableName() string {
return "withdraw_applications"
}
type WithdrawApplicationInterface interface {
Create(ctx context.Context, applications ...*WithdrawApplication) error
Take(ctx context.Context, applicationID string) (*WithdrawApplication, error)
FindByUserID(ctx context.Context, userID string, pagination pagination.Pagination) (int64, []*WithdrawApplication, error)
FindByStatus(ctx context.Context, status int32, pagination pagination.Pagination) (int64, []*WithdrawApplication, error)
UpdateStatus(ctx context.Context, applicationID string, status int32, auditorID string, auditRemark string) error
Page(ctx context.Context, pagination pagination.Pagination) (int64, []*WithdrawApplication, error)
Update(ctx context.Context, applicationID string, data map[string]any) error
}