李伟乐 2 years ago
parent 15d412e903
commit 71fb8ec5ac
  1. 1
      cmd/ts/main.go
  2. 2
      middleware/add_header_md.go

@ -26,6 +26,7 @@ func (u *Kit) Generate(plugin *protogen.Plugin) error {
}
fname := f.GeneratedFilenamePrefix + ".ts"
t := plugin.NewGeneratedFile(fname, f.GoImportPath)
t.P(`// @ts-ignore`)
t.P(`import {Config,http} from "./http";`)
for _, s := range f.Messages {
t.P(`export interface `, s.Desc.Name(), ` {`)

@ -2,7 +2,6 @@ package middleware
import (
"context"
"fmt"
"github.com/gin-gonic/gin"
"google.golang.org/grpc/metadata"
)
@ -10,7 +9,6 @@ import (
func AddHeaderMdMiddle(c *gin.Context) Middleware {
return func(handler Handler) Handler {
return func(ctx context.Context, a any) (any, error) {
fmt.Println("add_header_md")
headers := metadata.MD{}
headers1 := c.Request.Header.Clone()
for k, v := range headers1 {

Loading…
Cancel
Save