kuro

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Addr          = "https://api.kurobbs.com"
	UserAgent     = "okhttp/3.11.0"
	AndroidName   = "com.kurogame.kjq"
	Version       = "2.2.0"
	SourceAndroid = "android"
	SourceH5      = "h5"

	CodeHasSigned = Code(1511)
)
View Source
const (
	GameIdPNS = 2 // 战双
	GameIdMC  = 3 // 鸣潮
)

Variables

View Source
var GameNames = map[int]string{
	GameIdPNS: "战双",
	GameIdMC:  "鸣潮",
}

Functions

func Exec

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

func IsCode

func IsCode(err error, code Code) bool

func R

func R(vs ...any) *resty.Request

Types

type BaseResp

type BaseResp[T any] struct {
	Code Code   `json:"code"`
	Msg  string `json:"msg"`

	Data T `json:"data,omitempty"`
}

func (*BaseResp[T]) GetCode

func (t *BaseResp[T]) GetCode() Code

func (*BaseResp[T]) IsSuccess

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

func (*BaseResp[T]) String

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

type Code

type Code int

func (*Code) UnmarshalJSON

func (c *Code) UnmarshalJSON(bs []byte) error

type GainVo

type GainVo struct {
	GainTyp   int `json:"gainTyp"`
	GainValue int `json:"gainValue"`
}

type Game3Widget

type Game3Widget struct {
	GameId         int                `json:"gameId"`
	UserId         int                `json:"userId"`
	ServerTime     int                `json:"serverTime"`
	ServerId       string             `json:"serverId"`
	ServerName     string             `json:"serverName"`
	SignInTxt      string             `json:"signInTxt"`
	HasSignIn      bool               `json:"hasSignIn"`
	RoleId         string             `json:"roleId"`
	RoleName       string             `json:"roleName"`
	EnergyData     *Game3WidgetItem   `json:"energyData"`
	LivenessData   *Game3WidgetItem   `json:"livenessData"`
	BattlePassData []*Game3WidgetItem `json:"battlePassData"`
}

func GetGame3Widget

func GetGame3Widget(account config.Account) (*Game3Widget, error)

type Game3WidgetItem

type Game3WidgetItem struct {
	Name             string `json:"name"`
	RefreshTimeStamp int    `json:"refreshTimeStamp"`
	ExpireTimeStamp  int    `json:"expireTimeStamp"`
	Status           int    `json:"status"`
	Cur              int    `json:"cur"`
	Total            int    `json:"total"`
}

type GeeTestData

type GeeTestData struct {
	CaptchaId     string `json:"captcha_id"`
	LotNumber     string `json:"lot_number"`
	PassToken     string `json:"pass_token"`
	GenTime       string `json:"gen_time"`
	CaptchaOutput string `json:"captcha_output"`
}

type GetSignForumData

type GetSignForumData struct {
	ContinueDays int  `json:"continueDays"`
	HasSignIn    bool `json:"hasSignIn"`
}

func GetSignForum

func GetSignForum(gid int, account config.Account) (*GetSignForumData, error)

type Good

type Good struct {
	SerialNum int    `json:"serialNum,omitempty"`
	Type      int    `json:"type,omitempty"`
	GoodsName string `json:"goodsName"`
	GoodsNum  int    `json:"goodsNum"`
	GoodsId   int    `json:"goodsId"`
	SigInDate string `json:"sigInDate,omitempty"`
}

type Goods

type Goods []*Good

func ListSignGameRecord

func ListSignGameRecord(gid int, sid, rid string, uid int, account config.Account) (Goods, error)

func (Goods) ShortString

func (v1 Goods) ShortString() string

func (Goods) ShortStringByMap

func (v1 Goods) ShortStringByMap(m map[int]*Good) string

func (Goods) Today

func (v1 Goods) Today() (v2 Goods)

type ListSignGameData

type ListSignGameData struct {
	DisposableGoodsList Goods `json:"disposableGoodsList"`
	DisposableSignNum   int   `json:"disposableSignNum"`

	SignInGoodsConfigs Goods `json:"signInGoodsConfigs"`
	SignLoopGoodsList  Goods `json:"signLoopGoodsList"`
	SigInNum           int   `json:"sigInNum"`

	NowServerTimes  string `json:"nowServerTimes"`
	EventStartTimes string `json:"eventStartTimes"`
	EventEndTimes   string `json:"eventEndTimes"`
	ExpendGold      int    `json:"expendGold"`
	ExpendNum       int    `json:"expendNum"`
	IsSigIn         bool   `json:"isSigIn"`
	OmissionNnm     int    `json:"omissionNnm"`
}

func ListSignGame

func ListSignGame(gid int, sid, rid string, uid int, account config.Account) (*ListSignGameData, error)

func (*ListSignGameData) GoodsMap

func (v *ListSignGameData) GoodsMap() map[int]*Good

type LoginByPhoneCodeData

type LoginByPhoneCodeData struct {
	UserId   string `json:"userId"`
	UserName string `json:"userName"`
	Token    string `json:"token"`
}

func LoginByPhoneCode

func LoginByPhoneCode(phone, code, devCode string) (*LoginByPhoneCodeData, error)

type Mine

type Mine struct {
	UserId       string `json:"userId"`
	UserName     string `json:"userName"`
	Mobile       string `json:"mobile"`
	Status       int    `json:"status"`
	Gender       int    `json:"gender"`
	GoldNum      int    `json:"goldNum"`
	IpRegion     string `json:"ipRegion"`
	RegisterTime string `json:"registerTime"`
	Signature    string `json:"signature"`
}

type Role

type Role struct {
	UserId     int    `json:"userId"`
	GameId     int    `json:"gameId"`
	ServerId   string `json:"serverId"`
	ServerName string `json:"serverName"`
	RoleId     string `json:"roleId"`
	RoleName   string `json:"roleName"`
	IsDefault  bool   `json:"isDefault"`
}

func ListRole

func ListRole(gid int, account config.Account) ([]*Role, error)

type SendPhoneCodeData

type SendPhoneCodeData struct {
	GeeTest bool `json:"geeTest"`
}

func SendPhoneCode

func SendPhoneCode(phone string) (*SendPhoneCodeData, error)

func SendPhoneCodeGeeTest

func SendPhoneCodeGeeTest(phone string, geeTest *GeeTestData) (*SendPhoneCodeData, error)

type SignForumData

type SignForumData struct {
	GainVoList   []*GainVo `json:"gainVoList"`
	ContinueDays int       `json:"continueDays"`
}

func SignForum

func SignForum(gid int, account config.Account) (*SignForumData, error)

type SignGameData

type SignGameData struct {
	TodayList    Goods `json:"todayList"`
	TomorrowList Goods `json:"tomorrowList"`
}

func SignGame

func SignGame(gid int, sid, rid string, uid int, account config.Account) (*SignGameData, error)

type User

type User struct {
	Mine Mine `json:"mine"`
}

func GetUser

func GetUser(account config.Account) (*User, error)

Jump to

Keyboard shortcuts

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