api

package
v0.0.0-...-611965f Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoriesData

type CategoriesData struct {
	CurrentPage    int        `json:"currentPage"`
	Total          int        `json:"total"`
	CategoriesList []Category `json:"categoriesList"`
}

type CategoriesResponse

type CategoriesResponse struct {
	Code    int            `json:"code"`
	Message string         `json:"message"`
	Data    CategoriesData `json:"data"`
}

type Category

type Category struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Sort        int    `json:"sort"`
}

type Client

type Client struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) DownloadSkill

func (c *Client) DownloadSkill(id int, outputPath string) (string, error)

func (*Client) GetSkillDetail

func (c *Client) GetSkillDetail(id int) (*DetailResponse, error)

func (*Client) GetSkillFiles

func (c *Client) GetSkillFiles(id int) (*FilesResponse, error)

func (*Client) ImportZip

func (c *Client) ImportZip(zipPath, description string, categoryID int, overwrite bool) (*ImportZipResponse, error)

func (*Client) ListCategories

func (c *Client) ListCategories() ([]Category, error)

func (*Client) ListSkills

func (c *Client) ListSkills(pageNum, pageSize, categoryID int, keyword string) (*ListResponse, error)

func (*Client) Login

func (c *Client) Login(token string) (*LoginResponse, error)

type DetailResponse

type DetailResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    Skill  `json:"data"`
}

type FileNode

type FileNode struct {
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	Path     string     `json:"path"`
	Type     string     `json:"type"`
	Content  string     `json:"content,omitempty"`
	Children []FileNode `json:"children,omitempty"`
}

type FilesData

type FilesData struct {
	Files []FileNode `json:"files"`
}

type FilesResponse

type FilesResponse struct {
	Code    int       `json:"code"`
	Message string    `json:"message"`
	Data    FilesData `json:"data"`
}

type ImportZipResponse

type ImportZipResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		SkillID int    `json:"skillId"`
		Name    string `json:"name"`
	} `json:"data"`
}

type ListData

type ListData struct {
	CurrentPage int     `json:"currentPage"`
	Total       int     `json:"total"`
	List        []Skill `json:"skillsList"`
}

type ListResponse

type ListResponse struct {
	Code    int      `json:"code"`
	Message string   `json:"message"`
	Data    ListData `json:"data"`
}

type LoginResponse

type LoginResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		Token string `json:"token"`
	} `json:"data"`
}

type Skill

type Skill struct {
	ID            int      `json:"id"`
	Name          string   `json:"name"`
	Description   string   `json:"description"`
	Version       string   `json:"version"`
	CategoryID    int      `json:"categoryId"`
	CategoryName  string   `json:"categoryName"`
	Status        int      `json:"status"`
	IsPublic      bool     `json:"isPublic"`
	IsValid       bool     `json:"isValid"`
	FilePath      string   `json:"filePath"`
	License       string   `json:"license"`
	DownloadCount int      `json:"downloadCount"`
	StarCount     int      `json:"starCount"`
	FileSize      int64    `json:"fileSize"`
	CreatedAt     string   `json:"createdAt"`
	UpdatedAt     string   `json:"updatedAt"`
	ValidatedAt   string   `json:"validatedAt"`
	Tags          []string `json:"tags"`
}

Jump to

Keyboard shortcuts

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