refactor: update conf initialization and change Order field type

This commit is contained in:
v03413
2026-01-20 11:36:47 +08:00
parent 3541cc02c6
commit 8043da9eae
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package model
import (
"fmt"
"os"
"strings"
"sync"
"time"
@@ -107,7 +108,7 @@ func CheckoutCounter(host, id string) string {
func ConfInit() {
var hash = utils.StrSha256(utils.Md5String(time.Now().String()))
var secure = "/" + hash[:10]
var token = utils.Md5String(hash[18:28])
var token = strings.ToUpper(utils.Md5String(hash[18:28]))
var username = hash[10:20]
var password = hash[20:30]
var encrypt, _ = bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
+1 -1
View File
@@ -73,7 +73,7 @@ type Order struct {
NotifyNum int `gorm:"column:notify_num;type:int(11);not null;default:0;comment:回调次数" json:"notify_num"`
NotifyState int `gorm:"column:notify_state;type:tinyint(1);not null;default:0;comment:回调状态 1:成功 0:失败" json:"notify_state"`
RefHash string `gorm:"column:ref_hash;type:varchar(128);not null;default:'';index;comment:交易哈希" json:"ref_hash"`
RefBlockNum int64 `gorm:"column:ref_block_num;type:bigint(20);not null;default:0;comment:区块索引" json:"ref_block_num"`
RefBlockNum int64 `gorm:"column:ref_block_num;type:varchar(64);not null;default:0;comment:区块索引" json:"ref_block_num"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;not null;comment:失效时间" json:"expired_at"`
ConfirmedAt *time.Time `gorm:"column:confirmed_at;type:datetime;not null;comment:交易确认时间" json:"confirmed_at"`
AutoTimeAt