This commit is contained in:
孟帅
2023-05-10 23:54:50 +08:00
parent bbe655a4d8
commit 49a96750bf
314 changed files with 15138 additions and 6244 deletions

View File

@@ -115,6 +115,48 @@ type SmsConfig struct {
TencentTemplate []*SmsTemplate `json:"smsTencentTemplate"`
}
type PayConfig struct {
Debug bool `json:"payDebug"`
// 支付宝
AliPayAppId string `json:"payAliPayAppId"`
AliPayPrivateKey string `json:"payAliPayPrivateKey"`
AliPayAppCertPublicKey string `json:"payAliPayAppCertPublicKey"`
AliPayRootCert string `json:"payAliPayRootCert"`
AliPayCertPublicKeyRSA2 string `json:"payAliPayCertPublicKeyRSA2"`
// 微信支付
WxPayAppId string `json:"payWxPayAppId"`
WxPayMchId string `json:"payWxPayMchId"`
WxPaySerialNo string `json:"payWxPaySerialNo"`
WxPayAPIv3Key string `json:"payWxPayAPIv3Key"`
WxPayPrivateKey string `json:"payWxPayPrivateKey"`
// QQ支付
QQPayAppId string `json:"payQQPayAppId"`
QQPayMchId string `json:"payQQPayMchId"`
QQPayApiKey string `json:"payQQPayApiKey"`
}
// WechatOfficialAccountConfig 微信公众号配置
type WechatOfficialAccountConfig struct {
OfficialAppID string `json:"officialAccountAppId"` // appid
OfficialAppSecret string `json:"officialAccountAppSecret"` // app secret
OfficialToken string `json:"officialAccountToken"` // token
OfficialEncodingAESKey string `json:"officialAccountEncodingAESKey"` // EncodingAESKey
}
// WechatOpenPlatformConfig 微信开放平台配置
type WechatOpenPlatformConfig struct {
OpenAppID string `json:"openPlatformAppId"` // appid
OpenAppSecret string `json:"openPlatformAppSecret"` // app secret
OpenToken string `json:"openPlatformToken"` // token
OpenEncodingAESKey string `json:"openPlatformEncodingAESKey"` // EncodingAESKey
}
// WechatConfig 微信配置
type WechatConfig struct {
*WechatOfficialAccountConfig
*WechatOpenPlatformConfig
}
///////////// 以下是本地配置
// SSLConfig https配置
@@ -201,3 +243,25 @@ type CacheConfig struct {
Adapter string `json:"adapter"`
FileDir string `json:"fileDir"`
}
type TCPServerConfig struct {
Address string `json:"address"`
}
type TCPClientConfig struct {
Cron *TCPClientConnConfig `json:"cron"`
Auth *TCPClientConnConfig `json:"auth"`
}
type TCPClientConnConfig struct {
Group string `json:"group"`
Name string `json:"name"`
Address string `json:"address"`
AppId string `json:"appId"`
SecretKey string `json:"secretKey"`
}
type TCPConfig struct {
Server *TCPServerConfig `json:"server"`
Client *TCPClientConfig `json:"client"`
}

View File

@@ -11,12 +11,11 @@ import (
// Context 请求上下文结构
type Context struct {
Module string // 应用模块 adminapihomewebsocket
AddonName string // 插件名称 如果不是插件模块请求,可能为空
TakeUpTime int64 // 请求耗时 ms
User *Identity // 上下文用户信息
Response *Response // 请求响应
Data g.Map // 自定kv变量 业务模块根据需要设置,不固定
Module string // 应用模块 adminapihomewebsocket
AddonName string // 插件名称 如果不是插件模块请求,可能为空
User *Identity // 上下文用户信息
Response *Response // 请求响应
Data g.Map // 自定kv变量 业务模块根据需要设置,不固定
}
// Identity 通用身份模型

View File

@@ -0,0 +1,25 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// AdminCash is the golang structure of table hg_admin_cash for DAO operations like Where/Data.
type AdminCash struct {
g.Meta `orm:"table:hg_admin_cash, do:true"`
Id interface{} // ID
MemberId interface{} // 管理员ID
Money interface{} // 提现金额
Fee interface{} // 手续费
LastMoney interface{} // 最终到账金额
Ip interface{} // 申请人IP
Status interface{} // 状态码
Msg interface{} // 处理结果
HandleAt *gtime.Time // 处理时间
CreatedAt *gtime.Time // 申请时间
}

View File

@@ -0,0 +1,30 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// AdminCreditsLog is the golang structure of table hg_admin_credits_log for DAO operations like Where/Data.
type AdminCreditsLog struct {
g.Meta `orm:"table:hg_admin_credits_log, do:true"`
Id interface{} // 变动ID
MemberId interface{} // 管理员ID
AppId interface{} // 应用id
AddonsName interface{} // 插件名称
CreditType interface{} // 变动类型
CreditGroup interface{} // 变动组别
BeforeNum interface{} // 变动前
Num interface{} // 变动数据
AfterNum interface{} // 变动后
Remark interface{} // 备注
Ip interface{} // 操作人IP
MapId interface{} // 关联ID
Status interface{} // 状态
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 修改时间
}

View File

@@ -22,6 +22,7 @@ type AdminMember struct {
Salt interface{} // 密码盐
AuthKey interface{} // 授权令牌
PasswordResetToken interface{} // 密码重置令牌
Integral interface{} // 积分
Balance interface{} // 余额
Avatar interface{} // 头像
Sex interface{} // 性别

View File

@@ -0,0 +1,30 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// AdminOauth is the golang structure of table hg_admin_oauth for DAO operations like Where/Data.
type AdminOauth struct {
g.Meta `orm:"table:hg_admin_oauth, do:true"`
Id interface{} // 主键
MemberId interface{} // 用户ID
Unionid interface{} // 唯一ID
OauthClient interface{} // 授权组别
OauthOpenid interface{} // 授权开放ID
Sex interface{} // 性别
Nickname interface{} // 昵称
HeadPortrait interface{} // 头像
Birthday *gtime.Time // 生日
Country interface{} // 国家
Province interface{} // 省
City interface{} // 市
Status interface{} // 状态
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 修改时间
}

View File

@@ -0,0 +1,27 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// AdminOrder is the golang structure of table hg_admin_order for DAO operations like Where/Data.
type AdminOrder struct {
g.Meta `orm:"table:hg_admin_order, do:true"`
Id interface{} // 主键
MemberId interface{} // 管理员id
OrderType interface{} // 订单类型
ProductId interface{} // 产品id
OrderSn interface{} // 关联订单号
Money interface{} // 充值金额
Remark interface{} // 备注
RefundReason interface{} // 退款原因
RejectRefundReason interface{} // 拒绝退款原因
Status interface{} // 状态
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 修改时间
}

View File

@@ -0,0 +1,46 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// PayLog is the golang structure of table hg_pay_log for DAO operations like Where/Data.
type PayLog struct {
g.Meta `orm:"table:hg_pay_log, do:true"`
Id interface{} // 主键
MemberId interface{} // 会员ID
AppId interface{} // 应用ID
AddonsName interface{} // 插件名称
OrderSn interface{} // 关联订单号
OrderGroup interface{} // 组别[默认统一支付类型]
Openid interface{} // openid
MchId interface{} // 商户支付账户
Subject interface{} // 订单标题
Detail *gjson.Json // 支付商品详情
AuthCode interface{} // 刷卡码
OutTradeNo interface{} // 商户订单号
TransactionId interface{} // 交易号
PayType interface{} // 支付类型
PayAmount interface{} // 支付金额
ActualAmount interface{} // 实付金额
PayStatus interface{} // 支付状态
PayAt *gtime.Time // 支付时间
TradeType interface{} // 交易类型
RefundSn interface{} // 退款单号
IsRefund interface{} // 是否退款
Custom interface{} // 自定义参数
CreateIp interface{} // 创建者IP
PayIp interface{} // 支付者IP
NotifyUrl interface{} // 支付通知回调地址
ReturnUrl interface{} // 买家付款成功跳转地址
TraceIds *gjson.Json // 链路ID集合
Status interface{} // 状态
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 修改时间
}

View File

@@ -0,0 +1,28 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// PayRefund is the golang structure of table hg_pay_refund for DAO operations like Where/Data.
type PayRefund struct {
g.Meta `orm:"table:hg_pay_refund, do:true"`
Id interface{} // 主键ID
MemberId interface{} // 会员ID
AppId interface{} // 应用ID
OrderSn interface{} // 业务订单号
RefundTradeNo interface{} // 退款交易号
RefundMoney interface{} // 退款金额
RefundWay interface{} // 退款方式
Ip interface{} // 申请者IP
Reason interface{} // 申请退款原因
Remark interface{} // 退款备注
Status interface{} // 退款状态
CreatedAt *gtime.Time // 申请时间
UpdatedAt *gtime.Time // 更新时间
}

View File

@@ -0,0 +1,23 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// AdminCash is the golang structure for table admin_cash.
type AdminCash struct {
Id int64 `json:"id" description:"ID"`
MemberId int64 `json:"memberId" description:"管理员ID"`
Money float64 `json:"money" description:"提现金额"`
Fee float64 `json:"fee" description:"手续费"`
LastMoney float64 `json:"lastMoney" description:"最终到账金额"`
Ip string `json:"ip" description:"申请人IP"`
Status int64 `json:"status" description:"状态码"`
Msg string `json:"msg" description:"处理结果"`
HandleAt *gtime.Time `json:"handleAt" description:"处理时间"`
CreatedAt *gtime.Time `json:"createdAt" description:"申请时间"`
}

View File

@@ -0,0 +1,28 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// AdminCreditsLog is the golang structure for table admin_credits_log.
type AdminCreditsLog struct {
Id int64 `json:"id" description:"变动ID"`
MemberId int64 `json:"memberId" description:"管理员ID"`
AppId string `json:"appId" description:"应用id"`
AddonsName string `json:"addonsName" description:"插件名称"`
CreditType string `json:"creditType" description:"变动类型"`
CreditGroup string `json:"creditGroup" description:"变动组别"`
BeforeNum float64 `json:"beforeNum" description:"变动前"`
Num float64 `json:"num" description:"变动数据"`
AfterNum float64 `json:"afterNum" description:"变动后"`
Remark string `json:"remark" description:"备注"`
Ip string `json:"ip" description:"操作人IP"`
MapId int64 `json:"mapId" description:"关联ID"`
Status int `json:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
}

View File

@@ -20,6 +20,7 @@ type AdminMember struct {
Salt string `json:"salt" description:"密码盐"`
AuthKey string `json:"authKey" description:"授权令牌"`
PasswordResetToken string `json:"passwordResetToken" description:"密码重置令牌"`
Integral float64 `json:"integral" description:"积分"`
Balance float64 `json:"balance" description:"余额"`
Avatar string `json:"avatar" description:"头像"`
Sex int `json:"sex" description:"性别"`

View File

@@ -0,0 +1,28 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// AdminOauth is the golang structure for table admin_oauth.
type AdminOauth struct {
Id int64 `json:"id" description:"主键"`
MemberId int64 `json:"memberId" description:"用户ID"`
Unionid string `json:"unionid" description:"唯一ID"`
OauthClient string `json:"oauthClient" description:"授权组别"`
OauthOpenid string `json:"oauthOpenid" description:"授权开放ID"`
Sex int `json:"sex" description:"性别"`
Nickname string `json:"nickname" description:"昵称"`
HeadPortrait string `json:"headPortrait" description:"头像"`
Birthday *gtime.Time `json:"birthday" description:"生日"`
Country string `json:"country" description:"国家"`
Province string `json:"province" description:"省"`
City string `json:"city" description:"市"`
Status int `json:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
}

View File

@@ -0,0 +1,25 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// AdminOrder is the golang structure for table admin_order.
type AdminOrder struct {
Id int64 `json:"id" description:"主键"`
MemberId int64 `json:"memberId" description:"管理员id"`
OrderType string `json:"orderType" description:"订单类型"`
ProductId int64 `json:"productId" description:"产品id"`
OrderSn string `json:"orderSn" description:"关联订单号"`
Money float64 `json:"money" description:"充值金额"`
Remark string `json:"remark" description:"备注"`
RefundReason string `json:"refundReason" description:"退款原因"`
RejectRefundReason string `json:"rejectRefundReason" description:"拒绝退款原因"`
Status int `json:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
}

View File

@@ -0,0 +1,44 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/os/gtime"
)
// PayLog is the golang structure for table pay_log.
type PayLog struct {
Id int64 `json:"id" description:"主键"`
MemberId int64 `json:"memberId" description:"会员ID"`
AppId string `json:"appId" description:"应用ID"`
AddonsName string `json:"addonsName" description:"插件名称"`
OrderSn string `json:"orderSn" description:"关联订单号"`
OrderGroup string `json:"orderGroup" description:"组别[默认统一支付类型]"`
Openid string `json:"openid" description:"openid"`
MchId string `json:"mchId" description:"商户支付账户"`
Subject string `json:"subject" description:"订单标题"`
Detail *gjson.Json `json:"detail" description:"支付商品详情"`
AuthCode string `json:"authCode" description:"刷卡码"`
OutTradeNo string `json:"outTradeNo" description:"商户订单号"`
TransactionId string `json:"transactionId" description:"交易号"`
PayType string `json:"payType" description:"支付类型"`
PayAmount float64 `json:"payAmount" description:"支付金额"`
ActualAmount float64 `json:"actualAmount" description:"实付金额"`
PayStatus int `json:"payStatus" description:"支付状态"`
PayAt *gtime.Time `json:"payAt" description:"支付时间"`
TradeType string `json:"tradeType" description:"交易类型"`
RefundSn string `json:"refundSn" description:"退款单号"`
IsRefund int `json:"isRefund" description:"是否退款"`
Custom string `json:"custom" description:"自定义参数"`
CreateIp string `json:"createIp" description:"创建者IP"`
PayIp string `json:"payIp" description:"支付者IP"`
NotifyUrl string `json:"notifyUrl" description:"支付通知回调地址"`
ReturnUrl string `json:"returnUrl" description:"买家付款成功跳转地址"`
TraceIds *gjson.Json `json:"traceIds" description:"链路ID集合"`
Status int `json:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
}

View File

@@ -0,0 +1,26 @@
// =================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// PayRefund is the golang structure for table pay_refund.
type PayRefund struct {
Id uint64 `json:"id" description:"主键ID"`
MemberId int64 `json:"memberId" description:"会员ID"`
AppId string `json:"appId" description:"应用ID"`
OrderSn string `json:"orderSn" description:"业务订单号"`
RefundTradeNo string `json:"refundTradeNo" description:"退款交易号"`
RefundMoney float64 `json:"refundMoney" description:"退款金额"`
RefundWay int `json:"refundWay" description:"退款方式"`
Ip string `json:"ip" description:"申请者IP"`
Reason string `json:"reason" description:"申请退款原因"`
Remark string `json:"remark" description:"退款备注"`
Status int `json:"status" description:"退款状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"申请时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
}

View File

@@ -0,0 +1,49 @@
// Package adminin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package adminin
import (
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// CashViewInp 获取信息
type CashViewInp struct {
Id int64 `json:"id" v:"required#提现ID不能为空" dc:"提现ID"`
}
type CashViewModel struct {
entity.AdminCash
MemberCash
}
// CashListInp 获取列表
type CashListInp struct {
form.PageReq
form.RangeDateReq
form.StatusReq
MemberId int64 `json:"memberId"`
CreatedAt []int64 `json:"created_at"`
}
type CashListModel struct {
MemberUser string `json:"memberUser"`
MemberName string `json:"memberName"`
entity.AdminCash
}
// CashApplyInp 申请提现
type CashApplyInp struct {
Money float64 `json:"money" description:"提现金额"`
MemberId int64
}
// CashPaymentInp 提现打款处理
type CashPaymentInp struct {
Id int64 `json:"id" description:"ID"`
Status int64 `json:"status" description:"状态码"`
Msg string `json:"msg" description:"处理结果"`
}

View File

@@ -0,0 +1,153 @@
// Package adminin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.5.3
// @AutoGenerate Date 2023-04-15 15:59:58
package adminin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/net/ghttp"
"hotgo/internal/consts"
"hotgo/internal/library/contexts"
"hotgo/internal/library/location"
"hotgo/internal/model/input/form"
"github.com/gogf/gf/v2/os/gtime"
)
// CreditsLogSaveBalanceInp 更新余额
type CreditsLogSaveBalanceInp struct {
MemberId int64 `json:"memberId" dc:"管理员ID"`
AppId string `json:"appId" dc:"应用id"`
AddonsName string `json:"addonsName" description:"插件名称"`
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
Num float64 `json:"num" dc:"变动数据"`
Ip string `json:"ip" description:"操作人IP"`
MapId int64 `json:"mapId" dc:"关联ID"`
Remark string `json:"remark" dc:"备注"`
}
func (in *CreditsLogSaveBalanceInp) Filter(ctx context.Context) (err error) {
if in.Num == 0 {
err = gerror.New("更新余额不能为0")
}
if in.AppId == "" {
in.AppId = contexts.GetModule(ctx)
}
if in.CreditGroup == "" {
if in.Num > 0 {
in.CreditGroup = consts.CreditGroupIncr
} else {
in.CreditGroup = consts.CreditGroupDecr
}
}
if in.Ip == "" {
in.Ip = location.GetClientIp(ghttp.RequestFromCtx(ctx))
}
return
}
type CreditsLogSaveBalanceModel struct {
}
// CreditsLogSaveIntegralInp 更新积分
type CreditsLogSaveIntegralInp struct {
MemberId int64 `json:"memberId" dc:"管理员ID"`
AppId string `json:"appId" dc:"应用id"`
AddonsName string `json:"addonsName" description:"插件名称"`
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
Num float64 `json:"num" dc:"变动数据"`
Ip string `json:"ip" description:"操作人IP"`
MapId int64 `json:"mapId" dc:"关联ID"`
Remark string `json:"remark" dc:"备注"`
}
func (in *CreditsLogSaveIntegralInp) Filter(ctx context.Context) (err error) {
if in.Num == 0 {
err = gerror.New("更新积分不能为0")
}
if in.AppId == "" {
in.AppId = contexts.GetModule(ctx)
}
if in.CreditGroup == "" {
if in.Num > 0 {
in.CreditGroup = consts.CreditGroupIncr
} else {
in.CreditGroup = consts.CreditGroupDecr
}
}
if in.Ip == "" {
in.Ip = location.GetClientIp(ghttp.RequestFromCtx(ctx))
}
return
}
type CreditsLogSaveIntegralModel struct {
}
// CreditsLogListInp 获取资产变动列表
type CreditsLogListInp struct {
form.PageReq
Id int64 `json:"id" dc:"变动ID"`
MemberId int64 `json:"memberId" dc:"管理员ID"`
AppId string `json:"appId" dc:"应用id"`
CreditType string `json:"creditType" dc:"变动类型"`
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
Remark string `json:"remark" dc:"备注"`
Ip string `json:"ip" dc:"操作人IP"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *CreditsLogListInp) Filter(ctx context.Context) (err error) {
return
}
type CreditsLogListModel struct {
Id int64 `json:"id" dc:"变动ID"`
MemberId int64 `json:"memberId" dc:"管理员ID"`
AppId string `json:"appId" dc:"应用id"`
AddonsName string `json:"addonsName" dc:"插件名称"`
CreditType string `json:"creditType" dc:"变动类型"`
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
BeforeNum float64 `json:"beforeNum" dc:"变动前"`
Num float64 `json:"num" dc:"变动数据"`
AfterNum float64 `json:"afterNum" dc:"变动后"`
Remark string `json:"remark" dc:"备注"`
Ip string `json:"ip" dc:"操作人IP"`
MapId int64 `json:"mapId" dc:"关联ID"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
// CreditsLogExportModel 导出资产变动
type CreditsLogExportModel struct {
Id int64 `json:"id" dc:"变动ID"`
MemberId int64 `json:"memberId" dc:"管理员ID"`
AppId string `json:"appId" dc:"应用id"`
AddonsName string `json:"addonsName" dc:"插件名称"`
CreditType string `json:"creditType" dc:"变动类型"`
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
BeforeNum float64 `json:"beforeNum" dc:"变动前"`
Num float64 `json:"num" dc:"变动数据"`
AfterNum float64 `json:"afterNum" dc:"变动后"`
Remark string `json:"remark" dc:"备注"`
Ip string `json:"ip" dc:"操作人IP"`
MapId int64 `json:"mapId" dc:"关联ID"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}

View File

@@ -3,11 +3,11 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminin
import (
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// DeptNameUniqueInp 名称是否唯一
@@ -73,3 +73,11 @@ type DeptStatusInp struct {
entity.AdminDept
}
type DeptStatusModel struct{}
type DeptOptionInp struct {
form.PageReq
}
type DeptOptionModel struct {
List []*DeptTree `json:"list"`
}

View File

@@ -3,13 +3,16 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminin
import (
"context"
"fmt"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/internal/library/contexts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
@@ -109,15 +112,6 @@ type MemberNameUniqueModel struct {
IsUnique bool
}
// MemberMaxSortInp 最大排序
type MemberMaxSortInp struct {
Id int64 `json:"id" dc:"用户ID"`
}
type MemberMaxSortModel struct {
Sort int
}
// MemberEditInp 修改/新增管理员
type MemberEditInp struct {
Id int64 `json:"id" dc:""`
@@ -188,6 +182,7 @@ type MemberListInp struct {
form.PageReq
form.RangeDateReq
form.StatusReq
RoleId int `json:"roleId" dc:"角色ID"`
DeptId int `json:"deptId" dc:"部门ID"`
Mobile int `json:"mobile" dc:"手机号"`
Username string `json:"username" dc:"用户名"`
@@ -227,6 +222,7 @@ type LoginMemberInfoModel struct {
RealName string `json:"realName" dc:"姓名"`
Avatar string `json:"avatar" dc:"头像"`
Balance float64 `json:"balance" dc:"余额"`
Integral float64 `json:"integral" dc:"积分"`
Sex int `json:"sex" dc:"性别"`
Qq string `json:"qq" dc:"qq"`
Email string `json:"email" dc:"邮箱"`
@@ -236,6 +232,7 @@ type LoginMemberInfoModel struct {
Address string `json:"address" dc:"联系地址"`
Cash *MemberCash `json:"cash" dc:"收款信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
OpenId string `json:"openId" dc:"本次登录的openId"` // 区别与绑定的微信openid
*MemberLoginStatModel
}
@@ -251,7 +248,7 @@ type MemberCash struct {
// MemberStatusInp 更新状态
type MemberStatusInp struct {
entity.AdminPost
entity.AdminMember
}
type MemberStatusModel struct{}
@@ -276,3 +273,89 @@ type MemberLoginStatModel struct {
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
LastLoginIp string `json:"lastLoginIp" dc:"最后登录IP"`
}
// MemberAddBalanceInp 增加余额
type MemberAddBalanceInp struct {
Id int64 `json:"id" v:"required#用户ID不能为空" dc:"管理员ID"`
OperateMode int64 `json:"operateMode" v:"in:1,2#输入的操作方式是无效的" dc:"操作方式"`
Num float64 `json:"num" dc:"操作数量"`
AppId string `json:"-"`
AddonsName string `json:"-"`
SelfNum float64 `json:"-"`
SelfCreditGroup string `json:"-"`
OtherNum float64 `json:"-"`
OtherCreditGroup string `json:"-"`
Remark string `json:"-"`
}
func (in *MemberAddBalanceInp) Filter(ctx context.Context) (err error) {
if in.Num <= 0 {
err = gerror.New("操作数量必须大于0")
return
}
if in.OperateMode == 1 {
// 加款
in.SelfNum = -in.Num
in.SelfCreditGroup = consts.CreditGroupOpIncr
in.OtherNum = in.Num
in.OtherCreditGroup = consts.CreditGroupIncr
in.Remark = fmt.Sprintf("增加余额:%v", in.OtherNum)
} else {
// 扣款
in.SelfNum = in.Num
in.SelfCreditGroup = consts.CreditGroupOpDecr
in.OtherNum = -in.Num
in.OtherCreditGroup = consts.CreditGroupDecr
in.Remark = fmt.Sprintf("扣除余额:%v", in.OtherNum)
}
in.AppId = contexts.GetModule(ctx)
in.AddonsName = contexts.GetAddonName(ctx)
return
}
type MemberAddBalanceModel struct{}
// MemberAddIntegralInp 增加积分
type MemberAddIntegralInp struct {
Id int64 `json:"id" v:"required#用户ID不能为空" dc:"管理员ID"`
OperateMode int64 `json:"operateMode" dc:"操作方式"`
Num float64 `json:"num" dc:"操作数量"`
AppId string `json:"-"`
AddonsName string `json:"-"`
SelfNum float64 `json:"-"`
SelfCreditGroup string `json:"-"`
OtherNum float64 `json:"-"`
OtherCreditGroup string `json:"-"`
Remark string `json:"-"`
}
func (in *MemberAddIntegralInp) Filter(ctx context.Context) (err error) {
if in.Num <= 0 {
err = gerror.New("操作数量必须大于0")
return
}
if in.OperateMode == 1 {
// 加款
in.SelfNum = -in.Num
in.SelfCreditGroup = consts.CreditGroupOpIncr
in.OtherNum = in.Num
in.OtherCreditGroup = consts.CreditGroupIncr
in.Remark = fmt.Sprintf("增加积分:%v", in.OtherNum)
} else {
// 扣款
in.SelfNum = in.Num
in.SelfCreditGroup = consts.CreditGroupOpDecr
in.OtherNum = -in.Num
in.OtherCreditGroup = consts.CreditGroupDecr
in.Remark = fmt.Sprintf("扣除积分:%v", in.OtherNum)
}
in.AppId = contexts.GetModule(ctx)
in.AddonsName = contexts.GetAddonName(ctx)
return
}
type MemberAddIntegralModel struct{}

View File

@@ -0,0 +1,153 @@
// Package adminin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package adminin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/payin"
"hotgo/utility/validate"
)
// OrderAcceptRefundInp 受理申请退款
type OrderAcceptRefundInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
RejectRefundReason string `json:"rejectRefundReason" dc:"拒绝退款原因"`
Status int64 `json:"status" dc:"状态"`
Remark string `json:"remark" dc:"退款备注"`
}
func (in *OrderAcceptRefundInp) Filter(ctx context.Context) (err error) {
if !validate.InSliceInt64(consts.OrderStatusSlice, in.Status) {
err = gerror.Newf("订单状态不正确")
return
}
if in.Status == consts.OrderStatusReturnReject && in.Remark == "" {
in.Remark = "退款申请被拒绝"
}
return
}
type OrderAcceptRefundModel struct {
}
// OrderApplyRefundInp 申请退款
type OrderApplyRefundInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
RefundReason string `json:"refundReason" v:"required#退款原因不能为空" dc:"退款原因"`
}
func (in *OrderApplyRefundInp) Filter(ctx context.Context) (err error) {
return
}
type OrderApplyRefundModel struct {
}
// OrderCreateInp 创建充值订单
type OrderCreateInp struct {
PayType string `json:"payType" dc:"支付方式"`
TradeType string `json:"tradeType" dc:"交易类型"`
OrderType string `json:"orderType" dc:"订单类型"`
ProductId int64 `json:"productId" dc:"产品id"`
Money float64 `json:"money" dc:"充值金额"`
Remark string `json:"remark" dc:"备注"`
ReturnUrl string `json:"returnUrl" dc:"买家付款成功跳转地址"`
}
func (in *OrderCreateInp) Filter(ctx context.Context) (err error) {
return
}
type OrderCreateModel struct {
Order *payin.CreateOrderModel `json:"order"`
}
// OrderEditInp 修改/新增充值订单
type OrderEditInp struct {
entity.AdminOrder
}
func (in *OrderEditInp) Filter(ctx context.Context) (err error) {
return
}
type OrderEditModel struct{}
// OrderDeleteInp 删除充值订单
type OrderDeleteInp struct {
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *OrderDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type OrderDeleteModel struct{}
// OrderViewInp 获取指定充值订单信息
type OrderViewInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *OrderViewInp) Filter(ctx context.Context) (err error) {
return
}
type OrderViewModel struct {
entity.AdminOrder
}
// OrderListInp 获取充值订单列表
type OrderListInp struct {
form.PageReq
MemberId uint64 `json:"memberId" dc:"用户id"`
OrderSn string `json:"orderSn" dc:"业务订单号"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
PayLogOutTradeNo string `json:"payLogOutTradeNo" dc:"商户订单号"`
}
func (in *OrderListInp) Filter(ctx context.Context) (err error) {
return
}
type OrderListModel struct {
entity.AdminOrder
OutTradeNo string `json:"payLogOutTradeNo" dc:"商户订单号"`
PayType string `json:"payLogPayType" dc:"支付类型"`
}
// OrderExportModel 导出充值订单
type OrderExportModel struct {
Id int64 `json:"id" dc:"主键"`
MemberId uint64 `json:"memberId" dc:"用户id"`
OrderType string `json:"orderType" dc:"订单类型"`
ProductId int64 `json:"productId" dc:"产品id"`
OrderSn string `json:"orderSn" dc:"关联订单号"`
Money float64 `json:"money" dc:"充值金额"`
Remark string `json:"remark" dc:"备注"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
// OrderStatusInp 更新充值订单状态
type OrderStatusInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
Status int `json:"status" dc:"状态"`
}
func (in *OrderStatusInp) Filter(ctx context.Context) (err error) {
return
}
type OrderStatusModel struct{}

View File

@@ -0,0 +1,17 @@
package commonin
// WechatAuthorizeInp 微信用户授权
type WechatAuthorizeInp struct {
Type string `json:"type" v:"required#授权类型不能为空" dc:"授权类型"`
SyncRedirect string `json:"syncRedirect" v:"required#同步跳转地址不能为空" dc:"同步跳转地址"`
}
type WechatAuthorizeModel struct{}
// WechatAuthorizeCallInp 微信用户授权回调
type WechatAuthorizeCallInp struct {
Code string `json:"code" dc:"code作为换取access_token的票据"`
State string `json:"state" dc:"state"`
}
type WechatAuthorizeCallModel struct{}

View File

@@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package form
import (
@@ -22,8 +21,7 @@ func DefaultPageSize(ctx context.Context) int {
if pageSize > 0 {
return pageSize
}
defaultPageSize := g.Cfg().MustGet(ctx, "hotgo.admin.defaultPageSize", 10)
pageSize = defaultPageSize.Int()
pageSize = g.Cfg().MustGet(ctx, "hotgo.admin.defaultPageSize", 10).Int()
if pageSize <= 0 {
pageSize = 10
}
@@ -35,8 +33,7 @@ func DefaultPage(ctx context.Context) int {
if page > 0 {
return page
}
defaultPage := g.Cfg().MustGet(ctx, "hotgo.admin.defaultPage", 1)
page = defaultPage.Int()
page = g.Cfg().MustGet(ctx, "hotgo.admin.defaultPage", 1).Int()
if page <= 0 {
page = 1
}
@@ -46,20 +43,20 @@ func DefaultPage(ctx context.Context) int {
// PageReq 分页
type PageReq struct {
Page int `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" dc:"当前页码"`
PerPage int `json:"pageSize" example:"1" d:"10" v:"min:1|max:200#|每页数量最小值不能低于1|最大值不能大于200" dc:"每页数量"`
PerPage int `json:"pageSize" example:"1" d:"10" v:"min:1|max:200#每页数量最小值不能低于1|最大值不能大于200" dc:"每页数量"`
}
type PageRes struct {
PageReq
PageCount int `json:"pageCount" example:"0" dc:"全部数据量"`
}
// RangeDateReq 时间查询
// RangeDateReq 时间范围查询
type RangeDateReq struct {
StartTime string `json:"start_time" v:"date#开始日期格式不正确" dc:"开始日期"`
EndTime string `json:"end_time" v:"date#结束日期格式不正确" dc:"结束日期"`
}
// StatusReq 状态查询
// StatusReq 通用状态查询
type StatusReq struct {
Status int `json:"status" v:"in:-1,0,1,2,3#输入的状态是无效的" dc:"状态"`
}
@@ -93,6 +90,7 @@ func CalPageCount(totalCount int, perPage int) int {
// Selects 选项
type Selects []*Select
type Select struct {
Value interface{} `json:"value"`
Label string `json:"label"`
@@ -102,9 +100,11 @@ type Select struct {
func (p Selects) Len() int {
return len(p)
}
func (p Selects) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}
func (p Selects) Less(i, j int) bool {
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
}

View File

@@ -4,7 +4,7 @@ import "github.com/gogf/gf/v2/os/gtime"
// AuthSummary 授权摘要
type AuthSummary struct {
Request
RpcMsg
}
// ResponseAuthSummary 响应授权摘要

View File

@@ -2,32 +2,74 @@ package msgin
import (
"fmt"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/utility/encrypt"
)
type Request struct {
AppId string `json:"appID" v:"0" example:"d0bb93048bc5c9164cdee845dcb7f820" description:"应用ID"`
TraceID string `json:"traceID" v:"0" example:"d0bb93048bc5c9164cdee845dcb7f820" description:"链路ID"`
Timestamp int64 `json:"timestamp" example:"1640966400" description:"服务器时间戳"`
Sign string `json:"sign" example:"d0bb93048bc5c9164cdee845dcb7f820" description:"签名"`
type RpcMsg struct {
AppId string `json:"appID" v:"0" example:"10001" description:"应用ID"`
TraceID string `json:"traceID" v:"0" example:"d0bb93048bc5c9164cdee845dcb7f820" description:"链路ID"`
Timestamp int64 `json:"timestamp" example:"1640966400" description:"服务器时间戳"`
Sign string `json:"sign" example:"d0bb93048bc5c9164cdee845dcb7f820" description:"签名"`
}
func (i *Request) SetSign(traceID, appId, secretKey string) {
func (i *RpcMsg) SetSign(appId, secretKey string) *RpcMsg {
i.AppId = appId
i.TraceID = traceID
i.Timestamp = gtime.Timestamp()
i.Sign = i.GetSign(secretKey)
return i
}
func (i *Request) GetSign(secretKey string) string {
return encrypt.Md5ToString(fmt.Sprintf("%s%s%s%s", i.AppId, i.TraceID, i.Timestamp, secretKey))
func (i *RpcMsg) GetSign(secretKey string) string {
return encrypt.Md5ToString(fmt.Sprintf("%v%v%v%v", i.AppId, i.TraceID, i.Timestamp, secretKey))
}
func (i *RpcMsg) GetTraceID() string {
return i.TraceID
}
func (i *RpcMsg) SetTraceID(traceID string) {
i.TraceID = traceID
}
type Response struct {
Code int `json:"code" example:"0" description:"状态码"`
Message string `json:"message,omitempty" example:"操作成功" description:"提示消息"`
//Data interface{} `json:"data,omitempty" description:"数据集"`
RpcMsg
Code int `json:"code" example:"2000" description:"状态码"`
Message string `json:"message,omitempty" example:"操作成功" description:"提示消息"`
}
// PkgResponse 打包响应消息
func (m *Response) PkgResponse() {
m.SetCode()
// ...
}
// SetCode 设置状态码
func (m *Response) SetCode(code ...int) {
if len(code) > 0 {
m.Code = code[0]
return
}
// 默认值,转为成功的状态码
if m.Code == 0 {
m.Code = consts.TCPMsgCodeSuccess
}
return
}
// GetError 获取响应中的错误
func (m *Response) GetError() (err error) {
if m.Code != consts.TCPMsgCodeSuccess {
if m.Message == "" {
m.Message = "操作失败"
}
err = gerror.New(m.Message)
}
return
}
// ServerHeartbeat 心跳
@@ -41,9 +83,9 @@ type ResponseServerHeartbeat struct {
// ServerLogin 服务登录
type ServerLogin struct {
Request
Group string
Name string
RpcMsg
Group string `json:"group" description:"分组"`
Name string `json:"name" description:"名称"`
}
// ResponseServerLogin 响应服务登录
@@ -53,6 +95,7 @@ type ResponseServerLogin struct {
// ServerOffline 服务离线
type ServerOffline struct {
RpcMsg
}
// ResponseServerOffline 响应服务离线

View File

@@ -0,0 +1,49 @@
package msgin
import (
"hotgo/internal/model/input/sysin"
)
// CronDelete 删除任务
type CronDelete struct {
RpcMsg
sysin.CronDeleteInp
}
type ResponseCronDelete struct {
Response
sysin.CronDeleteModel
}
// CronEdit 编辑任务
type CronEdit struct {
RpcMsg
sysin.CronEditInp
}
type ResponseCronEdit struct {
Response
sysin.CronEditModel
}
// CronStatus 修改任务状态
type CronStatus struct {
RpcMsg
sysin.CronStatusInp
}
type ResponseCronStatus struct {
Response
sysin.CronStatusModel
}
// CronOnlineExec 在线执行
type CronOnlineExec struct {
RpcMsg
sysin.OnlineExecInp
}
type ResponseCronOnlineExec struct {
Response
sysin.OnlineExecModel
}

View File

@@ -0,0 +1,55 @@
package payin
import (
"github.com/go-pay/gopay/wechat/v3"
"github.com/gogf/gf/v2/os/gtime"
officialJs "github.com/silenceper/wechat/v2/officialaccount/js"
"hotgo/internal/model/entity"
)
// 和功能库[payment]包的通用输入/输出
// CreateOrderInp 统一创建订单入口
type CreateOrderInp struct {
Pay *entity.PayLog
}
type CreateOrderModel struct {
TradeType string `json:"tradeType" description:"交易类型"`
PayURL string `json:"payURL" description:"支付地址"`
OutTradeNo string `json:"outTradeNo" description:"商户订单号"`
JsApi *JSAPI `json:"jsApi" description:"jsapi支付参数"`
}
type JSAPI struct {
Config *officialJs.Config `json:"config" description:"js初始化配置"`
Params *wechat.JSAPIPayParams `json:"params" description:"支付参数"`
}
// NotifyInp 统一异步通知处理入口
type NotifyInp struct {
}
type NotifyModel struct {
OutTradeNo string `json:"outTradeNo" description:"商户订单号"`
TransactionId string `json:"transactionId" description:"交易号"`
PayAt *gtime.Time `json:"payAt" description:"支付时间"`
ActualAmount float64 `json:"actualAmount" description:"实付金额"`
}
// NotifyCallFuncInp 异步通知回调,用于异步通知验签通过后回调到具体的业务中
type NotifyCallFuncInp struct {
Pay *entity.PayLog
}
// RefundInp 统一退款处理入口
type RefundInp struct {
Pay *entity.PayLog
RefundMoney float64 `json:"refundMoney" dc:"退款金额"`
RefundSn string `json:"refundSn" dc:"退款单号"`
Reason string `json:"reason" dc:"申请退款原因"`
Remark string `json:"remark" dc:"退款备注"`
}
type RefundModel struct {
}

View File

@@ -0,0 +1,199 @@
// Package payin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package payin
import (
"context"
"github.com/gogf/gf/v2/encoding/gjson"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"github.com/gogf/gf/v2/os/gtime"
)
// PayNotifyInp 异步通知
type PayNotifyInp struct {
PayType string `json:"payType" description:"支付类型"`
}
type PayNotifyModel struct {
PayType string `json:"payType" description:"支付类型"`
Code string `json:"code" description:"状态码"`
Message string `json:"message" description:"响应文本消息"`
}
type PayNotifyUpdate struct {
TransactionId string `json:"transactionId" description:"交易号"`
PayStatus int `json:"payStatus" description:"支付状态"`
PayAt *gtime.Time `json:"payAt" description:"支付时间"`
PayIp string `json:"payIp" description:"支付者ip"`
TraceIds *gjson.Json `json:"traceIds" description:"链路id集合"`
}
// PayCreateInp 创建支付订单和日志
type PayCreateInp struct {
Subject string `json:"subject" description:"订单标题"`
Detail *gjson.Json `json:"detail" description:"支付商品详情"`
OrderSn string `json:"orderSn" description:"关联订单号"`
OrderGroup string `json:"orderGroup" description:"组别[默认统一支付类型]"`
Openid string `json:"openid" description:"openid"`
PayType string `json:"payType" description:"支付类型"`
TradeType string `json:"tradeType" description:"交易类型"`
PayAmount float64 `json:"payAmount" description:"支付金额"`
ReturnUrl string `json:"returnUrl" description:"买家付款成功跳转地址"`
}
type PayCreateModel struct {
Order *CreateOrderModel
}
// PayEditInp 修改/新增支付日志
type PayEditInp struct {
entity.PayLog
}
func (in *PayEditInp) Filter(ctx context.Context) (err error) {
return
}
type PayEditModel struct{}
// PayDeleteInp 删除支付日志
type PayDeleteInp struct {
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *PayDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type PayDeleteModel struct{}
// PayViewInp 获取指定支付日志信息
type PayViewInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *PayViewInp) Filter(ctx context.Context) (err error) {
return
}
type PayViewModel struct {
entity.PayLog
}
// PayListInp 获取支付日志列表
type PayListInp struct {
form.PageReq
Id int64 `json:"id" dc:"ID"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
TestCategoryName string `json:"testCategoryName" dc:"分类名称"`
}
func (in *PayListInp) Filter(ctx context.Context) (err error) {
return
}
type PayListModel struct {
Id int64 `json:"id" description:"主键"`
MemberId uint64 `json:"memberId" description:"用户id"`
AppId string `json:"appId" description:"应用id"`
AddonsName string `json:"addonsName" description:"插件名称"`
OrderSn string `json:"orderSn" description:"关联订单号"`
OrderGroup string `json:"orderGroup" description:"组别[默认统一支付类型]"`
Openid string `json:"openid" description:"openid"`
MchId string `json:"mchId" description:"商户支付账户"`
Body string `json:"body" description:"创建支付报文"`
AuthCode string `json:"authCode" description:"刷卡码"`
OutTradeNo string `json:"outTradeNo" description:"商户订单号"`
TransactionId string `json:"transactionId" description:"交易号"`
PayType int `json:"payType" description:"支付类型"`
PayFee float64 `json:"payFee" description:"支付金额"`
PayStatus int `json:"payStatus" description:"支付状态"`
PayAt *gtime.Time `json:"payAt" description:"支付时间"`
TradeType string `json:"tradeType" description:"交易类型"`
RefundSn string `json:"refundSn" description:"退款编号"`
RefundFee float64 `json:"refundFee" description:"退款金额"`
RefundRemark string `json:"refundRemark" description:"退款备注"`
IsRefund int `json:"isRefund" description:"是否退款"`
CreateIp string `json:"createIp" description:"创建者ip"`
PayIp string `json:"payIp" description:"支付者ip"`
NotifyUrl string `json:"notifyUrl" description:"支付通知回调地址"`
ReturnUrl string `json:"returnUrl" description:"买家付款成功跳转地址"`
TraceIds *gjson.Json `json:"traceIds" description:"链路id集合"`
Status int `json:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
}
// PayExportModel 导出支付日志
type PayExportModel struct {
Id int64 `json:"id" description:"主键"`
MemberId uint64 `json:"memberId" description:"用户id"`
AppId string `json:"appId" description:"应用id"`
AddonsName string `json:"addonsName" description:"插件名称"`
OrderSn string `json:"orderSn" description:"关联订单号"`
OrderGroup string `json:"orderGroup" description:"组别[默认统一支付类型]"`
Openid string `json:"openid" description:"openid"`
MchId string `json:"mchId" description:"商户支付账户"`
Body string `json:"body" description:"创建支付报文"`
AuthCode string `json:"authCode" description:"刷卡码"`
OutTradeNo string `json:"outTradeNo" description:"商户订单号"`
TransactionId string `json:"transactionId" description:"交易号"`
PayType int `json:"payType" description:"支付类型"`
PayFee float64 `json:"payFee" description:"支付金额"`
PayStatus int `json:"payStatus" description:"支付状态"`
PayAt *gtime.Time `json:"payAt" description:"支付时间"`
TradeType string `json:"tradeType" description:"交易类型"`
RefundSn string `json:"refundSn" description:"退款编号"`
RefundFee float64 `json:"refundFee" description:"退款金额"`
RefundRemark string `json:"refundRemark" description:"退款备注"`
IsRefund int `json:"isRefund" description:"是否退款"`
CreateIp string `json:"createIp" description:"创建者ip"`
PayIp string `json:"payIp" description:"支付者ip"`
NotifyUrl string `json:"notifyUrl" description:"支付通知回调地址"`
ReturnUrl string `json:"returnUrl" description:"买家付款成功跳转地址"`
TraceIds *gjson.Json `json:"traceIds" description:"链路id集合"`
Status int `json:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
}
// PayMaxSortInp 获取支付日志最大排序
type PayMaxSortInp struct{}
func (in *PayMaxSortInp) Filter(ctx context.Context) (err error) {
return
}
type PayMaxSortModel struct {
Sort int `json:"sort" description:"排序"`
}
// PayStatusInp 更新支付日志状态
type PayStatusInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
Status int `json:"status" dc:"状态"`
}
func (in *PayStatusInp) Filter(ctx context.Context) (err error) {
return
}
type PayStatusModel struct{}
// PaySwitchInp 更新支付日志开关状态
type PaySwitchInp struct {
form.SwitchReq
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *PaySwitchInp) Filter(ctx context.Context) (err error) {
return
}
type PaySwitchModel struct{}

View File

@@ -0,0 +1,59 @@
// Package payin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.5.3
// @AutoGenerate Date 2023-04-15 15:59:58
package payin
import (
"context"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"github.com/gogf/gf/v2/os/gtime"
)
// PayRefundInp 订单退款
type PayRefundInp struct {
OrderSn string `json:"orderSn" dc:"业务订单号"`
RefundMoney float64 `json:"refundMoney" dc:"退款金额"`
Reason string `json:"reason" dc:"申请退款原因"`
Remark string `json:"remark" dc:"退款备注"`
}
func (in *PayRefundInp) Filter(ctx context.Context) (err error) {
return
}
type PayRefundModel struct {
entity.PayRefund
}
// PayRefundListInp 获取资产变动列表
type PayRefundListInp struct {
form.PageReq
Id int64 `json:"id" dc:"变动ID"`
MemberId int64 `json:"memberId" dc:"管理员ID"`
AppId string `json:"appId" dc:"应用id"`
CreditType string `json:"creditType" dc:"变动类型"`
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
Remark string `json:"remark" dc:"备注"`
Ip string `json:"ip" dc:"操作人IP"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *PayRefundListInp) Filter(ctx context.Context) (err error) {
return
}
type PayRefundListModel struct {
entity.PayRefund
}
// PayRefundExportModel 导出资产变动
type PayRefundExportModel struct {
entity.PayRefund
}

View File

@@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package sysin
import (
@@ -20,13 +19,13 @@ type CronMaxSortModel struct {
Sort int
}
// CronEditInp 修改/新增字典数据
// CronEditInp 修改/新增
type CronEditInp struct {
entity.SysCron
}
type CronEditModel struct{}
// CronDeleteInp 删除字典类型
// CronDeleteInp 删除
type CronDeleteInp struct {
Id interface{}
}

View File

@@ -3,9 +3,8 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.1.4
// @AutoGenerate Date 2023-02-20 16:41:58
//
// @AutoGenerate Version 2.5.3
// @AutoGenerate Date 2023-04-28 15:28:40
package sysin
import (