api

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrHypergryph = "https://as.hypergryph.com"
	AddrZonai      = "https://zonai.skland.com"
	UserAgent      = "Skland/1.5.1 (com.hypergryph.skland; build:100501001; Android 33; ) Okhttp/4.11.0"

	AppCodeSkland = "4ca99fa6b56cc2ba"
	Platform      = "1"
	VName         = "1.5.1"
	DId           = "743a446c83032899"

	GameIdArknights = "1" // 明日方舟

	GameAppCodeArknights = "arknights"
)
View Source
const (
	CodeGameHasSigned = 10001
)

Variables

Functions

func Exec

func Exec[T any](r *resty.Request, method, url string, args ...any) (t T, _ error)

func IsCode

func IsCode(err error, code int) bool

Types

type AuthRefreshData

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

type Calendar

type Calendar struct {
	ResourceId string `json:"resourceId"`
	Type       string `json:"type"`
	Count      int    `json:"count"`
	Available  bool   `json:"available"`
	Done       bool   `json:"done"`
}

type CalendarRecord

type CalendarRecord struct {
	Ts         string `json:"ts"`
	ResourceId string `json:"resourceId"`
	Type       string `json:"type"`
	Count      int    `json:"count"`
}

type CalendarRecords

type CalendarRecords []*CalendarRecord

func (CalendarRecords) ShortString

func (v1 CalendarRecords) ShortString(m map[string]*SignGameRes) string

func (CalendarRecords) Today

func (v1 CalendarRecords) Today() (v2 CalendarRecords)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(account config.Account) *Client

func (*Client) AuthLoginByCode

func (c *Client) AuthLoginByCode(code string) (*GenCredByCodeData, error)

func (*Client) AuthRefresh

func (c *Client) AuthRefresh(cred string) (*AuthRefreshData, error)

func (*Client) GrantApp

func (c *Client) GrantApp(token string, code string) (*GrantAppData, error)

func (*Client) ListPlayer

func (c *Client) ListPlayer() (*ListPlayerData, error)

func (*Client) ListSignGame

func (c *Client) ListSignGame(gid, uid string) (*ListAttendanceData, error)

func (*Client) LoginByPhoneCode

func (c *Client) LoginByPhoneCode(code string) (*LoginByPhoneCodeData, error)

func (*Client) R

func (c *Client) R() *resty.Request

func (*Client) SendPhoneCode

func (c *Client) SendPhoneCode() error

func (*Client) SignGame

func (c *Client) SignGame(gid, uid string) (*SignGameData, error)

type GenCredByCodeData

type GenCredByCodeData struct {
	UserId string `json:"userId"`
	Cred   string `json:"cred"`
	Token  string `json:"token"`
}

type GrantAppData

type GrantAppData struct {
	Uid  string `json:"uid"`
	Code string `json:"code"`
}

type ListAttendanceData

type ListAttendanceData struct {
	CurrentTs       string                  `json:"currentTs"`
	Calendar        []*Calendar             `json:"calendar"`
	Records         CalendarRecords         `json:"records"`
	ResourceInfoMap map[string]*SignGameRes `json:"resourceInfoMap"`
}

type ListPlayerData

type ListPlayerData struct {
	List []*PlayersByApp `json:"list"`
}

type LoginByPhoneCodeData

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

type Player

type Player struct {
	Uid             string `json:"uid"`
	ChannelName     string `json:"channelName"`
	ChannelMasterId string `json:"channelMasterId"`
	NickName        string `json:"nickName"`
	IsOfficial      bool   `json:"isOfficial"`
	IsDefault       bool   `json:"isDefault"`
	IsDelete        bool   `json:"isDelete"`
}

type PlayersByApp

type PlayersByApp struct {
	AppCode     string    `json:"appCode"`
	AppName     string    `json:"appName"`
	DefaultUid  string    `json:"defaultUid"`
	BindingList []*Player `json:"bindingList"`
}

type SignGameAward

type SignGameAward struct {
	Type     string       `json:"type"`
	Count    int          `json:"count"`
	Resource *SignGameRes `json:"resource"`
}

type SignGameAwards

type SignGameAwards []*SignGameAward

func (SignGameAwards) ShortString

func (t SignGameAwards) ShortString() string

type SignGameData

type SignGameData struct {
	Ts     string         `json:"ts"`
	Awards SignGameAwards `json:"awards"`
}

type SignGameRes

type SignGameRes struct {
	Id     string `json:"id"`
	Type   string `json:"type"`
	Name   string `json:"name"`
	Rarity int    `json:"rarity"`
}

Jump to

Keyboard shortcuts

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