api

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: Apache-2.0 Imports: 10 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"

	GameIdPNS = 2 // 战双
	GameIdMC  = 3 // 鸣潮

	ForumIdPNS3 = 3  // 伊甸闲庭
	ForumIdMC10 = 10 // 今州茶馆

	GT4Id = "3f7e2d848ce0cb7e7d019d621e556ce2"
)
View Source
const (
	CodeHasSigned = Code(1511)
)

Variables

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

	ForumIdByGameId = map[int]int{
		GameIdPNS: ForumIdPNS3,
		GameIdMC:  ForumIdMC10,
	}
)

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

Types

type Client

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

func NewClient

func NewClient(account config.Account) *Client

func (*Client) GetPost

func (c *Client) GetPost(id string) (*GetPostData, error)

func (*Client) GetSignForum

func (c *Client) GetSignForum(gid int) (*GetSignForumData, error)

func (*Client) GetUser

func (c *Client) GetUser() (*User, error)

func (*Client) LikePost

func (c *Client) LikePost(gid, fid int, pid, uid string, cancel bool) error

func (*Client) ListPost

func (c *Client) ListPost(gid, fid, page int) (*ListPostData, error)

func (*Client) ListRole

func (c *Client) ListRole(gid int) ([]*Role, error)

func (*Client) ListSignGame

func (c *Client) ListSignGame(gid int, sid, rid, uid string) (*ListSignGameData, error)

func (*Client) ListSignGameRecord

func (c *Client) ListSignGameRecord(gid int, sid, rid, uid string) (Goods, 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(gt *geetest.V4Data) (*SendPhoneCodeData, error)

func (*Client) SharePost

func (c *Client) SharePost(gid int) error

func (*Client) SignForum

func (c *Client) SignForum(gid int) (*SignForumData, error)

func (*Client) SignGame

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

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 GetPostData

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

type GetSignForumData

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

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

type GoodId int

func (*GoodId) UnmarshalJSON

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

type Goods

type Goods []*Good

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"`
}

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 (*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"`
}

type Mine

type Mine struct {
	UserId   string `json:"userId"`
	UserName string `json:"userName"`
}

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"`
	PostUserId      string    `json:"postUserId"` // detail
	PostTitle       string    `json:"postTitle"`
	PostContent     any       `json:"postContent"`
	UserId          string    `json:"userId"` // list
	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     string `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"`
}

type SendPhoneCodeData

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

type SignForumData

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

type SignGameData

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

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"`
}

Jump to

Keyboard shortcuts

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