mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2025-09-16 01:13:51 +08:00
由gopath形式改为module
This commit is contained in:
39
legend/models/fast/Account.go
Normal file
39
legend/models/fast/Account.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package fast
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type RpAccount struct {
|
||||
Id string `orm:"pk;column(id)"`
|
||||
CreateTime string
|
||||
EditTime string
|
||||
Version int
|
||||
Remark string
|
||||
AccountNo string
|
||||
Balance float64
|
||||
Unbalance float64
|
||||
SecurityMoney float64
|
||||
Status string
|
||||
TotalIncome float64
|
||||
TodayIncome float64
|
||||
SettAmount float64
|
||||
UserNo string
|
||||
AmountFrozen float64
|
||||
}
|
||||
|
||||
func (c *RpAccount) TableName() string {
|
||||
return "rp_account"
|
||||
}
|
||||
|
||||
func GetAccontInfo(userNo string) *RpAccount {
|
||||
o := orm.NewOrm()
|
||||
|
||||
rpAccount := new(RpAccount)
|
||||
if _, err := o.QueryTable("rp_account").Filter("user_no", userNo).All(rpAccount); err != nil {
|
||||
logs.Error("获取account信息失败:", err)
|
||||
}
|
||||
|
||||
return rpAccount
|
||||
}
|
44
legend/models/fast/UserBankAccount.go
Normal file
44
legend/models/fast/UserBankAccount.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package fast
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type RpUserBankAccount struct {
|
||||
Id string `orm:"pk;column(id)"`
|
||||
CreateTime string
|
||||
EditTime string
|
||||
Version string
|
||||
Remark string
|
||||
Status string
|
||||
UserNo string
|
||||
BankName string
|
||||
BankCode string
|
||||
BankAccountName string
|
||||
BankAccountNo string
|
||||
CardType string
|
||||
CardNo string
|
||||
MobileNo string
|
||||
IsDefault string
|
||||
Province string
|
||||
City string
|
||||
Areas string
|
||||
Street string
|
||||
BankAccountType string
|
||||
}
|
||||
|
||||
func (c *RpUserBankAccount) TableName() string {
|
||||
return "rp_user_bank_account"
|
||||
}
|
||||
|
||||
func GetBankInfoByUserNo(userNo string) *RpUserBankAccount {
|
||||
o := orm.NewOrm()
|
||||
userBankAccount := new(RpUserBankAccount)
|
||||
if _, err := o.QueryTable("rp_user_bank_account").
|
||||
Filter("user_no", userNo).
|
||||
All(userBankAccount); err != nil {
|
||||
logs.Error("获取用户银行卡信息失败:", err)
|
||||
}
|
||||
return userBankAccount
|
||||
}
|
58
legend/models/fast/UserInfo.go
Normal file
58
legend/models/fast/UserInfo.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package fast
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type RpUserInfo struct {
|
||||
Id string `orm:"pk;column(id)"`
|
||||
CreateTime string
|
||||
Status string
|
||||
UserNo string
|
||||
UserName string
|
||||
AccountNo string
|
||||
Mobile string
|
||||
Password string
|
||||
PayPwd string
|
||||
LastSmsVerifyCodeTime string
|
||||
Email string
|
||||
Ips string
|
||||
}
|
||||
|
||||
func (c *RpUserInfo) TableName() string {
|
||||
return "rp_user_info"
|
||||
|
||||
}
|
||||
|
||||
func tableName() string {
|
||||
return "rp_user_info"
|
||||
}
|
||||
|
||||
func GetUserInfoByUserName(userName string) *RpUserInfo {
|
||||
|
||||
o := orm.NewOrm()
|
||||
userInfo := new(RpUserInfo)
|
||||
|
||||
_, err := o.QueryTable(tableName()).Filter("mobile", userName).All(userInfo)
|
||||
|
||||
if err != nil {
|
||||
logs.Error("根据用户名从数据获取用户信息失败:", err)
|
||||
}
|
||||
|
||||
return userInfo
|
||||
}
|
||||
|
||||
/**
|
||||
** 更新用户信息
|
||||
*/
|
||||
func UpdateUserInfo(userInfo *RpUserInfo) bool {
|
||||
o := orm.NewOrm()
|
||||
|
||||
if _, err := o.Update(userInfo); err != nil {
|
||||
logs.Error("更新用户信息失败,错误:%s", err)
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
34
legend/models/fast/UserPayConfig.go
Normal file
34
legend/models/fast/UserPayConfig.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package fast
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type RpUserPayConfig struct {
|
||||
Id string `orm:"pk;column(id)"`
|
||||
UserNo string
|
||||
UserName string
|
||||
Status string
|
||||
PayKey string
|
||||
PaySecret string
|
||||
}
|
||||
|
||||
func (c *RpUserPayConfig) TableName() string {
|
||||
return "rp_user_pay_config"
|
||||
}
|
||||
|
||||
func getTableName() string {
|
||||
return "rp_user_pay_config"
|
||||
}
|
||||
|
||||
func GetUserPayConfigByUserNo(userNo string) *RpUserPayConfig {
|
||||
o := orm.NewOrm()
|
||||
userPayConfig := new(RpUserPayConfig)
|
||||
_, err := o.QueryTable(getTableName()).Filter("user_no", userNo).All(userPayConfig)
|
||||
if err != nil {
|
||||
logs.Error("获取用户支付配置错误:", err)
|
||||
}
|
||||
|
||||
return userPayConfig
|
||||
}
|
Reference in New Issue
Block a user