gmodel

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllType = []*TypeDetail{
	{TypeText, TypeText.String(), TypeText.StringEnglish()},
	{TypeTextCard, TypeTextCard.String(), TypeTextCard.StringEnglish()},
	{TypeMarkdown, TypeMarkdown.String(), TypeMarkdown.StringEnglish()},
	{TypeHTML, TypeHTML.String(), TypeHTML.StringEnglish()},
}

Functions

This section is empty.

Types

type Resp

type Resp struct {
	Code RespCode `json:"code"`
	Msg  string   `json:"msg,omitempty"`
	Data any      `json:"data,omitempty"`
}

func (*Resp) DataInt64

func (m *Resp) DataInt64() int64

func (*Resp) DataString

func (m *Resp) DataString() string

type RespCode

type RespCode int
const (
	RespCodeSucceeded       RespCode = 0 // 成功
	RespCodeFailed          RespCode = 1 // 失败
	RespCodeNotFound        RespCode = 2 // 未找到
	RespCodeBadRequest      RespCode = 3 // 错误输入
	RespCodeUnAuthorized    RespCode = 4 // 未登录
	RespCodeForbidden       RespCode = 5 // 未授权
	RespCodeConflict        RespCode = 6 // 数据冲突
	RespCodeTooManyRequests RespCode = 7 // 太多请求
)

type RespRaw

type RespRaw struct {
	Code RespCode        `json:"code"`
	Msg  string          `json:"msg,omitempty"`
	Data json.RawMessage `json:"data,omitempty"`
}

type Send

type Send struct {
	ID    int64  `json:"id" form:"id" query:"id"`
	Sign  string `json:"sign" form:"sign" query:"sign"` // 唯一标记
	Type  Type   `json:"type" form:"type" query:"type"` // 消息类型
	At    int64  `json:"at" form:"at" query:"at"`       // SendAt
	Title string `json:"title" form:"title" query:"title"`
	Msg   string `json:"msg" form:"msg" query:"msg"`
}

func NewSend

func NewSend(id int64, sign string, cType Type, at int64, title, msg string) *Send

type SendCancel

type SendCancel struct {
	ID int64 `json:"id" form:"id" query:"id"`
}

func NewSendCancel

func NewSendCancel(id int64) *SendCancel

type SendStatus

type SendStatus struct {
	ID int64 `json:"id" form:"id" query:"id"`
}

func NewSendStatus

func NewSendStatus(id int64) *SendStatus

type Status

type Status string
const (
	StatusOK     Status = "ok"
	StatusWait   Status = "wait"
	StatusCancel Status = "cancel"
	StatusFailed Status = "failed"
)

type StatusModel

type StatusModel struct {
	Status Status `json:"status"`
	SendAt int64  `json:"send_at"`
	SentAt int64  `json:"sent_at"`
	ErrMsg string `json:"err_msg"`
}

type Type

type Type string
const (
	TypeText     Type = "text"
	TypeTextCard Type = "textcard" // 微信卡片信息
	TypeMarkdown Type = "markdown"
	TypeHTML     Type = "html"
)

func (Type) String

func (t Type) String() string

func (Type) StringEnglish

func (t Type) StringEnglish() string

func (Type) Valid

func (t Type) Valid() bool

type TypeDetail

type TypeDetail struct {
	Type        Type   `json:"type"`
	Name        string `json:"name"`
	EnglishName string `json:"english_name"`
}

Jump to

Keyboard shortcuts

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