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

64 lines
2.9 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"
)
// WithdrawStatus 提现状态
const (
WithdrawStatusPending = 1 // 待审核
WithdrawStatusApproved = 2 // 已通过
WithdrawStatusRejected = 3 // 已拒绝
)
// Withdraw 提现记录
type Withdraw struct {
ID string `bson:"_id"` // 提现ID
UserID string `bson:"user_id"` // 用户ID
Amount int64 `bson:"amount"` // 提现金额(单位:分)
WithdrawAccount string `bson:"withdraw_account"` // 提现账号
Status int32 `bson:"status"` // 审核状态1-待审核2-已通过3-已拒绝
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"` // 应用版本
CreateTime time.Time `bson:"create_time"` // 创建时间
UpdateTime time.Time `bson:"update_time"` // 更新时间
}
func (Withdraw) TableName() string {
return "withdraws"
}
type WithdrawInterface interface {
Create(ctx context.Context, withdraws ...*Withdraw) error
Take(ctx context.Context, withdrawID string) (*Withdraw, error)
FindByUserID(ctx context.Context, userID string, pagination pagination.Pagination) (int64, []*Withdraw, error)
FindByStatus(ctx context.Context, status int32, pagination pagination.Pagination) (int64, []*Withdraw, error)
UpdateStatus(ctx context.Context, withdrawID string, status int32, auditorID string, auditRemark string) error
Page(ctx context.Context, pagination pagination.Pagination) (int64, []*Withdraw, error)
}