| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package mongo
- import (
- "fwh-toolbox-server/domain"
- "fwh-toolbox-server/dto"
- "fwh-toolbox-server/networkEvents"
- )
- type XlogManageInfo = domain.XlogSiteInfo
- type XlogManagePage = dto.ResPage[XlogManageInfo]
- func GetXlogManageList(page, size uint) XlogManagePage {
- infoList := networkEvents.GetConnectList()
- infoListLen := uint(len(infoList))
- resPage := XlogManagePage{
- Data: []XlogManageInfo{},
- PageNum: page,
- PageSize: size,
- Total: infoListLen,
- }
- if infoListLen == 0 {
- return resPage
- }
- if page < 1 {
- return resPage
- }
- startIndex := (page - 1) * size
- endIndex := page * size
- if endIndex > infoListLen {
- endIndex = infoListLen
- }
- if endIndex <= startIndex {
- return resPage
- }
- resPage.Data = infoList[startIndex:endIndex]
- return resPage
- }
- func SendXlogCmd(uuid, cmd string) (string, error) {
- return networkEvents.SendXlogCmdDate(uuid, []byte(cmd))
- }
|