Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1915dc0a2a | ||
![]() |
f8ebbff9d8 | ||
![]() |
559e79c5a8 | ||
![]() |
88bd5f740d | ||
![]() |
12617dbaf7 | ||
7d54fbd31d | |||
![]() |
f845aee1de | ||
1412fc67be | |||
![]() |
c25a65488e | ||
![]() |
dd74c1b5c6 |
36
README.en.md
36
README.en.md
@@ -1,36 +0,0 @@
|
||||
# rabbitMQ公共结构体
|
||||
|
||||
#### Description
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
50
README.md
50
README.md
@@ -1,39 +1,19 @@
|
||||
# rabbitMQ公共结构体
|
||||
|
||||
#### 介绍
|
||||
{**以下是 Gitee 平台说明,您可以替换此简介**
|
||||
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
||||
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
||||
## window开发者执行
|
||||
```bash
|
||||
git config --global core.autocrlf true # 提交时转 CRLF 为 LF,检出时转 LF 为 CRLF
|
||||
```
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
## mac开发者执行
|
||||
```bash
|
||||
git config --global core.autocrlf input # 提交时转 CRLF 为 LF,检出时不转换
|
||||
```
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
## 格式化
|
||||
```bash
|
||||
gofumpt -l -w .
|
||||
```
|
||||
```bash
|
||||
go install mvdan.cc/gofumpt@latest
|
||||
```
|
||||
|
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
|
||||
|
42
log.go
42
log.go
@@ -2,20 +2,40 @@ package common_structure
|
||||
|
||||
import "time"
|
||||
|
||||
type LogInfoType = string
|
||||
type LogType = string
|
||||
|
||||
const (
|
||||
LogInfoTypeOrder LogInfoType = "order"
|
||||
LogInfoTypeProduct LogInfoType = "product"
|
||||
LogTypeOrder LogType = "order" // 订单
|
||||
LogTypeProduct LogType = "product" // 商品
|
||||
LogTypeMerchant LogType = "merchant" // 商家
|
||||
LogTypeMerchantUser LogType = "merchant_user" // 商家用户
|
||||
LogTypePay LogType = "pay" // 支付
|
||||
LogTypeUser LogType = "user" // 用户
|
||||
LogTypeGPS LogType = "gps" // gps
|
||||
LogTypeSMS LogType = "sms" // 短信
|
||||
LogTypeSystem LogType = "system" // 系统、日志、定时任务初始化、定时任务、mq初始化等
|
||||
)
|
||||
|
||||
type LogInfo struct {
|
||||
InfoType LogInfoType `json:"info_type"` // 类型
|
||||
ID int `json:"id"` // ID,订单ID,商品ID,商品SKUID之类的id
|
||||
Operator interface{} `json:"operator"` // 操作人,商家用户对象,admin对象或者是系统,关闭订单消费队列等
|
||||
Title string `json:"title"` // 标题,做什么事情
|
||||
Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数
|
||||
Result interface{} `json:"result"` // 结果,返回值
|
||||
ErrStr string `json:"err_str"` // 错误信息,json转义error没有自动存储,需要手动转义
|
||||
At time.Time `json:"at"` // 记录时间
|
||||
InfoType LogType `json:"info_type"` // 日志类型,按被操作对象划分
|
||||
Operator *Operator `json:"operator,omitempty"` // 操作人,系统操作不用填写操作人,写日志类型就可以
|
||||
ObjectorID int `json:"objector_id,omitempty"` // 被操作对象ID,如果是gps,短信等服务则为0
|
||||
Title string `json:"title"` // 必填,标题,做什么事情
|
||||
Param interface{} `json:"param,omitempty"` // 参数,请求参数,传指针
|
||||
Result interface{} `json:"result,omitempty"` // 结果,返回值,传指针
|
||||
ErrStr string `json:"err_str,omitempty"` // 错误信息,json转义error没有自动存储,需要手动转义
|
||||
At time.Time `json:"at"` // 记录时间
|
||||
}
|
||||
|
||||
type OperatorType = string
|
||||
|
||||
const (
|
||||
AdminOperatorType OperatorType = "admin" // 管理员
|
||||
MerchantOperatorType OperatorType = "merchant" // 商家
|
||||
UserOperatorType OperatorType = "user" // 用户
|
||||
)
|
||||
|
||||
type Operator struct {
|
||||
ID int // 系统ID设置0
|
||||
OperatorType OperatorType
|
||||
}
|
||||
|
@@ -12,8 +12,10 @@ const (
|
||||
OrderCloseTypeMerchantClose OrderCloseType = 30 // 商家关闭
|
||||
OrderCloseTypeThirdOrderFailedClose OrderCloseType = 40 // 第三方订单下单失败关闭
|
||||
OrderCloseTypeUser OrderCloseType = 50 // 用户主动关闭
|
||||
OrderCloseTypeMerchantCancel OrderCloseType = 60 //商家取消订单关闭
|
||||
OrderCloseTypeDeliveryTimeout OrderCloseType = 70 //发货超时关闭
|
||||
OrderCloseTypeMerchantCancel OrderCloseType = 60 // 商家取消订单关闭
|
||||
OrderCloseTypeDeliveryTimeout OrderCloseType = 70 // 发货超时关闭
|
||||
OrderCloseTypePaymentFailed OrderCloseType = 80 // 创建支付失败
|
||||
OrderCloseTypeAbandonPayment OrderCloseType = 90 // 放弃支付
|
||||
|
||||
)
|
||||
|
||||
|
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"` // 剩余重复执行次数
|
||||
}
|
@@ -17,8 +17,8 @@ type ProductsIncreaseSold struct {
|
||||
type StockState = string
|
||||
|
||||
const (
|
||||
StockStateIncrease StockState = "increase_inventory" //增加库存
|
||||
StockStateDecrease StockState = "reduce_inventory" //减少库存
|
||||
StockStateIncrease StockState = "increase_inventory" // 增加库存
|
||||
StockStateDecrease StockState = "reduce_inventory" // 减少库存
|
||||
)
|
||||
|
||||
type ProductsChangeStockType = int
|
||||
|
Reference in New Issue
Block a user