working on project view
This commit is contained in:
@@ -6,13 +6,16 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
public class Constants {
|
||||
|
||||
|
||||
private Constants(){}
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String ATTACHMENTS = "attachments";
|
||||
public static final String AUTHORIZATION = "Authorization";
|
||||
public static final String BODY = "body";
|
||||
public static final String COMPANY = "company";
|
||||
public static final String COMPANY_ID = "company_id";
|
||||
public static final String CONTENT_TYPE = "Content-Type";
|
||||
|
||||
public static final String DATA = "data";
|
||||
public static final String DATE = "date";
|
||||
public static final String DEFAULT_LANGUAGE = "en";
|
||||
@@ -21,6 +24,7 @@ public class Constants {
|
||||
public static final String DOMAIN = "domain";
|
||||
public static final String DUE_DATE = "due_date";
|
||||
public static final String DURATION = "duration";
|
||||
|
||||
public static final String EMAIL = "email";
|
||||
public static final String END_TIME = "end_time";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
|
||||
public class UmbrellaException extends Exception{
|
||||
public class UmbrellaException extends RuntimeException{
|
||||
private final int statusCode;
|
||||
|
||||
public UmbrellaException(String message, Object ... fills){
|
||||
|
||||
@@ -39,6 +39,14 @@ public record Project(long id, String name, String description, Status status, L
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasMember(UmbrellaUser user) {
|
||||
for (var member : members){
|
||||
if (member.userId() == user.id()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static Project of(ResultSet rs) throws SQLException {
|
||||
return new Project(rs.getLong(ID),rs.getString(NAME),rs.getString(DESCRIPTION),Status.of(rs.getInt(STATUS)),rs.getLong(COMPANY_ID),rs.getBoolean(SHOW_CLOSED),new ArrayList<>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user