models

package
v0.10.2-0...-05cb27a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	gorms.Model
	CorpID         string `gorm:"uniqueIndex:files_corp_id_md5sum"`
	MD5Sum         string `gorm:"index;uniqueIndex:files_corp_id_md5sum;not null;default:null"`
	OriginalMD5Sum string `gorm:"index"`
	Name           string
	Ext            string
	Width          int
	Height         int
	Length         int
	Size           int
	ContentType    string
	Content        []byte
}

func FileFromMedia

func FileFromMedia(mm *WeWorkFinanceSDK.Media) *File

func (*File) FromMedia

func (m *File) FromMedia(mm *WeWorkFinanceSDK.Media)

type Media

type Media struct {
	gorms.Model
	CorpID         string `gorm:"uniqueIndex:media_corp_id_sequence_index"`
	MessageID      string `gorm:"index"`
	Sequence       uint64 `gorm:"uniqueIndex:media_corp_id_sequence_index"`
	Index          int    `gorm:"uniqueIndex:media_corp_id_sequence_index"`
	FileName       string
	FileSize       int
	Length         int
	Width          int
	Height         int
	FileID         string
	Ext            string
	MD5Sum         string `gorm:"index"`
	OriginalMD5Sum string `gorm:"index"` // 写入的文件 MD5
}

func FromMedia

func FromMedia(mm *WeWorkFinanceSDK.Media) (m *Media)

func (*Media) FromMedia

func (m *Media) FromMedia(mm *WeWorkFinanceSDK.Media)

type Message

type Message struct {
	gorms.Model
	CorpID      string    `gorm:"uniqueIndex:messages_corp_id_sequence"`
	MessageID   string    `gorm:"unique"`
	Sequence    uint64    `gorm:"uniqueIndex:messages_corp_id_sequence"`
	MessageTime time.Time `gorm:"index"`
	Type        string
	Action      string
	FromID      string
	ToID        string
	RoomID      string
	Raw         datatypes.JSON
	HasMedia    bool
	Medias      []*Media `gorm:"foreignKey:MessageID;references:MessageID"`
}

func FromMessage

func FromMessage(mm WeWorkFinanceSDK.Message) *Message

func (*Message) FromMedias

func (m *Message) FromMedias(medias []*WeWorkFinanceSDK.Media)

func (*Message) FromMessage

func (m *Message) FromMessage(mm WeWorkFinanceSDK.Message)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL