Member CRUD Service API with search capabilities
Searches members based on tags and member type.
- Path:
/api/v1/members/search
- Method:
GET
- Produces:
application/json
- Tags:
members
tags
(optional): Tags to search for. Multiple values can be provided.type
(optional): Member type to search for.
200 OK
: Returns an array of member objects matching the search criteria.
/api/v1/members/search?tags=Java&tags=Python&type=EMPLOYEE
[
{
"name": "John",
"tags": ["Java","Python"],
"contractDuration": 12,
"role": "Developer",
"type": "EMPLOYEE"
}
]
Checks the health status of the server and database connection.
- Path:
/api/health
- Method:
GET
- Produces:
text/plain
- Tags:
health
200 OK
: The health check is successful.500
: Could not establish a connection to the database.
Checks the availability of the server.
- Path:
/api/ping
- Method:
GET
- Produces:
text/plain
- Tags:
ping
200 OK
: The server is available.
Gets all members with their associated tags.
- Path:
/api/v1/members
- Method:
GET
- Produces:
application/json
- Tags:
members
200 OK
: Returns an array of member objects with tags.
[
{
"id": 1,
"name": "John",
"tags": ["java"],
"createdAt": "2022-01-01T00:00:00Z",
"deletedAt": null,
"updatedAt": "2022-01-01T00:00:00Z",
"role": "Developer",
"type": "EMPLOYEE"
},
{
"id": 2,
"name": "Anna",
"tags": ["manager"],
"createdAt": "2022-01-01T00:00:00Z",
"deletedAt": null,
"updatedAt": "2022-01-01T00:00:00Z",
"role": "Manager",
"type": "EMPLOYEE"
}
]
Adds a new member.
- Path:
/api/v1/members
- Method:
POST
- Consumes:
application/json
- Produces:
application/json
- Tags:
members
- Name:
member
- Type:
object
- Required: Yes
- Schema: models.Member
200 OK
: Returns the newly added member object.
{
"name": "Mike",
"tags": ["developer"],
"contractDuration": 12,
"role": "Developer",
"type": "CONTRACTOR"
}
Gets a member by their ID with their associated tags.
- Path:
/api/v1/members/{id}
- Method:
GET
- Produces:
application/json
- Tags:
members
- Name:
id
- Type:
string
- Description: Member ID
- In:
path
- Required: Yes
200 OK
: Returns the member object with tags.
{
"id": 1,
"name": "John",
"tags": ["developer"],
"contractDuration": 12,
"createdAt": "2022-01-01T00:00:00Z",
"deletedAt": null,
"updatedAt": "2022-01-01T00:00:00Z",
"role": "Developer",
"type": "EMPLOYEE"
}
Deletes a member by their ID.
- Path:
/api/v1/members/{id}
- Method:
DELETE
- Tags:
members
- Name:
id
- Type:
string
- Description: Member ID
- In:
path
- Required: Yes
200 OK
: Member deleted successfully.
Updates a member by their ID.
- Path:
/api/v1/members/{id}
- Method:
PUT
- Tags:
members
- Name:
id
- Type:
string
- Description: Member ID
- In:
path
- Required: Yes
- Name:
member
- Type:
object
- Required: Yes
- Schema: models.Member
- Name:
member
- Type:
object
- Required: Yes
- Schema:
models.Member
{
"name": "Updated John",
"tags": ["Java"],
"contractDuration": 12,
"role": "Developer",
"type": "CONTRACTOR"
}
200 OK
: Member updated successfully.
Gets all tags. Ideal for populating a combo box in the UI for example or a filter. Does not return associated members for efficiency.
- Path:
/api/v1/tags
- Method:
GET
- Produces:
application/json
- Tags:
tags
200 OK
: Returns an array of tag objects.
Represents a member object.
Properties:
contractDuration
(integer)createdAt
(string)deletedAt
(string)id
(integer)name
(string)role
(string)tags
(array of models.Tag)type
(string, enum: EMPLOYEE, CONTRACTOR)updatedAt
(string)
Represents a tag object.
Properties:
createdAt
(string)deletedAt
(string)id
(integer)members
(array of models.Member)name
(string)updatedAt
(string)