// Copyright 2023 Anlity <leo@leocode.net>. All rights reserved.
// Use of this source code is governed by a AGPL v3.0 style
// license that can be found in the LICENSE file.

// ==========================================================================
// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
// ==========================================================================

package internal

import (
	"github.com/gogf/gf/database/gdb"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/frame/gmvc"
)

// PayFlowDao is the manager for logic model data accessing
// and custom defined data operations functions management.
type PayFlowDao struct {
	gmvc.M                 // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
	DB      gdb.DB         // DB is the raw underlying database management object.
	Table   string         // Table is the table name of the DAO.
	Columns payFlowColumns // Columns contains all the columns of Table that for convenient usage.
}

// PayFlowColumns defines and stores column names for table c_pay_flow.
type payFlowColumns struct {
	Id                string // ID
	FlowType          string // 记录类型 1商城订单
	TargetId          string // 目标ID
	ConfigPayId       string // 支付接口ID
	PayChannel        string // 支付渠道以支付接口为准
	OrderAmount       string // 订单原金额
	PayAmount         string // 实付金额
	Status            string // 状态 0已创建 1已支付 2支付失败 3已过期
	PaymentResponse   string // 调用接口返回内容
	PaymentFailReason string // 调用接口失败原因
	NotifyResponse    string // 接口回调原文
	NotifyFailReason  string // 回调失败原因
	CreatedAt         string // 创建时间
	UpdatedAt         string // 更新时间
	PaidAt            string // 支付时间
	DueExpireAt       string // 应到期时间
	ExpiredAt         string // 过期时间
}

func NewPayFlowDao() *PayFlowDao {
	return &PayFlowDao{
		M:     g.DB("default").Model("c_pay_flow").Safe(),
		DB:    g.DB("default"),
		Table: "c_pay_flow",
		Columns: payFlowColumns{
			Id:                "id",
			FlowType:          "flow_type",
			TargetId:          "target_id",
			ConfigPayId:       "config_pay_id",
			PayChannel:        "pay_channel",
			OrderAmount:       "order_amount",
			PayAmount:         "pay_amount",
			Status:            "status",
			PaymentResponse:   "payment_response",
			PaymentFailReason: "payment_fail_reason",
			NotifyResponse:    "notify_response",
			NotifyFailReason:  "notify_fail_reason",
			CreatedAt:         "created_at",
			UpdatedAt:         "updated_at",
			PaidAt:            "paid_at",
			DueExpireAt:       "due_expire_at",
			ExpiredAt:         "expired_at",
		},
	}
}
