Skip to content

pravin772/mp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Masterplan

Masterplan of activities used in construction. This is coding task.

Env setup

You need to install Golang and MySQL to use Masterplan.

Once you install both requirements.

Clone GitHub repo

git clone https://github.com/pravin772/mp-api.git
cd mp-api

Create .env file with DB_URL variable that will hold database URL/URI or just put URI in main.go

model.DB, model.Err = gorm.Open("mysql", os.Getenv("DB_URL"))

Usage

Navigate to mp-api folder (if you not)

cd mp-api
go run main.go

Server will be running on http://localhost:8000

API endpoints

To create Activity in Masterplan do post request

POST http://localhost:8000/addData

Body

{
  "SrNo": "1.5",
  "Activity": "Boundary wall",
  "StartDate": "2018-08-01T00:00:01+10:00",
  "EndDate": "2018-09-02T00:00:01+10:00"
}

To get all the Activities in JSON array

GET http://localhost:8000/getAll

To download Activities in csv file by WBS no. do get request

GET http://localhost:8000/dcsv

To download Activities in csv file by StartDate (MM-DD-YYY) do get request

GET http://localhost:8000/dcsvbystartdate

Help

Please contact to pravinbendre772@gmail.com if you wish to suggest updates or having issue while running.

About

Masterplan of activities used in construction. This is coding task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages