2025-05-08 00:54:13 +08:00

52 lines
1.6 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package common_structure
import "time"
type LogType = string
const (
LogTypeOrder LogType = "order" // 订单
LogTypeProduct LogType = "product" // 商品
LogTypeGPS LogType = "gps" // gps
)
type LogInfo struct {
InfoType LogType `json:"info_type"` // 类型
Operator Operator `json:"operator"` // 操作人
ObjectorID int `json:"objector_id"` // 被操作对象ID如果是gps短信等服务则为0
Title string `json:"title"` // 标题,做什么事情
Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数
Result interface{} `json:"result"` // 结果,返回值
ErrStr string `json:"err_str"` // 错误信息json转义error没有自动存储需要手动转义
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
}