mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 19:00:33 +07:00
Compare commits
3 Commits
e8187f13be
...
v1.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db5bf3bae0 | ||
| 199fe0a823 | |||
| 53b750ad27 |
@@ -1,8 +1,8 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/opbnq-q/nto-cli/model"
|
||||
"log"
|
||||
"nto_cli/model"
|
||||
"os"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package generation
|
||||
|
||||
import (
|
||||
"github.com/opbnq-q/nto-cli/model"
|
||||
"github.com/opbnq-q/nto-cli/utils"
|
||||
"log"
|
||||
"nto_cli/model"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -3,9 +3,9 @@ package generation
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/opbnq-q/nto-cli/model"
|
||||
"github.com/opbnq-q/nto-cli/utils"
|
||||
"log"
|
||||
"nto_cli/model"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -3,9 +3,9 @@ package generation
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/opbnq-q/nto-cli/model"
|
||||
"github.com/opbnq-q/nto-cli/utils"
|
||||
"log"
|
||||
"nto_cli/model"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -33,7 +33,17 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> {
|
||||
return await SearchByAllTextFields(input) as {{ .ModelName }}[]
|
||||
}
|
||||
|
||||
async sort(options: SortOptions<{{ .ModelName }}>) {
|
||||
return await SortedByOrder(Object.entries(options).map(item => ({Name: item[0], Order: item[1]}))) as {{ .ModelName }}[]
|
||||
async sort(options: SortOptions<Task>) {
|
||||
return (await SortedByOrder(
|
||||
Object.entries(options).map((item) => {
|
||||
if (item[1] !== 'NONE') {
|
||||
return ({
|
||||
Name: item[0],
|
||||
Order: item[1],
|
||||
})
|
||||
}
|
||||
}).filter(item => !!item)
|
||||
)) as Task[];
|
||||
}
|
||||
}
|
||||
}
|
||||
3
go.mod
3
go.mod
@@ -1,9 +1,8 @@
|
||||
module nto_cli
|
||||
module github.com/opbnq-q/nto-cli
|
||||
|
||||
go 1.22.12
|
||||
|
||||
require (
|
||||
github.com/fatih/structtag v1.2.0 // indirect
|
||||
github.com/gdamore/encoding v1.0.0 // indirect
|
||||
github.com/gdamore/tcell/v2 v2.7.1 // indirect
|
||||
github.com/kuzgoga/fogg v0.1.2 // indirect
|
||||
|
||||
8
main.go
8
main.go
@@ -1,11 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/opbnq-q/nto-cli/cmd"
|
||||
"github.com/opbnq-q/nto-cli/generation"
|
||||
"github.com/opbnq-q/nto-cli/model"
|
||||
"github.com/opbnq-q/nto-cli/utils"
|
||||
"log"
|
||||
"nto_cli/cmd"
|
||||
"nto_cli/generation"
|
||||
"nto_cli/model"
|
||||
"nto_cli/utils"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package model
|
||||
|
||||
import "nto_cli/utils"
|
||||
import "github.com/opbnq-q/nto-cli/utils"
|
||||
|
||||
func GetNotImplementedModels(models []Model) []Model {
|
||||
var unimplementedModels []Model
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/opbnq-q/nto-cli/utils"
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"log/slog"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
Reference in New Issue
Block a user