lejianwen месяцев назад: 11
Родитель
Сommit
6aebf061a4
79 измененных файлов с 262 добавлено и 263 удалено
  1. 14 14
      cmd/apimain.go
  2. 19 19
      config/ldap.go
  3. 1 1
      config/oauth.go
  4. 5 5
      global/global.go
  5. 0 1
      global/i18n.go
  6. 1 1
      go.mod
  7. 4 4
      http/controller/admin/addressBook.go
  8. 5 5
      http/controller/admin/addressBookCollection.go
  9. 5 5
      http/controller/admin/addressBookCollectionRule.go
  10. 5 5
      http/controller/admin/audit.go
  11. 3 3
      http/controller/admin/config.go
  12. 3 3
      http/controller/admin/file.go
  13. 4 4
      http/controller/admin/group.go
  14. 8 8
      http/controller/admin/login.go
  15. 5 5
      http/controller/admin/loginLog.go
  16. 4 4
      http/controller/admin/my/addressBook.go
  17. 5 5
      http/controller/admin/my/addressBookCollection.go
  18. 5 5
      http/controller/admin/my/addressBookCollectionRule.go
  19. 5 5
      http/controller/admin/my/loginLog.go
  20. 3 3
      http/controller/admin/my/peer.go
  21. 4 4
      http/controller/admin/my/shareRecord.go
  22. 4 4
      http/controller/admin/my/tag.go
  23. 5 5
      http/controller/admin/oauth.go
  24. 4 4
      http/controller/admin/peer.go
  25. 5 5
      http/controller/admin/rustdesk.go
  26. 4 4
      http/controller/admin/shareRecord.go
  27. 4 4
      http/controller/admin/tag.go
  28. 6 6
      http/controller/admin/user.go
  29. 5 5
      http/controller/admin/userToken.go
  30. 7 7
      http/controller/api/ab.go
  31. 4 4
      http/controller/api/audit.go
  32. 5 5
      http/controller/api/group.go
  33. 4 4
      http/controller/api/index.go
  34. 6 6
      http/controller/api/login.go
  35. 6 6
      http/controller/api/ouath.go
  36. 3 3
      http/controller/api/peer.go
  37. 2 2
      http/controller/api/user.go
  38. 4 4
      http/controller/api/webClient.go
  39. 1 1
      http/controller/web/index.go
  40. 3 3
      http/http.go
  41. 2 2
      http/middleware/admin.go
  42. 2 2
      http/middleware/admin_privilege.go
  43. 3 3
      http/middleware/jwt.go
  44. 1 1
      http/middleware/logger.go
  45. 2 2
      http/middleware/rustauth.go
  46. 1 1
      http/request/admin/addressBook.go
  47. 1 1
      http/request/admin/group.go
  48. 1 1
      http/request/admin/oauth.go
  49. 1 1
      http/request/admin/peer.go
  50. 1 1
      http/request/admin/tag.go
  51. 1 1
      http/request/admin/user.go
  52. 2 2
      http/request/api/audit.go
  53. 1 1
      http/request/api/peer.go
  54. 1 1
      http/response/admin/user.go
  55. 1 1
      http/response/api/ab.go
  56. 1 1
      http/response/api/peer.go
  57. 1 1
      http/response/api/user.go
  58. 1 1
      http/response/api/webClient.go
  59. 1 1
      http/response/response.go
  60. 5 5
      http/router/admin.go
  61. 4 4
      http/router/api.go
  62. 2 2
      http/router/router.go
  63. 1 1
      lib/orm/mysql.go
  64. 1 1
      lib/orm/sqlite.go
  65. 1 1
      model/addressBook.go
  66. 1 1
      model/model.go
  67. 5 5
      model/userToken.go
  68. 2 2
      service/addressBook.go
  69. 2 2
      service/audit.go
  70. 2 2
      service/group.go
  71. 3 3
      service/ldap.go
  72. 2 2
      service/loginLog.go
  73. 3 3
      service/oauth.go
  74. 2 2
      service/peer.go
  75. 2 2
      service/serverCmd.go
  76. 1 1
      service/service.go
  77. 2 2
      service/shareRecord.go
  78. 2 2
      service/tag.go
  79. 4 4
      service/user.go

+ 14 - 14
cmd/apimain.go

@@ -2,18 +2,18 @@ package main
2 2
 
3 3
 import (
4 4
 	"github.com/go-redis/redis/v8"
5
-	"github.com/lejianwen/rustdesk-api/config"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/http"
8
-	"github.com/lejianwen/rustdesk-api/lib/cache"
9
-	"github.com/lejianwen/rustdesk-api/lib/jwt"
10
-	"github.com/lejianwen/rustdesk-api/lib/lock"
11
-	"github.com/lejianwen/rustdesk-api/lib/logger"
12
-	"github.com/lejianwen/rustdesk-api/lib/orm"
13
-	"github.com/lejianwen/rustdesk-api/lib/upload"
14
-	"github.com/lejianwen/rustdesk-api/model"
15
-	"github.com/lejianwen/rustdesk-api/service"
16
-	"github.com/lejianwen/rustdesk-api/utils"
5
+	"github.com/lejianwen/rustdesk-api/v2/config"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/http"
8
+	"github.com/lejianwen/rustdesk-api/v2/lib/cache"
9
+	"github.com/lejianwen/rustdesk-api/v2/lib/jwt"
10
+	"github.com/lejianwen/rustdesk-api/v2/lib/lock"
11
+	"github.com/lejianwen/rustdesk-api/v2/lib/logger"
12
+	"github.com/lejianwen/rustdesk-api/v2/lib/orm"
13
+	"github.com/lejianwen/rustdesk-api/v2/lib/upload"
14
+	"github.com/lejianwen/rustdesk-api/v2/model"
15
+	"github.com/lejianwen/rustdesk-api/v2/service"
16
+	"github.com/lejianwen/rustdesk-api/v2/utils"
17 17
 	"github.com/nicksnyder/go-i18n/v2/i18n"
18 18
 	"github.com/spf13/cobra"
19 19
 	"os"
@@ -186,12 +186,12 @@ func DatabaseAutoUpdate() {
186 186
 			// 获取底层的 *sql.DB 对象,并确保在程序退出时关闭连接
187 187
 			sqlDBWithoutDB, err := dbWithoutDB.DB()
188 188
 			if err != nil {
189
-				global.Logger.Error("获取底层 *sql.DB 对象失败: %v\n", err)
189
+				global.Logger.Errorf("获取底层 *sql.DB 对象失败: %v", err)
190 190
 				return
191 191
 			}
192 192
 			defer func() {
193 193
 				if err := sqlDBWithoutDB.Close(); err != nil {
194
-					global.Logger.Error("关闭连接失败: %v\n", err)
194
+					global.Logger.Errorf("关闭连接失败: %v", err)
195 195
 				}
196 196
 			}()
197 197
 

+ 19 - 19
config/ldap.go

@@ -1,16 +1,16 @@
1 1
 package config
2 2
 
3 3
 type LdapUser struct {
4
-	BaseDn 	   		string `mapstructure:"base-dn"` 				// The base DN of the user for searching
5
-	EnableAttr 		string `mapstructure:"enable-attr"` 			// The attribute name of the user for enabling, in AD it is "userAccountControl", empty means no enable attribute, all users are enabled
6
-	EnableAttrValue string `mapstructure:"enable-attr-value"` 		// The value of the enable attribute when the user is enabled. If you are using AD, just leave it random str, it will be ignored.
7
-	Filter     		string `mapstructure:"filter"`
8
-	Username   		string `mapstructure:"username"`
9
-	Email      		string `mapstructure:"email"`
10
-	FirstName  		string `mapstructure:"first-name"`
11
-	LastName   		string `mapstructure:"last-name"`
12
-	Sync       		bool   `mapstructure:"sync"` 				// Will sync the user's information to the internal database
13
-	AdminGroup      string `mapstructure:"admin-group"` 	    // Which group is the admin group
4
+	BaseDn          string `mapstructure:"base-dn"`           // The base DN of the user for searching
5
+	EnableAttr      string `mapstructure:"enable-attr"`       // The attribute name of the user for enabling, in AD it is "userAccountControl", empty means no enable attribute, all users are enabled
6
+	EnableAttrValue string `mapstructure:"enable-attr-value"` // The value of the enable attribute when the user is enabled. If you are using AD, just leave it random str, it will be ignored.
7
+	Filter          string `mapstructure:"filter"`
8
+	Username        string `mapstructure:"username"`
9
+	Email           string `mapstructure:"email"`
10
+	FirstName       string `mapstructure:"first-name"`
11
+	LastName        string `mapstructure:"last-name"`
12
+	Sync            bool   `mapstructure:"sync"`        // Will sync the user's information to the internal database
13
+	AdminGroup      string `mapstructure:"admin-group"` // Which group is the admin group
14 14
 }
15 15
 
16 16
 // type LdapGroup struct {
@@ -24,13 +24,13 @@ type LdapUser struct {
24 24
 // }
25 25
 
26 26
 type Ldap struct {
27
-	Enable       bool      `mapstructure:"enable"`
28
-	Url          string    `mapstructure:"url"`
29
-	TLS          bool      `mapstructure:"tls"`
30
-	TlsVerify 	 bool      `mapstructure:"tls-verify"`
31
-	BaseDn       string    `mapstructure:"base-dn"`
32
-	BindDn       string    `mapstructure:"bind-dn"`
33
-	BindPassword string    `mapstructure:"bind-password"`
34
-	User         LdapUser  `mapstructure:"user"`
27
+	Enable       bool     `mapstructure:"enable"`
28
+	Url          string   `mapstructure:"url"`
29
+	TLS          bool     `mapstructure:"tls"`
30
+	TlsVerify    bool     `mapstructure:"tls-verify"`
31
+	BaseDn       string   `mapstructure:"base-dn"`
32
+	BindDn       string   `mapstructure:"bind-dn"`
33
+	BindPassword string   `mapstructure:"bind-password"`
34
+	User         LdapUser `mapstructure:"user"`
35 35
 	// Group        LdapGroup `mapstructure:"group"`
36
-}
36
+}

+ 1 - 1
config/oauth.go

@@ -17,4 +17,4 @@ type OidcOauth struct {
17 17
 	ClientId     string `mapstructure:"client-id"`
18 18
 	ClientSecret string `mapstructure:"client-secret"`
19 19
 	RedirectUrl  string `mapstructure:"redirect-url"`
20
-}
20
+}

+ 5 - 5
global/global.go

@@ -5,11 +5,11 @@ import (
5 5
 	ut "github.com/go-playground/universal-translator"
6 6
 	"github.com/go-playground/validator/v10"
7 7
 	"github.com/go-redis/redis/v8"
8
-	"github.com/lejianwen/rustdesk-api/config"
9
-	"github.com/lejianwen/rustdesk-api/lib/cache"
10
-	"github.com/lejianwen/rustdesk-api/lib/jwt"
11
-	"github.com/lejianwen/rustdesk-api/lib/lock"
12
-	"github.com/lejianwen/rustdesk-api/lib/upload"
8
+	"github.com/lejianwen/rustdesk-api/v2/config"
9
+	"github.com/lejianwen/rustdesk-api/v2/lib/cache"
10
+	"github.com/lejianwen/rustdesk-api/v2/lib/jwt"
11
+	"github.com/lejianwen/rustdesk-api/v2/lib/lock"
12
+	"github.com/lejianwen/rustdesk-api/v2/lib/upload"
13 13
 	"github.com/nicksnyder/go-i18n/v2/i18n"
14 14
 	"github.com/sirupsen/logrus"
15 15
 	"github.com/spf13/viper"

+ 0 - 1
global/i18n.go

@@ -15,7 +15,6 @@ func InitI18n() {
15 15
 	fileInfos, err := os.ReadDir(dir)
16 16
 	if err != nil {
17 17
 		panic(err)
18
-		return
19 18
 	}
20 19
 	for _, fileInfo := range fileInfos {
21 20
 		//如果文件名不是.toml结尾

+ 1 - 1
go.mod

@@ -1,4 +1,4 @@
1
-module github.com/lejianwen/rustdesk-api
1
+module github.com/lejianwen/rustdesk-api/v2
2 2
 
3 3
 go 1.22
4 4
 

+ 4 - 4
http/controller/admin/addressBook.go

@@ -4,10 +4,10 @@ import (
4 4
 	"encoding/json"
5 5
 	_ "encoding/json"
6 6
 	"github.com/gin-gonic/gin"
7
-	"github.com/lejianwen/rustdesk-api/global"
8
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
9
-	"github.com/lejianwen/rustdesk-api/http/response"
10
-	"github.com/lejianwen/rustdesk-api/service"
7
+	"github.com/lejianwen/rustdesk-api/v2/global"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
9
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
10
+	"github.com/lejianwen/rustdesk-api/v2/service"
11 11
 	"gorm.io/gorm"
12 12
 	"strconv"
13 13
 )

+ 5 - 5
http/controller/admin/addressBookCollection.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 	"strconv"
12 12
 )

+ 5 - 5
http/controller/admin/addressBookCollectionRule.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 	"strconv"
12 12
 )

+ 5 - 5
http/controller/admin/audit.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 )
12 12
 

+ 3 - 3
http/controller/admin/config.go

@@ -2,9 +2,9 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/response"
7
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
7
+	"github.com/lejianwen/rustdesk-api/v2/service"
8 8
 	"os"
9 9
 	"strings"
10 10
 )

+ 3 - 3
http/controller/admin/file.go

@@ -3,9 +3,9 @@ package admin
3 3
 import (
4 4
 	"fmt"
5 5
 	"github.com/gin-gonic/gin"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/lib/upload"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/lib/upload"
9 9
 	"os"
10 10
 	"time"
11 11
 )

+ 4 - 4
http/controller/admin/group.go

@@ -2,10 +2,10 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"strconv"
10 10
 )
11 11
 

+ 8 - 8
http/controller/admin/login.go

@@ -3,14 +3,14 @@ package admin
3 3
 import (
4 4
 	"fmt"
5 5
 	"github.com/gin-gonic/gin"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/http/controller/api"
8
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
9
-	apiReq "github.com/lejianwen/rustdesk-api/http/request/api"
10
-	"github.com/lejianwen/rustdesk-api/http/response"
11
-	adResp "github.com/lejianwen/rustdesk-api/http/response/admin"
12
-	"github.com/lejianwen/rustdesk-api/model"
13
-	"github.com/lejianwen/rustdesk-api/service"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/controller/api"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
9
+	apiReq "github.com/lejianwen/rustdesk-api/v2/http/request/api"
10
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
11
+	adResp "github.com/lejianwen/rustdesk-api/v2/http/response/admin"
12
+	"github.com/lejianwen/rustdesk-api/v2/model"
13
+	"github.com/lejianwen/rustdesk-api/v2/service"
14 14
 	"github.com/mojocn/base64Captcha"
15 15
 	"sync"
16 16
 	"time"

+ 5 - 5
http/controller/admin/loginLog.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 	"strconv"
12 12
 )

+ 4 - 4
http/controller/admin/my/addressBook.go

@@ -3,10 +3,10 @@ package my
3 3
 import (
4 4
 	"encoding/json"
5 5
 	"github.com/gin-gonic/gin"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
8
-	"github.com/lejianwen/rustdesk-api/http/response"
9
-	"github.com/lejianwen/rustdesk-api/service"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 )
12 12
 

+ 5 - 5
http/controller/admin/my/addressBookCollection.go

@@ -2,11 +2,11 @@ package my
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 )
12 12
 

+ 5 - 5
http/controller/admin/my/addressBookCollectionRule.go

@@ -2,11 +2,11 @@ package my
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 )
12 12
 

+ 5 - 5
http/controller/admin/my/loginLog.go

@@ -2,11 +2,11 @@ package my
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 )
12 12
 

+ 3 - 3
http/controller/admin/my/peer.go

@@ -2,9 +2,9 @@ package my
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
6
-	"github.com/lejianwen/rustdesk-api/http/response"
7
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
7
+	"github.com/lejianwen/rustdesk-api/v2/service"
8 8
 	"gorm.io/gorm"
9 9
 	"time"
10 10
 )

+ 4 - 4
http/controller/admin/my/shareRecord.go

@@ -2,10 +2,10 @@ package my
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"gorm.io/gorm"
10 10
 )
11 11
 

+ 4 - 4
http/controller/admin/my/tag.go

@@ -2,10 +2,10 @@ package my
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"gorm.io/gorm"
10 10
 )
11 11
 

+ 5 - 5
http/controller/admin/oauth.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	adminReq "github.com/lejianwen/rustdesk-api/http/request/admin"
8
-	"github.com/lejianwen/rustdesk-api/http/response"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	adminReq "github.com/lejianwen/rustdesk-api/v2/http/request/admin"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"strconv"
11 11
 )
12 12
 

+ 4 - 4
http/controller/admin/peer.go

@@ -2,10 +2,10 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"gorm.io/gorm"
10 10
 	"strconv"
11 11
 	"time"

+ 5 - 5
http/controller/admin/rustdesk.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 )
11 11
 
12 12
 type Rustdesk struct {

+ 4 - 4
http/controller/admin/shareRecord.go

@@ -2,10 +2,10 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"gorm.io/gorm"
10 10
 )
11 11
 

+ 4 - 4
http/controller/admin/tag.go

@@ -2,10 +2,10 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"gorm.io/gorm"
10 10
 	"strconv"
11 11
 )

+ 6 - 6
http/controller/admin/user.go

@@ -2,12 +2,12 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	adResp "github.com/lejianwen/rustdesk-api/http/response/admin"
9
-	"github.com/lejianwen/rustdesk-api/model"
10
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	adResp "github.com/lejianwen/rustdesk-api/v2/http/response/admin"
9
+	"github.com/lejianwen/rustdesk-api/v2/model"
10
+	"github.com/lejianwen/rustdesk-api/v2/service"
11 11
 	"gorm.io/gorm"
12 12
 	"strconv"
13 13
 )

+ 5 - 5
http/controller/admin/userToken.go

@@ -2,11 +2,11 @@ package admin
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/admin"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"gorm.io/gorm"
11 11
 )
12 12
 

+ 7 - 7
http/controller/api/ab.go

@@ -4,13 +4,13 @@ import (
4 4
 	"encoding/json"
5 5
 	"errors"
6 6
 	"github.com/gin-gonic/gin"
7
-	"github.com/lejianwen/rustdesk-api/global"
8
-	requstform "github.com/lejianwen/rustdesk-api/http/request/api"
9
-	"github.com/lejianwen/rustdesk-api/http/response"
10
-	"github.com/lejianwen/rustdesk-api/http/response/api"
11
-	"github.com/lejianwen/rustdesk-api/model"
12
-	"github.com/lejianwen/rustdesk-api/service"
13
-	"github.com/lejianwen/rustdesk-api/utils"
7
+	"github.com/lejianwen/rustdesk-api/v2/global"
8
+	requstform "github.com/lejianwen/rustdesk-api/v2/http/request/api"
9
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
10
+	"github.com/lejianwen/rustdesk-api/v2/http/response/api"
11
+	"github.com/lejianwen/rustdesk-api/v2/model"
12
+	"github.com/lejianwen/rustdesk-api/v2/service"
13
+	"github.com/lejianwen/rustdesk-api/v2/utils"
14 14
 	"net/http"
15 15
 	"strconv"
16 16
 	"strings"

+ 4 - 4
http/controller/api/audit.go

@@ -3,10 +3,10 @@ package api
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5 5
 	"github.com/gin-gonic/gin/binding"
6
-	request "github.com/lejianwen/rustdesk-api/http/request/api"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
6
+	request "github.com/lejianwen/rustdesk-api/v2/http/request/api"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"time"
11 11
 )
12 12
 

+ 5 - 5
http/controller/api/group.go

@@ -2,11 +2,11 @@ package api
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	apiReq "github.com/lejianwen/rustdesk-api/http/request/api"
6
-	"github.com/lejianwen/rustdesk-api/http/response"
7
-	apiResp "github.com/lejianwen/rustdesk-api/http/response/api"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/service"
5
+	apiReq "github.com/lejianwen/rustdesk-api/v2/http/request/api"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
7
+	apiResp "github.com/lejianwen/rustdesk-api/v2/http/response/api"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/service"
10 10
 	"net/http"
11 11
 )
12 12
 

+ 4 - 4
http/controller/api/index.go

@@ -2,10 +2,10 @@ package api
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	requstform "github.com/lejianwen/rustdesk-api/http/request/api"
6
-	"github.com/lejianwen/rustdesk-api/http/response"
7
-	"github.com/lejianwen/rustdesk-api/model"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	requstform "github.com/lejianwen/rustdesk-api/v2/http/request/api"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
7
+	"github.com/lejianwen/rustdesk-api/v2/model"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"net/http"
10 10
 	"os"
11 11
 	"time"

+ 6 - 6
http/controller/api/login.go

@@ -4,12 +4,12 @@ import (
4 4
 	"encoding/json"
5 5
 	"fmt"
6 6
 	"github.com/gin-gonic/gin"
7
-	"github.com/lejianwen/rustdesk-api/global"
8
-	"github.com/lejianwen/rustdesk-api/http/request/api"
9
-	"github.com/lejianwen/rustdesk-api/http/response"
10
-	apiResp "github.com/lejianwen/rustdesk-api/http/response/api"
11
-	"github.com/lejianwen/rustdesk-api/model"
12
-	"github.com/lejianwen/rustdesk-api/service"
7
+	"github.com/lejianwen/rustdesk-api/v2/global"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/request/api"
9
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
10
+	apiResp "github.com/lejianwen/rustdesk-api/v2/http/response/api"
11
+	"github.com/lejianwen/rustdesk-api/v2/model"
12
+	"github.com/lejianwen/rustdesk-api/v2/service"
13 13
 	"net/http"
14 14
 )
15 15
 

+ 6 - 6
http/controller/api/ouath.go

@@ -2,12 +2,12 @@ package api
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/request/api"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	apiResp "github.com/lejianwen/rustdesk-api/http/response/api"
9
-	"github.com/lejianwen/rustdesk-api/model"
10
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/request/api"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	apiResp "github.com/lejianwen/rustdesk-api/v2/http/response/api"
9
+	"github.com/lejianwen/rustdesk-api/v2/model"
10
+	"github.com/lejianwen/rustdesk-api/v2/service"
11 11
 	"net/http"
12 12
 )
13 13
 

+ 3 - 3
http/controller/api/peer.go

@@ -3,9 +3,9 @@ package api
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5 5
 	"github.com/gin-gonic/gin/binding"
6
-	requstform "github.com/lejianwen/rustdesk-api/http/request/api"
7
-	"github.com/lejianwen/rustdesk-api/http/response"
8
-	"github.com/lejianwen/rustdesk-api/service"
6
+	requstform "github.com/lejianwen/rustdesk-api/v2/http/request/api"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"net/http"
10 10
 )
11 11
 

+ 2 - 2
http/controller/api/user.go

@@ -2,8 +2,8 @@ package api
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	apiResp "github.com/lejianwen/rustdesk-api/http/response/api"
6
-	"github.com/lejianwen/rustdesk-api/service"
5
+	apiResp "github.com/lejianwen/rustdesk-api/v2/http/response/api"
6
+	"github.com/lejianwen/rustdesk-api/v2/service"
7 7
 	"net/http"
8 8
 )
9 9
 

+ 4 - 4
http/controller/api/webClient.go

@@ -2,10 +2,10 @@ package api
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/response"
7
-	"github.com/lejianwen/rustdesk-api/http/response/api"
8
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/response/api"
8
+	"github.com/lejianwen/rustdesk-api/v2/service"
9 9
 	"time"
10 10
 )
11 11
 

+ 1 - 1
http/controller/web/index.go

@@ -2,7 +2,7 @@ package web
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6 6
 	"strconv"
7 7
 )
8 8
 

+ 3 - 3
http/http.go

@@ -2,9 +2,9 @@ package http
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/middleware"
7
-	"github.com/lejianwen/rustdesk-api/http/router"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/middleware"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/router"
8 8
 	"github.com/sirupsen/logrus"
9 9
 	"net/http"
10 10
 	"strings"

+ 2 - 2
http/middleware/admin.go

@@ -2,8 +2,8 @@ package middleware
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/http/response"
6
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
6
+	"github.com/lejianwen/rustdesk-api/v2/service"
7 7
 )
8 8
 
9 9
 // AdminAuth 后台权限验证中间件

+ 2 - 2
http/middleware/admin_privilege.go

@@ -2,8 +2,8 @@ package middleware
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/http/response"
6
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
6
+	"github.com/lejianwen/rustdesk-api/v2/service"
7 7
 )
8 8
 
9 9
 // AdminPrivilege ...

+ 3 - 3
http/middleware/jwt.go

@@ -2,9 +2,9 @@ package middleware
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/response"
7
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/response"
7
+	"github.com/lejianwen/rustdesk-api/v2/service"
8 8
 )
9 9
 
10 10
 func JwtAuth() gin.HandlerFunc {

+ 1 - 1
http/middleware/logger.go

@@ -2,7 +2,7 @@ package middleware
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6 6
 	"github.com/sirupsen/logrus"
7 7
 )
8 8
 

+ 2 - 2
http/middleware/rustauth.go

@@ -2,8 +2,8 @@ package middleware
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/service"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/service"
7 7
 )
8 8
 
9 9
 func RustAuth() gin.HandlerFunc {

+ 1 - 1
http/request/admin/addressBook.go

@@ -2,7 +2,7 @@ package admin
2 2
 
3 3
 import (
4 4
 	"encoding/json"
5
-	"github.com/lejianwen/rustdesk-api/model"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 )
7 7
 
8 8
 type AddressBookForm struct {

+ 1 - 1
http/request/admin/group.go

@@ -1,6 +1,6 @@
1 1
 package admin
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 type GroupForm struct {
6 6
 	Id   uint   `json:"id"`

+ 1 - 1
http/request/admin/oauth.go

@@ -1,7 +1,7 @@
1 1
 package admin
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/model"
5 5
 )
6 6
 
7 7
 type BindOauthForm struct {

+ 1 - 1
http/request/admin/peer.go

@@ -1,6 +1,6 @@
1 1
 package admin
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 type PeerForm struct {
6 6
 	RowId    uint   `json:"row_id" `

+ 1 - 1
http/request/admin/tag.go

@@ -1,6 +1,6 @@
1 1
 package admin
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 type TagForm struct {
6 6
 	Id           uint   `json:"id"`

+ 1 - 1
http/request/admin/user.go

@@ -1,7 +1,7 @@
1 1
 package admin
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/model"
5 5
 )
6 6
 
7 7
 type UserForm struct {

+ 2 - 2
http/request/api/audit.go

@@ -2,8 +2,8 @@ package api
2 2
 
3 3
 import (
4 4
 	"encoding/json"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/model"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/model"
7 7
 	"strconv"
8 8
 )
9 9
 

+ 1 - 1
http/request/api/peer.go

@@ -1,6 +1,6 @@
1 1
 package api
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 type AddressBookFormData struct {
6 6
 	Tags      []string             `json:"tags"`

+ 1 - 1
http/response/admin/user.go

@@ -1,6 +1,6 @@
1 1
 package admin
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 type LoginPayload struct {
6 6
 	Username   string   `json:"username"`

+ 1 - 1
http/response/api/ab.go

@@ -1,6 +1,6 @@
1 1
 package api
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 type AbList struct {
6 6
 	Peers     []*model.AddressBook `json:"peers,omitempty"`

+ 1 - 1
http/response/api/peer.go

@@ -1,6 +1,6 @@
1 1
 package api
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 /*
6 6
 GroupPeerPayload

+ 1 - 1
http/response/api/user.go

@@ -1,6 +1,6 @@
1 1
 package api
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model"
3
+import "github.com/lejianwen/rustdesk-api/v2/model"
4 4
 
5 5
 /*
6 6
 	pub enum UserStatus {

+ 1 - 1
http/response/api/webClient.go

@@ -1,7 +1,7 @@
1 1
 package api
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/model"
5 5
 	"time"
6 6
 )
7 7
 

+ 1 - 1
http/response/response.go

@@ -3,7 +3,7 @@ package response
3 3
 import (
4 4
 	"fmt"
5 5
 	"github.com/gin-gonic/gin"
6
-	"github.com/lejianwen/rustdesk-api/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7 7
 	"github.com/nicksnyder/go-i18n/v2/i18n"
8 8
 	"net/http"
9 9
 )

+ 5 - 5
http/router/admin.go

@@ -2,11 +2,11 @@ package router
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	_ "github.com/lejianwen/rustdesk-api/docs/admin"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/http/controller/admin"
8
-	"github.com/lejianwen/rustdesk-api/http/controller/admin/my"
9
-	"github.com/lejianwen/rustdesk-api/http/middleware"
5
+	_ "github.com/lejianwen/rustdesk-api/v2/docs/admin"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/controller/admin"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/controller/admin/my"
9
+	"github.com/lejianwen/rustdesk-api/v2/http/middleware"
10 10
 	swaggerFiles "github.com/swaggo/files"
11 11
 	ginSwagger "github.com/swaggo/gin-swagger"
12 12
 )

+ 4 - 4
http/router/api.go

@@ -2,10 +2,10 @@ package router
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	_ "github.com/lejianwen/rustdesk-api/docs/api"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/http/controller/api"
8
-	"github.com/lejianwen/rustdesk-api/http/middleware"
5
+	_ "github.com/lejianwen/rustdesk-api/v2/docs/api"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/http/controller/api"
8
+	"github.com/lejianwen/rustdesk-api/v2/http/middleware"
9 9
 	swaggerFiles "github.com/swaggo/files"
10 10
 	ginSwagger "github.com/swaggo/gin-swagger"
11 11
 	"net/http"

+ 2 - 2
http/router/router.go

@@ -2,8 +2,8 @@ package router
2 2
 
3 3
 import (
4 4
 	"github.com/gin-gonic/gin"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/http/controller/web"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/http/controller/web"
7 7
 	"net/http"
8 8
 )
9 9
 

+ 1 - 1
lib/orm/mysql.go

@@ -2,7 +2,7 @@ package orm
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-	"github.com/lejianwen/rustdesk-api/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6 6
 	"gorm.io/driver/mysql"
7 7
 	"gorm.io/gorm"
8 8
 	"gorm.io/gorm/logger"

+ 1 - 1
lib/orm/sqlite.go

@@ -2,7 +2,7 @@ package orm
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-	"github.com/lejianwen/rustdesk-api/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6 6
 	"gorm.io/driver/sqlite"
7 7
 	"gorm.io/gorm"
8 8
 	"gorm.io/gorm/logger"

+ 1 - 1
model/addressBook.go

@@ -1,6 +1,6 @@
1 1
 package model
2 2
 
3
-import "github.com/lejianwen/rustdesk-api/model/custom_types"
3
+import "github.com/lejianwen/rustdesk-api/v2/model/custom_types"
4 4
 
5 5
 // final String id;
6 6
 // String hash; // personal ab hash password

+ 1 - 1
model/model.go

@@ -1,7 +1,7 @@
1 1
 package model
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/model/custom_types"
4
+	"github.com/lejianwen/rustdesk-api/v2/model/custom_types"
5 5
 )
6 6
 
7 7
 type StatusCode int

+ 5 - 5
model/userToken.go

@@ -2,11 +2,11 @@ package model
2 2
 
3 3
 type UserToken struct {
4 4
 	IdModel
5
-	UserId    	uint   `json:"user_id" gorm:"default:0;not null;index"`
6
-	DeviceUuid 	string `json:"device_uuid" gorm:"default:'';omitempty;"`
7
-	DeviceId	string `json:"device_id" gorm:"default:'';omitempty;"`
8
-	Token     	string `json:"token" gorm:"default:'';not null;index"`
9
-	ExpiredAt 	int64  `json:"expired_at" gorm:"default:0;not null;"`
5
+	UserId     uint   `json:"user_id" gorm:"default:0;not null;index"`
6
+	DeviceUuid string `json:"device_uuid" gorm:"default:'';omitempty;"`
7
+	DeviceId   string `json:"device_id" gorm:"default:'';omitempty;"`
8
+	Token      string `json:"token" gorm:"default:'';not null;index"`
9
+	ExpiredAt  int64  `json:"expired_at" gorm:"default:0;not null;"`
10 10
 	TimeModel
11 11
 }
12 12
 

+ 2 - 2
service/addressBook.go

@@ -3,8 +3,8 @@ package service
3 3
 import (
4 4
 	"encoding/json"
5 5
 	"github.com/google/uuid"
6
-	"github.com/lejianwen/rustdesk-api/global"
7
-	"github.com/lejianwen/rustdesk-api/model"
6
+	"github.com/lejianwen/rustdesk-api/v2/global"
7
+	"github.com/lejianwen/rustdesk-api/v2/model"
8 8
 	"gorm.io/gorm"
9 9
 	"strings"
10 10
 )

+ 2 - 2
service/audit.go

@@ -1,8 +1,8 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/global"
5
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 	"gorm.io/gorm"
7 7
 )
8 8
 

+ 2 - 2
service/group.go

@@ -1,8 +1,8 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/global"
5
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 	"gorm.io/gorm"
7 7
 )
8 8
 

+ 3 - 3
service/ldap.go

@@ -9,9 +9,9 @@ import (
9 9
 
10 10
 	"github.com/go-ldap/ldap/v3"
11 11
 
12
-	"github.com/lejianwen/rustdesk-api/config"
13
-	"github.com/lejianwen/rustdesk-api/global"
14
-	"github.com/lejianwen/rustdesk-api/model"
12
+	"github.com/lejianwen/rustdesk-api/v2/config"
13
+	"github.com/lejianwen/rustdesk-api/v2/global"
14
+	"github.com/lejianwen/rustdesk-api/v2/model"
15 15
 )
16 16
 
17 17
 var (

+ 2 - 2
service/loginLog.go

@@ -1,8 +1,8 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/global"
5
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 	"gorm.io/gorm"
7 7
 )
8 8
 

+ 3 - 3
service/oauth.go

@@ -4,9 +4,9 @@ import (
4 4
 	"context"
5 5
 	"encoding/json"
6 6
 	"errors"
7
-	"github.com/lejianwen/rustdesk-api/global"
8
-	"github.com/lejianwen/rustdesk-api/model"
9
-	"github.com/lejianwen/rustdesk-api/utils"
7
+	"github.com/lejianwen/rustdesk-api/v2/global"
8
+	"github.com/lejianwen/rustdesk-api/v2/model"
9
+	"github.com/lejianwen/rustdesk-api/v2/utils"
10 10
 	"golang.org/x/oauth2"
11 11
 	"golang.org/x/oauth2/github"
12 12
 	// "golang.org/x/oauth2/google"

+ 2 - 2
service/peer.go

@@ -1,8 +1,8 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/global"
5
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 	"gorm.io/gorm"
7 7
 )
8 8
 

+ 2 - 2
service/serverCmd.go

@@ -2,8 +2,8 @@ package service
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/model"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/model"
7 7
 	"net"
8 8
 	"time"
9 9
 )

+ 1 - 1
service/service.go

@@ -1,7 +1,7 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/model"
5 5
 	"gorm.io/gorm"
6 6
 )
7 7
 

+ 2 - 2
service/shareRecord.go

@@ -1,8 +1,8 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/global"
5
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 	"gorm.io/gorm"
7 7
 )
8 8
 

+ 2 - 2
service/tag.go

@@ -1,8 +1,8 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"github.com/lejianwen/rustdesk-api/global"
5
-	"github.com/lejianwen/rustdesk-api/model"
4
+	"github.com/lejianwen/rustdesk-api/v2/global"
5
+	"github.com/lejianwen/rustdesk-api/v2/model"
6 6
 	"gorm.io/gorm"
7 7
 )
8 8
 

+ 4 - 4
service/user.go

@@ -2,9 +2,9 @@ package service
2 2
 
3 3
 import (
4 4
 	"errors"
5
-	"github.com/lejianwen/rustdesk-api/global"
6
-	"github.com/lejianwen/rustdesk-api/model"
7
-	"github.com/lejianwen/rustdesk-api/utils"
5
+	"github.com/lejianwen/rustdesk-api/v2/global"
6
+	"github.com/lejianwen/rustdesk-api/v2/model"
7
+	"github.com/lejianwen/rustdesk-api/v2/utils"
8 8
 	"math/rand"
9 9
 	"strconv"
10 10
 	"strings"
@@ -52,7 +52,7 @@ func (us *UserService) InfoByUsernamePassword(username, password string) *model.
52 52
 		if err == nil {
53 53
 			return u
54 54
 		}
55
-		global.Logger.Error("LDAP authentication failed, %v", err)
55
+		global.Logger.Errorf("LDAP authentication failed, %v", err)
56 56
 		global.Logger.Warn("Fallback to local database")
57 57
 	}
58 58
 	u := &model.User{}