123456789101112131415161718192021222324252627282930313233 |
- package apis
- import (
- "go-admin/app/observe/service"
- "go-admin/app/observe/service/dto"
- "go-admin/utils"
- "time"
- "github.com/gin-gonic/gin"
- )
- type WeaveScope struct {
- utils.OtApi
- }
- // GetPage 获取OtUrlMapping列表
- func (e WeaveScope) GetMenu(c *gin.Context) {
- req := dto.ScopeMenuResp{}
- svc := service.WeaveScope{}
- if err := e.Init(c, &req, &svc.OtService); err != nil {
- return
- }
- if req.EndTime == 0 {
- req.EndTime = time.Now().Unix()
- }
- if req.StartTime == 0 {
- req.StartTime = req.EndTime - 3600
- }
- e.Context.Writer.Header().Set("Content-Type", "application/json")
- e.Context.Writer.Write([]byte(svc.GetMenu(&req)))
- return
- }
|