This service is use to company. It includes the following operations
- Add company
- List company
- Update company
- Remove company
The software in this layer contains application specific business rules. It encapsulates and implements all of the use cases of the system.
The software in this layer is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the Database or the Web.
The outermost layer is generally composed of frameworks and tools such as the Database, the Web Framework, etc.
Create database first and update the credentials in config/config.go
file.
After updating the file use the following command to download packages
make deps
NOTE : Go modules should be enabled.
Use one of the following commands to run the app
make run
or
go run main.go
API | Methood | Example | Auth |
---|---|---|---|
/company | POST | Cyprus IP Required | |
/company/{id} | DELETE | /company/1 | Cyprus IP Required |
/company | GET | This endpoint is used for filtering. All properties are filterable. Example /company?id=1 OR /company?name=abc | |
/company | PUT |
JSON Body
{ "name":"Go", "code":"h", "website":"hello.com", "phone":"123", "country":"se" }
id
is mandatory in update method.
JSON Body
{ "id":1 "name":"Go", "code":"h", "website":"hello.com", "phone":"123", "country":"se" }
Filters can be applied on all property Endpoint
/company?propertyName=value
Examples
/company?code=abc
/company?name=abc
/company?website=abc
/company?country=cy
/company?id=1