modify app to atom
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "app/providers"
|
_ "atom/providers"
|
||||||
|
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/services/http"
|
"atom/services/http"
|
||||||
"app/utils"
|
"atom/utils"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/cmd"
|
"atom/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package modules
|
package modules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "app/modules/system/container"
|
_ "atom/modules/system/container"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package container
|
package container
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/modules/system/controller"
|
"atom/modules/system/controller"
|
||||||
"app/modules/system/dao"
|
"atom/modules/system/dao"
|
||||||
"app/modules/system/routes"
|
"atom/modules/system/routes"
|
||||||
"app/modules/system/service"
|
"atom/modules/system/service"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"go.uber.org/dig"
|
"go.uber.org/dig"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/modules/system/dao"
|
"atom/modules/system/dao"
|
||||||
"app/modules/system/dto"
|
"atom/modules/system/dto"
|
||||||
"app/modules/system/service"
|
"atom/modules/system/service"
|
||||||
"app/providers/config"
|
"atom/providers/config"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/providers/config"
|
"atom/providers/config"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package routes
|
package routes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/contracts"
|
"atom/contracts"
|
||||||
"app/modules/system/controller"
|
"atom/modules/system/controller"
|
||||||
"app/providers/http"
|
"atom/providers/http"
|
||||||
|
|
||||||
"github.com/rogeecn/gen"
|
"github.com/rogeecn/gen"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/modules/system/dao"
|
"atom/modules/system/dao"
|
||||||
"app/modules/system/dto"
|
"atom/modules/system/dto"
|
||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package system
|
package system
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
_ "app/providers/config" // 这里的依赖需要被导入,否则会报错
|
_ "atom/modules/system/container"
|
||||||
_ "app/providers/logger"
|
"atom/modules/system/service"
|
||||||
_ "app/providers/mysql"
|
_ "atom/providers/config" // 这里的依赖需要被导入,否则会报错
|
||||||
_ "app/web/system/container"
|
_ "atom/providers/logger"
|
||||||
"app/web/system/service"
|
_ "atom/providers/mysql"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
@@ -45,7 +45,7 @@ func (s *TServiceSuite) Test_GetName() {
|
|||||||
assert.Equal(s.T(), "System.GetName", name.Name)
|
assert.Equal(s.T(), "System.GetName", name.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
//////
|
// ////
|
||||||
func (s *TServiceSuite) SetupSuite() {
|
func (s *TServiceSuite) SetupSuite() {
|
||||||
fmt.Println("SetupSuite")
|
fmt.Println("SetupSuite")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/utils"
|
"atom/utils"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import "app/utils"
|
import "atom/utils"
|
||||||
|
|
||||||
type App struct {
|
type App struct {
|
||||||
Mode string
|
Mode string
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/providers/config"
|
"atom/providers/config"
|
||||||
"app/providers/logger"
|
"atom/providers/logger"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package logger
|
package logger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/providers/config"
|
"atom/providers/config"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package micro
|
package micro
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/providers/config"
|
"atom/providers/config"
|
||||||
"app/utils"
|
"atom/utils"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
mgrpc "github.com/go-micro/plugins/v4/client/grpc"
|
mgrpc "github.com/go-micro/plugins/v4/client/grpc"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package mysql
|
package mysql
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/container"
|
"atom/container"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package providers
|
package providers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "app/providers/config"
|
_ "atom/providers/config"
|
||||||
_ "app/providers/http"
|
_ "atom/providers/http"
|
||||||
_ "app/providers/logger"
|
_ "atom/providers/logger"
|
||||||
_ "app/providers/micro"
|
_ "atom/providers/micro"
|
||||||
_ "app/providers/mysql"
|
_ "atom/providers/mysql"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package rpc
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"app/container"
|
"atom/container"
|
||||||
"app/proto"
|
"atom/proto"
|
||||||
|
|
||||||
"go-micro.dev/v4"
|
"go-micro.dev/v4"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "app/modules"
|
_ "atom/modules"
|
||||||
|
|
||||||
"app/contracts"
|
"atom/contracts"
|
||||||
"app/providers/config"
|
"atom/providers/config"
|
||||||
"app/providers/http"
|
"atom/providers/http"
|
||||||
"app/providers/logger"
|
"atom/providers/logger"
|
||||||
|
|
||||||
"go.uber.org/dig"
|
"go.uber.org/dig"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user