Skip to content

Commit 33d8a6d

Browse files
authored
feat: add the README (#5)
1 parent 86405dc commit 33d8a6d

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

.github/workflows/maven-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build casdoor-java-sdk
1+
name: Build casvisor-java-sdk
22

33
on: [push, pull_request]
44

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,54 @@
1-
# casvisor-java-sdk
1+
# casvisor-java-sdk
2+
3+
[![GitHub Actions](https://github.com/casvisor/casvisor-java-sdk/actions/workflows/maven-ci.yml/badge.svg)](https://github.com/casvisor/casvisor-java-sdk/actions/workflows/maven-ci.yml)
4+
[![codebeat badge](https://codebeat.co/badges/e3e92eff-8b71-4903-9764-5126e855b3b6)](https://codebeat.co/projects/github-com-casvisor-casvisor-java-sdk-master)
5+
[![codecov](https://codecov.io/gh/casvisor/casvisor-java-sdk/branch/master/graph/badge.svg?token=1C2FSTN4J8)](https://codecov.io/gh/casvisor/casvisor-java-sdk)
6+
[![Maven Central](https://img.shields.io/maven-central/v/org.casbin/casvisor-java-sdk.svg)](https://mvnrepository.com/artifact/org.casbin/casvisor-java-sdk/latest)
7+
[![Release](https://img.shields.io/github/release/casvisor/casvisor-java-sdk.svg)](https://github.com/casvisor/casvisor-java-sdk/releases/latest)
8+
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/5rPsrAzK7S)
9+
10+
Casvisor Java SDK is the official Java client for Casvisor, used to interact with Casvisor services.
11+
12+
## Step1. Init Config
13+
14+
Initialization requires 5 parameters, which are all string type:
15+
16+
| Name (in order) | Must | Description |
17+
|------------------|------|-------------------------------------------------------|
18+
| endpoint | Yes | Casvisor server URL, such as `http://localhost:16001` |
19+
| clientId | Yes | Application.clientId |
20+
| clientSecret | Yes | Application.clientSecret |
21+
| organizationName | Yes | Organization name |
22+
| applicationName | Yes | Application name |
23+
24+
### You can either initialize the SDK with global config
25+
26+
```java
27+
CasvisorConfig config = new CasvisorConfig(endpoint, clientId, clientSecret, certificate, organizationName, applicationName);
28+
```
29+
30+
## Step2. Get Service and use
31+
32+
Now provide service: ``RecordService``
33+
You can create them like
34+
```java
35+
RecordService recordService = new RecordService(config);
36+
```
37+
## RecordService
38+
39+
``RecordService``support basic user operations, like:
40+
- ``getRecord(String name)``, get one record by record name.
41+
- ``getRecords()``, get all records.
42+
- ``updateRecord(Record record)/addRecord(Record record)/deleteRecord(Record record)``, write record to database.
43+
44+
## Contribution
45+
46+
We welcome any form of contribution, including but not limited to:
47+
48+
1. Submit issues and suggestions
49+
2. Submit Pull Request
50+
3. Improve documentation
51+
52+
## License
53+
54+
This project is licensed under the [Apache 2.0 License](LICENSE).

0 commit comments

Comments
 (0)