重构增加模型枚举值定义
This commit is contained in:
@@ -15,6 +15,8 @@ import (
|
||||
"platform/pkg/u"
|
||||
"platform/web/auth"
|
||||
"platform/web/core"
|
||||
channel2 "platform/web/domains/channel"
|
||||
proxy2 "platform/web/domains/proxy"
|
||||
g "platform/web/globals"
|
||||
m "platform/web/models"
|
||||
q "platform/web/queries"
|
||||
@@ -214,7 +216,7 @@ func (s *channelService) CreateChannel(
|
||||
ctx context.Context,
|
||||
authCtx *auth.Context,
|
||||
resourceId int32,
|
||||
protocol ChannelProtocol,
|
||||
protocol channel2.Protocol,
|
||||
authType ChannelAuthType,
|
||||
count int,
|
||||
nodeFilter ...NodeFilterConfig,
|
||||
@@ -340,7 +342,7 @@ func findResource(q *q.Query, resourceId int32, authCtx *auth.Context, count int
|
||||
|
||||
func findProxies(q *q.Query) (proxies []*m.Proxy, err error) {
|
||||
proxies, err = q.Proxy.
|
||||
Where(q.Proxy.Type.Eq(1)).
|
||||
Where(q.Proxy.Type.Eq(int32(proxy2.TypeThirdParty))).
|
||||
Find()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -394,7 +396,7 @@ func calcChannels(
|
||||
whitelist *[]string,
|
||||
count int,
|
||||
userId int32,
|
||||
protocol ChannelProtocol,
|
||||
protocol channel2.Protocol,
|
||||
authType ChannelAuthType,
|
||||
expiration time.Time,
|
||||
filter NodeFilterConfig,
|
||||
@@ -700,15 +702,6 @@ const (
|
||||
ChannelAuthTypePass
|
||||
)
|
||||
|
||||
type ChannelProtocol int32
|
||||
|
||||
const (
|
||||
ProtocolAll ChannelProtocol = iota
|
||||
ProtocolHTTP
|
||||
ProtocolHttps
|
||||
ProtocolSocks5
|
||||
)
|
||||
|
||||
type ChannelServiceErr string
|
||||
|
||||
func (c ChannelServiceErr) Error() string {
|
||||
|
||||
Reference in New Issue
Block a user