Add GitHub Actions for Maven setup, JUnit reporting, and SonarCloud analysis. Update README with SonarCloud badges, embed assets, and document breaking changes. Refactor APIs with paging support, add model class tests, and improve error messages and code quality. Fix #13 and fix #15.
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
|
||||
[](https://ci.codeberg.org/repos/16522)
|
||||
|
||||
[](https://sonarcloud.io/summary/new_code?id=th-schwarz_CloudflareDNS-java)
|
||||
[](https://sonarcloud.io/summary/new_code?id=th-schwarz_CloudflareDNS-java)
|
||||
[](https://sonarcloud.io/summary/new_code?id=th-schwarz_CloudflareDNS-java)
|
||||
[](https://sonarcloud.io/summary/new_code?id=th-schwarz_CloudflareDNS-java)
|
||||
[](https://sonarcloud.io/summary/new_code?id=th-schwarz_CloudflareDNS-java)
|
||||
|
||||
[](https://codeberg.org/th-schwarz/CloudflareDNS-java)
|
||||
|
||||
## Preface
|
||||
|
||||
This project provides a java client for minimalistic access to the Cloudflare API version 4, which is mainly used for
|
||||
@@ -42,6 +50,9 @@ The dependency is:
|
||||
|
||||
## Changelog
|
||||
|
||||
- 0.4.0-SNAPSHOT:
|
||||
- **Breaking Change**: renamed `client.zone().record()` to `client.zone().getRecord()`
|
||||
- Code quality improvements: Increasing test coverage
|
||||
- 0.3.0:
|
||||
- **Breaking Change**:
|
||||
- **New Fluent API**: Changed the initialization of the client(`new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()`)
|
||||
@@ -54,7 +65,7 @@ The dependency is:
|
||||
- RecordEntity getter methods renamed for clarity: `getName()` → `getSld()`
|
||||
- **New Fluent API**: Changed the initialization of the client(`new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()`) and added chainable method interface for more readable DNS operations (
|
||||
`client.zone().record()...`)
|
||||
- Code quality improvements: eliminated duplication in batch operations, improved type safety in HTTP methods,
|
||||
- Code quality improvements: removed duplication in batch operations, improved type safety in HTTP methods,
|
||||
optimized string concatenation, removed mutable setters from CfDnsClient
|
||||
- Enhanced type validation in `RecordEntity.build()` with better error messages
|
||||
- CfClient#recordList must return multiple RecordEntries
|
||||
@@ -359,7 +370,7 @@ that reduces verbosity and improves code readability.
|
||||
### Basic Usage
|
||||
|
||||
```java
|
||||
// Create a DNS record
|
||||
// Create a DNS getRecord
|
||||
client.zone("example.com")
|
||||
.record("api")
|
||||
.create(RecordType.A, "192.168.1.1",60);
|
||||
@@ -373,7 +384,7 @@ List<RecordEntity> records = client.zone("example.com")
|
||||
List<RecordEntity> zoneRecords = client.zone("example.com")
|
||||
.list(RecordType.A, RecordType.AAAA);
|
||||
|
||||
// Update a DNS record
|
||||
// Update a DNS getRecord
|
||||
RecordEntity updated = client.zone("example.com")
|
||||
.record("api", RecordType.A)
|
||||
.update("192.168.1.2");
|
||||
@@ -398,7 +409,7 @@ CfDnsClient client = new CfDnsClientBuilder()
|
||||
.withApiTokenAuth("your-api-token")
|
||||
.build();
|
||||
|
||||
// Create a new record
|
||||
// Create a new getRecord
|
||||
client.zone("example.com")
|
||||
.record("api")
|
||||
.create(RecordType.A, "192.168.100.1",60);
|
||||
@@ -409,7 +420,7 @@ List<RecordEntity> records = client.zone("example.com")
|
||||
.get();
|
||||
System.out.println("IP: "+records.get(0).getContent());
|
||||
|
||||
// Update the record
|
||||
// Update the getRecord
|
||||
client.zone("example.com")
|
||||
.record("api",RecordType.A)
|
||||
.update("192.168.100.2");
|
||||
|
||||
Reference in New Issue
Block a user