feat(api): 新增 AES 加密参数接口

- 在 restriction 接口新增 GetAESEncryptionParams 方法
- 从 validation 接口移除 GetAESEncryptionParams 方法
- 删除验证控制器中的 AES 加密参数实现逻辑
This commit is contained in:
danial
2025-11-13 16:31:32 +08:00
parent 3ca7e78053
commit d1b602792e
4 changed files with 1 additions and 26 deletions

View File

@@ -11,6 +11,7 @@ import (
)
type IRestrictionV1 interface {
GetAESEncryptionParams(ctx context.Context, req *v1.GetAESEncryptionParamsReq) (res *v1.GetAESEncryptionParamsRes, err error)
UserInfoCollection(ctx context.Context, req *v1.UserInfoCollectionReq) (res *v1.UserInfoCollectionRes, err error)
BlockOrder(ctx context.Context, req *v1.BlockOrderReq) (res *v1.BlockOrderRes, err error)
QueryAllProvince(ctx context.Context, req *v1.QueryAllProvinceReq) (res *v1.QueryAllProvinceRes, err error)

View File

@@ -11,6 +11,5 @@ import (
)
type IValidationV1 interface {
GetAESEncryptionParams(ctx context.Context, req *v1.GetAESEncryptionParamsReq) (res *v1.GetAESEncryptionParamsRes, err error)
GetCaptcha(ctx context.Context, req *v1.GetCaptchaReq) (res *v1.GetCaptchaRes, err error)
}

View File

@@ -1,25 +0,0 @@
package validation
import (
"context"
"github.com/gogf/gf/v2/errors/gcode"
v1 "kami/api/validation/v1"
"kami/internal/errHandler"
"kami/internal/service"
)
func (c *ControllerV1) GetAESEncryptionParams(ctx context.Context, req *v1.GetAESEncryptionParamsReq) (res *v1.GetAESEncryptionParamsRes, err error) {
params, err := service.SysConfigDict().GetAESKey(ctx)
if err != nil {
err = errHandler.WrapError(ctx, gcode.CodeInternalError, err, "获取 AES 加密参数失败")
return
}
res = &v1.GetAESEncryptionParamsRes{
Key: params.Key,
IV: params.IV,
}
return
}