Skip to content

Commit

Permalink
[deco] using Device from the model package
Browse files Browse the repository at this point in the history
  • Loading branch information
DictumMortuum committed Oct 21, 2024
1 parent c636fb7 commit 788141a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions cmd/servus-deco/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ package main

import (
"github.com/DictumMortuum/servus-extapi/pkg/db"
"github.com/DictumMortuum/servus-extapi/pkg/model"
)

type Mapping struct {
Id int64 `json:"id"`
Mac string `json:"mac"`
Alias string `json:"alias"`
}

func getMappings() ([]Mapping, error) {
func getMappings() ([]model.Device, error) {
DB, err := db.DatabaseX()
if err != nil {
return nil, err
}
defer DB.Close()

rs := []Mapping{}
rs := []model.Device{}
q := `select id, mac, alias from tdevices`
err = DB.Select(&rs, q)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.0.38"
"version": "0.0.39"
}

0 comments on commit 788141a

Please sign in to comment.