mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-05 09:46:21 +00:00
![]() checkPortExist Function: Simplified the query by combining the conditions into a single Where clause. Removed unnecessary variable assignment for db. checkEmailExistForInbound Function: Introduced a map seenEmails to track already seen emails, which eliminates the need for the contains function call for each client email, thus reducing the complexity from O(n^2) to O(n). UpdateInbound Function: Instead of manually assigning each field, a map updates is used to update only the changed fields in the database. This reduces the verbosity of the code and makes it easier to maintain. Removed the unnecessary API calls for adding and deleting inbounds, as the function should only update the database record. addClientTraffic Function: Streamlined the update process by directly updating the traffic records in the database using a loop, which avoids the need to first load all records into a slice and then adjust them. |
||
---|---|---|
.. | ||
assets | ||
controller | ||
entity | ||
global | ||
html | ||
job | ||
locale | ||
middleware | ||
network | ||
service | ||
session | ||
translation | ||
web.go |