完善节点筛选机制
This commit is contained in:
@@ -230,23 +230,6 @@ type CreateChannelReqV3 struct {
|
||||
Isp *int `json:"isp"`
|
||||
}
|
||||
|
||||
func buildCreateChannelResp(result []*m.Channel, protocol int, authType s.ChannelAuthType) []*CreateChannelRespItem {
|
||||
resp := make([]*CreateChannelRespItem, len(result))
|
||||
for i, channel := range result {
|
||||
resp[i] = &CreateChannelRespItem{
|
||||
Proto: protocol,
|
||||
Host: channel.Host,
|
||||
IP: channel.Proxy.IP.String(),
|
||||
Port: channel.Port,
|
||||
}
|
||||
if authType == s.ChannelAuthTypePass {
|
||||
resp[i].Username = channel.Username
|
||||
resp[i].Password = channel.Password
|
||||
}
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
type CreateChannelRespItem struct {
|
||||
Proto int `json:"-"`
|
||||
Host string `json:"host"`
|
||||
@@ -474,3 +457,20 @@ type SyncChannelClearExpiredByAdminReq struct {
|
||||
type SyncChannelClearExpiredByAdminResp struct {
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
func buildCreateChannelResp(result []*m.Channel, protocol int, authType s.ChannelAuthType) []*CreateChannelRespItem {
|
||||
resp := make([]*CreateChannelRespItem, len(result))
|
||||
for i, channel := range result {
|
||||
resp[i] = &CreateChannelRespItem{
|
||||
Proto: protocol,
|
||||
Host: channel.Host,
|
||||
IP: channel.Proxy.IP.String(),
|
||||
Port: channel.Port,
|
||||
}
|
||||
if authType == s.ChannelAuthTypePass {
|
||||
resp[i].Username = channel.Username
|
||||
resp[i].Password = channel.Password
|
||||
}
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user