Coder Social home page Coder Social logo

yuque's Introduction

img

Yuque for java SDK


📚 介绍

👋 你好,欢迎使用语雀Java版SDK,写这个SDK的目的是为了方便使用Java语言调用语雀,同时也欢迎使用SDK的伙伴一起完善Java版SDK,如果有什么问题可以提出Issue。

📦 安装

🏗 Maven

<dependency>
  <groupId>com.bkood</groupId>
  <artifactId>yuque</artifactId>
  <version>1.0.0</version>
</dependency>

🛖 Gradle

implementation group: 'com.bkood', name: 'yuque', version: '1.0.0'

📥 下载 jar

SDK 没有对移动端测试,如果有移动端使用请自行测试,大家自行甄别

🤔 SDK 都实现了那些

SDK分为4个模块 新增、 查询、更新、删除, 功能请看下面的列表

模块 功能 介绍
查询(query) users 用户ID或login获取单个用户信息
user 获取单个用户信息
usersGroup 获取某个用户的加入的组织列表
groupsUsers 获取组织成员信息
usersRepos 获取某个用户的知识库列表
groupsRepos 获取团队的知识库列表
repos 获取知识库详情
reposDocs 获取一个仓库的文档列表
reposDoc 获取单篇文档的详细信息
新增(add) groupsRepos 创建团队知识库
reposDoc 创建文档
usersRepos 创建自己知识库
更新(update) repos 更新知识库信息
reposDocs 更新文档
groupsUsers 增加或更新组织成员
删除(delete) groupsUsers 删除组织成员
repos 删除知识库
reposDocs 删除文档

🚀 快速使用

🛠 配置

配置主要是配置个人信息,如:token、agent、proxy 这些

Config config = Config.builder().token("xxx").userAgent("xx").build();

🛫 使用

例如我想要查询,那么就可以:YuQueClient.query.功能.run() 就可以实现一个简单的查询功能,其中query就是上面表格的模块,如果是删除就是上面表格模块的delete

YuQueClient.query(config).xxx().run()

yuque's People

Contributors

ka-zii avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

imzty

yuque's Issues

Master Branch has bug!

see class:com.bkood.yuque.common.Request,the properties url is shared with all thread and never clear.

for example:

Thread A first send a request with com.bkood.yuque.common.Request#url = https://www.yuque.com/api/v2/user.

Then, when thread B expect to send a request with com.bkood.yuque.common.Request#url = 'https://www.yuque.com/api/v2/users/123/repos', but found that com.bkood.yuque.common.Request#url is actually equal to the fucking https://www.yuque.com/api/v2/userhttps://www.yuque.com/api/v2/users/123/repos.

You can reproduce the example with these code:

@Test
    public void testBug() {
        Config apiConfig = getConfig();
        Result<User> userResult = YuQueClient.query(apiConfig).user().run();
        Assert.assertEquals(200, result.getStatus());
        User user = userResult.getEntity();
        ResultList<Book> repoResult = YuQueClient.query(apiConfig).usersRepos(String.valueOf(user.getId())).run();
        Assert.assertEquals(200, result.getStatus());
        List<Book> repos = repoResult.getEntity();
    } 

fixbug advice:

change com.bkood.yuque.common.Request and com.bkood.yuque.common.RequestParameters from interface to abstract class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.