Documentation ¶
Index ¶
- Variables
- func AllowKeysInterfaceMarshal(input interface{}, keys []string) ([]byte, error)
- func ApplyChatRoomTemplate(db *gorm.DB, myId, subId, workTemplateId string, chatRoomList []string) (data interface{}, err error)
- func CheckCmdUseWechatMini(m *models.MyCmd) bool
- func CountWorkTemplateChatRoom(db *gorm.DB, myId, subId, cmdType string) error
- func CreateWorkTemplate(db *gorm.DB, myId, subId, name, cmdType, cmdValue, cmdParams, cmdReply string, ...) (ret *models.WorkTemplate, err error)
- func EventChatRoomCreate(v *models.RobotChatRoom, publisher *rmqtool.PublisherTool) error
- func FetchAlimamaSearchPid(myId, subId string, db *gorm.DB) (string, error)
- func FetchChatRoomCustomKeywordReplyTemplate(db *gorm.DB, chatRoomSerialNo, msg string, org map[string]interface{}) ([]map[string]interface{}, error)
- func FetchChatRoomIntelligentChatTemplate(db *gorm.DB, chatRoomSerialNo string, msgDate time.Time) (*models.WorkTemplate, error)
- func FetchChatRoomMemberJoinMessage(charRoomSerialNo string, db *gorm.DB) string
- func FetchChatRoomMemberJoinMessageTemplate(db *gorm.DB, chatRoomSerialNo string) (string, time.Duration)
- func FetchTuikeasySearchDomain(myId, subId string, db *gorm.DB) (string, error)
- func FetchTulingResult(key, secret string, context map[string]interface{}, chat_room_serial_no string, ...) ([]map[string]string, error)
- func FixUchatJsonBinary(b []byte) []byte
- func FixWechatMiniGroupContext(text, webviewUrl string) string
- func FixWechatMiniGroupMessageQueue(chatRoomSerialNo, text, webviewUrl, img string) *models.MessageQueue
- func GenerateTuikeasyProductCouponSearchByChatRoomSerialNo(chat_room_serial_no string, db *gorm.DB, managerDB *gorm.DB) (string, error)
- func GenerateTuikeasyProductSearchContent(myId, domain, content string, db *gorm.DB) (string, error)
- func GenerateTuikeasyProductSearchContentByKeyword(chat_room_serial_no, key string, db *gorm.DB, managerDB *gorm.DB) (string, error)
- func GenerateTuikeasyProductSearchTextUrl(myId, domain, content string, db *gorm.DB) (*models.MyCmd, string, string, error)
- func GenerateTuikeasyProductSearchTextUrlByKeyword(chat_room_serial_no, key string, db *gorm.DB, managerDB *gorm.DB) (string, string, error)
- func GenerateTuikeasyProductSearchUrl(domain, key string) string
- func GetChatRoomHeadImage(db *gorm.DB, chatRoomSerialNo string, limit int) (io.Reader, error)
- func GetChatRoomTemplate(db *gorm.DB, myId, subId, workTemplateId string) (list *[]models.ChatRoomWorkTemplate, err error)
- func GetChatRoomTemplates(db *gorm.DB, chat_room_serial_no string) (data interface{}, err error)
- func GetChatRoomValidTemplate(db *gorm.DB, chat_room_serial_no, cmd_type string) (data *models.WorkTemplate, err error)
- func GetChatRoomValidTemplates(db *gorm.DB, chat_room_serial_no, cmd_type string) (data []models.WorkTemplate, err error)
- func GetCmdType(db *gorm.DB, typeFlag string) (ret *models.CmdType, err error)
- func GetWorkTemplate(db *gorm.DB, workTemplateId string) (ret interface{}, err error)
- func InitHashIds(salt string, minLen int)
- func ListCmdType(db *gorm.DB) (list *[]models.CmdType, err error)
- func ListWorkTemplate(db *gorm.DB, myId, subId, cmdType string) (list *[]models.WorkTemplate, err error)
- func SendAlimamCouponSearch(myId, pid, chatRoomSerialNo, content string, db *gorm.DB) error
- func SendAlimamProductSearch(myId, pid, chatRoomSerialNo, content string, db *gorm.DB) error
- func SendChatRoomMemberTextMessage(charRoomSerialNo, wxSerialNo, msg string, db, managerDB *gorm.DB) error
- func SendShopCustomSearch(myId, subId, chatRoomSerialNo, content string, db *gorm.DB) error
- func SendTuikeasyCouponSearch(myId, domain, chatRoomSerialNo, content string, db *gorm.DB) error
- func SendTuikeasyProductSearch(myId, domain, chatRoomSerialNo, content string, db *gorm.DB) error
- func SetDefaultWorkTemplate(db *gorm.DB, myId, subId, workTemplateId string) (ret *models.WorkTemplate, err error)
- func ShortUrl(link string) string
- func SyncChatKeywordCallback(b []byte, db *gorm.DB, managerDB *gorm.DB, tool *utils.ReceiveTool, ...) error
- func SyncChatMessageCallback(b []byte, db *gorm.DB, managerDB *gorm.DB, tool *utils.ReceiveTool) error
- func SyncChatOverCallback(b []byte, client *uchatlib.UchatClient) error
- func SyncChatQrCodeCallback(b []byte, db *gorm.DB) error
- func SyncChatRoomCreateCallback(b []byte, client *uchatlib.UchatClient, db *gorm.DB, ...) error
- func SyncChatRoomMembers(chatRoomSerialNo string, client *uchatlib.UchatClient) error
- func SyncChatRoomMembersCallback(b []byte, db *gorm.DB) error
- func SyncChatRoomStatus(chatRoomSerialNo string, client *uchatlib.UchatClient, db *gorm.DB) error
- func SyncMemberJoinCallback(b []byte, db *gorm.DB, managerDB *gorm.DB) error
- func SyncMemberMessageSumCallback(b []byte, db *gorm.DB) error
- func SyncMemberQuitCallback(b []byte, db *gorm.DB) error
- func SyncRobotChatJoinCallback(b []byte, db *gorm.DB) error
- func SyncRobotChatRooms(RobotSerialNo string, client *uchatlib.UchatClient, db *gorm.DB) error
- func SyncRobotChatRoomsCallback(b []byte, db *gorm.DB) error
- func SyncRobotFriendAddCallback(b []byte, db *gorm.DB) error
- func SyncRobots(client *uchatlib.UchatClient, db *gorm.DB) error
- func UpdateChatRoomHeadImage(db *gorm.DB, chatRoomSerialNo string) (*models.ChatRoom, error)
- func UpdateWorkTemplate(db *gorm.DB, workTemplateId, name string, ...) (ret *models.WorkTemplate, err error)
- func UploadQiuniu(filename string, data []byte) (storage.PutRet, error)
- type ChatRoomHeadImage
- type ChatRoomMembersList
- type CustomKeywordReplyTemplateParams
- type CustomKeywordReplyTemplateParamsKeyword
- type HeadImage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ReceiveMQMemberList = "uchat.member.list" //用户列表 ReceiveMQMemberJoin = "uchat.member.join" //用户入群 ReceiveMQMemberQuit = "uchat.member.quit" //用户群群 ReceiveMQMemberMessageSum = "uchat.member.message.sum" //用户发言总数 ReceiveMQRobotChatList = "uchat.robot.chat.list" //设备所开群列表 ReceiveMQRobotJoinChat = "uchat.robot.chat.join" //设备开群信息 ReceiveMQRobotPrivateMessage = "uchat.robot.message.private" //设备私聊 ReceiveMQChatKeyword = "uchat.chat.keyword" //群关键字 ReceiveMQChatCreate = "uchat.chat.create" //建群 ReceiveMQChatMessage = "uchat.chat.message" //群聊天记录 ReceiveMQChatRedpack = "uchat.chat.redpack" //群红包记录 )
小U机器回调队列配置
View Source
var ( DefaultChatRoomHeadImageBackgroundColor color.RGBA = color.RGBA{222, 222, 222, 0} DefaultChatRoomHeadSizeUnit int = 132 DefaultChatRoomHeadPadding int = 12 )
View Source
var ( DefaultMemberJoinWelcome string = "" DefaultMemberJoinSendInterval time.Duration = 60 * time.Second HashID *hashids.HashID UseWorkTemplate bool = false )
View Source
var (
AllowMultiTemplatesCmdType []string = []string{
"shop.custom.keyword.reply",
}
)
View Source
var Shorten *shorten.T
Functions ¶
func ApplyChatRoomTemplate ¶
func CheckCmdUseWechatMini ¶
func CreateWorkTemplate ¶
func EventChatRoomCreate ¶
func EventChatRoomCreate(v *models.RobotChatRoom, publisher *rmqtool.PublisherTool) error
func FetchAlimamaSearchPid ¶
获取淘宝联盟广告位pid
func FetchChatRoomCustomKeywordReplyTemplate ¶
func FetchChatRoomCustomKeywordReplyTemplate(db *gorm.DB, chatRoomSerialNo, msg string, org map[string]interface{}) ([]map[string]interface{}, error)
获取商家自定义关键词回复模板
func FetchChatRoomMemberJoinMessage ¶
获取入群欢迎通知
func FetchTuikeasySearchDomain ¶
获取淘宝联盟广告位pid
func FetchTulingResult ¶
func FixUchatJsonBinary ¶
小U的回调有时候会有换行符 \n,导致json decode失败,此方法兼容这个问题
func FixWechatMiniGroupMessageQueue ¶
func FixWechatMiniGroupMessageQueue(chatRoomSerialNo, text, webviewUrl, img string) *models.MessageQueue
func GetChatRoomHeadImage ¶
func GetChatRoomTemplate ¶
func GetChatRoomTemplates ¶
func GetWorkTemplate ¶
func ListWorkTemplate ¶
func SendAlimamCouponSearch ¶
获取淘宝联盟优惠信息
func SendAlimamProductSearch ¶
获取淘宝联盟产品搜索信息
func SendChatRoomMemberTextMessage ¶
func SendChatRoomMemberTextMessage(charRoomSerialNo, wxSerialNo, msg string, db, managerDB *gorm.DB) error
发送群内信息
func SendShopCustomSearch ¶
func SetDefaultWorkTemplate ¶
func SyncChatKeywordCallback ¶
func SyncChatMessageCallback ¶
func SyncChatMessageCallback(b []byte, db *gorm.DB, managerDB *gorm.DB, tool *utils.ReceiveTool) error
同步群成员时时消息回调 支持重复调用
func SyncChatOverCallback ¶
func SyncChatOverCallback(b []byte, client *uchatlib.UchatClient) error
func SyncChatRoomCreateCallback ¶
func SyncChatRoomCreateCallback(b []byte, client *uchatlib.UchatClient, db *gorm.DB, publisher *rmqtool.PublisherTool) error
同步开群通知回调 支持重复调用
func SyncChatRoomMembers ¶
func SyncChatRoomMembers(chatRoomSerialNo string, client *uchatlib.UchatClient) error
同步群会员信息 支持重复调用
func SyncChatRoomMembersCallback ¶
群会员信息回调 支持重复调用
func SyncChatRoomStatus ¶
同步群状态 支持重复调用
func SyncMemberJoinCallback ¶
同步群成员入群通知回调 支持重复调用
func SyncMemberMessageSumCallback ¶
同步群成员发言数量回调 支持重复调用
func SyncMemberQuitCallback ¶
同步群成员退群通知回调 支持重复调用
func SyncRobotChatRooms ¶
同步设备开群信息 支持重复调用
func SyncRobotChatRoomsCallback ¶
同步设备开群信息回调 支持重复调用
func UpdateChatRoomHeadImage ¶
func UpdateWorkTemplate ¶
func UpdateWorkTemplate(db *gorm.DB, workTemplateId, name string, cmdValue, cmdParams, cmdReply *goutils.NullString, status int8) (ret *models.WorkTemplate, err error)
Types ¶
type ChatRoomHeadImage ¶
type ChatRoomHeadImage struct {
// contains filtered or unexported fields
}
func NewChatRoomHeadImage ¶
func NewChatRoomHeadImage(db *gorm.DB, chatRoomSerialNo string) (*ChatRoomHeadImage, error)
type ChatRoomMembersList ¶
type CustomKeywordReplyTemplateParams ¶
type CustomKeywordReplyTemplateParams struct { Keywords []CustomKeywordReplyTemplateParamsKeyword `json:"keywords"` ReplyType string `json:"reply_type"` }
type HeadImage ¶
type HeadImage struct {
// contains filtered or unexported fields
}
微信头像生成
func NewHeadImage ¶
func NewHeadImage() *HeadImage
Click to show internal directories.
Click to hide internal directories.