1 Star 0 Fork 1

iThings/core

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
debugGetLogic.go 753 Bytes
Copy Edit Raw Blame History
杨磊 authored 2024-08-14 15:32 +08:00 . feat: 完善项目
package common
import (
"context"
"net/http"
"gitee.com/i-Things/core/service/apisvr/internal/svc"
"gitee.com/i-Things/core/service/apisvr/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type DebugGetLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewDebugGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DebugGetLogic {
return &DebugGetLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *DebugGetLogic) DebugGet(r *http.Request) (resp *types.DebugResp, err error) {
var headers = make(map[string]string)
for k, v := range r.Header {
headers[k] = v[0]
}
return &types.DebugResp{
RequestUri: r.RequestURI,
Headers: headers,
}, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/i-Things/core.git
git@gitee.com:i-Things/core.git
i-Things
core
core
v0.1.6

Search