Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>de.filefighter</groupId>
<artifactId>rest</artifactId>
<version>0.0.3-Snapshot</version>
<version>0.0.3</version>
<name>RestApi</name>
<description>RestApi for FileFighter</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class File extends FileSystemItem{
public File() {
}

public File(long id, String name, double size, long createdByUserId, boolean isPublic, long lastUpdated, FileSystemType type, PermissionSet permissionSet) {
super(id, name, size, createdByUserId, isPublic, lastUpdated, type, permissionSet);
public File(long id, String name, double size, long createdByUserId, long lastUpdated, FileSystemType type, PermissionSet permissionSet) {
super(id, name, size, createdByUserId, lastUpdated, type, permissionSet);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ public class FileSystemItem {
private String name;
private double size;
private long createdByUserId; //uploadedBy
private boolean isPublic;
private long lastUpdated;
private FileSystemType type;
private PermissionSet permissionSet;

protected FileSystemItem() {
}

public FileSystemItem(long id, String name, double size, long createdByUserId, boolean isPublic, long lastUpdated, FileSystemType type, PermissionSet permissionSet) {
public FileSystemItem(long id, String name, double size, long createdByUserId, long lastUpdated, FileSystemType type, PermissionSet permissionSet) {
this.id = id;
this.name = name;
this.size = size;
this.createdByUserId = createdByUserId;
this.isPublic = isPublic;
this.lastUpdated = lastUpdated;
this.type = type;
this.permissionSet = permissionSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ public class FileSystemItemUpdate {
private String name;
private FileSystemType type;
private double size;
private boolean isPublic;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class Folder extends FileSystemItem {
public Folder() {
}

public Folder(long id, String name, double size, long createdByUserId, boolean isPublic, long lastUpdated, FileSystemType type, PermissionSet permissionSet, String path) {
super(id, name, size, createdByUserId, isPublic, lastUpdated, type, permissionSet);
public Folder(long id, String name, double size, long createdByUserId, long lastUpdated, FileSystemType type, PermissionSet permissionSet, String path) {
super(id, name, size, createdByUserId, lastUpdated, type, permissionSet);
this.path = path;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@
import org.springframework.data.mongodb.core.mapping.MongoId;

@Data
@Document(collection = "file")
@Document(collection = "filesystem")
@Builder
public class FileSystemEntity {
@MongoId private String _id;

@MongoId
private String _id;
private long id;
private String name;
private String path;
private long typeId;
private double size;
private boolean isFile;
private long createdByUserId; //uploadedBy
private boolean isPublic;
private long lastUpdated;
private long[] visibleForRoleIds;
private long[] editableForRoleIds;
private long[] visibleForUserIds;
private long[] editableForUserIds;
private long[] itemIds;

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class AccessTokenEntity {

@MongoId
private String id;
private String _id;
private String value;
private long userId;
private long validUntil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class UserEntity {

@MongoId
private String id;
private String _id;
private long userId;
private String username;
private String password;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import de.filefighter.rest.domain.permission.rest.PermissionRestController;
import de.filefighter.rest.domain.user.rest.UserRestController;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.web.client.ResponseErrorHandler;
import org.springframework.web.client.RestTemplate;

Expand All @@ -21,6 +21,8 @@

import static org.assertj.core.api.Assertions.assertThat;

@SuppressWarnings("SameParameterValue")
@ActiveProfiles("test")
@SpringBootTest(classes = RestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class RestApplicationIntegrationTest {

Expand Down