From 0cb9a0066984296675622a28dad4a92d9dee0310 Mon Sep 17 00:00:00 2001 From: xuyang Date: Thu, 28 Mar 2024 22:00:49 +0800 Subject: [PATCH 1/3] Feat:Channel Identify --- biz/model/device_ability/ability.go | 2 +- biz/model/dto/bind/identify/ticket.go | 11 +++ biz/model/dto/bind/space/create/create.go | 1 + biz/model/dto/httpbase.go | 6 +- biz/model/platform/baseUrl.go | 52 +++++++++++ biz/service/bind/identify/ticket.go | 87 +++++++++++++++++++ biz/service/bind/space/create/create.go | 59 ++++++++----- biz/service/switch-platform/network_switch.go | 9 ++ biz/web/handler/bind/identify/channel.go | 33 +++++++ biz/web/routers/router.go | 3 + config/config.go | 6 ++ docs/docs.go | 78 ++++++++++++++++- docs/swagger.json | 76 ++++++++++++++++ docs/swagger.yaml | 48 ++++++++++ 14 files changed, 443 insertions(+), 28 deletions(-) create mode 100644 biz/model/dto/bind/identify/ticket.go create mode 100644 biz/model/platform/baseUrl.go create mode 100644 biz/service/bind/identify/ticket.go create mode 100644 biz/web/handler/bind/identify/channel.go diff --git a/biz/model/device_ability/ability.go b/biz/model/device_ability/ability.go index 2217363..a6f3b70 100644 --- a/biz/model/device_ability/ability.go +++ b/biz/model/device_ability/ability.go @@ -99,7 +99,7 @@ func init() { deviceAbility.AospaceAppSupport = true deviceAbility.AospaceDevOptionSupport = true - deviceAbility.AospaceSwitchPlatformSupport = true + deviceAbility.AospaceSwitchPlatformSupport = false deviceAbility.OpenSource = true deviceAbility.UpgradeApiSupport = true } diff --git a/biz/model/dto/bind/identify/ticket.go b/biz/model/dto/bind/identify/ticket.go new file mode 100644 index 0000000..6fc44f1 --- /dev/null +++ b/biz/model/dto/bind/identify/ticket.go @@ -0,0 +1,11 @@ +package identify + +type TicketRsp struct { + Ticket string `json:"ticket"` // 临时ticket用于通道实名认证,web携带后可以临时访问平台 + ExpiresAt string `json:"expiresAt"` // 过期时间,秒时间戳 +} + +type TicketReq struct { + BoxUuid string `json:"boxUuid"` + PlatformUrl string `json:"platformUrl"` //平台的url +} diff --git a/biz/model/dto/bind/space/create/create.go b/biz/model/dto/bind/space/create/create.go index d93a4c2..4396fcd 100644 --- a/biz/model/dto/bind/space/create/create.go +++ b/biz/model/dto/bind/space/create/create.go @@ -25,6 +25,7 @@ type CreateReq struct { SpaceName string `json:"spaceName" binding:"required"` // 空间名称 Password string `json:"password" binding:"required"` // 空间密码 EnableInternetAccess bool `json:"enableInternetAccess"` // 是否启用互联网通道 + ChannelIdentified bool `json:"channelIdentified"` // 通道是否认证 PlatformApiBase string `json:"platformApiBase"` // Platform api url setting, e.g. "https://ao.space"` VerifyMethod []*document.VerificationMethod `json:"verificationMethod" binding:"required"` // did 的验证方法 } diff --git a/biz/model/dto/httpbase.go b/biz/model/dto/httpbase.go index 7d52905..c0fb091 100644 --- a/biz/model/dto/httpbase.go +++ b/biz/model/dto/httpbase.go @@ -68,9 +68,9 @@ const ( AgentCodeSwitchTaskNotFoundErr = "AG-580" //切换任务未找到 AgentCodeConnectErr = "AG-581" //连接错误 //AlreadyLatestVersion = "AG-591" - - GatewayCodeOkStr = "GW-200" - AccountCodeOkStr = "ACC-200" + AgentGetTicketFailed = "AG-616" + GatewayCodeOkStr = "GW-200" + AccountCodeOkStr = "ACC-200" ) type BaseRsp struct { diff --git a/biz/model/platform/baseUrl.go b/biz/model/platform/baseUrl.go new file mode 100644 index 0000000..cd048e8 --- /dev/null +++ b/biz/model/platform/baseUrl.go @@ -0,0 +1,52 @@ +package platform + +type PlatformUrl struct { + AppSSPlatformUrl string + AppPSPlatformUrl string + AppAppstoreAppApiUrl string + AppAppstoreAppSignUrl string +} + +var BaseUrlMap map[string]PlatformUrl + +func init() { + baseUrlMap := make(map[string]PlatformUrl) + baseUrlMap["CN"] = PlatformUrl{ + AppSSPlatformUrl: "https://ao.space", + AppPSPlatformUrl: "https://ao.space", + AppAppstoreAppApiUrl: "https://api.apps.ao.space", + AppAppstoreAppSignUrl: "https://auth.apps.ao.space", + } + baseUrlMap["SG"] = PlatformUrl{ + AppSSPlatformUrl: "https://aospace.sg", + AppPSPlatformUrl: "https://aospace.sg", + AppAppstoreAppApiUrl: "https://api.apps.aospace.sg", + AppAppstoreAppSignUrl: "https://auth.apps.aospace.sg", + } + baseUrlMap["dev"] = PlatformUrl{ + AppSSPlatformUrl: "https://dev.eulix.xyz", + AppPSPlatformUrl: "https://dev.eulix.xyz", + AppAppstoreAppApiUrl: "https://api.dev-apps.eulix.xyz", + AppAppstoreAppSignUrl: "https://auth.dev-apps.eulix.xyz", + } + baseUrlMap["dev2"] = PlatformUrl{ + AppSSPlatformUrl: "https://dev2.eulix.xyz", + AppPSPlatformUrl: "https://dev2.eulix.xyz", + AppAppstoreAppApiUrl: "https://api.dev2-apps.eulix.xyz", + AppAppstoreAppSignUrl: "https://auth.dev2-apps.eulix.xyz", + } + baseUrlMap["sit"] = PlatformUrl{ + AppSSPlatformUrl: "https://sit.eulix.xyz", + AppPSPlatformUrl: "https://sit.eulix.xyz", + AppAppstoreAppApiUrl: "https://api.sit-apps.eulix.xyz", + AppAppstoreAppSignUrl: "https://auth.sit-apps.eulix.xyz", + } + baseUrlMap["sit2"] = PlatformUrl{ + AppSSPlatformUrl: "https://sit2.eulix.xyz", + AppPSPlatformUrl: "https://sit2.eulix.xyz", + AppAppstoreAppApiUrl: "https://api.sit2-apps.eulix.xyz", + AppAppstoreAppSignUrl: "https://auth.sit2-apps.eulix.xyz", + } + + BaseUrlMap = baseUrlMap +} diff --git a/biz/service/bind/identify/ticket.go b/biz/service/bind/identify/ticket.go new file mode 100644 index 0000000..a79b5ab --- /dev/null +++ b/biz/service/bind/identify/ticket.go @@ -0,0 +1,87 @@ +package identify + +import ( + "agent/biz/model/device" + "agent/biz/model/dto" + "agent/biz/model/dto/bind/identify" + "agent/biz/service/base" + "agent/biz/service/pair" + "agent/config" + "agent/utils/logger" + utilshttp "agent/utils/network/http" + "github.com/dungeonsnd/gocom/encrypt/random" + "net/http" + "time" +) + +type TicketService struct { + base.BaseService +} + +func (svc *TicketService) Process() dto.BaseRspStr { + req := svc.Req.(*identify.TicketReq) + ticket, err := GetTempTicket(req.PlatformUrl) + if err != nil { + return dto.BaseRspStr{Code: dto.AgentGetTicketFailed, Message: err.Error()} + } + + svc.Rsp = ticket + + return svc.BaseService.Process() +} + +func GetTempTicket(platformUrl string) (*identify.TicketRsp, error) { + //先获取 box-reg-key + if boxRegKeyInfo, err := pair.GetDeviceRegKey("https://" + platformUrl); err != nil { + logger.AppLogger().Warnf("ServiceRegisterBox, failed GetBoxRegKey, err:%+v", err) + return nil, err + } else { + logger.AppLogger().Debugf("ServiceRegisterBox, succ GetBoxRegKey, boxRegKeyInfo:%+v", boxRegKeyInfo) + device.SetDeviceRegKey(boxRegKeyInfo.BoxRegKey, boxRegKeyInfo.ExpiresAt) + } + // 平台请求结构 + type registryStruct struct { + BoxUUID string `json:"boxUUID"` + } + // 平台响应结构 + type ticketRspStruct struct { + Ticket string `json:"ticket"` + ExpiresAt string `json:"expiresAt"` + } + + // 请求平台 + parms := ®istryStruct{BoxUUID: device.GetDeviceInfo().BoxUuid} + // url := config.Config.Platform.APIBase.Url + config.Config.Platform.RegistryBox.Path + url := "https://" + platformUrl + config.Config.Platform.GetChannelTicket.Path + logger.AppLogger().Debugf("ServiceGetChannelTempTicket, v2, url:%+v, parms:%+v", url, parms) + + var headers = map[string]string{"Request-Id": random.GenUUID(), "Box-Reg-Key": device.GetDeviceInfo().BoxRegKey} + var rsp identify.TicketRsp + + tryTotal := 3 + // var httpReq *http.Request + var httpRsp *http.Response + var body []byte + var err1 error + for i := 0; i < tryTotal; i++ { + _, httpRsp, body, err1 = utilshttp.PostJsonWithHeaders(url, parms, headers, &rsp) + if err1 != nil { + // logger.AppLogger().Warnf("Failed PostJson, err:%v, @@httpReq:%+v, @@httpRsp:%+v, @@body:%v", err1, httpReq, httpRsp, string(body)) + if i == tryTotal-1 { + return nil, err1 + } + time.Sleep(time.Second * 2) + continue + } else { + break + } + } + + logger.AppLogger().Infof("ServiceRegisterBox, parms:%+v", parms) + logger.AppLogger().Infof("ServiceRegisterBox, rsp:%+v", rsp) + // logger.AppLogger().Infof("ServiceRegisterBox, httpReq:%+v", httpReq) + logger.AppLogger().Infof("ServiceRegisterBox, httpRsp:%+v", httpRsp) + logger.AppLogger().Infof("ServiceRegisterBox, body:%v", string(body)) + + return &rsp, nil +} diff --git a/biz/service/bind/space/create/create.go b/biz/service/bind/space/create/create.go index f1210e5..88388e0 100644 --- a/biz/service/bind/space/create/create.go +++ b/biz/service/bind/space/create/create.go @@ -23,6 +23,7 @@ import ( "agent/biz/model/dto" "agent/biz/model/dto/bind/space/create" "agent/biz/model/gt" + "agent/biz/model/platform" "agent/biz/service/base" "agent/biz/service/call" "agent/biz/service/pair" @@ -32,6 +33,7 @@ import ( "agent/utils/retry" "encoding/base64" "fmt" + "strings" "time" ) @@ -63,15 +65,26 @@ func (svc *SpaceCreateService) Process() dto.BaseRspStr { logger.AppLogger().Debugf("SpaceCreateService, rebind:%+v", svc.PairedInfo.Rebind()) // 注册平台 - if req.EnableInternetAccess && !svc.PairedInfo.Rebind() { // 首次且开启互联网通道情况下。解绑后重新绑定时不改变互联网服务配置。 + if req.ChannelIdentified && req.EnableInternetAccess && !svc.PairedInfo.Rebind() { // 首次且开启互联网通道情况下。解绑后重新绑定时不改变互联网服务配置。 if req.PlatformApiBase != "" { + device.SetApiBaseUrl(req.PlatformApiBase) - //envFiles := make(map[string]map[string]string) - //gwEnvFile := make(map[string]string) - //gwEnvFile["APP_SSPLATFORM_URL"] = req.PlatformApiBase - //envFiles["aospace-gateway.env"] = gwEnvFile - //docker.ProcessEnv(config.Config.Docker.ComposeFile, envFiles) + envFiles := make(map[string]map[string]string) + gwEnvFile := make(map[string]string) + gwEnvFile["APP_SSPLATFORM_URL"] = req.PlatformApiBase + + for _, urls := range platform.BaseUrlMap { + if strings.Contains(urls.AppPSPlatformUrl, req.PlatformApiBase) { + gwEnvFile["APP_APPSTORE_APPAPI_URL"] = urls.AppAppstoreAppApiUrl + gwEnvFile["APP_APPSTORE_APPSIGN_URL"] = urls.AppAppstoreAppSignUrl + gwEnvFile["APP_PSPLATFORM_URL"] = req.PlatformApiBase + } + } + + envFiles["aospace-gateway.env"] = gwEnvFile + docker.ProcessEnv(config.Config.Docker.ComposeFile, envFiles) + } result, err := svc.registerDevice(req) @@ -169,23 +182,23 @@ func (svc *SpaceCreateService) callGateway(req *create.CreateReq) (call.MicroSer // 调用网关接口切换平台 - if req.PlatformApiBase != config.Config.Platform.APIBase.Url && req.PlatformApiBase != "" { - type ChangePlatformReq struct { - SSPlatformUrl string `json:"ssplatformUrl"` - } - changePlatformReq := &ChangePlatformReq{SSPlatformUrl: req.PlatformApiBase} - switchPlatformReq := func() error { - err := call.CallServiceByPost(config.Config.GateWay.SwitchPlatform.Url, nil, changePlatformReq, µServerRsp) - if err != nil { - return err - } - return nil - } - err := retry.Retry(switchPlatformReq, 3, time.Second*2) - if err != nil { - return microServerRsp, err - } - } + //if req.PlatformApiBase != config.Config.Platform.APIBase.Url && req.PlatformApiBase != "" { + // type ChangePlatformReq struct { + // SSPlatformUrl string `json:"ssplatformUrl"` + // } + // changePlatformReq := &ChangePlatformReq{SSPlatformUrl: req.PlatformApiBase} + // switchPlatformReq := func() error { + // err := call.CallServiceByPost(config.Config.GateWay.SwitchPlatform.Url, nil, changePlatformReq, µServerRsp) + // if err != nil { + // return err + // } + // return nil + // } + // err := retry.Retry(switchPlatformReq, 3, time.Second*2) + // if err != nil { + // return microServerRsp, err + // } + //} // 调用网关的 "/space/v2/api/space/admin" type CreateStruct struct { ClientUUID string `json:"clientUUID,omitempty"` diff --git a/biz/service/switch-platform/network_switch.go b/biz/service/switch-platform/network_switch.go index 089124b..5e34919 100644 --- a/biz/service/switch-platform/network_switch.go +++ b/biz/service/switch-platform/network_switch.go @@ -25,9 +25,11 @@ import ( "agent/biz/docker" "agent/biz/model/device" "agent/biz/model/gt" + "agent/biz/model/platform" "agent/biz/service/network" "agent/config" "agent/utils" + "strings" "agent/utils/logger" ) @@ -84,6 +86,13 @@ func networkSwitchV2(newSSP bool) error { gwEnvFile := make(map[string]string) gwEnvFile["APP_SSPLATFORM_URL"] = si.NewApiBaseUrl + for _, urls := range platform.BaseUrlMap { + if strings.EqualFold(urls.AppPSPlatformUrl, si.NewApiBaseUrl) { + gwEnvFile["APP_APPSTORE_APPAPI_URL"] = urls.AppAppstoreAppApiUrl + gwEnvFile["APP_APPSTORE_APPSIGN_URL"] = urls.AppAppstoreAppSignUrl + gwEnvFile["APP_PSPLATFORM_URL"] = si.NewApiBaseUrl + } + } envFiles["aospace-gateway.env"] = gwEnvFile err := gtConfig.Switch(remoteAPI, clientId, secret) if err != nil { diff --git a/biz/web/handler/bind/identify/channel.go b/biz/web/handler/bind/identify/channel.go new file mode 100644 index 0000000..77d3800 --- /dev/null +++ b/biz/web/handler/bind/identify/channel.go @@ -0,0 +1,33 @@ +package identify + +import ( + "agent/biz/model/dto/bind/identify" + identifySvc "agent/biz/service/bind/identify" + "agent/config" + "agent/utils/logger" + "github.com/gin-gonic/gin" + "net/http" +) + +// GetTicket godoc +// @Summary 获取临时ticket [客户端蓝牙/局域网调用/网关call调用] +// @Description 实名认证,client获取临时ticket +// @ID GetTicket +// @Tags Pair +// @Accept plain +// @Produce json +// @Param ticketReq body identify.TicketReq true "boxuuid" +// @Success 200 {object} dto.BaseRspStr{results=identify.TicketRsp} "code=AG-200 成功;" +// @Router /agent/v1/api/bind/identify/ticket [POST] +func GetTicket(c *gin.Context) { + logger.AppLogger().Debugf("%+v", c.Request) + + var req identify.TicketReq + svc := new(identifySvc.TicketService) + if c.Request.Host == config.Config.Web.DockerLocalListenAddr { + c.JSON(http.StatusOK, svc.InitGatewayService("", c.Request.Header, c).Enter(svc, &req)) + } else { + c.JSON(http.StatusOK, svc.InitLanService("", c.Request.Header, c).Enter(svc, &req)) + } + +} diff --git a/biz/web/routers/router.go b/biz/web/routers/router.go index dc39542..e1e6242 100644 --- a/biz/web/routers/router.go +++ b/biz/web/routers/router.go @@ -18,6 +18,7 @@ import ( "agent/biz/web/handler/bind/bindinit" "agent/biz/web/handler/bind/com/progress" "agent/biz/web/handler/bind/com/start" + "agent/biz/web/handler/bind/identify" internetserviceconfig "agent/biz/web/handler/bind/internet/service/config" "agent/biz/web/handler/bind/password" "agent/biz/web/handler/bind/revoke" @@ -99,6 +100,7 @@ func ExternalRouter() *gin.Engine { bind.GET("/internet/service/config", internetserviceconfig.GetConfig) bind.POST("/password/verify", password.Verify) bind.POST("/revoke", revoke.Revoke) + bind.POST("/identify/ticket", identify.GetTicket) } api.GET("/space/ready/check", space.ReadyCheck) @@ -185,6 +187,7 @@ func InternalRouter() *gin.Engine { { bindGroup.POST("/internet/service/config", internetserviceconfig.PostConfig) bindGroup.GET("/internet/service/config", internetserviceconfig.GetConfig) + bindGroup.POST("/identify/ticket", identify.GetTicket) } did := v1.Group("/did") diff --git a/config/config.go b/config/config.go index 6215991..4342af8 100644 --- a/config/config.go +++ b/config/config.go @@ -267,6 +267,12 @@ var Config = struct { Path string `default:"/v2/platform/boxes"` } + GetChannelTicket struct { + Path string `default:"/v2/platform/channel/ticket"` + } + GetDomainTicket struct { + Path string `default:"/v2/platform/channel/user/ticket"` + } PresetBoxInfo struct { Path string `default:"/v2/service/trail/boxinfos"` } diff --git a/docs/docs.go b/docs/docs.go index 152cefa..a8dbafd 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,4 +1,4 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag package docs @@ -218,6 +218,53 @@ const docTemplate = `{ } } }, + "/agent/v1/api/bind/identify/ticket": { + "post": { + "description": "实名认证,client获取临时ticket", + "consumes": [ + "text/plain" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pair" + ], + "summary": "获取临时ticket [客户端蓝牙/局域网调用/网关call调用]", + "operationId": "GetTicket", + "parameters": [ + { + "description": "boxuuid", + "name": "ticketReq", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/identify.TicketReq" + } + } + ], + "responses": { + "200": { + "description": "code=AG-200 成功;", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/dto.BaseRspStr" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/identify.TicketRsp" + } + } + } + ] + } + } + } + } + }, "/agent/v1/api/bind/init": { "get": { "description": "get aospace server base info.", @@ -1819,6 +1866,10 @@ const docTemplate = `{ "verificationMethod" ], "properties": { + "channelIdentified": { + "description": "通道是否认证", + "type": "boolean" + }, "clientPhoneModel": { "description": "客户端手机型号.", "type": "string" @@ -2197,6 +2248,31 @@ const docTemplate = `{ } } }, + "identify.TicketReq": { + "type": "object", + "properties": { + "boxUuid": { + "type": "string" + }, + "platformUrl": { + "description": "平台的url", + "type": "string" + } + } + }, + "identify.TicketRsp": { + "type": "object", + "properties": { + "expiresAt": { + "description": "过期时间,秒时间戳", + "type": "string" + }, + "ticket": { + "description": "临时ticket用于通道实名认证,web携带后可以临时访问平台", + "type": "string" + } + } + }, "method.UpdateDocumentMethodReq": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 1157c7b..1720217 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -206,6 +206,53 @@ } } }, + "/agent/v1/api/bind/identify/ticket": { + "post": { + "description": "实名认证,client获取临时ticket", + "consumes": [ + "text/plain" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pair" + ], + "summary": "获取临时ticket [客户端蓝牙/局域网调用/网关call调用]", + "operationId": "GetTicket", + "parameters": [ + { + "description": "boxuuid", + "name": "ticketReq", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/identify.TicketReq" + } + } + ], + "responses": { + "200": { + "description": "code=AG-200 成功;", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/dto.BaseRspStr" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/identify.TicketRsp" + } + } + } + ] + } + } + } + } + }, "/agent/v1/api/bind/init": { "get": { "description": "get aospace server base info.", @@ -1807,6 +1854,10 @@ "verificationMethod" ], "properties": { + "channelIdentified": { + "description": "通道是否认证", + "type": "boolean" + }, "clientPhoneModel": { "description": "客户端手机型号.", "type": "string" @@ -2185,6 +2236,31 @@ } } }, + "identify.TicketReq": { + "type": "object", + "properties": { + "boxUuid": { + "type": "string" + }, + "platformUrl": { + "description": "平台的url", + "type": "string" + } + } + }, + "identify.TicketRsp": { + "type": "object", + "properties": { + "expiresAt": { + "description": "过期时间,秒时间戳", + "type": "string" + }, + "ticket": { + "description": "临时ticket用于通道实名认证,web携带后可以临时访问平台", + "type": "string" + } + } + }, "method.UpdateDocumentMethodReq": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 01b3e8c..d2872df 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -65,6 +65,9 @@ definitions: type: object create.CreateReq: properties: + channelIdentified: + description: 通道是否认证 + type: boolean clientPhoneModel: description: 客户端手机型号. type: string @@ -336,6 +339,23 @@ definitions: description: 请求体 type: string type: object + identify.TicketReq: + properties: + boxUuid: + type: string + platformUrl: + description: 平台的url + type: string + type: object + identify.TicketRsp: + properties: + expiresAt: + description: 过期时间,秒时间戳 + type: string + ticket: + description: 临时ticket用于通道实名认证,web携带后可以临时访问平台 + type: string + type: object method.UpdateDocumentMethodReq: properties: aoId: @@ -947,6 +967,34 @@ paths: summary: run docker containers [for client bluetooth/LAN] tags: - Pair + /agent/v1/api/bind/identify/ticket: + post: + consumes: + - text/plain + description: 实名认证,client获取临时ticket + operationId: GetTicket + parameters: + - description: boxuuid + in: body + name: ticketReq + required: true + schema: + $ref: '#/definitions/identify.TicketReq' + produces: + - application/json + responses: + "200": + description: code=AG-200 成功; + schema: + allOf: + - $ref: '#/definitions/dto.BaseRspStr' + - properties: + results: + $ref: '#/definitions/identify.TicketRsp' + type: object + summary: 获取临时ticket [客户端蓝牙/局域网调用/网关call调用] + tags: + - Pair /agent/v1/api/bind/init: get: consumes: From 89daeb56cd6fbc2ab452b2d0444d985e00085b13 Mon Sep 17 00:00:00 2001 From: xuyang Date: Tue, 2 Apr 2024 08:46:25 +0800 Subject: [PATCH 2/3] fix description --- biz/web/handler/bind/identify/channel.go | 2 +- docs/docs.go | 2 +- docs/swagger.json | 2 +- docs/swagger.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/biz/web/handler/bind/identify/channel.go b/biz/web/handler/bind/identify/channel.go index 77d3800..f479ede 100644 --- a/biz/web/handler/bind/identify/channel.go +++ b/biz/web/handler/bind/identify/channel.go @@ -11,7 +11,7 @@ import ( // GetTicket godoc // @Summary 获取临时ticket [客户端蓝牙/局域网调用/网关call调用] -// @Description 实名认证,client获取临时ticket +// @Description 通道认证,client获取临时ticket // @ID GetTicket // @Tags Pair // @Accept plain diff --git a/docs/docs.go b/docs/docs.go index a8dbafd..51f3b71 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -220,7 +220,7 @@ const docTemplate = `{ }, "/agent/v1/api/bind/identify/ticket": { "post": { - "description": "实名认证,client获取临时ticket", + "description": "通道认证,client获取临时ticket", "consumes": [ "text/plain" ], diff --git a/docs/swagger.json b/docs/swagger.json index 1720217..48da988 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -208,7 +208,7 @@ }, "/agent/v1/api/bind/identify/ticket": { "post": { - "description": "实名认证,client获取临时ticket", + "description": "通道认证,client获取临时ticket", "consumes": [ "text/plain" ], diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d2872df..955e841 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -971,7 +971,7 @@ paths: post: consumes: - text/plain - description: 实名认证,client获取临时ticket + description: 通道认证,client获取临时ticket operationId: GetTicket parameters: - description: boxuuid From 04a26da431618148b9237f829e6a1f48625a1f47 Mon Sep 17 00:00:00 2001 From: xuyang Date: Tue, 2 Apr 2024 08:47:49 +0800 Subject: [PATCH 3/3] fix description --- biz/model/dto/bind/identify/ticket.go | 2 +- docs/docs.go | 2 +- docs/swagger.json | 2 +- docs/swagger.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/biz/model/dto/bind/identify/ticket.go b/biz/model/dto/bind/identify/ticket.go index 6fc44f1..a1f1428 100644 --- a/biz/model/dto/bind/identify/ticket.go +++ b/biz/model/dto/bind/identify/ticket.go @@ -1,7 +1,7 @@ package identify type TicketRsp struct { - Ticket string `json:"ticket"` // 临时ticket用于通道实名认证,web携带后可以临时访问平台 + Ticket string `json:"ticket"` // 临时ticket用于通道认证,web携带后可以临时访问平台 ExpiresAt string `json:"expiresAt"` // 过期时间,秒时间戳 } diff --git a/docs/docs.go b/docs/docs.go index 51f3b71..e4e6047 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2268,7 +2268,7 @@ const docTemplate = `{ "type": "string" }, "ticket": { - "description": "临时ticket用于通道实名认证,web携带后可以临时访问平台", + "description": "临时ticket用于通道认证,web携带后可以临时访问平台", "type": "string" } } diff --git a/docs/swagger.json b/docs/swagger.json index 48da988..2362f38 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2256,7 +2256,7 @@ "type": "string" }, "ticket": { - "description": "临时ticket用于通道实名认证,web携带后可以临时访问平台", + "description": "临时ticket用于通道认证,web携带后可以临时访问平台", "type": "string" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 955e841..bc5baec 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -353,7 +353,7 @@ definitions: description: 过期时间,秒时间戳 type: string ticket: - description: 临时ticket用于通道实名认证,web携带后可以临时访问平台 + description: 临时ticket用于通道认证,web携带后可以临时访问平台 type: string type: object method.UpdateDocumentMethodReq: