feat: add wechat pay

This commit is contained in:
Rogee
2025-01-14 14:42:08 +08:00
parent 52c17b63bb
commit 9cd7659d14
32 changed files with 1431 additions and 110 deletions

View File

@@ -15,6 +15,7 @@ type Medias struct {
ID int64 `sql:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
TenantID int64 `json:"tenant_id"`
UserID int64 `json:"user_id"`
PostID int64 `json:"post_id"`
StorageID int64 `json:"storage_id"`

View File

@@ -8,25 +8,26 @@
package model
import (
"backend/database/fields"
"time"
)
type Orders struct {
ID int64 `sql:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at"`
TenantID int64 `json:"tenant_id"`
UserID int64 `json:"user_id"`
Type int16 `json:"type"`
Status int16 `json:"status"`
OrderSerial string `json:"order_serial"`
RemoteOrderSerial string `json:"remote_order_serial"`
RefundSerial string `json:"refund_serial"`
RemoteRefundSerial string `json:"remote_refund_serial"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Title string `json:"title"`
Description *string `json:"description"`
Meta *string `json:"meta"`
ID int64 `sql:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at"`
TenantID int64 `json:"tenant_id"`
UserID int64 `json:"user_id"`
Type fields.OrderType `json:"type"`
Status fields.OrderStatus `json:"status"`
OrderSerial string `json:"order_serial"`
RemoteOrderSerial string `json:"remote_order_serial"`
RefundSerial string `json:"refund_serial"`
RemoteRefundSerial string `json:"remote_refund_serial"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Title string `json:"title"`
Description *string `json:"description"`
Meta fields.Json[fields.OrderMeta] `json:"meta"`
}

View File

@@ -18,7 +18,7 @@ type Posts struct {
DeletedAt *time.Time `json:"deleted_at"`
TenantID int64 `json:"tenant_id"`
UserID int64 `json:"user_id"`
HashID string `json:"hash_id"`
Hash string `json:"hash"`
Title string `json:"title"`
Description string `json:"description"`
Poster string `json:"poster"`

View File

@@ -0,0 +1,24 @@
//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//
package model
import (
"time"
)
type UserBoughtPosts struct {
ID int64 `sql:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
TenantID int64 `json:"tenant_id"`
UserID int64 `json:"user_id"`
PostID int64 `json:"post_id"`
Price int64 `json:"price"`
Discount int16 `json:"discount"`
Meta *string `json:"meta"`
}