提交 71f88367 authored 作者: mooncake's avatar mooncake

update

上级 cabcac14
...@@ -6,8 +6,8 @@ PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/ | grep -v /api/ | grep ...@@ -6,8 +6,8 @@ PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/ | grep -v /api/ | grep
.PHONY: fmt .PHONY: fmt
fmt: fmt:
go mod tidy @go mod tidy
gofmt -s -w . @gofmt -s -w .
.PHONY: ci-lint .PHONY: ci-lint
# Check the code specification against the rules in the .golangci.yml file # Check the code specification against the rules in the .golangci.yml file
......
...@@ -202,7 +202,7 @@ func GetGinCtx(ctx context.Context) (*gin.Context, error) { ...@@ -202,7 +202,7 @@ func GetGinCtx(ctx context.Context) (*gin.Context, error) {
return nil, ErrorGinContextNotFound return nil, ErrorGinContextNotFound
} }
func GetGinUID(c context.Context) xsf.ID { func GetGinUID(c *gin.Context) xsf.ID {
if val := c.Value(KeyUID); val != nil { if val := c.Value(KeyUID); val != nil {
if v, ok := val.(xsf.ID); ok { if v, ok := val.(xsf.ID); ok {
return v return v
...@@ -213,7 +213,7 @@ func GetGinUID(c context.Context) xsf.ID { ...@@ -213,7 +213,7 @@ func GetGinUID(c context.Context) xsf.ID {
return xsf.ID(0) return xsf.ID(0)
} }
func GetGinUName(c context.Context) string { func GetGinUName(c *gin.Context) string {
if val := c.Value(KeyUName); val != nil { if val := c.Value(KeyUName); val != nil {
if v, ok := val.(string); ok { if v, ok := val.(string); ok {
return v return v
...@@ -223,7 +223,7 @@ func GetGinUName(c context.Context) string { ...@@ -223,7 +223,7 @@ func GetGinUName(c context.Context) string {
return "" return ""
} }
func GetGinCompanyName(c context.Context) string { func GetGinCompanyName(c *gin.Context) string {
if val := c.Value(KeyCompanyName); val != nil { if val := c.Value(KeyCompanyName); val != nil {
if v, ok := val.(string); ok { if v, ok := val.(string); ok {
return v return v
......
...@@ -151,7 +151,7 @@ func Init() { ...@@ -151,7 +151,7 @@ func Init() {
func AddAsync(ctx context.Context, operate string, req *entity.CopyHttpReq, rsp *entity.CopyHttpRsp) { func AddAsync(ctx context.Context, operate string, req *entity.CopyHttpReq, rsp *entity.CopyHttpRsp) {
wl := &WebLog{} wl := &WebLog{}
wl.ID = xsf.GenerateID() wl.ID = xsf.GenerateID()
wl.CompanyName = ctxUtils.GetGinCompanyName(ctx) wl.CompanyName = ctxUtils.GetCtxCompanyName(ctx)
wl.CompanyID = ctxUtils.GetCtxCompanyID(ctx) wl.CompanyID = ctxUtils.GetCtxCompanyID(ctx)
wl.UID = ctxUtils.GetCtxUID(ctx) wl.UID = ctxUtils.GetCtxUID(ctx)
wl.UName = ctxUtils.GetCtxUName(ctx) wl.UName = ctxUtils.GetCtxUName(ctx)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论