kuro

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 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 // 鸣潮
)
View Source
const (
	ForumIdPNS2 = 2 // 推荐
	ForumIdPNS3 = 3 // 伊甸闲庭
	ForumIdPNS4 = 4 // 攻略
	ForumIdPNS5 = 5 // 同人

	ForumIdMC9  = 9  // 推荐
	ForumIdMC10 = 10 // 今州茶馆
	ForumIdMC11 = 11 // 同人
	ForumIdMC12 = 12 // 攻略
	ForumIdMC15 = 15 // 新手
)
View Source
const (
	GameMCCountryCodeHL = 1 // 瑝珑
)

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 LikePost

func LikePost(gid, fid int, pid, uid string, cancel bool, account config.Account) error

func R

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

func SharePost

func SharePost(gid int, account config.Account) error

Types

type AreaInfo

type AreaInfo struct {
	AreaId       int             `json:"areaId"`
	AreaProgress int             `json:"areaProgress"`
	AreaName     string          `json:"areaName"`
	ItemList     []*AreaItemInfo `json:"itemList"`
}

type AreaItemInfo

type AreaItemInfo struct {
	Type     int    `json:"type"`
	Name     string `json:"name"`
	Progress int    `json:"progress"`
}

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 BossInfo

type BossInfo struct {
	BossId     int    `json:"bossId"`
	BossLevel  int    `json:"bossLevel"`
	BossName   string `json:"bossName"`
	Difficulty int    `json:"difficulty"`
}

type BoxInfo

type BoxInfo struct {
	Name string `json:"boxName"`
	Num  int    `json:"num"`
}

type Code

type Code int

func (*Code) UnmarshalJSON

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

type DetectionInfo

type DetectionInfo struct {
	DetectionId   int    `json:"detectionId"`
	DetectionName string `json:"detectionName"`
	Level         int    `json:"level"`
	LevelName     string `json:"levelName"`
	Acronym       string `json:"acronym"`
}

type ForumTaskInfo

type ForumTaskInfo struct {
	CompleteTimes   int     `json:"completeTimes"`
	GainGold        int     `json:"gainGold"`
	NeedActionTimes int     `json:"needActionTimes"`
	Process         float64 `json:"process"`
	Remark          string  `json:"remark"`
	SkipType        int     `json:"skipType"`
	Times           int     `json:"times"`
}

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,omitempty"`
	LotNumber     string `json:"lot_number,omitempty"`
	PassToken     string `json:"pass_token,omitempty"`
	GenTime       string `json:"gen_time,omitempty"`
	CaptchaOutput string `json:"captcha_output,omitempty"`
}

type GetForumGoldData

type GetForumGoldData struct {
	GoldNum int `json:"goldNum"`
}

func GetForumGold

func GetForumGold(account config.Account) (*GetForumGoldData, error)

type GetForumTaskData

type GetForumTaskData struct {
	CurrentDailyGold int              `json:"currentDailyGold"`
	MaxDailyGold     int              `json:"maxDailyGold"`
	GrowTask         []*ForumTaskInfo `json:"growTask"`
	DailyTask        []*ForumTaskInfo `json:"dailyTask"`
}

func GetForumTask

func GetForumTask(account config.Account) (*GetForumTaskData, error)

type GetPostData

type GetPostData struct {
	PostDetail *PostInfo `json:"postDetail"`
	IsCollect  int       `json:"isCollect"`
	IsFollow   int       `json:"isFollow"`
	IsLike     int       `json:"isLike"`
}

func GetPost

func GetPost(id string, account config.Account) (*GetPostData, error)

type GetRoleBaseData

type GetRoleBaseData struct {
	Id               int        `json:"id"`
	Name             string     `json:"name"`
	ActiveDays       int        `json:"activeDays"`
	Level            int        `json:"level"`
	WorldLevel       int        `json:"worldLevel"`
	RoleNum          int        `json:"roleNum"`
	SoundBox         int        `json:"soundBox"`
	Energy           int        `json:"energy"`
	MaxEnergy        int        `json:"maxEnergy"`
	Liveness         int        `json:"liveness"`
	LivenessMaxCount int        `json:"livenessMaxCount"`
	LivenessUnlock   bool       `json:"livenessUnlock"`
	ChapterId        int        `json:"chapterId"`
	BigCount         int        `json:"bigCount"`
	SmallCount       int        `json:"smallCount"`
	AchievementCount int        `json:"achievementCount"`
	ShowToGuest      bool       `json:"showToGuest"`
	BoxList          []*BoxInfo `json:"boxList"`
	CreatTime        Timestamp  `json:"creatTime"`
}

func GetRoleBase

func GetRoleBase(gid int, sid, rid string, account config.Account) (*GetRoleBaseData, error)

type GetRoleCalabashData

type GetRoleCalabashData struct {
	Level           int            `json:"level"`
	BaseCatch       string         `json:"baseCatch"`
	StrengthenCatch string         `json:"strengthenCatch"`
	CatchQuality    int            `json:"catchQuality"`
	Cost            int            `json:"cost"`
	MaxCount        int            `json:"maxCount"`
	UnlockCount     int            `json:"unlockCount"`
	PhantomList     []*PhantomInfo `json:"phantomList"`
}

func GetRoleCalabash

func GetRoleCalabash(gid int, sid, rid string, account config.Account) (*GetRoleCalabashData, error)

type GetRoleChallengeData

type GetRoleChallengeData struct {
	IndexList []*BossInfo `json:"indexList"`
}

func GetRoleChallenge

func GetRoleChallenge(gid int, sid, rid string, cid, code int, account config.Account) (*GetRoleChallengeData, error)

type GetRoleExploreData

type GetRoleExploreData struct {
	CountryCode       int              `json:"countryCode"`
	CountryName       string           `json:"countryName"`
	CountryProgress   string           `json:"countryProgress"`
	AreaInfoList      []*AreaInfo      `json:"areaInfoList"`
	DetectionInfoList []*DetectionInfo `json:"detectionInfoList"`
}

func GetRoleExplore

func GetRoleExplore(gid int, sid, rid string, cid, code int, account config.Account) (*GetRoleExploreData, error)

type GetRoleListData

type GetRoleListData struct {
	RoleList []*RoleInfo `json:"roleList"`
}

func GetRoleList

func GetRoleList(gid int, sid, rid string, account config.Account) (*GetRoleListData, error)

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   GoodId `json:"goodsId,string"`
	SigInDate string `json:"sigInDate,omitempty"`
}

type GoodId added in v1.0.2

type GoodId int

func (*GoodId) UnmarshalJSON added in v1.0.2

func (v *GoodId) UnmarshalJSON(bs []byte) error

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 ListPostData

type ListPostData struct {
	HasNext  int         `json:"hasNext"`
	PostList []*PostInfo `json:"postList"`
}

func ListPost

func ListPost(gid, fid, page int, account config.Account) (*ListPostData, error)

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 string, account config.Account) (*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 Phantom

type Phantom struct {
	PhantomId int    `json:"phantomId"`
	Name      string `json:"name"`
	Cost      int    `json:"cost"`
	Acronym   string `json:"acronym"`
}

type PhantomInfo

type PhantomInfo struct {
	Phantom *Phantom `json:"phantom"`
	Star    int      `json:"star"`
	MaxStar int      `json:"maxStar"`
}

type PostInfo

type PostInfo struct {
	GameId          int       `json:"gameId"`
	GameName        string    `json:"gameName"`
	GameForumId     int       `json:"gameForumId"`
	PostId          string    `json:"postId"`
	PostType        int       `json:"postType"`
	PostTitle       string    `json:"postTitle"`
	PostContent     any       `json:"postContent"`
	UserId          string    `json:"userId"`
	UserName        string    `json:"userName"`
	BrowseCount     string    `json:"browseCount"`
	CommentCount    int       `json:"commentCount"`
	LikeCount       int       `json:"likeCount"`
	IsFollow        int       `json:"isFollow"`
	IsLike          int       `json:"isLike"`
	IsLock          int       `json:"isLock"`
	IsPublisher     int       `json:"isPublisher"`
	CreateTimestamp Timestamp `json:"createTimestamp"`
}

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 RoleInfo

type RoleInfo struct {
	RoleId         int    `json:"roleId"`
	Level          int    `json:"level"`
	RoleName       string `json:"roleName"`
	StarLevel      int    `json:"starLevel"`
	AttributeId    int    `json:"attributeId"`
	AttributeName  string `json:"attributeName"`
	WeaponTypeId   int    `json:"weaponTypeId"`
	WeaponTypeName string `json:"weaponTypeName"`
	Acronym        string `json:"acronym"`
}

type SendPhoneCodeData

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

func SendPhoneCodeGeeTest

func SendPhoneCodeGeeTest(phone string, geeTest *GeeTestData, account config.Account) (*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 Timestamp

type Timestamp struct {
	time.Time
}

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(bs []byte) 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