-
Setup DB address
a. Give the proper db connection address in src/aircto/model/init.go file.
b.sql.Open("mysql", "homestead:secret@tcp([192.168.11.11]:3306)/")
c. Replace your db connection address here. -
Run the DB Migration at first instant
a. Navigate tomani@Mani:~/aircto-assignments-16_08/src$
project directory.
b. Rungo run aircto/migration/run_migration.go
c. Now the Database anduser
,issues
tables created with some user and issue seed data. d. There is no API to create user, please use the seed user data. You can find all the user list from herehttp://localhost:3011/api/users
-
Run the code.
a. Navigate tomani@Mani:~/aircto-assignments-16_08/src$
project directory.
b. Rungo run aircto/main.go
b. Now the server started to serve inhttp://localhost:3011/api/
-
Available API to test.
# The following API's no need of any authendication/access token 1. http://localhost:3011/api/ 2. http://localhost:3011/api/users 3. http://localhost:3011/api/login <br /> # After login access token will be provided for the user, need to send access token along with the request. 1. http://localhost:3011/api/issues // get - all issues 2. http://localhost:3011/api/issue/{issueID:[0-9]+} // get - issue details 3. http://localhost:3011/api/issue // post - create issue 4. http://localhost:3011/api/issue/{issueID:[0-9]+} // put - update issue info 5. http://localhost:3011/api/issue/{issueID:[0-9]+} // delete - delete issue 6. http://localhost:3011/api/issues-by-me 7. http://localhost:3011/api/issues-for-me Every issue created or updated mail will send to the assigned user with issue info. Cron Job for generate report mail to all the user.
-
Need more info on the API, please refer the following Postman Document.
Note: Limited lifetime to this document.
Please reach me out for more clarification @ manigandan.jeff@gmail.com, 9578628779, Skype: manigandan.dharmalingam
Design: System will have two models called User and Issue. With following information
#1. User
a. Email b. Username c. FirstName d. LastName e. Password f. AccessToken
#2. Issue
- Title
- Description
- AssignedTo (User relation)
- Createdby (User relation)
- Status (Open, Closed)
Problem Statement: Expose a RESTful API to make CRUD operation of Issue resource.
- Every endpoint need user authentication
- Authentication should be stateless (access_token)
- User who created the issue only should be able to edit or delete that issue
Note:
- Whenever an Issue is created or assigned to different user(in case of update), an email should be triggered exactly after 12 mins to the particular user saying issue has been assigned to him/her.
- Every 24 hours an email should be triggered to every users with details of all the issues assigned to him/her. Here 24 hours should be configurable.(for e.g we may ask you to send emails for every 10 hours or even every 10 secs)