Rename rest to code.

This commit is contained in:
zicla
2019-04-26 02:59:35 +08:00
parent 46256439da
commit ce84a9c9f0
67 changed files with 138 additions and 124 deletions
+14
View File
@@ -0,0 +1,14 @@
# Package dependency
```
main
├── bin
├── pkg
├── src
│   ├── github.com
│   ├── golang.org
│   ├── tank
│   │   ├── build
│   │   │   ├── conf
│   │   │   ├── doc
```
@@ -1,12 +1,12 @@
package rest
package code
import (
"fmt"
"net/http"
"regexp"
"strconv"
"tank/rest/result"
"tank/rest/tool"
"tank/code/result"
"tank/code/tool"
"time"
)
@@ -1,10 +1,10 @@
package rest
package code
import (
"fmt"
"net/http"
"tank/rest/result"
"tank/rest/tool"
"tank/code/result"
"tank/code/tool"
"time"
)
@@ -1,11 +1,11 @@
package rest
package code
import (
"fmt"
"github.com/json-iterator/go"
"go/types"
"net/http"
"tank/rest/result"
"tank/code/result"
)
type IController interface {
+1 -1
View File
@@ -1,4 +1,4 @@
package rest
package code
type BaseDao struct {
Bean
+2 -2
View File
@@ -1,9 +1,9 @@
package rest
package code
import (
"math"
"reflect"
"tank/rest/config"
"tank/code/config"
"time"
)
+5 -5
View File
@@ -1,11 +1,11 @@
package rest
package code
import (
"net/http"
"tank/rest/config"
"tank/rest/logger"
"tank/rest/result"
"tank/rest/tool"
"tank/code/config"
"tank/code/logger"
"tank/code/result"
"tank/code/tool"
)
type IBean interface {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"sort"
"sync"
"tank/rest/tool"
"tank/code/tool"
"time"
)
@@ -3,8 +3,8 @@ package config
import (
"github.com/json-iterator/go"
"io/ioutil"
"tank/rest/logger"
"tank/rest/tool"
"tank/code/logger"
"tank/code/tool"
"time"
"unsafe"
)
+4 -4
View File
@@ -1,12 +1,12 @@
package rest
package code
import (
"fmt"
"github.com/jinzhu/gorm"
"reflect"
"tank/rest/cache"
"tank/rest/config"
"tank/rest/logger"
"tank/code/cache"
"tank/code/config"
"tank/code/logger"
)
//全局唯一的上下文(在main函数中初始化)
@@ -1,9 +1,9 @@
package rest
package code
import (
"net/http"
"strconv"
"tank/rest/result"
"tank/code/result"
)
type DashboardController struct {
@@ -1,4 +1,4 @@
package rest
package code
import (
"github.com/jinzhu/gorm"
@@ -1,6 +1,6 @@
package rest
package code
import "tank/rest/config"
import "tank/code/config"
/**
* 系统的所有访问记录均记录在此
@@ -1,7 +1,7 @@
package rest
package code
import (
"tank/rest/tool"
"tank/code/tool"
"time"
)
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"fmt"
"io"
"net/http"
"tank/rest/dav/xml"
"tank/rest/result"
"tank/code/dav/xml"
"tank/code/result"
)
// Proppatch describes a property update instruction as defined in RFC 4918.
@@ -1,4 +1,4 @@
package rest
package code
import (
"bytes"
@@ -7,8 +7,8 @@ import (
"net/http"
"regexp"
"strings"
"tank/rest/result"
"tank/rest/tool"
"tank/code/result"
"tank/code/tool"
)
/**
+3 -3
View File
@@ -1,12 +1,12 @@
package rest
package code
import (
"fmt"
"net/http"
"path"
"strconv"
"tank/rest/dav"
"tank/rest/dav/xml"
"tank/code/dav"
"tank/code/dav/xml"
)
//访问前缀,这个是特殊入口
+5 -5
View File
@@ -1,4 +1,4 @@
package rest
package code
import (
"fmt"
@@ -7,10 +7,10 @@ import (
"path"
"regexp"
"strings"
"tank/rest/dav"
"tank/rest/dav/xml"
"tank/rest/result"
"tank/rest/tool"
"tank/code/dav"
"tank/code/dav/xml"
"tank/code/result"
"tank/code/tool"
)
/**
@@ -11,8 +11,8 @@ import (
"os"
"strconv"
"strings"
"tank/rest/result"
"tank/rest/tool"
"tank/code/result"
"tank/code/tool"
"time"
)
@@ -1,4 +1,4 @@
package rest
package code
import (
@@ -1,7 +1,7 @@
package rest
package code
import (
"tank/rest/config"
"tank/code/config"
"time"
)
@@ -1,9 +1,9 @@
package rest
package code
import (
"net/http"
"strconv"
"tank/rest/result"
"tank/code/result"
)
type FootprintController struct {
@@ -1,4 +1,4 @@
package rest
package code
import (
"github.com/jinzhu/gorm"
@@ -1,6 +1,6 @@
package rest
package code
import "tank/rest/config"
import "tank/code/config"
/**
* 系统的所有访问记录均记录在此
@@ -1,10 +1,10 @@
package rest
package code
import (
"encoding/json"
"net/http"
"tank/rest/config"
"tank/rest/tool"
"tank/code/config"
"tank/code/tool"
"time"
)
@@ -1,10 +1,10 @@
package rest
package code
import (
"net/http"
"strconv"
"strings"
"tank/rest/result"
"tank/code/result"
)
type ImageCacheController struct {
@@ -1,4 +1,4 @@
package rest
package code
import (
"fmt"
@@ -6,7 +6,7 @@ import (
"github.com/nu7hatch/gouuid"
"os"
"path/filepath"
"tank/rest/tool"
"tank/code/tool"
"time"
)
@@ -1,7 +1,7 @@
package rest
package code
import (
"tank/rest/config"
"tank/code/config"
)
/**
@@ -1,4 +1,4 @@
package rest
package code
import (
"fmt"
@@ -9,7 +9,7 @@ import (
"path/filepath"
"strconv"
"strings"
"tank/rest/tool"
"tank/code/tool"
)
//@Service
@@ -1,4 +1,4 @@
package rest
package code
import (
"fmt"
@@ -11,9 +11,9 @@ import (
"os"
"regexp"
"strconv"
"tank/rest/config"
"tank/rest/result"
"tank/rest/tool"
"tank/code/config"
"tank/code/result"
"tank/code/tool"
"time"
)
@@ -1,4 +1,4 @@
package rest
package code
import "github.com/jinzhu/gorm"
@@ -6,7 +6,7 @@ import (
"os"
"runtime"
"sync"
"tank/rest/tool"
"tank/code/tool"
"time"
)
+6 -6
View File
@@ -5,9 +5,9 @@ import (
_ "github.com/go-sql-driver/mysql"
"log"
"net/http"
"tank/rest"
"tank/rest/config"
"tank/rest/logger"
"tank/code"
"tank/code/config"
"tank/code/logger"
)
func main() {
@@ -20,10 +20,10 @@ func main() {
config.CONFIG.Init()
//全局运行的上下文
rest.CONTEXT.Init()
defer rest.CONTEXT.Destroy()
code.CONTEXT.Init()
defer code.CONTEXT.Destroy()
http.Handle("/", rest.CONTEXT.Router)
http.Handle("/", code.CONTEXT.Router)
logger.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)
@@ -1,10 +1,10 @@
package rest
package code
import (
"net/http"
"strconv"
"strings"
"tank/rest/result"
"tank/code/result"
)
type MatterController struct {
+4 -4
View File
@@ -1,12 +1,12 @@
package rest
package code
import (
"github.com/jinzhu/gorm"
"github.com/nu7hatch/gouuid"
"os"
"tank/rest/config"
"tank/rest/result"
"tank/rest/tool"
"tank/code/config"
"tank/code/result"
"tank/code/tool"
"time"
)
@@ -1,9 +1,9 @@
package rest
package code
import (
"fmt"
"tank/rest/config"
"tank/rest/tool"
"tank/code/config"
"tank/code/tool"
)
const (
@@ -1,4 +1,4 @@
package rest
package code
import (
"io"
@@ -6,9 +6,9 @@ import (
"os"
"regexp"
"strings"
"tank/rest/download"
"tank/rest/result"
"tank/rest/tool"
"tank/code/download"
"tank/code/result"
"tank/code/tool"
)
/**
@@ -1,9 +1,9 @@
package rest
package code
import (
"net/http"
"tank/rest/result"
"tank/rest/tool"
"tank/code/result"
"tank/code/tool"
)
type PreferenceController struct {
@@ -1,8 +1,8 @@
package rest
package code
import (
"github.com/nu7hatch/gouuid"
"tank/rest/result"
"tank/code/result"
"time"
)
@@ -1,6 +1,6 @@
package rest
package code
import "tank/rest/config"
import "tank/code/config"
type Preference struct {
Base
@@ -1,4 +1,4 @@
package rest
package code
//@Service
type PreferenceService struct {
+5 -5
View File
@@ -1,4 +1,4 @@
package rest
package code
import (
"fmt"
@@ -7,10 +7,10 @@ import (
"net/http"
"os"
"strings"
"tank/rest/config"
"tank/rest/logger"
"tank/rest/result"
"tank/rest/tool"
"tank/code/config"
"tank/code/logger"
"tank/code/result"
"tank/code/tool"
"time"
)
+1 -1
View File
@@ -1,4 +1,4 @@
package rest
package code
import (
@@ -1,7 +1,7 @@
package rest
package code
import (
"tank/rest/config"
"tank/code/config"
"time"
)
@@ -1,4 +1,4 @@
package rest
package code
//@Service
type SessionService struct {
+1 -1
View File
@@ -1,4 +1,4 @@
package rest
package code
type OrderPair struct {
key string
@@ -2,8 +2,8 @@ package test
import (
"bytes"
"tank/rest/dav"
"tank/rest/dav/xml"
"tank/code/dav"
"tank/code/dav/xml"
"testing"
"time"
)
@@ -9,7 +9,7 @@ import (
"os/user"
"path/filepath"
"strings"
"tank/rest/result"
"tank/code/result"
)
//判断文件或文件夹是否已经存在
@@ -1,4 +1,4 @@
package rest
package code
import (
@@ -1,7 +1,7 @@
package rest
package code
import (
"tank/rest/config"
"tank/code/config"
"time"
)
@@ -1,12 +1,12 @@
package rest
package code
import (
"net/http"
"regexp"
"strconv"
"tank/rest/config"
"tank/rest/result"
"tank/rest/tool"
"tank/code/config"
"tank/code/result"
"tank/code/tool"
"time"
)
+1 -1
View File
@@ -1,4 +1,4 @@
package rest
package code
import (
"github.com/nu7hatch/gouuid"
+2 -2
View File
@@ -1,7 +1,7 @@
package rest
package code
import (
"tank/rest/config"
"tank/code/config"
"time"
)
@@ -1,10 +1,10 @@
package rest
package code
import (
"net/http"
"tank/rest/cache"
"tank/rest/config"
"tank/rest/result"
"tank/code/cache"
"tank/code/config"
"tank/code/result"
"time"
)