mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-11-11 07:41:10 +00:00
starter
This commit is contained in:
17
pkg/services/api.go
Normal file
17
pkg/services/api.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"wallet-api/pkg/models"
|
||||
|
||||
"github.com/go-pg/pg/v10"
|
||||
)
|
||||
|
||||
type ApiService struct {
|
||||
Db *pg.DB
|
||||
}
|
||||
|
||||
func (as *ApiService) GetFirst() models.ApiModel {
|
||||
apiModel := models.ApiModel{Api: "Works"}
|
||||
as.Db.Model(&apiModel).First()
|
||||
return apiModel
|
||||
}
|
||||
Reference in New Issue
Block a user