Browse Source

v0.1: integrate hx platform

master
han2015 6 months ago
parent
commit
88dcddb7b6
  1. 1
      .envrc
  2. 1
      .gitignore
  3. 8
      build/conf/tank.json
  4. 819
      build/log/tank.log
  5. 0
      build/pack/build.sh
  6. 0
      build/service/shutdown.sh
  7. 0
      build/service/startup.sh
  8. 2
      code/core/config.go
  9. 25
      code/rest/alien_controller.go
  10. 17
      code/rest/base_bean.go
  11. 22
      code/rest/base_controller.go
  12. 5
      code/rest/dashboard_controller.go
  13. 13
      code/rest/dav_controller.go
  14. 11
      code/rest/dav_model.go
  15. 45
      code/rest/dav_service.go
  16. 33
      code/rest/extend.go
  17. 7
      code/rest/image_cache_controller.go
  18. 21
      code/rest/install_controller.go
  19. 42
      code/rest/matter_controller.go
  20. 29
      code/rest/matter_model.go
  21. 109
      code/rest/matter_service.go
  22. 13
      code/rest/preference_controller.go
  23. 9
      code/rest/share_controller.go
  24. 87
      code/rest/user_controller.go
  25. 21
      code/rest/user_dao.go
  26. 87
      code/rest/user_service.go
  27. 18
      code/support/tank_application.go
  28. 22
      code/support/tank_router.go
  29. 5
      code/test/dav_test.go
  30. 15
      code/tool/result/web_result.go
  31. 42
      code/tool/util/util_file.go
  32. 5
      code/tool/uuid/uuid_test.go
  33. 2
      go.sum

1
.envrc

@ -0,0 +1 @@
export HomePath=./build

1
.gitignore

@ -1,5 +1,6 @@
#idea file
.idea
build/matter/
# develop temp folder.
tmp

8
build/conf/tank.json

@ -1,4 +1,10 @@
{
"ServerPort": 6010,
"MatterPath": ""
"MatterPath": "./build/matter",
"MysqlPort":3306,
"MysqlHost":"127.0.0.1",
"MysqlSchema":"hxstorage",
"MysqlUsername":"dj",
"MysqlPassword":"123456",
"MysqlCharset":"utf8mb4"
}

819
build/log/tank.log

@ -0,0 +1,819 @@
[INFO ]13:09:05 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]13:09:05 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]13:09:05 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]13:09:05 tank_config.go:157: file storage location: build
[INFO ]13:09:05 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]13:09:05 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]13:09:05 dashboard_service.go:72: ETL dashboard data from 2025-05-08 00:00:00 to 2025-05-08 23:59:59
[INFO ]13:09:05 footprint_service.go:107: Delete footprint data before 2025-05-01 00:00:00
[INFO ]13:09:05 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]13:09:05 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]13:09:05 dashboard_service.go:77: 2025-05-08 already exits. delete it and insert new one.
[INFO ]13:09:05 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]13:09:05 task_service.go:170: scan task not enabled.
[INFO ]13:09:05 tank_application.go:153: App started at http://localhost:6010
[INFO ]13:09:05 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 8, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 0
[INFO ]13:09:05 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 0, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]13:09:05 dashboard_service.go:72: ETL dashboard data from 2025-05-09 00:00:00 to 2025-05-09 23:59:59
[INFO ]13:09:05 dashboard_service.go:77: 2025-05-09 already exits. delete it and insert new one.
[INFO ]13:09:05 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 8, UV = 1, totalUV = 1, matterNum = 0, totalMatterNum = 0
[INFO ]13:09:05 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 0, cacheSize = 0, totalCacheSize = 0, avgCost = 2
[INFO ]13:09:22 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[ERROR]13:09:22 tank_router.go:99: panic on base_bean.go:66 &{LOGIN 401 not login}
[INFO ]13:09:22 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/info Params:{}
[INFO ]13:09:22 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[INFO ]13:38:37 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]13:38:37 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[ERROR]14:06:38 tank_router.go:99: panic on user_controller.go:111 用户名或密码错误
[INFO ]14:06:38 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/user/login Params:{"password":["******"],"username":["admin"]}
[ERROR]14:18:06 tank_router.go:99: panic on tank_router.go:176 cannot handle /api/install/create/admin
[INFO ]14:18:06 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/install/create/admin Params:{}
[ERROR]14:18:19 tank_router.go:99: panic on base_bean.go:66 &{LOGIN 401 not login}
[INFO ]14:18:19 footprint_service.go:90: Ip:[ Cost:3 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]14:18:19 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[ERROR]14:37:32 tank_router.go:99: panic on user_controller.go:115 用户名或密码错误
[INFO ]14:37:32 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/login Params:{"password":["******"],"username":["admin"]}
[ERROR]14:37:34 tank_router.go:99: panic on user_controller.go:115 用户名或密码错误
[INFO ]14:37:34 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/login Params:{"password":["******"],"username":["admin"]}
[ERROR]14:37:56 tank_router.go:99: panic on user_controller.go:115 用户名或密码错误
[INFO ]14:37:56 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/login Params:{"password":["******"],"username":["admin"]}
[INFO ]14:39:40 footprint_service.go:90: Ip:[ Cost:79 Uri:/api/user/login Params:{"password":["******"],"username":["admin"]}
[INFO ]14:39:40 footprint_service.go:90: Ip:[ Cost:8 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]14:41:00 footprint_service.go:90: Ip:[ Cost:19 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[INFO ]14:41:06 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[INFO ]14:46:29 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]14:46:32 footprint_service.go:90: Ip:[ Cost:3 Uri:/api/share/page Params:{"page":["0"],"pageSize":["500"]}
[INFO ]14:46:33 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/matter/page Params:{"deleted":["true"],"orderDeleteTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"]}
[INFO ]14:46:34 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]14:46:37 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/matter/page Params:{"deleted":["true"],"orderDeleteTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"]}
[INFO ]14:46:38 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]14:46:43 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]14:46:45 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/share/page Params:{"page":["0"],"pageSize":["500"]}
[INFO ]14:46:47 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]14:50:05 matter_service.go:388: upload go.env 505B
[ERROR]14:50:05 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/go.env: The process cannot access the file because it is being used by another process.
[INFO ]14:50:05 footprint_service.go:90: Ip:[ Cost:15 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[INFO ]14:50:58 matter_service.go:388: upload main.go 234B
[ERROR]14:50:58 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.go: The process cannot access the file because it is being used by another process.
[INFO ]14:50:58 footprint_service.go:90: Ip:[ Cost:7 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[ERROR]14:51:07 matter_service.go:372: build/admin/root/main.go exits, overwrite it.
[INFO ]14:51:07 matter_service.go:388: upload main.go 234B
[ERROR]14:51:07 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.go: The process cannot access the file because it is being used by another process.
[INFO ]14:51:07 footprint_service.go:90: Ip:[ Cost:3 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[ERROR]14:51:27 matter_service.go:372: build/admin/root/main.go exits, overwrite it.
[INFO ]14:51:27 matter_service.go:388: upload main.go 234B
[ERROR]14:51:27 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.go: The process cannot access the file because it is being used by another process.
[INFO ]14:51:27 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[ERROR]14:51:41 matter_service.go:372: build/admin/root/main.go exits, overwrite it.
[INFO ]14:51:41 matter_service.go:388: upload main.go 234B
[ERROR]14:51:41 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.go: The process cannot access the file because it is being used by another process.
[INFO ]14:51:41 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[INFO ]14:54:26 matter_service.go:388: upload main.txt 234B
[ERROR]14:54:26 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.txt: The process cannot access the file because it is being used by another process.
[INFO ]14:54:26 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[INFO ]14:56:28 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[INFO ]14:56:44 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/user/detail Params:{"uuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[INFO ]14:57:02 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:00:17 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[INFO ]15:02:48 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[ERROR]15:02:53 matter_service.go:372: build/admin/root/main.txt exits, overwrite it.
[INFO ]15:02:53 matter_service.go:388: upload main.txt 234B
[ERROR]15:02:53 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.txt: The process cannot access the file because it is being used by another process.
[INFO ]15:02:53 footprint_service.go:90: Ip:[ Cost:7 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[ERROR]15:03:55 matter_service.go:372: build/admin/root/main.txt exits, overwrite it.
[INFO ]15:03:55 matter_service.go:388: upload main.txt 234B
[ERROR]15:03:55 tank_router.go:99: panic on matter_service.go:407 remove build/admin/root/main.txt: The process cannot access the file because it is being used by another process.
[INFO ]15:03:55 footprint_service.go:90: Ip:[ Cost:9 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[INFO ]15:04:16 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:04:16 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:04:16 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:04:16 tank_config.go:157: file storage location: build
[INFO ]15:04:17 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:04:17 dashboard_service.go:72: ETL dashboard data from 2025-05-08 00:00:00 to 2025-05-08 23:59:59
[INFO ]15:04:17 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:04:17 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:04:17 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:04:17 dashboard_service.go:77: 2025-05-08 already exits. delete it and insert new one.
[INFO ]15:04:17 task_service.go:170: scan task not enabled.
[INFO ]15:04:17 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:04:17 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:04:17 footprint_service.go:107: Delete footprint data before 2025-05-01 00:00:00
[INFO ]15:04:17 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 46, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 0
[INFO ]15:04:17 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 0, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]15:04:17 dashboard_service.go:72: ETL dashboard data from 2025-05-09 00:00:00 to 2025-05-09 23:59:59
[INFO ]15:04:17 dashboard_service.go:77: 2025-05-09 already exits. delete it and insert new one.
[INFO ]15:04:17 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 46, totalInvokeNum = 46, UV = 1, totalUV = 1, matterNum = 0, totalMatterNum = 0
[INFO ]15:04:17 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 0, cacheSize = 0, totalCacheSize = 0, avgCost = 4
[INFO ]15:04:27 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/preference/fetch Params:{}
[INFO ]15:04:27 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/info Params:{}
[INFO ]15:04:28 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[ERROR]15:04:33 matter_service.go:372: build/admin/root/main.txt exits, overwrite it.
[INFO ]15:04:33 matter_service.go:388: upload main.txt 234B
[INFO ]15:04:33 footprint_service.go:90: Ip:[ Cost:15 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["10d06f17-2ad9-4b0e-42ac-d91d5ea7f97c"]}
[INFO ]15:04:33 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:04:53 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/alien/preview/b01495f5-e89c-4972-58fb-5fe463d19cf4/main.txt Params:{}
[INFO ]15:04:59 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[INFO ]15:05:07 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:05:08 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/alien/preview/b01495f5-e89c-4972-58fb-5fe463d19cf4/main.txt Params:{}
[INFO ]15:11:18 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[INFO ]15:11:48 footprint_service.go:90: Ip:[ Cost:87 Uri:/api/user/create Params:{"avatarUrl":[""],"password":["******"],"role":["USER"],"sizeLimit":["1104857601"],"totalSizeLimit":["-1"],"username":["dj"],"uuid":[""]}
[INFO ]15:11:49 footprint_service.go:90: Ip:[ Cost:19 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[WARN ]15:11:53 base_bean.go:49: cache item doesn't exist with sessionId = fbdddd6e-13cb-422e-6e32-f5e993cb2c82
[INFO ]15:11:53 footprint_service.go:90: Ip:[ Cost:11 Uri:/api/user/logout Params:{}
[INFO ]15:11:56 footprint_service.go:90: Ip:[ Cost:97 Uri:/api/user/login Params:{"password":["******"],"username":["dj"]}
[INFO ]15:11:56 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:12:00 footprint_service.go:90: Ip:[ Cost:13 Uri:/api/preference/fetch Params:{}
[INFO ]15:12:00 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/info Params:{}
[INFO ]15:12:00 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:12:27 matter_service.go:388: upload main.txt 234B
[INFO ]15:12:27 footprint_service.go:90: Ip:[ Cost:46 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:12:27 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:16:32 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:16:32 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:16:32 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:16:32 tank_config.go:157: file storage location: build/matter
[INFO ]15:16:32 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:16:32 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:16:32 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:16:32 task_service.go:170: scan task not enabled.
[INFO ]15:16:32 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:16:32 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:16:32 footprint_service.go:107: Delete footprint data before 2025-05-01 00:00:00
[INFO ]15:16:32 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:16:32 dashboard_service.go:72: ETL dashboard data from 2025-05-08 00:00:00 to 2025-05-08 23:59:59
[INFO ]15:16:32 dashboard_service.go:77: 2025-05-08 already exits. delete it and insert new one.
[INFO ]15:16:32 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 66, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 2
[INFO ]15:16:32 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 468, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]15:16:32 dashboard_service.go:72: ETL dashboard data from 2025-05-09 00:00:00 to 2025-05-09 23:59:59
[INFO ]15:16:32 dashboard_service.go:77: 2025-05-09 already exits. delete it and insert new one.
[INFO ]15:16:32 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 66, totalInvokeNum = 66, UV = 1, totalUV = 1, matterNum = 2, totalMatterNum = 2
[INFO ]15:16:32 dashboard_service.go:101: Dashboard Summery 2. matterSize = 468, totalMatterSize = 468, cacheSize = 0, totalCacheSize = 0, avgCost = 7
[INFO ]15:18:09 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/preference/fetch Params:{}
[INFO ]15:18:09 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/info Params:{}
[INFO ]15:18:09 footprint_service.go:90: Ip:[ Cost:30 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:18:14 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]15:18:14 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/info Params:{}
[INFO ]15:18:14 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:18:15 footprint_service.go:90: Ip:[ Cost:8 Uri:/api/alien/preview/8a264f7e-ba58-4e9a-46f1-79d826f0b4eb/main.txt Params:{}
[INFO ]15:18:44 matter_service.go:388: upload main - 副本.txt 234B
[INFO ]15:18:44 footprint_service.go:90: Ip:[ Cost:23 Uri:/api/matter/upload Params:{"alien":["false"],"privacy":["true"],"puuid":["root"],"userUuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:18:44 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[ERROR]15:19:18 tank_router.go:99: panic on matter_service.go:564 name cannot be blank
[INFO ]15:19:18 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/create/directory Params:{"name":[""],"puuid":["root"],"userUuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:19:18 footprint_service.go:90: Ip:[ Cost:20 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:19:40 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]15:19:41 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/info Params:{}
[INFO ]15:19:41 footprint_service.go:90: Ip:[ Cost:7 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[WARN ]15:20:37 base_bean.go:49: cache item doesn't exist with sessionId = 5e636cc1-10ee-4b23-689f-62b9daf6eca7
[INFO ]15:20:37 footprint_service.go:90: Ip:[ Cost:9 Uri:/api/user/logout Params:{}
[INFO ]15:20:46 footprint_service.go:90: Ip:[ Cost:80 Uri:/api/user/login Params:{"password":["******"],"username":["admin"]}
[INFO ]15:20:47 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:23:04 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/share/page Params:{"page":["0"],"pageSize":["500"]}
[INFO ]15:23:06 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:33:02 footprint_service.go:90: Ip:[ Cost:3 Uri:/api/user/page Params:{"orderCreateTime":["DESC"],"page":["0"],"pageSize":["10"]}
[WARN ]15:33:07 base_bean.go:49: cache item doesn't exist with sessionId = e2d55225-cc6a-465a-4488-f94483f87056
[INFO ]15:33:07 footprint_service.go:90: Ip:[ Cost:8 Uri:/api/user/logout Params:{}
[INFO ]15:33:10 footprint_service.go:90: Ip:[ Cost:83 Uri:/api/user/login Params:{"password":["******"],"username":["dj"]}
[INFO ]15:33:10 footprint_service.go:90: Ip:[ Cost:8 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:33:19 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:34:28 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:35:44 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:35:47 footprint_service.go:90: Ip:[ Cost:4 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:36:06 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]15:36:11 footprint_service.go:90: Ip:[ Cost:2 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:36:23 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:38:14 user_service.go:220: sessionId 9934bc62-a1b2-409a-63c7-d3daf4792b66
[WARN ]15:38:14 base_bean.go:49: cache item doesn't exist with sessionId = 9934bc62-a1b2-409a-63c7-d3daf4792b66
[INFO ]15:38:14 footprint_service.go:90: Ip:[ Cost:11 Uri:/api/user/edit Params:{"avatarUrl":[""],"password":["******"],"role":["USER"],"sizeLimit":["1104857601"],"totalSizeLimit":["-1"],"username":["dj"],"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]15:38:14 footprint_service.go:90: Ip:[ Cost:26 Uri:/api/user/detail Params:{"uuid":["57818f43-0ea3-4947-66b3-6fceced2367b"]}
[INFO ]08:56:57 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]08:56:57 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]08:56:57 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]08:56:57 tank_config.go:157: file storage location: build/matter
[INFO ]08:56:57 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]08:56:57 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]08:56:57 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]08:56:57 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]08:56:57 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]08:56:57 footprint_service.go:107: Delete footprint data before 2025-05-04 00:00:00
[INFO ]08:56:57 dashboard_service.go:72: ETL dashboard data from 2025-05-11 00:00:00 to 2025-05-11 23:59:59
[INFO ]08:56:57 task_service.go:170: scan task not enabled.
[INFO ]08:56:57 tank_application.go:153: App started at http://localhost:6010
[INFO ]08:56:57 dashboard_service.go:77: 2025-05-11 already exits. delete it and insert new one.
[INFO ]08:56:57 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 98, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 3
[INFO ]08:56:57 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]08:56:57 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]08:56:57 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]08:56:57 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 98, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 3
[INFO ]08:56:57 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[ERROR]08:58:01 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]08:58:01 footprint_service.go:90: Ip:[ Cost:7 Uri:/api/preference/fetch Params:{}
[INFO ]08:58:01 footprint_service.go:90: Ip:[ Cost:6 Uri:/api/user/info Params:{}
[INFO ]08:58:01 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[INFO ]08:59:07 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/preference/fetch Params:{}
[INFO ]08:59:07 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[INFO ]09:16:14 footprint_service.go:90: Ip:[ Cost:103 Uri:/api/user/login Params:{"password":["******"],"username":["dj"]}
[INFO ]09:16:14 footprint_service.go:90: Ip:[ Cost:22 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[WARN ]09:16:33 base_bean.go:50: cache item doesn't exist with sessionId = c6bac709-7dae-4914-4ea0-1163954f401f
[INFO ]09:16:33 footprint_service.go:90: Ip:[ Cost:20 Uri:/api/user/logout Params:{}
[ERROR]09:16:36 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]09:16:36 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]09:16:36 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/info Params:{}
[INFO ]09:16:36 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[ERROR]09:16:58 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]09:16:59 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]09:16:59 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/info Params:{}
[INFO ]09:16:59 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[INFO ]09:18:13 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/preference/fetch Params:{}
[INFO ]09:18:13 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[ERROR]09:20:11 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]09:20:11 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[INFO ]09:20:11 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/user/info Params:{}
[INFO ]09:20:11 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[ERROR]10:03:26 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]10:03:26 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/preference/fetch Params:{}
[INFO ]10:03:26 footprint_service.go:90: Ip:[ Cost:8 Uri:/api/user/info Params:{}
[INFO ]10:03:26 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[INFO ]10:03:45 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/preference/fetch Params:{}
[ERROR]10:03:45 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]10:03:45 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/user/info Params:{}
[INFO ]10:03:45 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/logout Params:{}
[INFO ]10:05:18 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]10:05:18 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]10:05:18 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]10:05:18 tank_config.go:157: file storage location: build/matter
[INFO ]10:05:18 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]10:05:18 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]10:05:18 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]10:05:18 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]10:05:18 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]10:05:18 footprint_service.go:107: Delete footprint data before 2025-05-04 00:00:00
[INFO ]10:05:18 dashboard_service.go:72: ETL dashboard data from 2025-05-11 00:00:00 to 2025-05-11 23:59:59
[INFO ]10:05:18 task_service.go:170: scan task not enabled.
[INFO ]10:05:18 tank_application.go:153: App started at http://localhost:6010
[INFO ]10:05:18 dashboard_service.go:77: 2025-05-11 already exits. delete it and insert new one.
[INFO ]10:05:18 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 123, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 3
[INFO ]10:05:18 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]10:05:18 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]10:05:18 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]10:05:18 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 25, totalInvokeNum = 123, UV = 1, totalUV = 1, matterNum = 0, totalMatterNum = 3
[INFO ]10:05:18 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 7
[ERROR]10:05:30 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]10:05:30 footprint_service.go:90: Ip:[ Cost:1 Uri:/api/preference/fetch Params:{}
[INFO ]10:05:30 footprint_service.go:90: Ip:[ Cost:5 Uri:/api/user/info Params:{}
[INFO ]10:05:30 footprint_service.go:90: Ip:[ Cost:3 Uri:/api/user/logout Params:{}
[ERROR]10:20:45 tank_router.go:99: panic on user_controller.go:111 用户名或密码不能为空
[INFO ]10:20:45 footprint_service.go:90: Ip:[ Cost:229 Uri:/api/user/login Params:{"password":["******"],"username":["dj"]}
[ERROR]10:21:11 tank_router.go:99: panic on user_controller.go:111 用户名或密码不能为空
[INFO ]10:21:11 footprint_service.go:90: Ip:[ Cost:0 Uri:/api/user/login Params:{"password":["******"],"username":["dj"]}
[INFO ]10:22:36 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]10:22:36 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]10:22:36 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]10:22:36 tank_config.go:157: file storage location: build/matter
[INFO ]10:22:36 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]10:22:36 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]10:22:36 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]10:22:36 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]10:22:36 footprint_service.go:107: Delete footprint data before 2025-05-04 00:00:00
[INFO ]10:22:36 dashboard_service.go:72: ETL dashboard data from 2025-05-11 00:00:00 to 2025-05-11 23:59:59
[INFO ]10:22:36 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]10:22:36 task_service.go:170: scan task not enabled.
[INFO ]10:22:36 tank_application.go:153: App started at http://localhost:6010
[INFO ]10:22:36 dashboard_service.go:77: 2025-05-11 already exits. delete it and insert new one.
[INFO ]10:22:36 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 128, UV = 0, totalUV = 1, matterNum = 0, totalMatterNum = 3
[INFO ]10:22:36 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]10:22:36 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]10:22:36 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]10:22:37 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 30, totalInvokeNum = 128, UV = 1, totalUV = 1, matterNum = 0, totalMatterNum = 3
[INFO ]10:22:37 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 13
[INFO ]10:23:00 footprint_service.go:90: Ip:[ Cost:14 Uri:/api/user/login Params:{"password":["******"],"username":["dj"]}
[ERROR]10:23:01 user_service.go:138: no user with sessionId test-user-id
[WARN ]10:23:01 base_bean.go:50: cache item doesn't exist with sessionId = 2a173e03-f256-40b6-425c-e669e19bd139
[ERROR]10:23:01 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[WARN ]10:23:01 base_bean.go:50: cache item doesn't exist with sessionId = 2a173e03-f256-40b6-425c-e669e19bd139
[INFO ]10:23:01 footprint_service.go:90: Ip:[ Cost:40 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[ERROR]10:23:01 user_service.go:138: no user with sessionId test-user-id
[WARN ]10:23:01 base_bean.go:50: cache item doesn't exist with sessionId = 2a173e03-f256-40b6-425c-e669e19bd139
[ERROR]10:23:01 user_controller.go:341: error while deleting session.
[WARN ]10:23:01 base_bean.go:50: cache item doesn't exist with sessionId = 2a173e03-f256-40b6-425c-e669e19bd139
[INFO ]10:23:01 footprint_service.go:90: Ip:[ Cost:13 Uri:/api/user/logout Params:{}
[ERROR]11:00:46 tank_router.go:99: panic on base_bean.go:68 &{LOGIN 401 not login}
[INFO ]11:00:46 footprint_service.go:90: Ip:[ Cost:7 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]13:58:02 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]13:58:02 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]13:58:02 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]13:58:02 tank_config.go:157: file storage location: build/matter
[INFO ]13:58:02 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]13:58:02 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]13:58:02 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]13:58:02 task_service.go:170: scan task not enabled.
[INFO ]13:58:02 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]13:58:02 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]13:58:02 tank_application.go:153: App started at http://localhost:6010
[INFO ]13:58:02 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]13:58:02 footprint_service.go:107: Delete footprint data before 2025-05-05 00:00:00
[INFO ]13:58:02 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]13:58:02 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 35, totalInvokeNum = 135, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]13:58:02 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 14
[INFO ]13:58:02 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]13:58:02 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]13:58:02 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 2, totalInvokeNum = 135, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]13:58:02 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 483
[INFO ]14:03:28 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]14:03:28 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]14:03:28 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]14:03:28 tank_config.go:157: file storage location: build/matter
[INFO ]14:03:28 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]14:03:28 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]14:03:28 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]14:03:28 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]14:03:28 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]14:03:28 footprint_service.go:107: Delete footprint data before 2025-05-05 00:00:00
[INFO ]14:03:28 task_service.go:170: scan task not enabled.
[INFO ]14:03:28 tank_application.go:153: App started at http://localhost:6010
[INFO ]14:03:28 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]14:03:28 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]14:03:28 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 35, totalInvokeNum = 135, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:03:28 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 14
[INFO ]14:03:28 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]14:03:28 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]14:03:28 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 2, totalInvokeNum = 135, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:03:28 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 483
[INFO ]14:11:58 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]14:11:58 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]14:11:58 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]14:11:58 tank_config.go:157: file storage location: build/matter
[INFO ]14:11:58 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]14:11:58 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]14:11:58 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]14:11:58 task_service.go:170: scan task not enabled.
[INFO ]14:11:58 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]14:11:58 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]14:11:58 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]14:11:58 tank_application.go:153: App started at http://localhost:6010
[INFO ]14:11:58 footprint_service.go:107: Delete footprint data before 2025-05-05 00:00:00
[INFO ]14:11:58 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]14:11:58 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 35, totalInvokeNum = 135, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:11:58 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 14
[INFO ]14:11:58 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]14:11:58 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]14:11:58 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 2, totalInvokeNum = 135, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:11:58 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 483
[INFO ]14:12:15 footprint_service.go:90: Ip:127.0.0.1 Cost:51 Uri:/hxpan/matter/page Params:{}
[ERROR]14:12:50 user_service.go:140: no user with sessionId p015993815826844528
[ERROR]14:12:50 tank_router.go:99: panic on runtime_faststr_swiss.go:265 assignment to entry in nil map
[WARN ]14:12:50 base_bean.go:50: cache item doesn't exist with sessionId = 646df4e5-498c-4303-7f49-3273c2d9b3c4
[INFO ]14:12:50 footprint_service.go:90: Ip:127.0.0.1 Cost:54 Uri:/hxpan/matter/page Params:{}
[INFO ]14:23:02 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]14:23:02 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]14:23:02 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]14:23:02 tank_config.go:157: file storage location: build/matter
[INFO ]14:23:02 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]14:23:02 footprint_service.go:107: Delete footprint data before 2025-05-05 00:00:00
[INFO ]14:23:02 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]14:23:02 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]14:23:02 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]14:23:02 task_service.go:170: scan task not enabled.
[INFO ]14:23:02 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]14:23:02 tank_application.go:153: App started at http://localhost:6010
[INFO ]14:23:02 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]14:23:02 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]14:23:02 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 35, totalInvokeNum = 137, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:23:02 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 14
[INFO ]14:23:02 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]14:23:02 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]14:23:02 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 4, totalInvokeNum = 137, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:23:02 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 267
[INFO ]14:24:31 footprint_service.go:90: Ip:127.0.0.1 Cost:4 Uri:/hxpan/matter/page Params:{}
[INFO ]14:24:46 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/hxpan/matter/page Params:{}
[INFO ]14:51:03 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]14:51:03 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]14:51:03 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]14:51:03 tank_config.go:157: file storage location: build/matter
[INFO ]14:51:03 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]14:51:03 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]14:51:03 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]14:51:03 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]14:51:03 footprint_service.go:107: Delete footprint data before 2025-05-05 00:00:00
[INFO ]14:51:03 task_service.go:170: scan task not enabled.
[INFO ]14:51:03 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]14:51:03 tank_application.go:153: App started at http://localhost:6010
[INFO ]14:51:03 dashboard_service.go:72: ETL dashboard data from 2025-05-12 00:00:00 to 2025-05-12 23:59:59
[INFO ]14:51:03 dashboard_service.go:77: 2025-05-12 already exits. delete it and insert new one.
[INFO ]14:51:03 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 35, totalInvokeNum = 139, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:51:03 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 14
[INFO ]14:51:03 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]14:51:03 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]14:51:03 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 6, totalInvokeNum = 139, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]14:51:03 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 179
[INFO ]14:51:28 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/hxpan/matter/page Params:{}
[INFO ]14:52:32 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/hxpan/matter/page Params:{}
[INFO ]08:09:53 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]08:09:53 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]08:09:53 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]08:09:53 tank_config.go:157: file storage location: build/matter
[INFO ]08:09:53 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]08:09:53 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]08:09:53 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]08:09:53 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]08:09:53 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]08:09:53 task_service.go:170: scan task not enabled.
[INFO ]08:09:53 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]08:09:53 tank_application.go:153: App started at http://localhost:6010
[INFO ]08:09:53 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]08:09:53 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]08:09:53 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 141, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:09:53 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]08:09:53 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]08:09:53 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 0, totalInvokeNum = 141, UV = 0, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:09:53 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 0
[INFO ]08:26:56 footprint_service.go:90: Ip:[ Cost:125 Uri:/hxpan/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["500"],"puuid":["root"]}
[INFO ]08:41:11 footprint_service.go:90: Ip:127.0.0.1 Cost:29 Uri:/hxpan/matter/page Params:{}
[INFO ]08:43:31 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]08:43:31 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]08:43:31 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]08:43:31 tank_config.go:157: file storage location: build/matter
[INFO ]08:43:31 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]08:43:31 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]08:43:31 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]08:43:31 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]08:43:31 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]08:43:31 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]08:43:31 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]08:43:31 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]08:43:31 task_service.go:170: scan task not enabled.
[INFO ]08:43:31 tank_application.go:153: App started at http://localhost:6010
[INFO ]08:43:31 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 143, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:43:31 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]08:43:31 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]08:43:31 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]08:43:31 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 2, totalInvokeNum = 143, UV = 2, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:43:31 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 77
[INFO ]08:44:02 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/hxpan/matter/page Params:{}
[INFO ]08:44:04 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/hxpan/matter/page Params:{}
[INFO ]08:44:08 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/hxpan/matter/page Params:{}
[INFO ]08:44:19 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/hxpan/matter/page Params:{}
[ERROR]08:45:06 tank_router.go:99: panic on tank_router.go:182 cannot handle /hxpan
[INFO ]08:45:06 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/hxpan Params:{}
[INFO ]08:46:24 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]08:46:24 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]08:46:24 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]08:46:24 tank_config.go:157: file storage location: build/matter
[INFO ]08:46:24 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]08:46:24 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]08:46:24 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]08:46:24 task_service.go:170: scan task not enabled.
[INFO ]08:46:24 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]08:46:24 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]08:46:24 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]08:46:24 tank_application.go:153: App started at http://localhost:6010
[INFO ]08:46:24 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]08:46:24 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]08:46:24 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 148, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:46:24 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]08:46:24 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]08:46:24 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]08:46:24 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 7, totalInvokeNum = 148, UV = 2, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:46:24 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 22
[INFO ]08:58:33 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]08:58:33 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]08:58:33 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]08:58:33 tank_config.go:157: file storage location: build/matter
[INFO ]08:58:33 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]08:58:33 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]08:58:33 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]08:58:33 task_service.go:170: scan task not enabled.
[INFO ]08:58:33 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]08:58:33 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]08:58:33 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]08:58:33 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]08:58:33 tank_application.go:153: App started at http://localhost:6010
[INFO ]08:58:33 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]08:58:33 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 148, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:58:33 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]08:58:34 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]08:58:34 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]08:58:34 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 7, totalInvokeNum = 148, UV = 2, totalUV = 2, matterNum = 0, totalMatterNum = 3
[INFO ]08:58:34 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 702, cacheSize = 0, totalCacheSize = 0, avgCost = 22
[INFO ]08:58:53 footprint_service.go:90: Ip:127.0.0.1 Cost:77 Uri:/api/matter/page Params:{}
[INFO ]09:16:14 footprint_service.go:90: Ip:127.0.0.1 Cost:32 Uri:/api/matter/page Params:{}
[INFO ]09:16:53 footprint_service.go:90: Ip:127.0.0.1 Cost:4 Uri:/api/matter/page Params:{}
[INFO ]09:17:10 matter_service.go:389: upload CEF license.txt 1.6kB
[INFO ]09:17:11 footprint_service.go:90: Ip:127.0.0.1 Cost:145 Uri:/api/matter/upload Params:{"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]09:17:51 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]09:31:41 footprint_service.go:90: Ip:127.0.0.1 Cost:4 Uri:/api/matter/page Params:{}
[INFO ]09:46:40 footprint_service.go:90: Ip:127.0.0.1 Cost:7 Uri:/api/matter/page Params:{}
[INFO ]09:47:19 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]09:47:29 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]09:57:51 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]10:00:57 matter_service.go:389: upload 企业微信截图_20250514095327.png 54.6kB
[INFO ]10:00:57 footprint_service.go:90: Ip:127.0.0.1 Cost:15 Uri:/api/matter/upload Params:{"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]10:00:57 footprint_service.go:90: Ip:127.0.0.1 Cost:5 Uri:/api/matter/page Params:{}
[INFO ]10:27:37 footprint_service.go:90: Ip:127.0.0.1 Cost:8 Uri:/api/matter/page Params:{}
[INFO ]10:29:05 footprint_service.go:90: Ip:127.0.0.1 Cost:9 Uri:/api/matter/page Params:{}
[INFO ]10:29:54 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]10:30:35 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]10:31:37 footprint_service.go:90: Ip:127.0.0.1 Cost:5 Uri:/api/matter/page Params:{}
[INFO ]10:34:47 footprint_service.go:90: Ip:127.0.0.1 Cost:73 Uri:/api/matter/page Params:{}
[INFO ]10:37:22 footprint_service.go:90: Ip:127.0.0.1 Cost:158 Uri:/api/matter/page Params:{}
[INFO ]10:38:14 footprint_service.go:90: Ip:127.0.0.1 Cost:53 Uri:/api/matter/page Params:{}
[INFO ]10:50:31 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]10:50:53 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]10:58:57 footprint_service.go:90: Ip:127.0.0.1 Cost:6 Uri:/api/matter/page Params:{}
[INFO ]11:10:14 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]11:10:21 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]11:10:41 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]11:11:15 footprint_service.go:90: Ip:127.0.0.1 Cost:10 Uri:/api/matter/page Params:{}
[INFO ]11:12:34 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]11:15:22 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]11:15:47 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]11:16:46 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]11:24:26 footprint_service.go:90: Ip:127.0.0.1 Cost:8 Uri:/api/matter/page Params:{}
[INFO ]11:29:41 footprint_service.go:90: Ip:127.0.0.1 Cost:48 Uri:/api/matter/page Params:{}
[INFO ]11:41:16 footprint_service.go:90: Ip:127.0.0.1 Cost:6 Uri:/api/matter/page Params:{}
[INFO ]11:41:39 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]11:43:53 footprint_service.go:90: Ip:127.0.0.1 Cost:25 Uri:/api/matter/page Params:{}
[INFO ]11:45:46 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]11:48:09 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]11:48:31 footprint_service.go:90: Ip:127.0.0.1 Cost:31 Uri:/api/matter/page Params:{}
[INFO ]11:48:50 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]13:40:20 footprint_service.go:90: Ip:127.0.0.1 Cost:22 Uri:/api/matter/page Params:{}
[INFO ]13:43:11 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]13:43:41 footprint_service.go:90: Ip:127.0.0.1 Cost:26 Uri:/api/matter/page Params:{}
[INFO ]13:43:57 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]13:49:32 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]13:51:30 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]14:01:28 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]14:01:56 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]14:02:47 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]14:03:50 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]14:32:09 footprint_service.go:90: Ip:127.0.0.1 Cost:42 Uri:/api/matter/page Params:{}
[INFO ]14:32:35 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[ERROR]14:32:52 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]14:32:52 footprint_service.go:90: Ip:127.0.0.1 Cost:0 Uri:/api/matter/create/directory Params:{}
[INFO ]14:38:52 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]14:38:52 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]14:38:52 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]14:38:52 tank_config.go:157: file storage location: build/matter
[INFO ]14:38:52 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]14:38:52 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]14:38:52 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]14:38:52 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]14:38:52 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]14:38:52 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]14:38:52 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]14:38:52 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]14:38:52 task_service.go:170: scan task not enabled.
[INFO ]14:38:52 tank_application.go:153: App started at http://localhost:6010
[INFO ]14:38:52 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 201, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 5
[INFO ]14:38:52 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 58297, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]14:38:52 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]14:38:52 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]14:38:52 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 60, totalInvokeNum = 201, UV = 2, totalUV = 2, matterNum = 2, totalMatterNum = 5
[INFO ]14:38:52 dashboard_service.go:101: Dashboard Summery 2. matterSize = 57595, totalMatterSize = 58297, cacheSize = 0, totalCacheSize = 0, avgCost = 17
[INFO ]14:39:23 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[ERROR]14:39:53 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]14:39:53 footprint_service.go:90: Ip:127.0.0.1 Cost:0 Uri:/api/matter/create/directory Params:{}
[INFO ]14:43:47 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]14:46:03 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]14:46:17 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[ERROR]14:47:15 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]14:47:15 footprint_service.go:90: Ip:127.0.0.1 Cost:0 Uri:/api/matter/create/directory Params:{}
[INFO ]14:47:50 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[ERROR]14:53:08 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]14:53:08 footprint_service.go:90: Ip:127.0.0.1 Cost:0 Uri:/api/matter/create/directory Params:{}
[ERROR]14:53:13 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]14:53:13 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/create/directory Params:{}
[INFO ]14:58:57 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]15:03:05 footprint_service.go:90: Ip:127.0.0.1 Cost:13 Uri:/api/matter/page Params:{}
[INFO ]15:03:25 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]15:08:16 footprint_service.go:90: Ip:127.0.0.1 Cost:6 Uri:/api/matter/page Params:{}
[INFO ]15:08:23 footprint_service.go:90: Ip:127.0.0.1 Cost:36 Uri:/api/matter/page Params:{}
[INFO ]15:09:25 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:09:25 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:09:25 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:09:25 tank_config.go:157: file storage location: build/matter
[INFO ]15:09:25 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:09:25 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:09:25 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:09:25 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:09:25 task_service.go:170: scan task not enabled.
[INFO ]15:09:25 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:09:25 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:09:25 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:09:25 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:09:25 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:09:26 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 215, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 5
[INFO ]15:09:26 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 58297, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:09:26 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:09:26 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:09:26 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 74, totalInvokeNum = 215, UV = 2, totalUV = 2, matterNum = 2, totalMatterNum = 5
[INFO ]15:09:26 dashboard_service.go:101: Dashboard Summery 2. matterSize = 57595, totalMatterSize = 58297, cacheSize = 0, totalCacheSize = 0, avgCost = 14
[INFO ]15:09:47 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[ERROR]15:10:22 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]15:10:22 footprint_service.go:90: Ip:127.0.0.1 Cost:0 Uri:/api/matter/create/directory Params:{}
[INFO ]15:13:03 footprint_service.go:90: Ip:127.0.0.1 Cost:10 Uri:/api/matter/page Params:{}
[INFO ]15:13:13 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]15:13:27 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[ERROR]15:14:39 tank_router.go:99: panic on matter_dao.go:62 uuid cannot be null.
[INFO ]15:14:40 footprint_service.go:90: Ip:127.0.0.1 Cost:8 Uri:/api/matter/create/directory Params:{}
[INFO ]15:20:26 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{}
[INFO ]15:20:46 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]15:21:29 matter_service.go:597: Create Directory: build/matter//root/555
[INFO ]15:21:29 footprint_service.go:90: Ip:127.0.0.1 Cost:11 Uri:/api/matter/create/directory Params:{"name":["555"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:21:29 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]15:22:46 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]15:23:13 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]15:24:09 matter_service.go:597: Create Directory: build/matter//root/asdsd
[INFO ]15:24:09 footprint_service.go:90: Ip:127.0.0.1 Cost:10 Uri:/api/matter/create/directory Params:{"name":["asdsd"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:24:09 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{}
[INFO ]15:24:34 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{}
[INFO ]15:29:47 footprint_service.go:90: Ip:127.0.0.1 Cost:15 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:29:56 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:30:25 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:33:54 matter_service.go:597: Create Directory: build/matter//root/sssss
[INFO ]15:33:54 footprint_service.go:90: Ip:127.0.0.1 Cost:7 Uri:/api/matter/create/directory Params:{"name":["sssss"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:33:54 footprint_service.go:90: Ip:127.0.0.1 Cost:1 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[ERROR]15:34:49 tank_router.go:99: panic on matter_service.go:363 "CEF license.txt" 已经存在了,操作无效
[INFO ]15:34:49 footprint_service.go:90: Ip:127.0.0.1 Cost:12 Uri:/api/matter/upload Params:{"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:35:13 matter_service.go:389: upload CEF license1.txt 1.6kB
[INFO ]15:35:13 footprint_service.go:90: Ip:127.0.0.1 Cost:18 Uri:/api/matter/upload Params:{"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:35:14 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:40:18 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:40:18 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:40:18 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:40:18 tank_config.go:157: file storage location: build/matter
[INFO ]15:40:18 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:40:18 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:40:18 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:40:18 task_service.go:170: scan task not enabled.
[INFO ]15:40:18 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:40:18 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:40:18 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:40:18 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:40:18 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:40:18 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:40:18 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 238, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 9
[INFO ]15:40:18 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:40:18 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:40:18 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:40:18 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 97, totalInvokeNum = 238, UV = 2, totalUV = 2, matterNum = 6, totalMatterNum = 9
[INFO ]15:40:18 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 12
[INFO ]15:41:39 footprint_service.go:90: Ip:127.0.0.1 Cost:4 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:41:50 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:42:04 matter_service.go:597: Create Directory: build/matter//root/232323
[INFO ]15:42:04 footprint_service.go:90: Ip:127.0.0.1 Cost:11 Uri:/api/matter/create/directory Params:{"name":["232323"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:42:04 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:42:59 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:42:59 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:42:59 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:42:59 tank_config.go:157: file storage location: build/matter
[INFO ]15:42:59 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:42:59 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:42:59 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:42:59 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:42:59 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:42:59 task_service.go:170: scan task not enabled.
[INFO ]15:42:59 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:42:59 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:42:59 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:42:59 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:42:59 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 242, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 10
[INFO ]15:42:59 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:42:59 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:42:59 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:42:59 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 101, totalInvokeNum = 242, UV = 2, totalUV = 2, matterNum = 7, totalMatterNum = 10
[INFO ]15:42:59 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 12
[INFO ]15:43:18 matter_service.go:597: Create Directory: build/matter//root/sdsd
[INFO ]15:43:18 footprint_service.go:90: Ip:127.0.0.1 Cost:17 Uri:/api/matter/create/directory Params:{"name":["sdsd"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:43:18 footprint_service.go:90: Ip:127.0.0.1 Cost:4 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:47:39 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:47:39 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:47:39 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:47:39 tank_config.go:157: file storage location: build/matter
[INFO ]15:47:39 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:47:39 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:47:39 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:47:39 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:47:39 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:47:39 task_service.go:170: scan task not enabled.
[INFO ]15:47:39 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:47:39 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:47:39 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:47:39 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:47:39 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 244, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 11
[INFO ]15:47:39 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:47:39 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:47:39 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:47:39 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 103, totalInvokeNum = 244, UV = 2, totalUV = 2, matterNum = 8, totalMatterNum = 11
[INFO ]15:47:39 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 12
[INFO ]15:47:53 matter_service.go:597: Create Directory: build/matter//root/sss
[INFO ]15:47:53 footprint_service.go:90: Ip:127.0.0.1 Cost:14 Uri:/api/matter/create/directory Params:{"name":["sss"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:47:53 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:49:41 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:49:41 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:49:41 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:49:41 tank_config.go:157: file storage location: build/matter
[INFO ]15:49:41 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:49:41 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:49:41 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:49:41 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:49:41 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:49:41 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:49:41 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:49:41 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:49:41 task_service.go:170: scan task not enabled.
[INFO ]15:49:41 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:49:41 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 246, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 12
[INFO ]15:49:41 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:49:41 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:49:41 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:49:41 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 105, totalInvokeNum = 246, UV = 2, totalUV = 2, matterNum = 9, totalMatterNum = 12
[INFO ]15:49:41 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 12
[INFO ]15:49:54 matter_service.go:597: Create Directory: build/matter//root/444
[INFO ]15:49:54 footprint_service.go:90: Ip:127.0.0.1 Cost:10 Uri:/api/matter/create/directory Params:{"name":["444"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:49:54 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:53:50 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:53:50 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:53:50 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:53:50 tank_config.go:157: file storage location: build/matter
[INFO ]15:53:50 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:53:50 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:53:50 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:53:50 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:53:50 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:53:50 task_service.go:170: scan task not enabled.
[INFO ]15:53:50 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:53:50 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:53:50 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:53:50 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:53:50 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 248, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 13
[INFO ]15:53:50 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:53:50 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:53:50 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:53:50 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 107, totalInvokeNum = 248, UV = 2, totalUV = 2, matterNum = 10, totalMatterNum = 13
[INFO ]15:53:50 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 12
[INFO ]15:54:00 matter_service.go:597: Create Directory: build/matter//root/333
[INFO ]15:54:00 footprint_service.go:90: Ip:127.0.0.1 Cost:16 Uri:/api/matter/create/directory Params:{"name":["333"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:54:00 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:55:25 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]15:55:25 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]15:55:25 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]15:55:25 tank_config.go:157: file storage location: build/matter
[INFO ]15:55:25 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]15:55:25 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]15:55:25 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]15:55:25 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]15:55:25 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]15:55:25 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]15:55:25 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]15:55:25 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]15:55:25 task_service.go:170: scan task not enabled.
[INFO ]15:55:25 tank_application.go:153: App started at http://localhost:6010
[INFO ]15:55:25 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 250, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 14
[INFO ]15:55:25 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]15:55:25 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]15:55:25 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]15:55:25 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 109, totalInvokeNum = 250, UV = 2, totalUV = 2, matterNum = 11, totalMatterNum = 14
[INFO ]15:55:25 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 11
[INFO ]15:56:48 footprint_service.go:90: Ip:127.0.0.1 Cost:5 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:56:59 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]15:57:09 matter_service.go:597: Create Directory: build/matter//root/111
[INFO ]15:57:09 footprint_service.go:90: Ip:127.0.0.1 Cost:11 Uri:/api/matter/create/directory Params:{"name":["111"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]15:57:09 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]16:01:03 tank_logger.go:34: [cron job] Every day 00:00 maintain log file.
[WARN ]16:01:03 tank_config.go:124: read config file ./build/conf/tank.json
[INFO ]16:01:03 tank_config.go:156: use config file: ./build/conf/tank.json
[INFO ]16:01:03 tank_config.go:157: file storage location: build/matter
[INFO ]16:01:03 dashboard_service.go:51: Immediately ETL dashboard data.
[INFO ]16:01:03 footprint_service.go:96: Immediately delete Footprint data of 8 days ago.
[INFO ]16:01:03 task_service.go:65: [cron job] Every day 00:10 delete Footprint data of 8 days ago.
[INFO ]16:01:03 task_service.go:77: [cron job] Everyday 00:05 ETL dashboard data.
[INFO ]16:01:03 task_service.go:89: [cron job] Everyday 01:00 Clean deleted matters.
[INFO ]16:01:03 footprint_service.go:107: Delete footprint data before 2025-05-06 00:00:00
[INFO ]16:01:03 task_service.go:170: scan task not enabled.
[INFO ]16:01:03 tank_application.go:153: App started at http://localhost:6010
[INFO ]16:01:03 dashboard_service.go:72: ETL dashboard data from 2025-05-13 00:00:00 to 2025-05-13 23:59:59
[INFO ]16:01:03 dashboard_service.go:77: 2025-05-13 already exits. delete it and insert new one.
[INFO ]16:01:03 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 8, totalInvokeNum = 254, UV = 1, totalUV = 2, matterNum = 0, totalMatterNum = 15
[INFO ]16:01:03 dashboard_service.go:101: Dashboard Summery 2. matterSize = 0, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 135
[INFO ]16:01:03 dashboard_service.go:72: ETL dashboard data from 2025-05-14 00:00:00 to 2025-05-14 23:59:59
[INFO ]16:01:03 dashboard_service.go:77: 2025-05-14 already exits. delete it and insert new one.
[INFO ]16:01:03 dashboard_service.go:98: Dashboard Summery 1. invokeNum = 113, totalInvokeNum = 254, UV = 2, totalUV = 2, matterNum = 12, totalMatterNum = 15
[INFO ]16:01:03 dashboard_service.go:101: Dashboard Summery 2. matterSize = 59284, totalMatterSize = 59986, cacheSize = 0, totalCacheSize = 0, avgCost = 11
[INFO ]16:01:20 matter_service.go:597: Create Directory: build/matter/p015993815826844528/root/2222222
[INFO ]16:01:20 footprint_service.go:90: Ip:127.0.0.1 Cost:12 Uri:/api/matter/create/directory Params:{"name":["2222222"],"puuid":["root"],"userUuid":["p015993815826844528"]}
[INFO ]16:01:20 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]16:19:58 footprint_service.go:90: Ip:127.0.0.1 Cost:12 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]16:33:34 footprint_service.go:90: Ip:127.0.0.1 Cost:7 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]16:34:44 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]16:51:13 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]16:51:44 footprint_service.go:90: Ip:127.0.0.1 Cost:4 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]17:01:42 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]17:01:59 footprint_service.go:90: Ip:127.0.0.1 Cost:21 Uri:/api/matter/delete Params:{"uuid":["d252b282-f53b-4eac-4bce-53b590285b41"]}
[INFO ]17:02:06 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]17:02:09 footprint_service.go:90: Ip:127.0.0.1 Cost:23 Uri:/api/matter/delete Params:{"uuid":["f7e3bc4d-bf03-4e1f-54ad-277a5c251ae4"]}
[ERROR]17:02:12 tank_router.go:99: panic on matter_dao.go:53 not found record with uuid = f7e3bc4d-bf03-4e1f-54ad-277a5c251ae4
[INFO ]17:02:12 footprint_service.go:90: Ip:127.0.0.1 Cost:3 Uri:/api/matter/delete Params:{"uuid":["f7e3bc4d-bf03-4e1f-54ad-277a5c251ae4"]}
[INFO ]17:02:39 footprint_service.go:90: Ip:127.0.0.1 Cost:2 Uri:/api/matter/page Params:{"deleted":["false"],"orderCreateTime":["DESC"],"orderDir":["DESC"],"page":["0"],"pageSize":["100"],"puuid":["root"]}
[INFO ]17:02:42 footprint_service.go:90: Ip:127.0.0.1 Cost:17 Uri:/api/matter/delete Params:{"uuid":["94490f7c-e5de-4e3f-5237-a51351dc58d9"]}

0
build/pack/build.sh

0
build/service/shutdown.sh

0
build/service/startup.sh

2
code/core/config.go

@ -2,7 +2,7 @@ package core
const (
//authentication key of cookie
COOKIE_AUTH_KEY = "_ak"
COOKIE_AUTH_KEY = "hxpan"
USERNAME_KEY = "_username"
PASSWORD_KEY = "_password"

25
code/rest/alien_controller.go

@ -1,13 +1,14 @@
package rest
import (
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"net/http"
"regexp"
"strconv"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
)
type AlienController struct {
@ -80,7 +81,7 @@ func (this *AlienController) RegisterRoutes() map[string]func(writer http.Respon
return routeMap
}
//handle some special routes, eg. params in the url.
// handle some special routes, eg. params in the url.
func (this *AlienController) HandleRoutes(writer http.ResponseWriter, request *http.Request) (func(writer http.ResponseWriter, request *http.Request), bool) {
path := request.URL.Path
@ -108,7 +109,7 @@ func (this *AlienController) HandleRoutes(writer http.ResponseWriter, request *h
return nil, false
}
//fetch a upload token for guest. Guest can upload file with this token.
// fetch a upload token for guest. Guest can upload file with this token.
func (this *AlienController) FetchUploadToken(writer http.ResponseWriter, request *http.Request) *result.WebResult {
filename := request.FormValue("filename")
@ -170,7 +171,7 @@ func (this *AlienController) FetchUploadToken(writer http.ResponseWriter, reques
}
//user confirm a file whether uploaded successfully.
// user confirm a file whether uploaded successfully.
func (this *AlienController) Confirm(writer http.ResponseWriter, request *http.Request) *result.WebResult {
matterUuid := request.FormValue("matterUuid")
@ -188,7 +189,7 @@ func (this *AlienController) Confirm(writer http.ResponseWriter, request *http.R
return this.Success(matter)
}
//a guest upload a file with a upload token.
// a guest upload a file with a upload token.
func (this *AlienController) Upload(writer http.ResponseWriter, request *http.Request) *result.WebResult {
//allow cors.
this.allowCORS(writer)
@ -239,7 +240,7 @@ func (this *AlienController) Upload(writer http.ResponseWriter, request *http.Re
return this.Success(matter)
}
//crawl a url with uploadToken. guest can visit this method.
// crawl a url with uploadToken. guest can visit this method.
func (this *AlienController) CrawlToken(writer http.ResponseWriter, request *http.Request) *result.WebResult {
//allow cors.
@ -275,7 +276,7 @@ func (this *AlienController) CrawlToken(writer http.ResponseWriter, request *htt
return this.Success(matter)
}
//crawl a url directly. only user can visit this method.
// crawl a url directly. only user can visit this method.
func (this *AlienController) CrawlDirect(writer http.ResponseWriter, request *http.Request) *result.WebResult {
filename := request.FormValue("filename")
@ -298,7 +299,7 @@ func (this *AlienController) CrawlDirect(writer http.ResponseWriter, request *ht
return this.Success(matter)
}
//fetch a download token for guest. Guest can download file with this token.
// fetch a download token for guest. Guest can download file with this token.
func (this *AlienController) FetchDownloadToken(writer http.ResponseWriter, request *http.Request) *result.WebResult {
matterUuid := request.FormValue("matterUuid")
@ -338,13 +339,13 @@ func (this *AlienController) FetchDownloadToken(writer http.ResponseWriter, requ
}
//preview a file.
// preview a file.
func (this *AlienController) Preview(writer http.ResponseWriter, request *http.Request, uuid string, filename string) {
this.alienService.PreviewOrDownload(writer, request, uuid, filename, false)
}
//download a file.
// download a file.
func (this *AlienController) Download(writer http.ResponseWriter, request *http.Request, uuid string, filename string) {
this.alienService.PreviewOrDownload(writer, request, uuid, filename, true)

17
code/rest/base_bean.go

@ -1,10 +1,11 @@
package rest
import (
"net/http"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"net/http"
)
type BaseBean struct {
@ -19,17 +20,17 @@ func (this *BaseBean) Bootstrap() {
}
//clean up the application.
// clean up the application.
func (this *BaseBean) Cleanup() {
}
//shortcut for panic check.
// shortcut for panic check.
func (this *BaseBean) PanicError(err error) {
core.PanicError(err)
}
//find the current user from request.
// find the current user from request.
func (this *BaseBean) findUser(request *http.Request) *User {
//try to find from SessionCache.
@ -60,11 +61,11 @@ func (this *BaseBean) findUser(request *http.Request) *User {
}
//find current error. If not found, panic the LOGIN error.
// find current error. If not found, panic the LOGIN error.
func (this *BaseBean) checkUser(request *http.Request) *User {
if this.findUser(request) == nil {
_user := this.findUser(request)
if _user == nil {
panic(result.LOGIN)
} else {
return this.findUser(request)
}
return _user
}

22
code/rest/base_controller.go

@ -2,13 +2,14 @@ package rest
import (
"fmt"
"go/types"
"net/http"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"github.com/json-iterator/go"
"go/types"
"net/http"
jsoniter "github.com/json-iterator/go"
)
type BaseController struct {
@ -38,12 +39,12 @@ func (this *BaseController) RegisterRoutes() map[string]func(writer http.Respons
return make(map[string]func(writer http.ResponseWriter, request *http.Request))
}
//handle some special routes, eg. params in the url.
// handle some special routes, eg. params in the url.
func (this *BaseController) HandleRoutes(writer http.ResponseWriter, request *http.Request) (func(writer http.ResponseWriter, request *http.Request), bool) {
return nil, false
}
//wrap the handle method.
// wrap the handle method.
func (this *BaseController) Wrap(f func(writer http.ResponseWriter, request *http.Request) *result.WebResult, qualifiedRole string) func(w http.ResponseWriter, r *http.Request) {
return func(writer http.ResponseWriter, request *http.Request) {
@ -73,8 +74,13 @@ func (this *BaseController) Wrap(f func(writer http.ResponseWriter, request *htt
if webResult != nil {
writer.Header().Set("Content-Type", "application/json;charset=UTF-8")
//by han: hx frontend's code is number
var resultEx result.WebResultEx
resultEx.Code = result.FetchHttpStatus(webResult.Code)
resultEx.Msg = webResult.Msg
resultEx.Data = webResult.Data
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(webResult)
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(resultEx)
this.PanicError(err)
@ -87,7 +93,7 @@ func (this *BaseController) Wrap(f func(writer http.ResponseWriter, request *htt
}
}
//response a success result. 1.string 2. WebResult 3.nil pointer 4.any type
// response a success result. 1.string 2. WebResult 3.nil pointer 4.any type
func (this *BaseController) Success(data interface{}) *result.WebResult {
var webResult *result.WebResult = nil
if value, ok := data.(string); ok {
@ -106,7 +112,7 @@ func (this *BaseController) Success(data interface{}) *result.WebResult {
return webResult
}
//allow cors.
// allow cors.
func (this *BaseController) allowCORS(writer http.ResponseWriter) {
util.AllowCORS(writer)
}

5
code/rest/dashboard_controller.go

@ -1,11 +1,12 @@
package rest
import (
"net/http"
"strconv"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/result"
"net/http"
"strconv"
)
type DashboardController struct {

13
code/rest/dav_controller.go

@ -3,14 +3,15 @@ package rest
import (
"bytes"
"fmt"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"io/ioutil"
"net/http"
"regexp"
"strings"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
)
/**
@ -71,7 +72,7 @@ func (this *DavController) Init() {
}
}
//Auth user by BasicAuth
// Auth user by BasicAuth
func (this *DavController) CheckCurrentUser(writer http.ResponseWriter, request *http.Request) *User {
username, password, ok := request.BasicAuth()
@ -100,7 +101,7 @@ func (this *DavController) RegisterRoutes() map[string]func(writer http.Response
return routeMap
}
//handle some special routes, eg. params in the url.
// handle some special routes, eg. params in the url.
func (this *DavController) HandleRoutes(writer http.ResponseWriter, request *http.Request) (func(writer http.ResponseWriter, request *http.Request), bool) {
path := request.URL.Path

11
code/rest/dav_model.go

@ -2,23 +2,24 @@ package rest
import (
"fmt"
"github.com/eyebluecn/tank/code/tool/dav"
"github.com/eyebluecn/tank/code/tool/dav/xml"
"net/http"
"path"
"strconv"
"github.com/eyebluecn/tank/code/tool/dav"
"github.com/eyebluecn/tank/code/tool/dav/xml"
)
//webdav url prefix.
// webdav url prefix.
var WEBDAV_PREFIX = "/api/dav"
//live prop.
// live prop.
type LiveProp struct {
findFn func(user *User, matter *Matter) string
dir bool
}
//all live prop map.
// all live prop map.
var LivePropMap = map[xml.Name]LiveProp{
{Space: "DAV:", Local: "resourcetype"}: {
findFn: func(user *User, matter *Matter) string {

45
code/rest/dav_service.go

@ -2,12 +2,6 @@ package rest
import (
"fmt"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/dav"
"github.com/eyebluecn/tank/code/tool/dav/xml"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"github.com/eyebluecn/tank/code/tool/webdav"
"io/ioutil"
"net/http"
"net/url"
@ -15,6 +9,13 @@ import (
"regexp"
"strings"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/dav"
"github.com/eyebluecn/tank/code/tool/dav/xml"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"github.com/eyebluecn/tank/code/tool/webdav"
)
/**
@ -49,7 +50,7 @@ func (this *DavService) Init() {
this.lockSystem = webdav.NewMemLS()
}
//get the depth in header. Not support infinity yet.
// get the depth in header. Not support infinity yet.
func (this *DavService) ParseDepth(request *http.Request) int {
depth := 1
@ -88,7 +89,7 @@ func (this *DavService) makePropstatResponse(href string, pstats []dav.Propstat)
return &resp
}
//fetch a matter's []dav.Propstat
// fetch a matter's []dav.Propstat
func (this *DavService) PropstatsFromXmlNames(user *User, matter *Matter, xmlNames []xml.Name) []dav.Propstat {
propstats := make([]dav.Propstat, 0)
@ -182,7 +183,7 @@ func (this *DavService) Propstats(user *User, matter *Matter, propfind *dav.Prop
}
//list the directory.
// list the directory.
func (this *DavService) HandlePropfind(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("PROPFIND %s\n", subPath)
@ -228,7 +229,7 @@ func (this *DavService) HandlePropfind(writer http.ResponseWriter, request *http
}
//change the file's property
// change the file's property
func (this *DavService) HandleProppatch(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("PROPPATCH %s\n", subPath)
@ -251,7 +252,7 @@ func (this *DavService) HandleProppatch(writer http.ResponseWriter, request *htt
patches, status, err := webdav.ReadProppatch(request.Body)
this.PanicError(err)
fmt.Println("status:%v", status)
fmt.Printf("status:%v\n", status)
//prepare a multiStatusWriter.
multiStatusWriter := &dav.MultiStatusWriter{Writer: writer}
@ -296,7 +297,7 @@ func (this *DavService) HandleProppatch(writer http.ResponseWriter, request *htt
}
//handle download
// handle download
func (this *DavService) HandleGetHeadPost(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("GET %s\n", subPath)
@ -314,7 +315,7 @@ func (this *DavService) HandleGetHeadPost(writer http.ResponseWriter, request *h
}
//upload a file
// upload a file
func (this *DavService) HandlePut(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("PUT %s\n", subPath)
@ -354,7 +355,7 @@ func (this *DavService) HandlePut(writer http.ResponseWriter, request *http.Requ
}
//delete file
// delete file
func (this *DavService) HandleDelete(w http.ResponseWriter, r *http.Request, user *User, subPath string) {
fmt.Printf("DELETE %s\n", subPath)
@ -376,7 +377,7 @@ func (this *DavService) HandleDelete(w http.ResponseWriter, r *http.Request, use
this.matterService.AtomicSoftDelete(r, matter, user)
}
//crate a directory
// crate a directory
func (this *DavService) HandleMkcol(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("MKCOL %s\n", subPath)
@ -417,7 +418,7 @@ func (this *DavService) HandleMkcol(writer http.ResponseWriter, request *http.Re
}
//cors options
// cors options
func (this *DavService) HandleOptions(w http.ResponseWriter, r *http.Request, user *User, subPath string) {
fmt.Printf("OPTIONS %s\n", subPath)
@ -439,7 +440,7 @@ func (this *DavService) HandleOptions(w http.ResponseWriter, r *http.Request, us
}
//prepare for moving or copying
// prepare for moving or copying
func (this *DavService) prepareMoveCopy(
writer http.ResponseWriter,
request *http.Request,
@ -523,7 +524,7 @@ func (this *DavService) prepareMoveCopy(
}
//move or rename.
// move or rename.
func (this *DavService) HandleMove(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("MOVE %s\n", subPath)
@ -562,7 +563,7 @@ func (this *DavService) HandleMove(writer http.ResponseWriter, request *http.Req
}
}
//copy file/directory
// copy file/directory
func (this *DavService) HandleCopy(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("COPY %s\n", subPath)
@ -688,7 +689,7 @@ func (h *DavService) confirmLocks(r *http.Request, src, dst string) (release fun
return nil, http.StatusLocked, webdav.ErrLocked
}
//lock.
// lock.
func (this *DavService) HandleLock(w http.ResponseWriter, r *http.Request, user *User, subPath string) {
duration, err := webdav.ParseTimeout(r.Header.Get("Timeout"))
@ -785,7 +786,7 @@ func (this *DavService) HandleLock(w http.ResponseWriter, r *http.Request, user
}
//unlock
// unlock
func (this *DavService) HandleUnlock(w http.ResponseWriter, r *http.Request, user *User, subPath string) {
// http://www.webdav.org/specs/rfc4918.html#HEADER_Lock-Token says that the
@ -810,7 +811,7 @@ func (this *DavService) HandleUnlock(w http.ResponseWriter, r *http.Request, use
}
}
//hanle all the request.
// hanle all the request.
func (this *DavService) HandleDav(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
method := request.Method

33
code/rest/extend.go

@ -0,0 +1,33 @@
package rest
import (
"net/http"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/util"
)
func handleSessionAndCookie(writer http.ResponseWriter, request *http.Request, seDao *SessionDao, user *User) {
//set cookie. expire after 30 days.
expiration := time.Now()
expiration = expiration.AddDate(0, 0, 30)
//save session to db.
session := &Session{
UserUuid: user.Uuid,
Ip: util.GetIpAddress(request),
ExpireTime: expiration,
}
session.UpdateTime = time.Now()
session.CreateTime = time.Now()
session = seDao.Create(session)
//set cookie
cookie := http.Cookie{
Name: core.COOKIE_AUTH_KEY,
Path: "/",
Value: session.Uuid,
Expires: expiration}
http.SetCookie(writer, &cookie)
}

7
code/rest/image_cache_controller.go

@ -1,12 +1,13 @@
package rest
import (
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/result"
"net/http"
"strconv"
"strings"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/result"
)
type ImageCacheController struct {

21
code/rest/install_controller.go

@ -2,6 +2,11 @@ package rest
import (
"fmt"
"net/http"
"regexp"
"strconv"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/i18n"
@ -9,13 +14,9 @@ import (
"github.com/eyebluecn/tank/code/tool/util"
"github.com/eyebluecn/tank/code/tool/uuid"
"github.com/jinzhu/gorm"
"net/http"
"regexp"
"strconv"
"time"
)
//install apis. Only when installing period can be visited.
// install apis. Only when installing period can be visited.
type InstallController struct {
BaseController
uploadTokenDao *UploadTokenDao
@ -197,7 +198,7 @@ func (this *InstallController) validateTableMetaList(tableInfoList []*InstallTab
}
//Ping db.
// Ping db.
func (this *InstallController) Verify(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
@ -245,7 +246,7 @@ func (this *InstallController) CreateTable(writer http.ResponseWriter, request *
}
//get the list of admin.
// get the list of admin.
func (this *InstallController) AdminList(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
@ -263,7 +264,7 @@ func (this *InstallController) AdminList(writer http.ResponseWriter, request *ht
return this.Success(users)
}
//create admin
// create admin
func (this *InstallController) CreateAdmin(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
@ -309,7 +310,7 @@ func (this *InstallController) CreateAdmin(writer http.ResponseWriter, request *
}
//(if there is admin in db)Validate admin.
// (if there is admin in db)Validate admin.
func (this *InstallController) ValidateAdmin(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
@ -343,7 +344,7 @@ func (this *InstallController) ValidateAdmin(writer http.ResponseWriter, request
}
//Finish the installation
// Finish the installation
func (this *InstallController) Finish(writer http.ResponseWriter, request *http.Request) *result.WebResult {
mysqlPortStr := request.FormValue("mysqlPort")

42
code/rest/matter_controller.go

@ -1,13 +1,14 @@
package rest
import (
"net/http"
"strconv"
"strings"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"net/http"
"strconv"
"strings"
)
type MatterController struct {
@ -70,20 +71,20 @@ func (this *MatterController) RegisterRoutes() map[string]func(writer http.Respo
routeMap := make(map[string]func(writer http.ResponseWriter, request *http.Request))
routeMap["/api/matter/create/directory"] = this.Wrap(this.CreateDirectory, USER_ROLE_USER)
routeMap["/api/matter/upload"] = this.Wrap(this.Upload, USER_ROLE_USER)
routeMap["/api/matter/create/directory"] = this.Wrap(this.CreateDirectory, USER_ROLE_USER) //done
routeMap["/api/matter/upload"] = this.Wrap(this.Upload, USER_ROLE_USER) //done
routeMap["/api/matter/crawl"] = this.Wrap(this.Crawl, USER_ROLE_USER)
routeMap["/api/matter/soft/delete"] = this.Wrap(this.SoftDelete, USER_ROLE_USER)
routeMap["/api/matter/soft/delete/batch"] = this.Wrap(this.SoftDeleteBatch, USER_ROLE_USER)
routeMap["/api/matter/recovery"] = this.Wrap(this.Recovery, USER_ROLE_USER)
routeMap["/api/matter/recovery/batch"] = this.Wrap(this.RecoveryBatch, USER_ROLE_USER)
routeMap["/api/matter/delete"] = this.Wrap(this.Delete, USER_ROLE_USER)
routeMap["/api/matter/delete/batch"] = this.Wrap(this.DeleteBatch, USER_ROLE_USER)
routeMap["/api/matter/rename"] = this.Wrap(this.Rename, USER_ROLE_USER)
routeMap["/api/matter/delete"] = this.Wrap(this.Delete, USER_ROLE_USER) //done
routeMap["/api/matter/delete/batch"] = this.Wrap(this.DeleteBatch, USER_ROLE_USER) //wait less
routeMap["/api/matter/rename"] = this.Wrap(this.Rename, USER_ROLE_USER) //wait less
routeMap["/api/matter/change/privacy"] = this.Wrap(this.ChangePrivacy, USER_ROLE_USER)
routeMap["/api/matter/move"] = this.Wrap(this.Move, USER_ROLE_USER)
routeMap["/api/matter/move"] = this.Wrap(this.Move, USER_ROLE_USER) // wait less
routeMap["/api/matter/detail"] = this.Wrap(this.Detail, USER_ROLE_USER)
routeMap["/api/matter/page"] = this.Wrap(this.Page, USER_ROLE_GUEST)
routeMap["/api/matter/page"] = this.Wrap(this.Page, USER_ROLE_GUEST) //done
//mirror local files.
routeMap["/api/matter/mirror"] = this.Wrap(this.Mirror, USER_ROLE_USER)
@ -222,7 +223,6 @@ func (this *MatterController) CreateDirectory(writer http.ResponseWriter, reques
name := request.FormValue("name")
user := this.checkUser(request)
var dirMatter = this.matterDao.CheckWithRootByUuid(puuid, user)
matter := this.matterService.AtomicCreateDirectory(request, dirMatter, name, user)
@ -232,7 +232,7 @@ func (this *MatterController) CreateDirectory(writer http.ResponseWriter, reques
func (this *MatterController) Upload(writer http.ResponseWriter, request *http.Request) *result.WebResult {
puuid := request.FormValue("puuid")
privacyStr := request.FormValue("privacy")
//privacyStr := request.FormValue("privacy")
file, handler, err := request.FormFile("file")
this.PanicError(err)
defer func() {
@ -241,8 +241,8 @@ func (this *MatterController) Upload(writer http.ResponseWriter, request *http.R
}()
user := this.checkUser(request)
privacy := privacyStr == TRUE
//by han: default should be true
privacy := true //privacyStr == TRUE
err = request.ParseMultipartForm(32 << 20)
this.PanicError(err)
@ -266,7 +266,7 @@ func (this *MatterController) Upload(writer http.ResponseWriter, request *http.R
return this.Success(matter)
}
//crawl a file by url.
// crawl a file by url.
func (this *MatterController) Crawl(writer http.ResponseWriter, request *http.Request) *result.WebResult {
url := request.FormValue("url")
@ -290,7 +290,7 @@ func (this *MatterController) Crawl(writer http.ResponseWriter, request *http.Re
return this.Success(matter)
}
//soft delete.
// soft delete.
func (this *MatterController) SoftDelete(writer http.ResponseWriter, request *http.Request) *result.WebResult {
uuid := request.FormValue("uuid")
@ -344,7 +344,7 @@ func (this *MatterController) SoftDeleteBatch(writer http.ResponseWriter, reques
return this.Success("OK")
}
//recovery delete.
// recovery delete.
func (this *MatterController) Recovery(writer http.ResponseWriter, request *http.Request) *result.WebResult {
uuid := request.FormValue("uuid")
@ -364,7 +364,7 @@ func (this *MatterController) Recovery(writer http.ResponseWriter, request *http
return this.Success("OK")
}
//recovery batch.
// recovery batch.
func (this *MatterController) RecoveryBatch(writer http.ResponseWriter, request *http.Request) *result.WebResult {
uuids := request.FormValue("uuids")
@ -395,7 +395,7 @@ func (this *MatterController) RecoveryBatch(writer http.ResponseWriter, request
return this.Success("OK")
}
//complete delete.
// complete delete.
func (this *MatterController) Delete(writer http.ResponseWriter, request *http.Request) *result.WebResult {
uuid := request.FormValue("uuid")
@ -554,7 +554,7 @@ func (this *MatterController) Move(writer http.ResponseWriter, request *http.Req
return this.Success(nil)
}
//mirror local files to EyeblueTank
// mirror local files to EyeblueTank
func (this *MatterController) Mirror(writer http.ResponseWriter, request *http.Request) *result.WebResult {
srcPath := request.FormValue("srcPath")
@ -578,7 +578,7 @@ func (this *MatterController) Mirror(writer http.ResponseWriter, request *http.R
}
//download zip.
// download zip.
func (this *MatterController) Zip(writer http.ResponseWriter, request *http.Request) *result.WebResult {
uuids := request.FormValue("uuids")

29
code/rest/matter_model.go

@ -2,15 +2,16 @@ package rest
import (
"fmt"
"net/http"
"regexp"
"strings"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
jsoniter "github.com/json-iterator/go"
"net/http"
"regexp"
"strings"
"time"
)
const (
@ -56,19 +57,19 @@ func (Matter) TableName() string {
// get matter's absolute path. the Path property is relative path in db.
func (this *Matter) AbsolutePath() string {
return GetUserMatterRootDir(this.Username) + this.Path
return GetUserMatterRootDir(this.UserUuid) + this.Path
}
func (this *Matter) MimeType() string {
return util.GetMimeType(util.GetExtension(this.Name))
}
//Create a root matter. It's convenient for copy and move
// Create a root matter. It's convenient for copy and move
func NewRootMatter(user *User) *Matter {
matter := &Matter{}
matter.Uuid = MATTER_ROOT
matter.UserUuid = user.Uuid
matter.Username = user.Username
matter.Username = user.Uuid
matter.Dir = true
matter.Path = ""
matter.CreateTime = user.CreateTime
@ -78,7 +79,7 @@ func NewRootMatter(user *User) *Matter {
return matter
}
//get user's space absolute path
// get user's space absolute path
func GetUserSpaceRootDir(username string) (rootDirPath string) {
rootDirPath = fmt.Sprintf("%s/%s", core.CONFIG.MatterPath(), username)
@ -86,7 +87,7 @@ func GetUserSpaceRootDir(username string) (rootDirPath string) {
return rootDirPath
}
//get user's root absolute path
// get user's root absolute path
func GetUserMatterRootDir(username string) (rootDirPath string) {
rootDirPath = fmt.Sprintf("%s/%s/%s", core.CONFIG.MatterPath(), username, MATTER_ROOT)
@ -94,7 +95,7 @@ func GetUserMatterRootDir(username string) (rootDirPath string) {
return rootDirPath
}
//get user's cache absolute path
// get user's cache absolute path
func GetUserCacheRootDir(username string) (rootDirPath string) {
rootDirPath = fmt.Sprintf("%s/%s/%s", core.CONFIG.MatterPath(), username, MATTER_CACHE)
@ -102,7 +103,7 @@ func GetUserCacheRootDir(username string) (rootDirPath string) {
return rootDirPath
}
//get user's zip absolute path
// get user's zip absolute path
func GetUserZipRootDir(username string) (rootDirPath string) {
rootDirPath = fmt.Sprintf("%s/%s/%s", core.CONFIG.MatterPath(), username, MATTER_ZIP)
@ -110,7 +111,7 @@ func GetUserZipRootDir(username string) (rootDirPath string) {
return rootDirPath
}
//check matter's name. If error, panic.
// check matter's name. If error, panic.
func CheckMatterName(request *http.Request, name string) string {
if name == "" {
@ -129,7 +130,7 @@ func CheckMatterName(request *http.Request, name string) string {
return name
}
//fetch the props
// fetch the props
func (this *Matter) FetchPropMap() map[string]string {
m := make(map[string]string)
@ -146,7 +147,7 @@ func (this *Matter) FetchPropMap() map[string]string {
return m
}
//fetch the props
// fetch the props
func (this *Matter) SetPropMap(propMap map[string]string) {
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(propMap)

109
code/rest/matter_service.go

@ -3,12 +3,6 @@ package rest
import (
"archive/zip"
"fmt"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/download"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"io"
"io/ioutil"
"net/http"
@ -18,6 +12,13 @@ import (
"regexp"
"strings"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/download"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
)
/**
@ -69,7 +70,7 @@ func (this *MatterService) Init() {
}
//Download. Support chunk download.
// Download. Support chunk download.
func (this *MatterService) DownloadFile(
writer http.ResponseWriter,
request *http.Request,
@ -80,7 +81,7 @@ func (this *MatterService) DownloadFile(
download.DownloadFile(writer, request, filePath, filename, withContentDisposition)
}
//Download specified matters. matters must have the same puuid.
// Download specified matters. matters must have the same puuid.
func (this *MatterService) DownloadZip(
writer http.ResponseWriter,
request *http.Request,
@ -150,7 +151,7 @@ func (this *MatterService) DownloadZip(
}
//zip matters.
// zip matters.
func (this *MatterService) zipMatters(request *http.Request, matters []*Matter, destPath string) {
if util.PathExists(destPath) {
@ -243,7 +244,7 @@ func (this *MatterService) zipMatters(request *http.Request, matters []*Matter,
}
}
//delete files.
// delete files.
func (this *MatterService) Delete(request *http.Request, matter *Matter, user *User) {
if matter == nil {
@ -256,7 +257,7 @@ func (this *MatterService) Delete(request *http.Request, matter *Matter, user *U
this.ComputeRouteSize(matter.Puuid, user)
}
//soft delete files.
// soft delete files.
func (this *MatterService) SoftDelete(request *http.Request, matter *Matter, user *User) {
if matter == nil {
@ -271,7 +272,7 @@ func (this *MatterService) SoftDelete(request *http.Request, matter *Matter, use
//no need to recompute size.
}
//recovery delete files.
// recovery delete files.
func (this *MatterService) Recovery(request *http.Request, matter *Matter, user *User) {
if matter == nil {
@ -286,7 +287,7 @@ func (this *MatterService) Recovery(request *http.Request, matter *Matter, user
//no need to recompute size.
}
//atomic delete files
// atomic delete files
func (this *MatterService) AtomicDelete(request *http.Request, matter *Matter, user *User) {
if matter == nil {
@ -300,7 +301,7 @@ func (this *MatterService) AtomicDelete(request *http.Request, matter *Matter, u
this.Delete(request, matter, user)
}
//atomic soft delete files
// atomic soft delete files
func (this *MatterService) AtomicSoftDelete(request *http.Request, matter *Matter, user *User) {
if matter == nil {
@ -318,7 +319,7 @@ func (this *MatterService) AtomicSoftDelete(request *http.Request, matter *Matte
this.SoftDelete(request, matter, user)
}
//atomic recovery delete files
// atomic recovery delete files
func (this *MatterService) AtomicRecovery(request *http.Request, matter *Matter, user *User) {
if matter == nil {
@ -336,7 +337,7 @@ func (this *MatterService) AtomicRecovery(request *http.Request, matter *Matter,
this.Recovery(request, matter, user)
}
//upload files.
// upload files.
func (this *MatterService) Upload(request *http.Request, file io.Reader, user *User, dirMatter *Matter, filename string, privacy bool) *Matter {
if user == nil {
@ -356,7 +357,7 @@ func (this *MatterService) Upload(request *http.Request, file io.Reader, user *U
}
dirAbsolutePath := dirMatter.AbsolutePath()
//check if have duplicated
count := this.matterDao.CountByUserUuidAndPuuidAndDirAndName(user.Uuid, dirMatter.Uuid, false, filename)
if count > 0 {
panic(result.BadRequestI18n(request, i18n.MatterExist, filename))
@ -388,27 +389,28 @@ func (this *MatterService) Upload(request *http.Request, file io.Reader, user *U
this.logger.Info("upload %s %v ", filename, util.HumanFileSize(fileSize))
//check the size limit.
if user.SizeLimit >= 0 {
if fileSize > user.SizeLimit {
//delete the file on disk.
err = os.Remove(fileAbsolutePath)
this.PanicError(err)
//by han: remove sizelimit check
// if user.SizeLimit >= 0 {
// if fileSize > user.SizeLimit {
// //delete the file on disk.
// err = os.Remove(fileAbsolutePath)
// this.PanicError(err)
panic(result.BadRequestI18n(request, i18n.MatterSizeExceedLimit, util.HumanFileSize(fileSize), util.HumanFileSize(user.SizeLimit)))
}
}
// panic(result.BadRequestI18n(request, i18n.MatterSizeExceedLimit, util.HumanFileSize(fileSize), util.HumanFileSize(user.SizeLimit)))
// }
// }
//check total size.
if user.TotalSizeLimit >= 0 {
if user.TotalSize+fileSize > user.TotalSizeLimit {
// //check total size.
// if user.TotalSizeLimit >= 0 {
// if user.TotalSize+fileSize > user.TotalSizeLimit {
//delete the file on disk.
err = os.Remove(fileAbsolutePath)
this.PanicError(err)
// //delete the file on disk.
// err = os.Remove(fileAbsolutePath)
// this.PanicError(err)
panic(result.BadRequestI18n(request, i18n.MatterSizeExceedTotalLimit, util.HumanFileSize(user.TotalSize), util.HumanFileSize(user.TotalSizeLimit)))
}
}
// panic(result.BadRequestI18n(request, i18n.MatterSizeExceedTotalLimit, util.HumanFileSize(user.TotalSize), util.HumanFileSize(user.TotalSizeLimit)))
// }
// }
matter := this.createNonDirMatter(dirMatter, filename, fileSize, privacy, user)
@ -539,7 +541,7 @@ func (this *MatterService) ComputeDirSize(dirMatter *Matter, user *User) {
}
//inner create directory.
// inner create directory.
func (this *MatterService) createDirectory(request *http.Request, dirMatter *Matter, name string, user *User) *Matter {
if dirMatter == nil {
@ -587,7 +589,6 @@ func (this *MatterService) createDirectory(request *http.Request, dirMatter *Mat
}
absolutePath := GetUserMatterRootDir(user.Username) + dirMatter.Path + "/" + name
relativePath := dirMatter.Path + "/" + name
//crate directory on disk.
@ -624,7 +625,7 @@ func (this *MatterService) AtomicCreateDirectory(request *http.Request, dirMatte
return matter
}
//copy or move may overwrite.
// copy or move may overwrite.
func (this *MatterService) handleOverwrite(request *http.Request, user *User, destinationPath string, overwrite bool) {
destMatter := this.matterDao.findByUserUuidAndPath(user.Uuid, destinationPath)
@ -641,7 +642,7 @@ func (this *MatterService) handleOverwrite(request *http.Request, user *User, de
}
//move srcMatter to destMatter. invoker must handled the overwrite and lock.
// move srcMatter to destMatter. invoker must handled the overwrite and lock.
func (this *MatterService) move(request *http.Request, srcMatter *Matter, destDirMatter *Matter, user *User) {
if srcMatter == nil {
@ -702,7 +703,7 @@ func (this *MatterService) move(request *http.Request, srcMatter *Matter, destDi
}
//move srcMatter to destMatter(must be dir)
// move srcMatter to destMatter(must be dir)
func (this *MatterService) AtomicMove(request *http.Request, srcMatter *Matter, destDirMatter *Matter, overwrite bool, user *User) {
if srcMatter == nil {
@ -737,7 +738,7 @@ func (this *MatterService) AtomicMove(request *http.Request, srcMatter *Matter,
this.move(request, srcMatter, destDirMatter, user)
}
//move srcMatters to destMatter(must be dir)
// move srcMatters to destMatter(must be dir)
func (this *MatterService) AtomicMoveBatch(request *http.Request, srcMatters []*Matter, destDirMatter *Matter, user *User) {
if destDirMatter == nil {
@ -774,7 +775,7 @@ func (this *MatterService) AtomicMoveBatch(request *http.Request, srcMatters []*
}
//copy srcMatter to destMatter. invoker must handled the overwrite and lock.
// copy srcMatter to destMatter. invoker must handled the overwrite and lock.
func (this *MatterService) copy(request *http.Request, srcMatter *Matter, destDirMatter *Matter, name string) {
this.logger.Info("copy srcPath = %s destPath = %s/%s", srcMatter.Path, destDirMatter.Path, name)
@ -832,7 +833,7 @@ func (this *MatterService) copy(request *http.Request, srcMatter *Matter, destDi
}
}
//copy srcMatter to destMatter.
// copy srcMatter to destMatter.
func (this *MatterService) AtomicCopy(request *http.Request, srcMatter *Matter, destDirMatter *Matter, name string, overwrite bool, user *User) {
if srcMatter == nil {
@ -852,7 +853,7 @@ func (this *MatterService) AtomicCopy(request *http.Request, srcMatter *Matter,
this.copy(request, srcMatter, destDirMatter, name)
}
//rename matter to name
// rename matter to name
func (this *MatterService) AtomicRename(request *http.Request, matter *Matter, name string, overwrite bool, user *User) {
this.logger.Info("Try to rename srcPath = %s to name = %s", matter.Path, name)
@ -934,7 +935,7 @@ func (this *MatterService) AtomicRename(request *http.Request, matter *Matter, n
return
}
//将本地文件映射到蓝眼云盘中去。
// 将本地文件映射到蓝眼云盘中去。
func (this *MatterService) AtomicMirror(request *http.Request, srcPath string, destPath string, overwrite bool, user *User) {
if user == nil {
@ -959,7 +960,7 @@ func (this *MatterService) AtomicMirror(request *http.Request, srcPath string, d
this.mirror(request, srcPath, destDirMatter, overwrite, user)
}
//将本地文件/文件夹映射到蓝眼云盘中去。
// 将本地文件/文件夹映射到蓝眼云盘中去。
func (this *MatterService) mirror(request *http.Request, srcPath string, destDirMatter *Matter, overwrite bool, user *User) {
if user == nil {
@ -1027,7 +1028,7 @@ func (this *MatterService) mirror(request *http.Request, srcPath string, destDir
}
//根据一个文件夹路径,依次创建,找到最后一个文件夹的matter,如果中途出错,返回err. 如果存在了那就直接返回即可。
// 根据一个文件夹路径,依次创建,找到最后一个文件夹的matter,如果中途出错,返回err. 如果存在了那就直接返回即可。
func (this *MatterService) CreateDirectories(request *http.Request, user *User, dirPath string) *Matter {
dirPath = path.Clean(dirPath)
@ -1068,7 +1069,7 @@ func (this *MatterService) CreateDirectories(request *http.Request, user *User,
return dirMatter
}
//wrap a matter. put its parent.
// wrap a matter. put its parent.
func (this *MatterService) WrapParentDetail(request *http.Request, matter *Matter) *Matter {
if matter == nil {
@ -1091,7 +1092,7 @@ func (this *MatterService) WrapParentDetail(request *http.Request, matter *Matte
return matter
}
//wrap a matter ,put its children
// wrap a matter ,put its children
func (this *MatterService) WrapChildrenDetail(request *http.Request, matter *Matter) {
if matter == nil {
@ -1110,13 +1111,13 @@ func (this *MatterService) WrapChildrenDetail(request *http.Request, matter *Mat
}
//fetch a matter's detail with parent info.
// fetch a matter's detail with parent info.
func (this *MatterService) Detail(request *http.Request, uuid string) *Matter {
matter := this.matterDao.CheckByUuid(uuid)
return this.WrapParentDetail(request, matter)
}
//crawl a url to dirMatter
// crawl a url to dirMatter
func (this *MatterService) AtomicCrawl(request *http.Request, url string, filename string, user *User, dirMatter *Matter, privacy bool) *Matter {
if user == nil {
@ -1145,7 +1146,7 @@ func (this *MatterService) AtomicCrawl(request *http.Request, url string, filena
return this.Upload(request, resp.Body, user, dirMatter, filename, privacy)
}
//adjust a matter's path.
// adjust a matter's path.
func (this *MatterService) adjustPath(matter *Matter, parentMatter *Matter) {
if matter.Dir {
@ -1169,7 +1170,7 @@ func (this *MatterService) adjustPath(matter *Matter, parentMatter *Matter) {
}
//delete someone's EyeblueTank files according to physics files.
// delete someone's EyeblueTank files according to physics files.
func (this *MatterService) DeleteByPhysics(request *http.Request, user *User) {
if user == nil {
@ -1200,7 +1201,7 @@ func (this *MatterService) deleteFolderByPhysics(request *http.Request, dirMatte
})
}
//scan someone's physics files to EyeblueTank
// scan someone's physics files to EyeblueTank
func (this *MatterService) ScanPhysics(request *http.Request, user *User) {
if user == nil {
@ -1290,7 +1291,7 @@ func (this *MatterService) scanPhysicsFolder(request *http.Request, dirInfo os.F
}
}
//clean all the expired deleted matters
// clean all the expired deleted matters
func (this *MatterService) CleanExpiredDeletedMatters() {
//mock a request.
request := &http.Request{}

13
code/rest/preference_controller.go

@ -1,13 +1,14 @@
package rest
import (
"net/http"
"strconv"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
jsoniter "github.com/json-iterator/go"
"net/http"
"strconv"
)
type PreferenceController struct {
@ -56,7 +57,7 @@ func (this *PreferenceController) RegisterRoutes() map[string]func(writer http.R
return routeMap
}
//ping the application. Return current version.
// ping the application. Return current version.
func (this *PreferenceController) Ping(writer http.ResponseWriter, request *http.Request) *result.WebResult {
return this.Success(core.VERSION)
@ -70,7 +71,7 @@ func (this *PreferenceController) Fetch(writer http.ResponseWriter, request *htt
return this.Success(preference)
}
//edit basic info.
// edit basic info.
func (this *PreferenceController) Edit(writer http.ResponseWriter, request *http.Request) *result.WebResult {
name := request.FormValue("name")
@ -151,7 +152,7 @@ func (this *PreferenceController) Edit(writer http.ResponseWriter, request *http
return this.Success(preference)
}
//edit preview config.
// edit preview config.
func (this *PreferenceController) EditPreviewConfig(writer http.ResponseWriter, request *http.Request) *result.WebResult {
previewConfig := request.FormValue("previewConfig")
@ -207,7 +208,7 @@ func (this *PreferenceController) EditScanConfig(writer http.ResponseWriter, req
return this.Success(preference)
}
//cleanup system data.
// cleanup system data.
func (this *PreferenceController) SystemCleanup(writer http.ResponseWriter, request *http.Request) *result.WebResult {
user := this.checkUser(request)

9
code/rest/share_controller.go

@ -1,15 +1,16 @@
package rest
import (
"net/http"
"strconv"
"strings"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"net/http"
"strconv"
"strings"
"time"
)
type ShareController struct {

87
code/rest/user_controller.go

@ -1,15 +1,16 @@
package rest
import (
"net/http"
"regexp"
"strconv"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/i18n"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"net/http"
"regexp"
"strconv"
"time"
)
type UserController struct {
@ -68,58 +69,46 @@ func (this *UserController) innerLogin(writer http.ResponseWriter, request *http
panic(result.BadRequestI18n(request, i18n.UserDisabled))
}
//set cookie. expire after 30 days.
expiration := time.Now()
expiration = expiration.AddDate(0, 0, 30)
//save session to db.
session := &Session{
UserUuid: user.Uuid,
Ip: util.GetIpAddress(request),
ExpireTime: expiration,
}
session.UpdateTime = time.Now()
session.CreateTime = time.Now()
session = this.sessionDao.Create(session)
//set cookie
cookie := http.Cookie{
Name: core.COOKIE_AUTH_KEY,
Path: "/",
Value: session.Uuid,
Expires: expiration}
http.SetCookie(writer, &cookie)
handleSessionAndCookie(writer, request, this.sessionDao, user)
//update lastTime and lastIp
user.LastTime = time.Now()
user.LastIp = util.GetIpAddress(request)
this.userDao.Save(user)
//by han: 去掉用户表相关操作
// user.LastTime = time.Now()
// user.LastIp = util.GetIpAddress(request)
// this.userDao.Save(user)
}
//login by username and password
// login by username and password
func (this *UserController) Login(writer http.ResponseWriter, request *http.Request) *result.WebResult {
username := request.FormValue("username")
password := request.FormValue("password")
if "" == username || "" == password {
panic(result.BadRequestI18n(request, i18n.UsernameOrPasswordCannotNull))
}
user := this.userDao.FindByUsername(username)
if user == nil {
panic(result.BadRequestI18n(request, i18n.UsernameOrPasswordError))
}
if !util.MatchBcrypt(password, user.Password) {
panic(result.BadRequestI18n(request, i18n.UsernameOrPasswordError))
}
//get from http header
// username := request.Header.Get("user-key")
// password := request.Header.Get("user-token")
uid := request.Header.Get("user-id")
if uid == "" {
uid = "test-user-id"
}
//should redirect to original domain
// if "" == username || "" == password {
// panic(result.BadRequestI18n(request, i18n.UsernameOrPasswordCannotNull))
// }
//by han:todo, 是否需要修改用户表,比如把用户注册到盘这边,最好取消云盘的用户系统依赖
// user := this.userDao.FindByUsername(username)
// if user == nil {
// panic(result.BadRequestI18n(request, i18n.UsernameOrPasswordError))
// }
user := &User{Base: Base{Uuid: uid}, Username: uid}
// if !util.MatchBcrypt(password, user.Password) {
// panic(result.BadRequestI18n(request, i18n.UsernameOrPasswordError))
// }
this.innerLogin(writer, request, user)
return this.Success(user)
}
//login by authentication.
// login by authentication.
func (this *UserController) AuthenticationLogin(writer http.ResponseWriter, request *http.Request) *result.WebResult {
authentication := request.FormValue("authentication")
@ -140,13 +129,13 @@ func (this *UserController) AuthenticationLogin(writer http.ResponseWriter, requ
return this.Success(user)
}
//fetch current user's info.
// fetch current user's info.
func (this *UserController) Info(writer http.ResponseWriter, request *http.Request) *result.WebResult {
user := this.checkUser(request)
return this.Success(user)
}
//register by username and password. After registering, will auto login.
// register by username and password. After registering, will auto login.
func (this *UserController) Register(writer http.ResponseWriter, request *http.Request) *result.WebResult {
username := request.FormValue("username")
@ -439,7 +428,7 @@ func (this *UserController) Transfiguration(writer http.ResponseWriter, request
return this.Success(session.Uuid)
}
//scan user's physics files. create index into EyeblueTank
// scan user's physics files. create index into EyeblueTank
func (this *UserController) Scan(writer http.ResponseWriter, request *http.Request) *result.WebResult {
uuid := request.FormValue("uuid")
@ -494,7 +483,7 @@ func (this *UserController) ChangePassword(writer http.ResponseWriter, request *
return this.Success(user)
}
//admin reset password.
// admin reset password.
func (this *UserController) ResetPassword(writer http.ResponseWriter, request *http.Request) *result.WebResult {
userUuid := request.FormValue("userUuid")

21
code/rest/user_dao.go

@ -1,12 +1,13 @@
package rest
import (
"math"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/builder"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/uuid"
"math"
"time"
)
type UserDao struct {
@ -36,9 +37,14 @@ func (this *UserDao) Create(user *User) *User {
return user
}
//find by uuid. if not found return nil.
// find by uuid. if not found return nil.
func (this *UserDao) FindByUuid(uuid string) *User {
var entity = &User{}
//by han: just return a user with uuid
entity.Uuid = uuid
entity.Username = uuid
return entity
db := core.CONTEXT.GetDB().Where("uuid = ?", uuid).First(entity)
if db.Error != nil {
if db.Error.Error() == result.DB_ERROR_NOT_FOUND {
@ -50,7 +56,7 @@ func (this *UserDao) FindByUuid(uuid string) *User {
return entity
}
//find by uuid. if not found panic NotFound error
// find by uuid. if not found panic NotFound error
func (this *UserDao) CheckByUuid(uuid string) *User {
entity := this.FindByUuid(uuid)
if entity == nil {
@ -60,7 +66,6 @@ func (this *UserDao) CheckByUuid(uuid string) *User {
}
func (this *UserDao) FindByUsername(username string) *User {
var user = &User{}
db := core.CONTEXT.GetDB().Where(&User{Username: username}).First(user)
if db.Error != nil {
@ -111,7 +116,7 @@ func (this *UserDao) PlainPage(page int, pageSize int, username string, status s
return count, users
}
//handle user page by page.
// handle user page by page.
func (this *UserDao) PageHandle(username string, status string, fun func(user *User)) {
//delete share and bridges.
@ -154,7 +159,7 @@ func (this *UserDao) Save(user *User) *User {
return user
}
//find all 2.0 users.
// find all 2.0 users.
func (this *UserDao) FindUsers20() []*User {
var users []*User
var wp = &builder.WherePair{}
@ -179,7 +184,7 @@ func (this *UserDao) Delete(user *User) {
this.PanicError(db.Error)
}
//System cleanup.
// System cleanup.
func (this *UserDao) Cleanup() {
this.logger.Info("[UserDao] clean up. Delete all User")
db := core.CONTEXT.GetDB().Where("uuid is not null and role != ?", USER_ROLE_ADMINISTRATOR).Delete(User{})

87
code/rest/user_service.go

@ -1,17 +1,18 @@
package rest
import (
"net/http"
"os"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/cache"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"github.com/eyebluecn/tank/code/tool/uuid"
"net/http"
"os"
"time"
)
//@Service
// @Service
type UserService struct {
BaseBean
userDao *UserDao
@ -82,7 +83,7 @@ func (this *UserService) Init() {
this.locker = cache.NewTable()
}
//lock a user's operation. If lock, user cannot operate file.
// lock a user's operation. If lock, user cannot operate file.
func (this *UserService) MatterLock(userUuid string) {
cacheItem, err := this.locker.Value(userUuid)
@ -98,7 +99,7 @@ func (this *UserService) MatterLock(userUuid string) {
this.locker.Add(userUuid, duration, true)
}
//unlock
// unlock
func (this *UserService) MatterUnlock(userUuid string) {
exist := this.locker.Exists(userUuid)
@ -110,12 +111,13 @@ func (this *UserService) MatterUnlock(userUuid string) {
}
}
//load session to SessionCache. This method will be invoked in every request.
//authorize by 1. cookie 2. username and password in request form. 3. Basic Auth
// load session to SessionCache. This method will be invoked in every request.
// authorize by 1. cookie 2. username and password in request form. 3. Basic Auth
func (this *UserService) PreHandle(writer http.ResponseWriter, request *http.Request) {
sessionId := util.GetSessionUuidFromRequest(request, core.COOKIE_AUTH_KEY)
var user *User
if sessionId != "" {
cacheItem, err := core.CONTEXT.GetSessionCache().Value(sessionId)
@ -131,7 +133,8 @@ func (this *UserService) PreHandle(writer http.ResponseWriter, request *http.Req
if duration <= 0 {
this.logger.Error("login info has expired.")
} else {
user := this.userDao.FindByUuid(session.UserUuid)
//by han: just return current user with usserUuid
user = this.userDao.FindByUuid(session.UserUuid)
if user != nil {
core.CONTEXT.GetSessionCache().Add(sessionId, duration, user)
} else {
@ -140,6 +143,13 @@ func (this *UserService) PreHandle(writer http.ResponseWriter, request *http.Req
}
}
}
} else {
userid := request.Header.Get("user-id")
user = &User{}
user.Uuid = userid
user.Username = userid
handleSessionAndCookie(writer, request, this.sessionDao, user)
}
//try to auth by USERNAME_KEY PASSWORD_KEY
@ -149,40 +159,49 @@ func (this *UserService) PreHandle(writer http.ResponseWriter, request *http.Req
}
if cacheItem == nil || cacheItem.Data() == nil {
username := request.FormValue(core.USERNAME_KEY)
password := request.FormValue(core.PASSWORD_KEY)
//------------by han--------------
//try to read from BasicAuth
if username == "" || password == "" {
username, password, _ = request.BasicAuth()
}
timeUUID, _ := uuid.NewV4()
uuidStr := string(timeUUID.String())
request.Form[core.COOKIE_AUTH_KEY] = []string{uuidStr}
core.CONTEXT.GetSessionCache().Add(uuidStr, 10*time.Second, user)
return
//--------------end----------------
if username != "" && password != "" {
// username := request.FormValue(core.USERNAME_KEY)
// password := request.FormValue(core.PASSWORD_KEY)
user := this.userDao.FindByUsername(username)
if user == nil {
this.logger.Error("%s no such user in db.", username)
} else {
// //try to read from BasicAuth
// if username == "" || password == "" {
// username, password, _ = request.BasicAuth()
// }
if !util.MatchBcrypt(password, user.Password) {
this.logger.Error("%s password error", username)
} else {
// if username != "" && password != "" {
this.logger.Info("load a temp session by username and password.")
timeUUID, _ := uuid.NewV4()
uuidStr := string(timeUUID.String())
request.Form[core.COOKIE_AUTH_KEY] = []string{uuidStr}
// user := this.userDao.FindByUsername(username)
// if user == nil {
// this.logger.Error("%s no such user in db.", username)
// } else {
core.CONTEXT.GetSessionCache().Add(uuidStr, 10*time.Second, user)
}
}
// if !util.MatchBcrypt(password, user.Password) {
// this.logger.Error("%s password error", username)
// } else {
}
// this.logger.Info("load a temp session by username and password.")
// timeUUID, _ := uuid.NewV4()
// uuidStr := string(timeUUID.String())
// request.Form[core.COOKIE_AUTH_KEY] = []string{uuidStr}
// core.CONTEXT.GetSessionCache().Add(uuidStr, 10*time.Second, user)
// }
// }
// }
}
}
//find a cache user by its userUuid
// find a cache user by its userUuid
func (this *UserService) FindCacheUsersByUuid(userUuid string) []*User {
var users []*User
@ -204,7 +223,7 @@ func (this *UserService) FindCacheUsersByUuid(userUuid string) []*User {
return users
}
//remove cache user by its userUuid
// remove cache user by its userUuid
func (this *UserService) RemoveCacheUserByUuid(userUuid string) {
var sessionId interface{}
@ -233,7 +252,7 @@ func (this *UserService) RemoveCacheUserByUuid(userUuid string) {
}
}
//delete user
// delete user
func (this *UserService) DeleteUser(request *http.Request, currentUser *User) {
//delete from cache

18
code/support/tank_application.go

@ -3,17 +3,18 @@ package support
import (
"flag"
"fmt"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
jsoniter "github.com/json-iterator/go"
"golang.org/x/crypto/ssh/terminal"
"io/ioutil"
"log"
"net/http"
"net/url"
"strings"
"syscall"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
jsoniter "github.com/json-iterator/go"
"golang.org/x/crypto/ssh/terminal"
)
const (
@ -47,7 +48,7 @@ type TankApplication struct {
filename string
}
//Start the application.
// Start the application.
func (this *TankApplication) Start() {
defer func() {
@ -79,15 +80,12 @@ func (this *TankApplication) Start() {
//default start as web.
if this.mode == "" || strings.ToLower(this.mode) == MODE_WEB {
this.HandleWeb()
} else if strings.ToLower(this.mode) == MODE_VERSION {
this.HandleVersion()
} else {
//default host.
if this.host == "" {
this.host = fmt.Sprintf("http://127.0.0.1:%d", core.DEFAULT_SERVER_PORT)
@ -248,7 +246,7 @@ func (this *TankApplication) HandleCrawl() {
}
//fetch the application version
// fetch the application version
func (this *TankApplication) HandleVersion() {
fmt.Printf("EyeblueTank %s\r\n", core.VERSION)

22
code/support/tank_router.go

@ -2,17 +2,18 @@ package support
import (
"fmt"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/rest"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
"github.com/json-iterator/go"
"io"
"net/http"
"os"
"runtime"
"strings"
"time"
"github.com/eyebluecn/tank/code/core"
"github.com/eyebluecn/tank/code/rest"
"github.com/eyebluecn/tank/code/tool/result"
"github.com/eyebluecn/tank/code/tool/util"
jsoniter "github.com/json-iterator/go"
)
type TankRouter struct {
@ -67,7 +68,7 @@ func NewRouter() *TankRouter {
}
//catch global panic.
// catch global panic.
func (this *TankRouter) GlobalPanicHandler(writer http.ResponseWriter, request *http.Request, startTime time.Time) {
if err := recover(); err != nil {
@ -114,6 +115,11 @@ func (this *TankRouter) GlobalPanicHandler(writer http.ResponseWriter, request *
//other error
webResult = result.ConstWebResult(result.UNKNOWN)
}
//by han: hx frontend's code is number
var resultEx result.WebResultEx
resultEx.Code = result.FetchHttpStatus(webResult.Code)
resultEx.Msg = webResult.Msg
resultEx.Data = webResult.Data
//change the http status.
writer.WriteHeader(result.FetchHttpStatus(webResult.Code))
@ -122,7 +128,7 @@ func (this *TankRouter) GlobalPanicHandler(writer http.ResponseWriter, request *
writer.Header().Set("Content-Type", "application/json;charset=UTF-8")
//write the response.
b, _ := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(webResult)
b, _ := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(resultEx)
//write to writer.
_, err := fmt.Fprintf(writer, string(b))
@ -145,8 +151,8 @@ func (this *TankRouter) ServeHTTP(writer http.ResponseWriter, request *http.Requ
defer this.GlobalPanicHandler(writer, request, startTime)
path := request.URL.Path
if strings.HasPrefix(path, "/api") {
if strings.HasPrefix(path, "/api") {
//IE browser will cache automatically. disable the cache.
util.DisableCache(writer)

5
code/test/dav_test.go

@ -2,10 +2,11 @@ package test
import (
"bytes"
"github.com/eyebluecn/tank/code/tool/dav"
"github.com/eyebluecn/tank/code/tool/dav/xml"
"testing"
"time"
"github.com/eyebluecn/tank/code/tool/dav"
"github.com/eyebluecn/tank/code/tool/dav/xml"
)
func TestXmlDecoder(t *testing.T) {

15
code/tool/result/web_result.go

@ -2,9 +2,10 @@ package result
import (
"fmt"
"github.com/eyebluecn/tank/code/tool/i18n"
"net/http"
"strconv"
"github.com/eyebluecn/tank/code/tool/i18n"
)
type WebResult struct {
@ -13,6 +14,12 @@ type WebResult struct {
Data interface{} `json:"data"`
}
type WebResultEx struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
func (this *WebResult) Error() string {
return this.Msg
}
@ -111,7 +118,7 @@ func CustomWebResult(codeWrapper *CodeWrapper, description string) *WebResult {
return wr
}
//use standard http status code.
// use standard http status code.
func StatusCodeWebResult(statusCode int, description string) *WebResult {
if description == "" {
description = http.StatusText(statusCode)
@ -140,12 +147,12 @@ func NotFound(format string, v ...interface{}) *WebResult {
}
//sever inner error
// sever inner error
func Server(format string, v ...interface{}) *WebResult {
return CustomWebResult(SERVER, fmt.Sprintf(format, v...))
}
//db error.
// db error.
var (
DB_ERROR_DUPLICATE_KEY = "Error 1062: Duplicate entry"
DB_ERROR_NOT_FOUND = "record not found"

42
code/tool/util/util_file.go

@ -2,7 +2,6 @@ package util
import (
"fmt"
"github.com/eyebluecn/tank/code/tool/result"
"go/build"
"io"
"io/ioutil"
@ -11,6 +10,8 @@ import (
"path/filepath"
"runtime"
"strings"
"github.com/eyebluecn/tank/code/tool/result"
)
func PathExists(path string) bool {
@ -32,7 +33,7 @@ func GetGoPath() string {
}
//get development home path.
// get development home path.
func GetDevHomePath() string {
_, file, _, ok := runtime.Caller(0)
@ -49,8 +50,12 @@ func GetDevHomePath() string {
return dir
}
//get home path for application.
// get home path for application.
func GetHomePath() string {
if str := os.Getenv("HomePath"); str != "" {
return str
}
ex, err := os.Executable()
if err != nil {
panic(err)
@ -68,19 +73,20 @@ func GetHomePath() string {
return UniformPath(exPath)
}
//get html path
//dev: return $project/build/html
//prod: return $application/html
// get html path
// dev: return $project/build/html
// prod: return $application/html
func GetHtmlPath() string {
//开发环境直接使用 build/html 下面的文件
if EnvWinDevelopment() || EnvMacDevelopment() {
return GetDevHomePath() + "/build/html"
}
return GetHomePath() + "/html"
}
//if directory not exit, create it.
// if directory not exit, create it.
func MakeDirAll(dirPath string) string {
exists := PathExists(dirPath)
@ -96,7 +102,7 @@ func MakeDirAll(dirPath string) string {
return dirPath
}
//eg /var/www/xx.log -> /var/www
// eg /var/www/xx.log -> /var/www
func GetDirOfPath(fullPath string) string {
index1 := strings.LastIndex(fullPath, "/")
@ -110,7 +116,7 @@ func GetDirOfPath(fullPath string) string {
return fullPath[:index]
}
//get filename from path. eg /var/www/xx.log -> xx.log
// get filename from path. eg /var/www/xx.log -> xx.log
func GetFilenameOfPath(fullPath string) string {
index1 := strings.LastIndex(fullPath, "/")
@ -124,7 +130,7 @@ func GetFilenameOfPath(fullPath string) string {
return fullPath[index+1:]
}
//try to delete empty dir. true: delete an empty dir, false: delete nothing.
// try to delete empty dir. true: delete an empty dir, false: delete nothing.
func DeleteEmptyDir(dirPath string) bool {
dir, err := ioutil.ReadDir(dirPath)
if err != nil {
@ -146,7 +152,7 @@ func DeleteEmptyDir(dirPath string) bool {
return false
}
//delete empty dir recursive, delete until not empty.
// delete empty dir recursive, delete until not empty.
func DeleteEmptyDirRecursive(dirPath string) {
fmt.Printf("recursive delete %v \n", dirPath)
@ -162,10 +168,10 @@ func DeleteEmptyDirRecursive(dirPath string) {
}
}
//get conf path.
// get conf path.
func GetConfPath() string {
homePath := GetHomePath()
homePath := "./build" //GetHomePath()
filePath := homePath + "/conf"
exists := PathExists(filePath)
@ -179,7 +185,7 @@ func GetConfPath() string {
return filePath
}
//get log path.
// get log path.
func GetLogPath() string {
homePath := GetHomePath()
@ -196,7 +202,7 @@ func GetLogPath() string {
return filePath
}
//copy file
// copy file
func CopyFile(srcPath string, destPath string) (nBytes int64) {
srcFileStat, err := os.Stat(srcPath)
@ -234,9 +240,9 @@ func CopyFile(srcPath string, destPath string) (nBytes int64) {
return nBytes
}
//1. replace \\ to /
//2. clean path.
//3. trim suffix /
// 1. replace \\ to /
// 2. clean path.
// 3. trim suffix /
func UniformPath(p string) string {
p = strings.Replace(p, "\\", "/", -1)
p = path.Clean(p)

5
code/tool/uuid/uuid_test.go

@ -47,7 +47,7 @@ func TestParseString(t *testing.T) {
func TestNewV3(t *testing.T) {
u, err := NewV3(NamespaceURL, []byte("golang.org"))
if err != nil {
t.Errorf("Expected to generate UUID without problems, error thrown: %d", err.Error())
t.Errorf("Expected to generate UUID without problems, error thrown: %s", err.Error())
return
}
if u.Version() != 3 {
@ -80,6 +80,7 @@ func TestNewV4(t *testing.T) {
t.Errorf("Expected to generate UUID without problems, error thrown: %s", err.Error())
return
}
t.Log(u.String())
if u.Version() != 4 {
t.Errorf("Expected to generate UUIDv4, given %d", u.Version())
}
@ -95,7 +96,7 @@ func TestNewV4(t *testing.T) {
func TestNewV5(t *testing.T) {
u, err := NewV5(NamespaceURL, []byte("golang.org"))
if err != nil {
t.Errorf("Expected to generate UUID without problems, error thrown: %d", err.Error())
t.Errorf("Expected to generate UUID without problems, error thrown: %s", err.Error())
return
}
if u.Version() != 5 {

2
go.sum

@ -38,7 +38,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg=
@ -49,7 +48,6 @@ golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=

Loading…
Cancel
Save