skland

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Addr      = "https://zonai.skland.com"
	UserAgent = "Skland/1.5.1 (com.hypergryph.skland; build:100501001; Android 33; ) Okhttp/4.11.0"
	Platform  = "1"
	VName     = "1.5.1"
	DId       = "743a446c83032899"

	GameIdArknights = "1"   // 明日方舟
	GameIdExastris  = "2"   // 来自星尘
	GameIdEndfleld  = "3"   // 明日方舟:终末地
	GameIdPopucom   = "4"   // 泡姆泡姆
	GameIdNest      = "100" // 纳斯特港
	GameIdOpenup    = "101" // 开拓芯

	GameAppCodeArknights = "arknights"

	MessageForumHasSigned = "重复签到"
	MessageGameHasSigned  = "请勿重复签到!"
)
View Source
const (
	ActionLike    = 12
	ActionCollect = 21
)

Variables

This section is empty.

Functions

func ActionPost added in v1.2.0

func ActionPost(postId string, action int, cancel bool, skland config.AccountSkland) error

func AddSign

func AddSign(r *resty.Request, method, path string, skland config.AccountSkland)

func Exec

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

func IsMessage added in v1.2.0

func IsMessage(err error, msg string) bool

func IsUnauthorized

func IsUnauthorized(err error) bool

func R

func R() *resty.Request

func SharePost added in v1.1.6

func SharePost(gameId string, skland config.AccountSkland) error

func SignForum added in v1.2.0

func SignForum(gid string, skland config.AccountSkland) error

func SwitchPlayer

func SwitchPlayer(gid, uid string, skland config.AccountSkland) error

Types

type AuthRefreshData

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

func AuthRefresh

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

type BaseResp

type BaseResp[T any] struct {
	Code    *int   `json:"code"`
	Message string `json:"message"`
	Data    T      `json:"data,omitempty"`
}

func (*BaseResp[T]) GetMessage added in v1.2.0

func (t *BaseResp[T]) GetMessage() string

func (*BaseResp[T]) IsSuccess

func (t *BaseResp[T]) IsSuccess() bool

func (*BaseResp[T]) String

func (t *BaseResp[T]) String() string

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 added in v1.2.0

type CalendarRecords []*CalendarRecord

func (CalendarRecords) ShortString added in v1.2.0

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

func (CalendarRecords) Today added in v1.2.0

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

type GameCate added in v1.2.0

type GameCate struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Kind        int    `json:"kind"`
	Status      int    `json:"status"`
	StartAtTs   int    `json:"startAtTs"`
	CreatedAtTs int    `json:"createdAtTs"`
	UpdatedAtTs int    `json:"updatedAtTs"`
}

type GameData added in v1.2.0

type GameData struct {
	Game          *GameInfo          `json:"game"`
	Cates         []*GameCate        `json:"cates"`
	QuickAccesses []*GameQuickAccess `json:"quickaccesses"`
}

func (*GameData) FirstCate20 added in v1.2.0

func (t *GameData) FirstCate20() *GameCate

type GameInfo

type GameInfo struct {
	GameId int    `json:"gameId"`
	Name   string `json:"name"`
}

type GameQuickAccess added in v1.2.0

type GameQuickAccess struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Status      int    `json:"status"`
	StartAtTs   int    `json:"startAtTs"`
	CreatedAtTs int    `json:"createdAtTs"`
	UpdatedAtTs int    `json:"updatedAtTs"`
}

type GenCredByCodeData

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

func AuthLoginByCode

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

type GetPostData added in v1.1.6

type GetPostData struct {
	List []*PostData `json:"list"`
}

func (*GetPostData) Get added in v1.1.6

func (v *GetPostData) Get() *PostData

type GetSignForumData added in v1.2.0

type GetSignForumData struct {
	List []*SignFormData `json:"list"`
}

func GetSignForum added in v1.2.0

func GetSignForum(skland config.AccountSkland) (*GetSignForumData, error)

func (GetSignForumData) Map added in v1.2.0

func (t GetSignForumData) Map() map[int]bool

type ListAttendanceData

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

func ListSignGame added in v1.2.0

func ListSignGame(gid, uid string, skland config.AccountSkland) (*ListAttendanceData, error)

type ListGameData

type ListGameData struct {
	List []*GameData `json:"list"`
}

func ListGame

func ListGame() (*ListGameData, error)

type ListPlayerData

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

func ListPlayer

func ListPlayer(skland config.AccountSkland) (*ListPlayerData, error)

type ListPostData added in v1.1.6

type ListPostData struct {
	HasMore   bool        `json:"hasMore"`
	PageSize  int         `json:"pageSize"`
	PageToken string      `json:"pageToken"`
	List      []*PostData `json:"list"`
}

func ListPost added in v1.1.6

func ListPost(gameId, cateId, pageToken string, skland config.AccountSkland) (*ListPostData, error)

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 added in v1.2.0

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

type PostData added in v1.2.0

type PostData struct {
	Item    *PostInfo    `json:"item"`
	ItemRel *PostRel     `json:"itemRel"`
	ItemRts *PostRts     `json:"itemRts"`
	User    *PostUser    `json:"user"`
	UserRel *PostUserRel `json:"userRel"`
}

func GetPost added in v1.1.6

func GetPost(postId string, skland config.AccountSkland) (*PostData, error)

func (*PostData) IsCollected added in v1.2.0

func (p *PostData) IsCollected() bool

func (*PostData) IsLiked added in v1.2.0

func (p *PostData) IsLiked() bool

type PostInfo added in v1.2.0

type PostInfo struct {
	Id               string `json:"id"`
	UserId           string `json:"userId"`
	GameId           int    `json:"gameId"`
	CateId           int    `json:"cateId"`
	Title            string `json:"title"`
	Status           int    `json:"status"`
	Version          int    `json:"version"`
	CreatedAtTs      int    `json:"createdAtTs"`
	UpdatedAtTs      int    `json:"updatedAtTs"`
	LatestEditAtTs   int    `json:"latestEditAtTs"`
	LatestReplyAtTs  int    `json:"latestReplyAtTs"`
	FirstIpLocation  string `json:"firstIpLocation"`
	LatestIpLocation string `json:"latestIpLocation"`
}

type PostRel added in v1.2.0

type PostRel struct {
	Collect bool `json:"collect"`
	Like    bool `json:"like"`
}

type PostRts added in v1.2.0

type PostRts struct {
	Collected string `json:"collected"`
	Commented string `json:"commented"`
	Liked     string `json:"liked"`
	Reposted  string `json:"reposted"`
	Viewed    string `json:"viewed"`
}

type PostUser added in v1.1.6

type PostUser struct {
	Id               string `json:"id"`
	Nickname         string `json:"nickname"`
	Profile          string `json:"profile"`
	Status           int    `json:"status"`
	Gender           int    `json:"gender"`
	Birthday         string `json:"birthday"`
	LatestIpLocation string `json:"latestIpLocation"`
}

type PostUserRel added in v1.1.6

type PostUserRel struct {
	Black    bool `json:"black"`
	Blacked  bool `json:"blacked"`
	Fans     bool `json:"fans"`
	FansAtTs int  `json:"fansAtTs"`
	Follow   bool `json:"follow"`
}

type SignFormData added in v1.2.0

type SignFormData struct {
	GameId  int `json:"gameId"`
	Checked int `json:"checked"`
}

type SignGameAward added in v1.2.0

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

type SignGameAwards added in v1.2.0

type SignGameAwards []*SignGameAward

func (SignGameAwards) ShortString added in v1.2.0

func (t SignGameAwards) ShortString() string

type SignGameData added in v1.2.0

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

func SignGame added in v1.2.0

func SignGame(gid, uid string, skland config.AccountSkland) (*SignGameData, error)

type SignGameRes added in v1.2.0

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

type User

type User struct {
	User *UserInfo `json:"user"`
}

func GetUser

func GetUser(skland config.AccountSkland) (*User, error)

type UserInfo

type UserInfo struct {
	Id       string `json:"id"`
	Nickname string `json:"nickname"`
}

Jump to

Keyboard shortcuts

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