Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
559e79c5a8 | ||
![]() |
88bd5f740d | ||
![]() |
12617dbaf7 | ||
7d54fbd31d | |||
![]() |
f845aee1de | ||
1412fc67be | |||
![]() |
c25a65488e | ||
![]() |
dd74c1b5c6 | ||
![]() |
959cb87ee2 | ||
![]() |
c1d08db044 | ||
![]() |
9edec35425 | ||
![]() |
7c6e1ba3a8 | ||
![]() |
91324cd225 | ||
![]() |
92e71475d3 | ||
![]() |
48b3206053 | ||
![]() |
981dd3b98d | ||
88dd6fbdf5 |
2
go.mod
2
go.mod
@@ -1,3 +1,3 @@
|
|||||||
module gitee.com/shenzhen-jinhuatai-network/common_structure
|
module git.ssgfgtfy.com/public/common_structure
|
||||||
|
|
||||||
go 1.18.0
|
go 1.18.0
|
||||||
|
52
log.go
52
log.go
@@ -2,20 +2,50 @@ package common_structure
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type LogInfoType = string
|
type LogType = string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
LogInfoTypeOrder LogInfoType = "order"
|
LogTypeOrder LogType = "order" // 订单
|
||||||
LogInfoTypeProduct LogInfoType = "product"
|
LogTypeProduct LogType = "product" // 商品
|
||||||
|
LogTypeGPS LogType = "gps" // gps
|
||||||
)
|
)
|
||||||
|
|
||||||
type LogInfo struct {
|
type LogInfo struct {
|
||||||
InfoType LogInfoType `json:"info_type"` // 类型
|
InfoType LogType `json:"info_type"` // 类型
|
||||||
ID int `json:"id"` // ID,订单ID,商品ID,商品SKUID之类的id
|
Operator Operator `json:"operator"` // 操作人
|
||||||
Operator interface{} `json:"operator"` // 操作人
|
ObjectorID int `json:"objector_id"` // 被操作对象ID,如果是gps,短信等服务则为0
|
||||||
Title string `json:"title"` // 标题,做什么事情
|
Title string `json:"title"` // 标题,做什么事情
|
||||||
Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数
|
Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数
|
||||||
Result interface{} `json:"result"` // 结果,返回值
|
Result interface{} `json:"result"` // 结果,返回值
|
||||||
Err error `json:"err"` // 错误
|
ErrStr string `json:"err_str"` // 错误信息,json转义error没有自动存储,需要手动转义
|
||||||
At time.Time `json:"at"` // 记录时间
|
At time.Time `json:"at"` // 记录时间
|
||||||
|
}
|
||||||
|
|
||||||
|
type OperatorType = string
|
||||||
|
|
||||||
|
const (
|
||||||
|
SystemOperatorType OperatorType = "system" // 系统
|
||||||
|
AdminOperatorType OperatorType = "admin" // 管理员
|
||||||
|
MerchantOperatorType OperatorType = "merchant" // 商家
|
||||||
|
UserOperatorType OperatorType = "user" // 用户
|
||||||
|
)
|
||||||
|
|
||||||
|
type Operator struct {
|
||||||
|
ID int // 系统ID设置0
|
||||||
|
OperatorType OperatorType
|
||||||
|
}
|
||||||
|
|
||||||
|
type ObjectorType = string
|
||||||
|
|
||||||
|
const (
|
||||||
|
ObjectorTypeGPS ObjectorType = "gps" // gps
|
||||||
|
ObjectorTypeSMS ObjectorType = "sms" // sms
|
||||||
|
ObjectorTypeProduct ObjectorType = "product"
|
||||||
|
ObjectorTypeOrder ObjectorType = "order"
|
||||||
|
ObjectorTypePay ObjectorType = "pay"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Objector struct {
|
||||||
|
ID int // 系统ID设置0
|
||||||
|
ObjectorType ObjectorType
|
||||||
}
|
}
|
||||||
|
@@ -7,9 +7,16 @@ type OrderCreate struct {
|
|||||||
type OrderCloseType = int
|
type OrderCloseType = int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
OrderCloseTypePayTimeout OrderCloseType = 10 // 支付超时
|
OrderCloseTypePayTimeout OrderCloseType = 10 // 支付超时
|
||||||
OrderCloseTypeRefundClose OrderCloseType = 20 // 退款关闭,判断商品是否仅退款
|
OrderCloseTypeRefundClose OrderCloseType = 20 // 售后完成关闭
|
||||||
OrderCloseTypeMerchantClose OrderCloseType = 30 // 商家关闭
|
OrderCloseTypeMerchantClose OrderCloseType = 30 // 商家关闭
|
||||||
|
OrderCloseTypeThirdOrderFailedClose OrderCloseType = 40 // 第三方订单下单失败关闭
|
||||||
|
OrderCloseTypeUser OrderCloseType = 50 // 用户主动关闭
|
||||||
|
OrderCloseTypeMerchantCancel OrderCloseType = 60 //商家取消订单关闭
|
||||||
|
OrderCloseTypeDeliveryTimeout OrderCloseType = 70 //发货超时关闭
|
||||||
|
OrderCloseTypePaymentFailed OrderCloseType = 80 //创建支付失败
|
||||||
|
OrderCloseTypeAbandonPayment OrderCloseType = 90 //放弃支付
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type OrderClose struct {
|
type OrderClose struct {
|
||||||
@@ -69,3 +76,12 @@ type OrderUpdateSuccess struct {
|
|||||||
type ThirdOrderRefund struct {
|
type ThirdOrderRefund struct {
|
||||||
ID uint `json:"id"` // 订单ID
|
ID uint `json:"id"` // 订单ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RedPacketRefund struct {
|
||||||
|
ID uint `json:"id"` // 订单ID
|
||||||
|
OrderProductsID uint `json:"order_products_id"` // 订单商品ID
|
||||||
|
}
|
||||||
|
|
||||||
|
type OrderSentOvertime struct {
|
||||||
|
ID uint `json:"id"` // 订单ID
|
||||||
|
}
|
||||||
|
15
rabbitmq_pay.go
Normal file
15
rabbitmq_pay.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package common_structure
|
||||||
|
|
||||||
|
type PayNotify struct {
|
||||||
|
PayID uint `json:"pay_id"` // 支付ID
|
||||||
|
PayNo string `json:"pay_no"` // 支付单号
|
||||||
|
RemainExecNum int `json:"num"` // 剩余执行次数
|
||||||
|
RemainRepeatNum int `json:"repeat_num"` // 剩余重复执行次数
|
||||||
|
}
|
||||||
|
|
||||||
|
type HelibaoSettlementQuery struct {
|
||||||
|
ID uint `json:"id"` // 提现ID
|
||||||
|
WithdrawNo string `json:"withdraw_no"` // 提现单号
|
||||||
|
RemainExecNum int `json:"num"` // 剩余执行次数
|
||||||
|
RemainRepeatNum int `json:"repeat_num"` // 剩余重复执行次数
|
||||||
|
}
|
Reference in New Issue
Block a user