Skip to content

Commit

Permalink
Merge pull request #116 from alexj212/master
Browse files Browse the repository at this point in the history
updated router template, updated go version
  • Loading branch information
alexj212 authored Jul 7, 2020
2 parents 73960c3 + 1dd65aa commit e5274f6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
9 changes: 6 additions & 3 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions code_http.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func GetInvoices(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
// @Failure 400 {object} api.HTTPError
// @Failure 404 {object} api.HTTPError
// @Router /invoices [post]
// echo '{"invoice_date": "2107-12-17T19:51:25.004788883-05:00","billing_address": "DvyYzGcuAeRAbdPBNFBlagepf","billing_city": "MAcHDoutMRvxAjKXaMFTplPFi","invoice_id": 98,"customer_id": 75,"billing_postal_code": "RxuAQTMTpGTgcFkuWHzosorWm","total": 0.04925881466860712,"billing_state": "guFrmbkzSZZCiqPmIvOwAMDuW","billing_country": "kLClnGHrwfzPehQfVmdbHusUp"}' | http POST "http://127.0.0.1:8080/invoices" X-Api-User:user123
// echo '{"billing_address": "hfpTCaJjJCoSnDgudTmRXDASZ","billing_state": "YGyQENIeYhCtprzMmukaXYJJq","total": 0.46911798908093755,"invoice_id": 83,"customer_id": 15,"invoice_date": "2169-11-16T10:07:41.298601898-05:00","billing_city": "zeVProxhCUeuzJoBrYnlluuaw","billing_country": "YCXzwrtvTmfjohrILMZsmENoS","billing_postal_code": "hOSXNDvfrGCWgDyKwViSsOaoH"}' | http POST "http://127.0.0.1:8080/invoices" X-Api-User:user123
func AddInvoices(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
ctx := initializeContext(r)
invoices := &model.Invoices{}
Expand Down Expand Up @@ -192,7 +192,7 @@ func AddInvoices(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
// @Failure 400 {object} api.HTTPError
// @Failure 404 {object} api.HTTPError
// @Router /invoices/{argInvoiceID} [patch]
// echo '{"invoice_date": "2107-12-17T19:51:25.004788883-05:00","billing_address": "DvyYzGcuAeRAbdPBNFBlagepf","billing_city": "MAcHDoutMRvxAjKXaMFTplPFi","invoice_id": 98,"customer_id": 75,"billing_postal_code": "RxuAQTMTpGTgcFkuWHzosorWm","total": 0.04925881466860712,"billing_state": "guFrmbkzSZZCiqPmIvOwAMDuW","billing_country": "kLClnGHrwfzPehQfVmdbHusUp"}' | http PUT "http://127.0.0.1:8080/invoices/1" X-Api-User:user123
// echo '{"billing_address": "hfpTCaJjJCoSnDgudTmRXDASZ","billing_state": "YGyQENIeYhCtprzMmukaXYJJq","total": 0.46911798908093755,"invoice_id": 83,"customer_id": 15,"invoice_date": "2169-11-16T10:07:41.298601898-05:00","billing_city": "zeVProxhCUeuzJoBrYnlluuaw","billing_country": "YCXzwrtvTmfjohrILMZsmENoS","billing_postal_code": "hOSXNDvfrGCWgDyKwViSsOaoH"}' | http PUT "http://127.0.0.1:8080/invoices/1" X-Api-User:user123
func UpdateInvoices(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
ctx := initializeContext(r)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smallnest/gen

go 1.12
go 1.14

require (
github.com/bxcodec/faker/v3 v3.3.1
Expand Down
6 changes: 3 additions & 3 deletions packrd/packed-packr.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions template/GEN_README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ Table Name: registration_source
|ms sql |y | y | y | y | y | y| n

## Version History
- v0.9.20 (07/07/2020)
- Fixed render error in router.go.tmpl
- upgraded project to use go.mod 1.14
- v0.9.19 (07/07/2020)
- Added --windows flag to write files with CRLF windows line endings, otherwise they are all unix based LF line endings
- v0.9.18 (06/30/2020)
Expand Down
2 changes: 1 addition & 1 deletion template/gomod.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module {{.module}}

go 1.13
go 1.14

require (
cloud.google.com/go v0.37.4 // indirect
Expand Down
2 changes: 1 addition & 1 deletion template/router.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func init() {
FetchDDLURL: "/ddl/{{$tableName}}",
}

tmp.TableInfo, _ = {{.modelPackageName}}.GetTableInfo("{{$tableName}}")
tmp.TableInfo, _ = {{$.modelPackageName}}.GetTableInfo("{{$tableName}}")
crudEndpoints["{{$tableName}}"] = tmp

{{end}}
Expand Down

0 comments on commit e5274f6

Please sign in to comment.