mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-09 10:43:47 +08:00
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
const (
|
||||
|
||||
13
server/internal/consts/cash.go
Normal file
13
server/internal/consts/cash.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
// 提现状态
|
||||
const (
|
||||
CashStatusWait = 1 // 处理中
|
||||
CashStatusOk = 2 // 提现成功
|
||||
CashStatusFail = 3 // 提现异常
|
||||
)
|
||||
@@ -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 consts
|
||||
|
||||
// ContextKey 上下文
|
||||
const (
|
||||
ContextKey = "HotGoContext" // http上下文变量名称
|
||||
ContextKeyCronArgs = "args" // 定时任务参数上下文变量名称
|
||||
ContextKey = "HotGoContext" // http上下文变量名称
|
||||
ContextKeyCronArgs = "args" // 定时任务参数上下文变量名称
|
||||
ContextTCPKey = "HotGoTCPContext" // tcp上下文变量名称
|
||||
)
|
||||
|
||||
85
server/internal/consts/credit_log.go
Normal file
85
server/internal/consts/credit_log.go
Normal file
@@ -0,0 +1,85 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
const (
|
||||
CreditTypeBalance = "balance" // 余额
|
||||
CreditTypeIntegral = "integral" // 积分
|
||||
)
|
||||
|
||||
const (
|
||||
CreditGroupDecr = "decr" // 扣款
|
||||
CreditGroupIncr = "incr" // 加款
|
||||
CreditGroupOpDecr = "op_decr" // 操作扣款
|
||||
CreditGroupOpIncr = "op_incr" // 操作加款
|
||||
CreditGroupBalanceRecharge = "balance_recharge" // 余额充值
|
||||
CreditGroupBalanceRefund = "balance_refund" // 余额退款
|
||||
CreditGroupApplyCash = "apply_cash" // 申请提现
|
||||
)
|
||||
|
||||
// CreditTypeOptions 变动类型
|
||||
var CreditTypeOptions = []g.Map{
|
||||
{
|
||||
"key": CreditTypeBalance,
|
||||
"value": CreditTypeBalance,
|
||||
"label": "余额",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": CreditTypeIntegral,
|
||||
"value": CreditTypeIntegral,
|
||||
"label": "积分",
|
||||
"listClass": "info",
|
||||
},
|
||||
}
|
||||
|
||||
// CreditGroupOptions 变动分组
|
||||
var CreditGroupOptions = []g.Map{
|
||||
{
|
||||
"key": CreditGroupDecr,
|
||||
"value": CreditGroupDecr,
|
||||
"label": "扣款",
|
||||
"listClass": "warning",
|
||||
},
|
||||
{
|
||||
"key": CreditGroupIncr,
|
||||
"value": CreditGroupIncr,
|
||||
"label": "加款",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": CreditGroupOpDecr,
|
||||
"value": CreditGroupOpDecr,
|
||||
"label": "操作扣款",
|
||||
"listClass": "warning",
|
||||
},
|
||||
{
|
||||
"key": CreditGroupOpIncr,
|
||||
"value": CreditGroupOpIncr,
|
||||
"label": "操作加款",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": CreditGroupBalanceRefund,
|
||||
"value": CreditGroupBalanceRefund,
|
||||
"label": "余额退款",
|
||||
"listClass": "warning",
|
||||
},
|
||||
{
|
||||
"key": CreditGroupBalanceRecharge,
|
||||
"value": CreditGroupBalanceRecharge,
|
||||
"label": "余额充值",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": CreditGroupApplyCash,
|
||||
"value": CreditGroupApplyCash,
|
||||
"label": "申请提现",
|
||||
"listClass": "info",
|
||||
},
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
// 公告类型
|
||||
|
||||
129
server/internal/consts/order.go
Normal file
129
server/internal/consts/order.go
Normal file
@@ -0,0 +1,129 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// 订单分组
|
||||
// 为不同的业务订单设置不同的分组,分组可以设置不同的业务回调方法
|
||||
|
||||
const (
|
||||
OrderGroupDefault = "order" // 普通订单
|
||||
OrderGroupAdminOrder = "admin_order" // 后台充值订单
|
||||
// 还可以设置其他,方便后期扩展..
|
||||
)
|
||||
|
||||
// 订单类型
|
||||
|
||||
const (
|
||||
OrderTypeBalance = "balance" // 余额充值
|
||||
OrderTypeProduct = "product" // 购买产品
|
||||
)
|
||||
|
||||
const (
|
||||
OrderStatusALL int64 = -1 // 全部状态
|
||||
OrderStatusNotPay = 1 // 待付款
|
||||
OrderStatusPay = 2 // 已付款
|
||||
OrderStatusShipments = 3 // 已发货
|
||||
OrderStatusDone = 4 // 已完成
|
||||
OrderStatusClose = 5 // 已关闭
|
||||
OrderStatusReturnRequest = 6 // 申请退款
|
||||
OrderStatusReturning = 7 // 退款中
|
||||
OrderStatusReturned = 8 // 已退款
|
||||
OrderStatusReturnReject = 9 // 拒绝退款
|
||||
)
|
||||
|
||||
var OrderStatusSlice = []int64{
|
||||
OrderStatusALL,
|
||||
OrderStatusNotPay, OrderStatusPay, OrderStatusShipments, OrderStatusDone, OrderStatusClose,
|
||||
OrderStatusReturnRequest, OrderStatusReturning, OrderStatusReturned, OrderStatusReturnReject,
|
||||
}
|
||||
|
||||
// OrderStatusOptions 订单状态选项
|
||||
var OrderStatusOptions = []g.Map{
|
||||
{
|
||||
"key": OrderStatusALL,
|
||||
"value": OrderStatusALL,
|
||||
"label": "全部",
|
||||
"listClass": "info",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusNotPay,
|
||||
"value": OrderStatusNotPay,
|
||||
"label": "待付款",
|
||||
"listClass": "info",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusPay,
|
||||
"value": OrderStatusPay,
|
||||
"label": "已付款",
|
||||
"listClass": "info",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusShipments,
|
||||
"value": OrderStatusShipments,
|
||||
"label": "已发货",
|
||||
"listClass": "info",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusDone,
|
||||
"value": OrderStatusDone,
|
||||
"label": "已完成",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusClose,
|
||||
"value": OrderStatusClose,
|
||||
"label": "已关闭",
|
||||
"listClass": "default",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusReturnRequest,
|
||||
"value": OrderStatusReturnRequest,
|
||||
"label": "申请退款",
|
||||
"listClass": "warning",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusReturning,
|
||||
"value": OrderStatusReturning,
|
||||
"label": "退款中",
|
||||
"listClass": "default",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusReturned,
|
||||
"value": OrderStatusReturned,
|
||||
"label": "已退款",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusReturnReject,
|
||||
"value": OrderStatusReturnReject,
|
||||
"label": "拒绝退款",
|
||||
"listClass": "error",
|
||||
},
|
||||
}
|
||||
|
||||
// OrderAcceptRefundOptions 订单退款受理状态
|
||||
var OrderAcceptRefundOptions = []g.Map{
|
||||
{
|
||||
"key": OrderStatusReturnRequest,
|
||||
"value": OrderStatusReturnRequest,
|
||||
"label": "申请退款",
|
||||
"listClass": "warning",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusReturned,
|
||||
"value": OrderStatusReturned,
|
||||
"label": "已退款",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": OrderStatusReturnReject,
|
||||
"value": OrderStatusReturnReject,
|
||||
"label": "拒绝退款",
|
||||
"listClass": "error",
|
||||
},
|
||||
}
|
||||
97
server/internal/consts/pay.go
Normal file
97
server/internal/consts/pay.go
Normal file
@@ -0,0 +1,97 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// 支付方式
|
||||
|
||||
const (
|
||||
PayTypeALL = "" // 全部
|
||||
PayTypeWxPay = "wxpay" // 微信支付
|
||||
PayTypeAliPay = "alipay" // 支付宝
|
||||
PayTypeQQPay = "qqpay" // QQ支付
|
||||
)
|
||||
|
||||
var (
|
||||
PayTypeSlice = []string{
|
||||
PayTypeWxPay, PayTypeAliPay, PayTypeQQPay,
|
||||
}
|
||||
|
||||
PayTypeNameMap = map[string]string{
|
||||
PayTypeALL: "全部",
|
||||
PayTypeWxPay: "微信支付",
|
||||
PayTypeAliPay: "支付宝",
|
||||
PayTypeQQPay: "QQ支付",
|
||||
}
|
||||
)
|
||||
|
||||
// 交易方式
|
||||
|
||||
const (
|
||||
// 微信
|
||||
TradeTypeWxMP = "mp" // 公众号
|
||||
TradeTypeWxMini = "mini" // 小程序
|
||||
TradeTypeWxApp = "app" // APP
|
||||
TradeTypeWxScan = "scan" // 二维码扫码
|
||||
TradeTypeWxPos = "pos" // 二维码收款
|
||||
TradeTypeWxH5 = "h5" // H5
|
||||
|
||||
// 支付宝
|
||||
TradeTypeAliWeb = "web" // 电脑网页
|
||||
TradeTypeAliApp = "app" // APP
|
||||
TradeTypeAliScan = "scan" // 二维码扫码
|
||||
TradeTypeAliWap = "wap" // 手机网页
|
||||
TradeTypeAliPos = "pos" // 二维码收款
|
||||
|
||||
// QQ
|
||||
TradeTypeQQWeb = "qqweb" // PC网页
|
||||
TradeTypeQQWap = "qqwap" // 移动端
|
||||
)
|
||||
|
||||
var (
|
||||
TradeTypeWxSlice = []string{TradeTypeWxMP, TradeTypeWxMini, TradeTypeWxApp, TradeTypeWxScan, TradeTypeWxPos, TradeTypeWxH5}
|
||||
TradeTypeAliSlice = []string{TradeTypeAliWeb, TradeTypeAliApp, TradeTypeAliScan, TradeTypeAliWap, TradeTypeAliPos}
|
||||
TradeTypeQQSlice = []string{TradeTypeQQWeb, TradeTypeQQWap}
|
||||
)
|
||||
|
||||
// 支付状态
|
||||
|
||||
const (
|
||||
PayStatusWait = 1 // 待支付
|
||||
PayStatusOk = 2 // 已支付
|
||||
)
|
||||
|
||||
// 退款状态
|
||||
|
||||
const (
|
||||
RefundStatusNo = 1 // 未退款
|
||||
RefundStatusApply = 2 // 申请退款
|
||||
RefundStatusReject = 3 // 拒绝退款
|
||||
RefundStatusAgree = 4 // 同意退款,已退款
|
||||
)
|
||||
|
||||
// PayTypeOptions 支付方式选项
|
||||
var PayTypeOptions = []g.Map{
|
||||
{
|
||||
"key": PayTypeWxPay,
|
||||
"value": PayTypeWxPay,
|
||||
"label": "微信支付",
|
||||
"listClass": "success",
|
||||
},
|
||||
{
|
||||
"key": PayTypeAliPay,
|
||||
"value": PayTypeAliPay,
|
||||
"label": "支付宝",
|
||||
"listClass": "info",
|
||||
},
|
||||
{
|
||||
"key": PayTypeQQPay,
|
||||
"value": PayTypeQQPay,
|
||||
"label": "QQ支付",
|
||||
"listClass": "default",
|
||||
},
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
// Package consts
|
||||
// @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 consts
|
||||
|
||||
// 短信驱动
|
||||
|
||||
25
server/internal/consts/tcp.go
Normal file
25
server/internal/consts/tcp.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package consts
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
TCPMsgCodeSuccess = 2000 // 成功的状态码
|
||||
)
|
||||
|
||||
// 定时任务
|
||||
const (
|
||||
TCPCronHeartbeatVerify = "tcpHeartbeatVerify"
|
||||
TCPCronHeartbeat = "tcpHeartbeat"
|
||||
TCPCronAuthVerify = "tcpAuthVerify"
|
||||
)
|
||||
|
||||
// 认证分组
|
||||
const (
|
||||
TCPClientGroupCron = "cron" // 定时任务
|
||||
TCPClientGroupQueue = "queue" // 消息队列
|
||||
TCPClientGroupAuth = "auth" // 服务授权
|
||||
)
|
||||
|
||||
const (
|
||||
TCPRpcTimeout = time.Second * 10 // rpc通讯超时时间, 默认10s
|
||||
)
|
||||
@@ -7,5 +7,5 @@ package consts
|
||||
|
||||
// VersionApp HotGo版本
|
||||
const (
|
||||
VersionApp = "2.5.3"
|
||||
VersionApp = "2.6.7"
|
||||
)
|
||||
|
||||
13
server/internal/consts/wechat.go
Normal file
13
server/internal/consts/wechat.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package consts
|
||||
|
||||
// 授权类型
|
||||
const (
|
||||
WechatAuthorizeOpenId = "openId" // 设置openid
|
||||
WechatAuthorizeBindLogin = "bindLogin" // 绑定微信登录
|
||||
)
|
||||
|
||||
// 应用授权作用域
|
||||
const (
|
||||
WechatScopeBase = "snsapi_base" // 只获取openid,无需用户授权
|
||||
WechatScopeUserinfo = "snsapi_userinfo" // 获取用户信息,需要授权
|
||||
)
|
||||
Reference in New Issue
Block a user