-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from near-daos/develop
Develop
- Loading branch information
Showing
21 changed files
with
917 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { AccountBearer } from '@sputnik-v2/common'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class UpdateBountyContextDto extends AccountBearer { | ||
@ApiProperty() | ||
daoId: string; | ||
|
||
@ApiProperty() | ||
ids: string[]; | ||
|
||
@ApiProperty() | ||
isArchived: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
test-framework/src/main/java/api/app/astrodao/com/core/controllers/NotificationsApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package api.app.astrodao.com.core.controllers; | ||
|
||
import api.app.astrodao.com.core.clients.HttpClient; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.http.HttpEntity; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.util.UriComponentsBuilder; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class NotificationsApi { | ||
protected final HttpClient httpClient; | ||
|
||
@Value("${framework.api.url}") | ||
private String apiUrl; | ||
|
||
public ResponseEntity<String> getNotifications(Map<String, Object> queryParams) { | ||
HttpHeaders httpHeaders = httpClient.getBasicHeaders(); | ||
httpHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); | ||
|
||
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(apiUrl); | ||
builder.pathSegment("notifications"); | ||
queryParams.forEach((key, value) -> builder.queryParam(key, value)); | ||
|
||
return httpClient.get(builder.toUriString(), new HttpEntity<>(httpHeaders), String.class); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
test-framework/src/main/java/api/app/astrodao/com/core/dto/api/comments/CreatedComment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package api.app.astrodao.com.core.dto.api.comments; | ||
|
||
import api.app.astrodao.com.openapi.models.Comment; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class CreatedComment extends Comment { | ||
private String publicKey; | ||
private String signature; | ||
} |
24 changes: 24 additions & 0 deletions
24
...framework/src/main/java/api/app/astrodao/com/core/dto/api/notigications/Notification.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package api.app.astrodao.com.core.dto.api.notigications; | ||
|
||
import api.app.astrodao.com.openapi.models.Dao; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import lombok.Data; | ||
|
||
import java.math.BigDecimal; | ||
import java.time.OffsetDateTime; | ||
|
||
@Data | ||
public class Notification { | ||
private Boolean isArchived; | ||
private OffsetDateTime createdAt; | ||
private OffsetDateTime updatedAt; | ||
private String id; | ||
private String daoId; | ||
private Dao dao; | ||
private String targetId; | ||
private String signerId; | ||
private JsonNode type; | ||
private JsonNode status; | ||
private JsonNode metadata; | ||
private BigDecimal timestamp; | ||
} |
15 changes: 15 additions & 0 deletions
15
.../src/main/java/api/app/astrodao/com/core/dto/api/notigications/NotificationsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package api.app.astrodao.com.core.dto.api.notigications; | ||
|
||
import lombok.Data; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.List; | ||
|
||
@Data | ||
public class NotificationsResponse { | ||
private BigDecimal count; | ||
private BigDecimal total; | ||
private BigDecimal page; | ||
private BigDecimal pageCount; | ||
private List<Notification> data; | ||
} |
8 changes: 8 additions & 0 deletions
8
...-framework/src/main/java/api/app/astrodao/com/core/dto/api/tokens/AssetsNftEventList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package api.app.astrodao.com.core.dto.api.tokens; | ||
|
||
import api.app.astrodao.com.openapi.models.AssetsNftEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class AssetsNftEventList extends ArrayList<AssetsNftEvent> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.