Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
Project
Commits
b162a9cd
Commit
b162a9cd
authored
Mar 02, 2020
by
Marcel Nellesen
Browse files
New: Api refactoring
parent
a19772c5
Changes
71
Hide whitespace changes
Inline
Side-by-side
src/Project/ReturnObjects/RDSResourceTypeObject.cs
deleted
100644 → 0
View file @
a19772c5
using
System
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
class
RDSResourceTypeObject
:
ResourceTypeOptionObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
BucketName
{
get
;
set
;
}
public
int
Size
{
get
;
set
;
}
public
RDSResourceTypeObject
(
Guid
id
,
string
bucketName
,
int
size
)
{
Id
=
id
;
BucketName
=
bucketName
;
Size
=
size
;
}
}
}
src/Project/ReturnObjects/ResourceObject.cs
deleted
100644 → 0
View file @
a19772c5
using
Coscine.ApiCommons.ReturnObjects
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
class
ResourceObject
:
IReturnObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
PID
{
get
{
return
Program
.
Configuration
.
GetStringAndWait
(
"coscine/global/epic/prefix"
)
+
"/"
+
Id
.
ToString
();
}
}
public
string
DisplayName
{
get
;
set
;
}
public
string
ResourceName
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
string
Keywords
{
get
;
set
;
}
public
string
UsageRights
{
get
;
set
;
}
public
ResourceTypeObject
Type
{
get
;
set
;
}
public
IEnumerable
<
DisciplineObject
>
Disciplines
{
get
;
set
;
}
public
VisibilityObject
Visibility
{
get
;
set
;
}
public
LicenseObject
License
{
get
;
set
;
}
public
JObject
ResourceTypeOption
{
get
;
set
;
}
public
string
ApplicationProfile
{
get
;
set
;
}
public
JToken
FixedValues
{
get
;
set
;
}
public
Guid
?
Creator
{
get
;
set
;
}
public
ResourceObject
(
Guid
id
,
string
displayName
,
string
resourceName
,
string
description
,
string
keywords
,
string
usageRights
,
ResourceTypeObject
type
,
IEnumerable
<
DisciplineObject
>
disciplines
,
VisibilityObject
visibility
,
LicenseObject
license
,
JObject
resourceTypeOption
,
string
applicationProfile
,
JToken
fixedValues
,
Guid
?
creator
=
null
)
{
Id
=
id
;
DisplayName
=
displayName
;
ResourceName
=
resourceName
;
Description
=
description
;
Keywords
=
keywords
;
UsageRights
=
usageRights
;
Type
=
type
;
Disciplines
=
disciplines
;
Visibility
=
visibility
;
License
=
license
;
ResourceTypeOption
=
resourceTypeOption
;
ApplicationProfile
=
applicationProfile
;
FixedValues
=
fixedValues
;
Creator
=
creator
;
}
}
}
src/Project/ReturnObjects/ResourceTypeObject.cs
deleted
100644 → 0
View file @
a19772c5
using
Coscine.ApiCommons.ReturnObjects
;
using
System
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
class
ResourceTypeObject
:
IReturnObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
DisplayName
{
get
;
set
;
}
public
bool
Enabled
{
get
;
set
;
}
public
ResourceTypeObject
(
Guid
id
,
string
displayName
,
bool
enabled
)
{
Id
=
id
;
DisplayName
=
displayName
;
Enabled
=
enabled
;
}
}
}
src/Project/ReturnObjects/ResourceTypeOptionObject.cs
deleted
100644 → 0
View file @
a19772c5
using
Coscine.ApiCommons.ReturnObjects
;
using
System
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
abstract
class
ResourceTypeOptionObject
:
IReturnObject
{
}
}
\ No newline at end of file
src/Project/ReturnObjects/RoleObject.cs
deleted
100644 → 0
View file @
a19772c5
using
Coscine.ApiCommons.ReturnObjects
;
using
System
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
class
RoleObject
:
IReturnObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
DisplayName
{
get
;
set
;
}
public
RoleObject
(
Guid
id
,
string
displayName
)
{
Id
=
id
;
DisplayName
=
displayName
;
}
}
}
\ No newline at end of file
src/Project/ReturnObjects/S3ResourceTypeObject.cs
deleted
100644 → 0
View file @
a19772c5
using
System
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
class
S3ResourceTypeObject
:
ResourceTypeOptionObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
BucketName
{
get
;
set
;
}
public
string
AccessKey
{
get
;
set
;
}
public
string
SecretKey
{
get
;
set
;
}
public
S3ResourceTypeObject
(
Guid
id
,
string
bucketName
,
string
accessKey
,
string
secretKey
)
{
Id
=
id
;
BucketName
=
bucketName
;
AccessKey
=
accessKey
;
SecretKey
=
secretKey
;
}
}
}
src/Project/ReturnObjects/UserObject.cs
deleted
100644 → 0
View file @
a19772c5
using
Coscine.ApiCommons.ReturnObjects
;
using
System
;
namespace
Coscine.Api.Project.ReturnObjects
{
[
Serializable
]
public
class
UserObject
:
IReturnObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
DisplayName
{
get
;
set
;
}
public
string
Givenname
{
get
;
set
;
}
public
string
Surname
{
get
;
set
;
}
public
string
EmailAddress
{
get
;
set
;
}
public
UserObject
(
Guid
id
,
string
displayName
,
string
givenname
,
string
surname
,
string
emailAddress
)
{
Id
=
id
;
DisplayName
=
displayName
;
Givenname
=
givenname
;
Surname
=
surname
;
EmailAddress
=
emailAddress
;
}
}
}
src/Project/ReturnObjects/VisibilityObject.cs
deleted
100644 → 0
View file @
a19772c5
using
Coscine.ApiCommons.ReturnObjects
;
using
Coscine.Database.Model
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Coscine.Api.Project.ReturnObjects
{
public
class
VisibilityObject
:
IReturnObject
{
public
Guid
Id
{
get
;
set
;
}
public
string
DisplayName
{
get
;
set
;
}
public
VisibilityObject
(
Guid
id
,
string
displayName
)
{
Id
=
id
;
DisplayName
=
displayName
;
}
}
}
src/Project/ReturnObjects/WaterbutlerFolder.cs
deleted
100644 → 0
View file @
a19772c5
using
System
;
using
System.Collections.Generic
;
using
Newtonsoft.Json.Linq
;
namespace
Coscine.Api.Project.ReturnObjects
{
public
class
WaterbutlerObject
{
public
bool
IsFolder
{
get
;
set
;
}
=
false
;
public
string
Absolutepath
{
get
;
set
;
}
=
null
;
public
string
Name
{
get
;
set
;
}
=
null
;
public
string
LastModified
{
get
;
set
;
}
public
string
Created
{
get
;
set
;
}
public
string
Size
{
get
;
set
;
}
// Shallow! Only one level deep.
// Should the folder contain additional folders, they will be empty/null.
public
List
<
WaterbutlerObject
>
Content
{
get
;
set
;
}
=
null
;
public
WaterbutlerObject
()
{
}
public
WaterbutlerObject
(
string
path
,
JToken
data
)
{
Absolutepath
=
path
;
Content
=
new
List
<
WaterbutlerObject
>();
IsFolder
=
true
;
if
(
data
==
null
)
{
throw
new
ArgumentNullException
(
"The data for the WaterbutlerFolder cannot be null."
);
}
foreach
(
var
obj
in
data
)
{
if
(
obj
[
"type"
].
ToObject
<
string
>()
==
"files"
)
{
Content
.
Add
(
new
WaterbutlerObject
{
IsFolder
=
obj
[
"attributes"
][
"kind"
].
ToObject
<
string
>()
==
"folder"
,
Absolutepath
=
obj
[
"attributes"
][
"path"
].
ToObject
<
string
>(),
Name
=
obj
[
"attributes"
][
"name"
].
ToObject
<
string
>(),
Created
=
obj
[
"attributes"
][
"modified_utc"
]?.
ToObject
<
string
>(),
LastModified
=
obj
[
"attributes"
][
"LastModified_utc"
]?.
ToObject
<
string
>(),
Size
=
obj
[
"attributes"
][
"size"
]?.
ToObject
<
string
>(),
});
}
}
}
}
}
src/Project/UserRoles.cs
deleted
100644 → 0
View file @
a19772c5
namespace
Coscine.Api.Project
{
public
static
class
UserRoles
{
public
static
string
Member
{
get
;
}
=
"member"
;
public
static
string
Owner
{
get
;
}
=
"owner"
;
}
}
src/Project/packages.config
View file @
b162a9cd
...
...
@@ -2,23 +2,21 @@
<
packages
>
<
package
id
=
"AutoMapper"
version
=
"8.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"AutoMapper.Extensions.Microsoft.DependencyInjection"
version
=
"6.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Castle.Core"
version
=
"4.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.
9
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.
5
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.
10
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.
6
.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.1
5.1
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.1
6.0
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.0.1"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ProxyApi"
version
=
"1.2.1"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.SharePoint.Webparts.Vue"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"dotNetRDF"
version
=
"2.2.1"
targetFramework
=
"net472"
/>
<
package
id
=
"dotNetRDF.Data.Virtuoso"
version
=
"2.2.1"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.SharePoint.Webparts.Vue"
version
=
"1.5.0"
targetFramework
=
"net472"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"HtmlAgilityPack"
version
=
"1.8.2"
targetFramework
=
"net472"
/>
<
package
id
=
"linq2db"
version
=
"2.6.4"
targetFramework
=
"net472"
/>
<
package
id
=
"linq2db.SqlServer"
version
=
"2.6.4"
targetFramework
=
"net472"
/>
<
package
id
=
"linq2db.t4models"
version
=
"2.6.4"
targetFramework
=
"net472"
/>
<
package
id
=
"LinqKit"
version
=
"1.1.16"
targetFramework
=
"net472"
/>
<
package
id
=
"Metadata"
version
=
"1.0.0"
targetFramework
=
"net472"
/>
<
package
id
=
"LinqKit"
version
=
"1.1.17"
targetFramework
=
"net472"
/>
<
package
id
=
"Microsoft.AspNetCore"
version
=
"2.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Microsoft.AspNetCore.Antiforgery"
version
=
"2.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Microsoft.AspNetCore.Authentication"
version
=
"2.2.0"
targetFramework
=
"net472"
/>
...
...
@@ -121,7 +119,8 @@
<
package
id
=
"Microsoft.IdentityModel.Tokens"
version
=
"5.6.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Microsoft.Net.Http.Headers"
version
=
"2.2.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Microsoft.Win32.Registry"
version
=
"4.5.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Newtonsoft.Json"
version
=
"12.0.2"
targetFramework
=
"net472"
/>
<
package
id
=
"Moq"
version
=
"4.13.1"
targetFramework
=
"net472"
/>
<
package
id
=
"Newtonsoft.Json"
version
=
"12.0.3"
targetFramework
=
"net472"
/>
<
package
id
=
"Newtonsoft.Json.Bson"
version
=
"1.0.2"
targetFramework
=
"net472"
/>
<
package
id
=
"NLog"
version
=
"4.6.8"
targetFramework
=
"net472"
/>
<
package
id
=
"NLog.Config"
version
=
"4.6.8"
targetFramework
=
"net472"
/>
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment