change contract

This commit is contained in:
jiangyong 2025-09-11 19:11:52 +08:00
parent 3294245595
commit f31c8b04e2
2 changed files with 136 additions and 69 deletions

63
go.mod
View File

@ -1,3 +1,64 @@
module git.u8t.cn/open/gosdk
go 1.24
go 1.24.0
toolchain go1.24.5
require (
git.u8t.cn/open/goutil v0.0.0-20250905165603-41d47bb16296
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf
github.com/eclipse/paho.mqtt.golang v1.5.0
github.com/gin-gonic/gin v1.10.1
github.com/gomodule/redigo v1.9.2
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c
github.com/minio/minio-go v6.0.14+incompatible
github.com/qiniu/go-sdk/v7 v7.25.4
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cast v1.10.0
github.com/tidwall/gjson v1.18.0
github.com/wechatpay-apiv3/wechatpay-go v0.2.21
golang.org/x/crypto v0.42.0
gorm.io/gorm v1.30.5
)
require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gammazero/toposort v0.1.1 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/speps/go-hashids v2.0.0+incompatible // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/text v0.29.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/fileutil v1.0.0 // indirect
)

View File

@ -35,8 +35,9 @@ const (
//MsgTypeTransfer 表示消息消息转发到客服
MsgTypeTransfer = "transfer_customer_service"
//MsgTypeEvent 表示事件推送消息
MsgTypeEvent = "event"
MsgTypeChannels = "channels"
MsgTypeEvent = "event"
MsgTypeChannels = "channels"
MsgTypeChnageContract = "change_contact"
)
const (
@ -83,94 +84,99 @@ const (
// MixMessage 存放所有微信发送过来的消息和事件
type MixMessage struct {
CommonToken
CommonToken `json:"commonToken"`
//基本消息
MsgID int64 `xml:"MsgId"`
Content string `xml:"Content"`
Recognition string `xml:"Recognition"`
PicURL string `xml:"PicUrl"`
MediaID string `xml:"MediaId"`
Format string `xml:"Format"`
ThumbMediaID string `xml:"ThumbMediaId"`
LocationX float64 `xml:"Location_X"`
LocationY float64 `xml:"Location_Y"`
Scale float64 `xml:"Scale"`
Label string `xml:"Label"`
Title string `xml:"Title"`
Description string `xml:"Description"`
URL string `xml:"Url"`
MsgID int64 `xml:"MsgId" json:"msgID,omitempty"`
Content string `xml:"Content" json:"content,omitempty"`
Recognition string `xml:"Recognition" json:"recognition,omitempty"`
PicURL string `xml:"PicUrl" json:"picURL,omitempty"`
MediaID string `xml:"MediaId" json:"mediaID,omitempty"`
Format string `xml:"Format" json:"format,omitempty"`
ThumbMediaID string `xml:"ThumbMediaId" json:"thumbMediaID,omitempty"`
LocationX float64 `xml:"Location_X" json:"locationX,omitempty"`
LocationY float64 `xml:"Location_Y" json:"locationY,omitempty"`
Scale float64 `xml:"Scale" json:"scale,omitempty"`
Label string `xml:"Label" json:"label,omitempty"`
Title string `xml:"Title" json:"title,omitempty"`
Description string `xml:"Description" json:"description,omitempty"`
URL string `xml:"Url" json:"URL,omitempty"`
//事件相关
Event EventType `xml:"Event"`
EventKey string `xml:"EventKey"`
Ticket string `xml:"Ticket"`
Latitude string `xml:"Latitude"`
Longitude string `xml:"Longitude"`
Precision string `xml:"Precision"`
MenuID string `xml:"MenuId"`
Status string `xml:"Status"`
SessionFrom string `xml:"SessionFrom"`
Event EventType `xml:"Event" json:"event,omitempty"`
EventKey string `xml:"EventKey" json:"eventKey,omitempty"`
Ticket string `xml:"Ticket" json:"ticket,omitempty"`
Latitude string `xml:"Latitude" json:"latitude,omitempty"`
Longitude string `xml:"Longitude" json:"longitude,omitempty"`
Precision string `xml:"Precision" json:"precision,omitempty"`
MenuID string `xml:"MenuId" json:"menuID,omitempty"`
Status string `xml:"Status" json:"status,omitempty"`
SessionFrom string `xml:"SessionFrom" json:"sessionFrom,omitempty"`
ScanCodeInfo struct {
ScanType string `xml:"ScanType"`
ScanResult string `xml:"ScanResult"`
} `xml:"ScanCodeInfo"`
ScanType string `xml:"ScanType" json:"scanType,omitempty"`
ScanResult string `xml:"ScanResult" json:"scanResult,omitempty"`
} `xml:"ScanCodeInfo" json:"scanCodeInfo"`
// 企业微信客服相关
OpenKfId string `xml:"OpenKfId"`
Token string `xml:"Token"`
OpenKfId string `xml:"OpenKfId" json:"openKfId,omitempty"`
Token string `xml:"Token" json:"token,omitempty"`
// 企业微信审核相关
ApprovalInfo struct {
SpNo string `xml:"SpNo"`
SpName string `xml:"SpName"`
SpStatus int `xml:"SpStatus"`
TemplateId string `xml:"TemplateId"`
ApplyTime int64 `xml:"ApplyTime"`
SpNo string `xml:"SpNo" json:"spNo,omitempty"`
SpName string `xml:"SpName" json:"spName,omitempty"`
SpStatus int `xml:"SpStatus" json:"spStatus,omitempty"`
TemplateId string `xml:"TemplateId" json:"templateId,omitempty"`
ApplyTime int64 `xml:"ApplyTime" json:"applyTime,omitempty"`
Applyer struct {
UserId string `xml:"UserId"`
} `xml:"Applyer"`
} `xml:"ApprovalInfo"`
UserId string `xml:"UserId" json:"userId,omitempty"`
} `xml:"Applyer" json:"applyer"`
} `xml:"ApprovalInfo" json:"approvalInfo"`
SendPicsInfo struct {
Count int32 `xml:"Count"`
PicList []EventPic `xml:"PicList>item"`
} `xml:"SendPicsInfo"`
Count int32 `xml:"Count" json:"count,omitempty"`
PicList []EventPic `xml:"PicList>item" json:"picList,omitempty"`
} `xml:"SendPicsInfo" json:"sendPicsInfo"`
SendLocationInfo struct {
LocationX float64 `xml:"Location_X"`
LocationY float64 `xml:"Location_Y"`
Scale float64 `xml:"Scale"`
Label string `xml:"Label"`
Poiname string `xml:"Poiname"`
}
LocationX float64 `xml:"Location_X" json:"locationX,omitempty"`
LocationY float64 `xml:"Location_Y" json:"locationY,omitempty"`
Scale float64 `xml:"Scale" json:"scale,omitempty"`
Label string `xml:"Label" json:"label,omitempty"`
Poiname string `xml:"Poiname" json:"poiname,omitempty"`
} `json:"sendLocationInfo"`
// 第三方平台相关
InfoType InfoType `xml:"InfoType"`
AppID string `xml:"AppId"`
ComponentVerifyTicket string `xml:"ComponentVerifyTicket"`
AuthorizerAppid string `xml:"AuthorizerAppid"`
AuthorizationCode string `xml:"AuthorizationCode"`
AuthorizationCodeExpiredTime int64 `xml:"AuthorizationCodeExpiredTime"`
PreAuthCode string `xml:"PreAuthCode"`
InfoType InfoType `xml:"InfoType" json:"infoType,omitempty"`
AppID string `xml:"AppId" json:"appID,omitempty"`
ComponentVerifyTicket string `xml:"ComponentVerifyTicket" json:"componentVerifyTicket,omitempty"`
AuthorizerAppid string `xml:"AuthorizerAppid" json:"authorizerAppid,omitempty"`
AuthorizationCode string `xml:"AuthorizationCode" json:"authorizationCode,omitempty"`
AuthorizationCodeExpiredTime int64 `xml:"AuthorizationCodeExpiredTime" json:"authorizationCodeExpiredTime,omitempty"`
PreAuthCode string `xml:"PreAuthCode" json:"preAuthCode,omitempty"`
// 卡券相关
CardID string `xml:"CardId"`
RefuseReason string `xml:"RefuseReason"`
IsGiveByFriend int32 `xml:"IsGiveByFriend"`
FriendUserName string `xml:"FriendUserName"`
UserCardCode string `xml:"UserCardCode"`
OldUserCardCode string `xml:"OldUserCardCode"`
OuterStr string `xml:"OuterStr"`
IsRestoreMemberCard int32 `xml:"IsRestoreMemberCard"`
UnionID string `xml:"UnionId"`
CardID string `xml:"CardId" json:"cardID,omitempty"`
RefuseReason string `xml:"RefuseReason" json:"refuseReason,omitempty"`
IsGiveByFriend int32 `xml:"IsGiveByFriend" json:"isGiveByFriend,omitempty"`
FriendUserName string `xml:"FriendUserName" json:"friendUserName,omitempty"`
UserCardCode string `xml:"UserCardCode" json:"userCardCode,omitempty"`
OldUserCardCode string `xml:"OldUserCardCode" json:"oldUserCardCode,omitempty"`
OuterStr string `xml:"OuterStr" json:"outerStr,omitempty"`
IsRestoreMemberCard int32 `xml:"IsRestoreMemberCard" json:"isRestoreMemberCard,omitempty"`
UnionID string `xml:"UnionId" json:"unionID,omitempty"`
// 内容审核相关
IsRisky bool `xml:"isrisky"`
ExtraInfoJSON string `xml:"extra_info_json"`
TraceID string `xml:"trace_id"`
StatusCode int `xml:"status_code"`
IsRisky bool `xml:"isrisky" json:"isRisky,omitempty"`
ExtraInfoJSON string `xml:"extra_info_json" json:"extraInfoJSON,omitempty"`
TraceID string `xml:"trace_id" json:"traceID,omitempty"`
StatusCode int `xml:"status_code" json:"statusCode,omitempty"`
//通讯录同步相关
ChangeType string `xml:"ChangeType"`
UserID string `xml:"UserID"`
Department string `xml:"Department"`
}
// EventPic 发图事件推送