Tutorial Golang REST API + Firebird part 2
Hi, greetings corona..
Hopefully it passes quickly hehe..
Actually I want to continue firebird part 2 but, i don’t think firebird is being used too much right now ( please correct if i wrong hehe…)
actually you only need to connect to the previous tutorial and the request
previous post : https://medium.com/@harisandy21/tutorial-golang-rest-api-firebird-part-1-4610f6239b23
I think this post continue our case study
Make a CRUD program that contains a heavy body.
The program must have:
1. An index page that displays weight per day.
- The difference in body weight can be by max - min.
- Data must be ordered in descending order.
- Average data.
2. A detail page that displays weight on a particular day.
For example, the index page will display a table like:Date Max Min Difference
2018-08-22 50 49 1
2018-08-21 49 49 0
2018-08-20 52 50 2
2018-08-19 51 50 1
2018-08-18 50 48 2
Average 50.4 49.2 1.2Detail Show :Date : 2018-08-18
Max : 50
Min : 48
Difference : 2
I use the mysql driver => go get -u github.com/go-sql-driver/mysql
I build Controller and use name Weight.go
And Then, u can execute controller like that
Finally, I edit the main.go file
must be considered!!
Part 2 tutorial is actually aimed at finishing the previous tutorial which previously did not exist ie : insert, update, and delete
so format directory same like tutorial part 1
Okay that’s what I can give in this part 2 tutorial