From 8d8d426e2e1e54f17a12708f90f9eec1f77faf6e Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 11 Apr 2026 17:22:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20verify-asset=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=BD=93=E5=89=8D=E7=94=9F=E6=95=88=E7=9A=84?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E5=92=8C=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=20AppID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/admin-openapi.yaml | 35 ++++++++++++++++--------- internal/model/dto/client_auth_dto.go | 6 +++-- internal/service/client_auth/service.go | 11 ++++++-- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/docs/admin-openapi.yaml b/docs/admin-openapi.yaml index 0aa24d3..23e86fc 100644 --- a/docs/admin-openapi.yaml +++ b/docs/admin-openapi.yaml @@ -3170,6 +3170,9 @@ components: carrier_name: description: 运营商名称 type: string + carrier_type: + description: 运营商类型(CMCC/CUCC/CTCC/CBN) + type: string iccid: description: 物联网卡ICCID type: string @@ -5083,7 +5086,7 @@ components: description: 上架状态 (1:上架, 2:下架) type: integer status: - description: 状态 (1:启用, 2:禁用) + description: 状态 (0:禁用, 1:启用) type: integer suggested_retail_price: description: 建议售价(分) @@ -5142,7 +5145,7 @@ components: description: 系列名称 type: string status: - description: 状态 (1:启用, 2:禁用) + description: 状态 (0:禁用, 1:启用) type: integer updated_at: description: 更新时间 @@ -6432,7 +6435,7 @@ components: description: 被授权店铺名称 type: string status: - description: 状态 1-启用 2-禁用 + description: 状态 0=禁用 1=启用 type: integer type: object DtoShopSeriesGrantPackageItem: @@ -6454,7 +6457,7 @@ components: description: 上架状态 1-上架 2-下架 type: integer status: - description: 分配状态 1-启用 2-禁用 + description: 分配状态 0=禁用 1=启用 type: integer type: object DtoShopSeriesGrantPageResult: @@ -6536,7 +6539,7 @@ components: description: 被授权店铺名称 type: string status: - description: 状态 1-启用 2-禁用 + description: 状态 0=禁用 1=启用 type: integer updated_at: description: 更新时间 @@ -7111,7 +7114,7 @@ components: DtoUpdatePackageSeriesStatusParams: properties: status: - description: 状态 (1:启用, 2:禁用) + description: 状态 (0:禁用, 1:启用) type: integer required: - status @@ -7127,7 +7130,7 @@ components: DtoUpdatePackageStatusParams: properties: status: - description: 状态 (1:启用, 2:禁用) + description: 状态 (0:禁用, 1:启用) type: integer required: - status @@ -7546,6 +7549,12 @@ components: expires_in: description: 过期时间(秒) type: integer + miniapp_app_id: + description: 当前生效的小程序 AppID + type: string + oa_app_id: + description: 当前生效的公众号 AppID + type: string type: object DtoWalletDetailResponse: properties: @@ -15220,11 +15229,11 @@ paths: maxLength: 255 nullable: true type: string - - description: 状态 (1:启用, 2:禁用) + - description: 状态 (0:禁用, 1:启用) in: query name: status schema: - description: 状态 (1:启用, 2:禁用) + description: 状态 (0:禁用, 1:启用) nullable: true type: integer - description: 是否启用一次性佣金 @@ -15677,11 +15686,11 @@ paths: minimum: 0 nullable: true type: integer - - description: 状态 (1:启用, 2:禁用) + - description: 状态 (0:禁用, 1:启用) in: query name: status schema: - description: 状态 (1:启用, 2:禁用) + description: 状态 (0:禁用, 1:启用) nullable: true type: integer - description: 上架状态 (1:上架, 2:下架) @@ -19308,11 +19317,11 @@ paths: minimum: 0 nullable: true type: integer - - description: 过滤状态 1-启用 2-禁用 + - description: 过滤状态 0=禁用 1=启用 in: query name: status schema: - description: 过滤状态 1-启用 2-禁用 + description: 过滤状态 0=禁用 1=启用 nullable: true type: integer responses: diff --git a/internal/model/dto/client_auth_dto.go b/internal/model/dto/client_auth_dto.go index 75ca39c..3f3e98a 100644 --- a/internal/model/dto/client_auth_dto.go +++ b/internal/model/dto/client_auth_dto.go @@ -11,8 +11,10 @@ type VerifyAssetRequest struct { // VerifyAssetResponse A1 资产验证响应 type VerifyAssetResponse struct { - AssetToken string `json:"asset_token" description:"资产令牌(5分钟有效)"` - ExpiresIn int `json:"expires_in" description:"过期时间(秒)"` + AssetToken string `json:"asset_token" description:"资产令牌(5分钟有效)"` + ExpiresIn int `json:"expires_in" description:"过期时间(秒)"` + OaAppID string `json:"oa_app_id" description:"当前生效的公众号 AppID"` + MiniappAppID string `json:"miniapp_app_id" description:"当前生效的小程序 AppID"` } // ======================================== diff --git a/internal/service/client_auth/service.go b/internal/service/client_auth/service.go index d4ef74f..39495af 100644 --- a/internal/service/client_auth/service.go +++ b/internal/service/client_auth/service.go @@ -112,10 +112,17 @@ func (s *Service) VerifyAsset(ctx context.Context, req *dto.VerifyAssetRequest, return nil, errors.Wrap(errors.CodeInternalError, err, "签发资产令牌失败") } - return &dto.VerifyAssetResponse{ + resp := &dto.VerifyAssetResponse{ AssetToken: assetToken, ExpiresIn: assetTokenExpireSeconds, - }, nil + } + + if wechatConfig, err := s.wechatConfigService.GetActiveConfig(ctx); err == nil && wechatConfig != nil { + resp.OaAppID = wechatConfig.OaAppID + resp.MiniappAppID = wechatConfig.MiniappAppID + } + + return resp, nil } // WechatLogin A2 公众号登录