models

package
v0.0.0-...-4c735e4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheToken = cache.New(2*time.Hour, 2*time.Hour)

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	PublicResult
	Access_token string
	Expires_in   int
}

func GetAccessToken

func GetAccessToken() (token *AccessToken)

func GetAccessTokenAPI

func GetAccessTokenAPI() (result *AccessToken, err error)

type Department

type Department struct {
	Name     string `json:"name"`
	Parentid int    `json:"parentid"`
	Order    int    `json:"order"`
	Id       int    `json:"id"`
}

type Department2

type Department2 struct {
	Name     string `json:"name"`
	Parentid int    `json:"parentid"`
	Order    int    `json:"order"`
}

type DepartmentAddResult

type DepartmentAddResult struct {
	PublicResult
	Id int
}

func DepartmentAdd

func DepartmentAdd(department Department2) (result *DepartmentAddResult, err error)

type DepartmentGetResult

type DepartmentGetResult struct {
	PublicResult
	Department []*Department
}

func GetDepartmentList

func GetDepartmentList() (result *DepartmentGetResult, err error)

type File

type File struct {
	Media_id string `json:"media_id"`
}

type Message

type Message struct {
	Touser   string   `json:"touser"`
	Toparty  string   `json:"toparty"`
	Totag    string   `json:"totag"`
	Msgtype  string   `json:"msgtype"`
	Agentid  int      `json:"agentid"`
	Safe     int      `json:"safe"`
	Text     Text     `json:"text"`     //Msgtype为text时方可使用
	File     File     `json:"file"`     //Msgtype为file时方可使用
	Textcard Textcard `json:"textcard"` //Msgtype为textcard时方可使用

}

type PublicResult

type PublicResult struct {
	Errcode int
	Errmsg  string
}

func DepartmentDelete

func DepartmentDelete(id int) (result *PublicResult, err error)

func DepartmentUpdate

func DepartmentUpdate(department Department) (result *PublicResult, err error)

func PushMessage

func PushMessage(message Message) (result *PublicResult, err error)

func PushMessageWithFile

func PushMessageWithFile(fileUrl string, message Message) (result *PublicResult, err error)

type Text

type Text struct {
	Content string `json:"content"`
}

type Textcard

type Textcard struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Url         string `json:"url"`
}

type UploadMediaRes

type UploadMediaRes struct {
	PublicResult
	Type     string `json:"type"`
	Media_id string `json:"media_id"`
}

文件上传时的返回

func UploadMedia

func UploadMedia(fileUrl string) (result *UploadMediaRes, err error)

Jump to

Keyboard shortcuts

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