Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
imoonkin committed Dec 20, 2023
1 parent 47cb6b8 commit 6bcc97a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

name: Release

on: workflow_dispatch
on:
push:
tags:
- "v*.*.*"

jobs:

Expand Down
4 changes: 2 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ func addNote(n note) error {
}
func rangeFetch(lat1, lng1, lat2, lng2 float64) ([]note, error) {
ret := []note{}
rows, err := db.Query("select * from sharedNote where latitude between ? and ? and longitude between ? and ? limit 100", lat1, lat2, lng1, lng2)
rows, err := db.Query("select latitude,longitude,title,address,content,updateTime,visible from sharedNote where latitude between ? and ? and longitude between ? and ? limit 100", lat1, lat2, lng1, lng2)
if err != nil {
return ret, err
}
defer rows.Close()
for rows.Next() {
var n note
if err = rows.Scan(&n.Latitude, &n.Longitude, &n.Title, &n.Address, &n.Content); err != nil {
if err = rows.Scan(&n.Latitude, &n.Longitude, &n.Title, &n.Address, &n.Content, &n.UpdateTime, &n.Visible); err != nil {
return ret, err
}
ret = append(ret, n)
Expand Down

0 comments on commit 6bcc97a

Please sign in to comment.