views

package
v0.0.0-...-9908d45 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NowSelectedAccount

func NowSelectedAccount() (*model.Account, bool)

func SetCtx

func SetCtx(c context.Context)

Types

type AccountsView

type AccountsView struct {
}

func (*AccountsView) AddAccount

func (v *AccountsView) AddAccount(req *AddAccountReq) *AddAccountResp

func (*AccountsView) GetAccounts

func (v *AccountsView) GetAccounts() *GetAccountsResp

func (*AccountsView) GetSelectedAccount

func (v *AccountsView) GetSelectedAccount() *GetSelectedAccountResp

func (*AccountsView) RemoveAccount

func (v *AccountsView) RemoveAccount(id uint) *GetAccountsResp

func (*AccountsView) SelectOneAccount

func (v *AccountsView) SelectOneAccount(id uint) *SelectOneAccountResp

type AddAccountReq

type AddAccountReq struct {
	Token string `json:"token"`
}

type AddAccountResp

type AddAccountResp struct {
	Ok    bool   `json:"ok"`
	Error string `json:"error"`
}

type AgreementView

type AgreementView struct {
}

func (*AgreementView) Quit

func (a *AgreementView) Quit()

type GetAccountsResp

type GetAccountsResp struct {
	Ok       bool                      `json:"ok"`
	Error    string                    `json:"error"`
	Accounts []*GetAccountsRespAccount `json:"accounts"`
}

type GetAccountsRespAccount

type GetAccountsRespAccount struct {
	ID        uint      `gorm:"primarykey" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Token     string    `gorm:"column:token;type:text;not null;" json:"token"`
	FirstName string    `gorm:"column:first_name;type:text;not null;default:'';" json:"first_name"`
	LastName  string    `gorm:"column:last_name;type:text;not null;default:'';" json:"last_name"`
	UserName  string    `gorm:"column:username;type:text;not null;default:'';" json:"username"`
	Running   bool      `json:"running"`
}

type GetHomeResp

type GetHomeResp struct {
	Ok    bool            `json:"ok"`
	Error string          `json:"error"`
	Data  GetHomeRespData `json:"data"`
}

type GetHomeRespAdvancedConfig

type GetHomeRespAdvancedConfig struct {
	ChatGptEnabled          bool   `json:"ChatGptEnabled"`
	ChatGptApiKey           string `json:"ChatGptApiKey"`
	ChatGptHttpProxy        string `json:"ChatGptHttpProxy"`
	ChatGptModel            string `json:"ChatGptModel"`
	ChatGptSystemPrompt     string `json:"ChatGptSystemPrompt"`
	ChatGptBaseUrl          string `json:"ChatGptBaseUrl"`
	ChatGptTemperature      string `json:"ChatGptTemperature"`
	ChatGptMaxTokens        string `json:"ChatGptMaxTokens"`
	ChatGptTopP             string `json:"ChatGptTopP"`
	ChatGptPresencePenalty  string `json:"ChatGptPresencePenalty"`
	ChatGptFrequencyPenalty string `json:"ChatGptFrequencyPenalty"`
	ChatGptHistoryCount     string `json:"ChatGptHistoryCount"`
	ChatGptTimeout          string `json:"ChatGptTimeout"`
}

type GetHomeRespButton

type GetHomeRespButton struct {
	Title string `json:"Title"`
	Url   string `json:"Url"`
}

type GetHomeRespCommand

type GetHomeRespCommand struct {
	Id              string `json:"id"`
	Command         string `json:"command"`
	ReplyId         string `json:"replyId"`
	ReplyName       string `json:"replyName"`
	ReplyIsTemplate string `json:"replyIsTemplate"`
	HookUrl         string `json:"hookUrl"`
}

type GetHomeRespData

type GetHomeRespData struct {
	Running        bool                       `json:"running"`
	RobotInfo      GetHomeRespRobotInfo       `json:"robotInfo"`
	KeyboardGroups []GetHomeRespKeyboardGroup `json:"keyboardGroups"`
	Replies        []GetHomeRespReply         `json:"replies"`
	Commands       []GetHomeRespCommand       `json:"commands"`
	AdvancedConfig GetHomeRespAdvancedConfig  `json:"advancedConfig"`
}

type GetHomeRespGame

type GetHomeRespGame struct {
	GameShortName string `json:"GameShortName"`
	GameTitle     string `json:"GameTitle"`
	Url           string `json:"Url"`
	ButtonText    string `json:"ButtonText"`
}

type GetHomeRespKeyboardGroup

type GetHomeRespKeyboardGroup struct {
	Id   string     `json:"id"`
	Name string     `json:"name"`
	Keys [][]string `json:"keys"`
}

type GetHomeRespPic

type GetHomeRespPic struct {
	Base64 string `json:"Base64"`
}

type GetHomeRespReply

type GetHomeRespReply struct {
	Id                string              `json:"id"`
	Name              string              `json:"name"`
	IsTemplate        string              `json:"isTemplate"`
	MessageType       string              `json:"messageType"`
	GameContent       GetHomeRespGame     `json:"gameContent"`
	PicContent        GetHomeRespPic      `json:"picContent"`
	TextContent       GetHomeRespText     `json:"textContent"`
	ExpandType        string              `json:"expandType"`
	KeyboardGroupId   string              `json:"keyboardGroupId"`
	KeyboardGroupName string              `json:"keyboardGroupName"`
	Buttons           []GetHomeRespButton `json:"buttons"`
}

type GetHomeRespRobotInfo

type GetHomeRespRobotInfo struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Username  string `json:"username"`
	Token     string `json:"token"`
}

type GetHomeRespText

type GetHomeRespText struct {
	Content string `json:"Content"`
}

type GetSelectedAccountResp

type GetSelectedAccountResp struct {
	Ok    bool   `json:"ok"`
	Error string `json:"error"`
	Id    uint   `json:"id"`
}

type HomeView

type HomeView struct {
}

func (*HomeView) GetHome

func (v *HomeView) GetHome() *GetHomeResp

func (*HomeView) SaveHome

func (v *HomeView) SaveHome(req *GetHomeRespData) *GetHomeResp

func (*HomeView) SetRunning

func (v *HomeView) SetRunning(running bool) *GetHomeResp

type SelectOneAccountResp

type SelectOneAccountResp struct {
	Ok    bool   `json:"ok"`
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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