Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add getOnline feature #1075

Merged
merged 6 commits into from May 11, 2024
Merged

feat: Add getOnline feature #1075

merged 6 commits into from May 11, 2024

Conversation

HynoR
Copy link
Contributor

@HynoR HynoR commented May 9, 2024

Feature for: #1074

按照群里想法写了,俺去测测有没有问题

@HynoR HynoR marked this pull request as ready for review May 9, 2024 02:13
@HynoR HynoR marked this pull request as draft May 9, 2024 03:11
@HynoR HynoR marked this pull request as ready for review May 9, 2024 03:15
@tobyxdd tobyxdd self-requested a review May 9, 2024 04:54
@tobyxdd tobyxdd self-assigned this May 9, 2024
@tobyxdd tobyxdd added the enhancement New feature or request label May 9, 2024
@HynoR HynoR force-pushed the feat/online branch 2 times, most recently from 95974ca to 10b2004 Compare May 9, 2024 06:03
@HynoR
Copy link
Contributor Author

HynoR commented May 9, 2024

确实存在connect ip 和 disconnected ip 不一样的情况,改成不匹配直接全清空下线了。

@HynoR HynoR changed the title Add getOnline feature feat: Add getOnline feature May 9, 2024
@tobyxdd
Copy link
Collaborator

tobyxdd commented May 10, 2024

我看了下那个 issue 好像并没有提到要记录 IP 这个需求?

如果不用 IP 的话其实逻辑可以简单得多,map[string]map[string]bool 变成 map[string]int (当前连接数) 就够了。。

@haruue 你怎么看

@haruue
Copy link
Collaborator

haruue commented May 11, 2024

如果不用 IP 的话其实逻辑可以简单得多,map[string]map[string]bool 变成 map[string]int (当前连接数) 就够了。。

我按这个改好了。

目前这个 API 会返回用户和该用户的当前连接数。

{
  "usera": 4,
  "userb": 2
}

@HynoR
Copy link
Contributor Author

HynoR commented May 11, 2024

我觉得按照当前连接数也没问题

haruue and others added 2 commits May 11, 2024 15:08
mock files regenerated with mockery v2.43.0
@tobyxdd
Copy link
Collaborator

tobyxdd commented May 11, 2024

lgtm

@tobyxdd tobyxdd merged commit a3c4cfa into apernet:master May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants