mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-07 00:20:35 +07:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bff39d2c75 | ||
|
|
db5bf3bae0 | ||
| 199fe0a823 |
@@ -1,8 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/opbnq-q/nto-cli/model"
|
||||||
"log"
|
"log"
|
||||||
"nto_cli/model"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package generation
|
package generation
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/opbnq-q/nto-cli/model"
|
||||||
|
"github.com/opbnq-q/nto-cli/utils"
|
||||||
"log"
|
"log"
|
||||||
"nto_cli/model"
|
|
||||||
"nto_cli/utils"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package generation
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/opbnq-q/nto-cli/model"
|
||||||
|
"github.com/opbnq-q/nto-cli/utils"
|
||||||
"log"
|
"log"
|
||||||
"nto_cli/model"
|
|
||||||
"nto_cli/utils"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package generation
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/opbnq-q/nto-cli/model"
|
||||||
|
"github.com/opbnq-q/nto-cli/utils"
|
||||||
"log"
|
"log"
|
||||||
"nto_cli/model"
|
|
||||||
"nto_cli/utils"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
@@ -34,6 +34,15 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async sort(options: SortOptions<{{ .ModelName }}>) {
|
async sort(options: SortOptions<{{ .ModelName }}>) {
|
||||||
return await SortedByOrder(Object.entries(options).map(item => ({Name: item[0], Order: item[1]}))) as {{ .ModelName }}[]
|
return (await SortedByOrder(
|
||||||
}
|
Object.entries(options).map((item) => {
|
||||||
|
if (item[1] !== 'NONE') {
|
||||||
|
return ({
|
||||||
|
Name: item[0],
|
||||||
|
Order: item[1],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).filter(item => !!item)
|
||||||
|
)) as {{ .ModelName }}[];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import "nto_cli/utils"
|
import "github.com/opbnq-q/nto-cli/utils"
|
||||||
|
|
||||||
func GetNotImplementedModels(models []Model) []Model {
|
func GetNotImplementedModels(models []Model) []Model {
|
||||||
var unimplementedModels []Model
|
var unimplementedModels []Model
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/opbnq-q/nto-cli/utils"
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"go/parser"
|
"go/parser"
|
||||||
"go/token"
|
"go/token"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"nto_cli/utils"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
Reference in New Issue
Block a user