重构提取逻辑,新增 area 表
This commit is contained in:
@@ -161,6 +161,17 @@ func (s *proxyService) Update(update *UpdateProxy) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *proxyService) SyncPool(id int32) error {
|
||||
proxy, err := q.Proxy.Where(q.Proxy.ID.Eq(id)).Select(q.Proxy.ID, q.Proxy.IP).First()
|
||||
if err != nil {
|
||||
return core.NewServErr("获取代理数据失败", err)
|
||||
}
|
||||
if proxy == nil {
|
||||
return core.NewBizErr("代理不存在")
|
||||
}
|
||||
return rebuildFreeChans(id, proxy.IP.Addr)
|
||||
}
|
||||
|
||||
func (s *proxyService) Remove(id int32) error {
|
||||
used, err := hasUsedChans(id)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user