Ver Fonte

feat:增加入参返参对象

Cheng Jian há 2 anos atrás
pai
commit
1df75ca941
3 ficheiros alterados com 26 adições e 0 exclusões
  1. 8 0
      go.mod
  2. 11 0
      net/request.go
  3. 7 0
      net/response.go

+ 8 - 0
go.mod

@@ -0,0 +1,8 @@
+module dashoo.cn/micro_libary
+
+go 1.18
+
+require github.com/gogf/gf/v2 v2.4.4 // indirect
+
+
+

+ 11 - 0
net/request.go

@@ -0,0 +1,11 @@
+package net
+
+import "github.com/gogf/gf/v2/net/ghttp"
+
+type Request struct {
+}
+
+// GetTenant 获取租户码
+func GetTenant(r *ghttp.Request) string {
+	return r.Header.Get("Tenant")
+}

+ 7 - 0
net/response.go

@@ -0,0 +1,7 @@
+package net
+
+type Response struct {
+	Code    int64  `json:"code"`
+	Message string `json:"message"`
+	Data    any    `json:"data"`
+}