This commit is contained in:
2025-11-10 15:48:46 +08:00
parent b82457fd50
commit eca559f6cd
3 changed files with 11 additions and 11 deletions

View File

@@ -3,13 +3,13 @@ package service
import (
"bytes"
"context"
"tydata-server/app/main/api/internal/config"
"tydata-server/app/main/model"
"database/sql"
"fmt"
"os"
"path/filepath"
"time"
"tydata-server/app/main/api/internal/config"
"tydata-server/app/main/model"
"github.com/jung-kurt/gofpdf"
"github.com/pkg/errors"
@@ -163,10 +163,10 @@ func (s *AuthorizationService) generatePDFContent(userInfo map[string]interface{
// 构建授权书内容(去掉标题部分)
content := fmt.Sprintf(`海南天远大数据科技有限公司:
本人%s拟向贵司申请大数据分析报告查询业务贵司需要了解本人相关状况用于查询大数据分析报告因此本人同意向贵司提供本人的姓名和手机号等个人信息并同意贵司向第三方(包括但不限于西部数据交易有限公司)传送上述信息。第三方将使用上述信息核实信息真实情况,查询信用记录,并生成报告。
本人%s拟向贵司申请大数据分析报告查询业务贵司需要了解本人相关状况用于查询大数据分析报告因此本人同意向贵司提供本人的姓名和手机号等个人信息并同意贵司向第三方传送上述信息。第三方将使用上述信息核实信息真实情况查询信用记录并生成报告。
授权内容如下:
贵司向依法成立的第三方服务商(包括但不限于西部数据交易有限公司)根据本人提交的信息进行核实,并有权通过前述第三方服务机构查询、使用本人的身份信息、设备信息、运营商信息等,查询本人信息(包括但不限于学历、婚姻、资产状况及对信息主体产生负面影响的不良信息),出具相关报告。
贵司向依法成立的第三方服务商根据本人提交的信息进行核实,并有权通过前述第三方服务机构查询、使用本人的身份信息、设备信息、运营商信息等,查询本人信息(包括但不限于学历、婚姻、资产状况及对信息主体产生负面影响的不良信息),出具相关报告。
依法成立的第三方服务商查询或核实、搜集、保存、处理、共享、使用(含合法业务应用)本人相关数据,且不再另行告知本人,但法律、法规、监管政策禁止的除外。
本人授权有效期为自授权之日起 1个月。本授权为不可撤销授权但法律法规另有规定的除外。

View File

@@ -2,8 +2,6 @@ package service
import (
"context"
"tydata-server/app/main/api/internal/config"
"tydata-server/app/main/model"
"database/sql"
"errors"
"fmt"
@@ -12,6 +10,8 @@ import (
"strings"
"testing"
"time"
"tydata-server/app/main/api/internal/config"
"tydata-server/app/main/model"
"github.com/Masterminds/squirrel"
"github.com/stretchr/testify/assert"
@@ -393,9 +393,9 @@ func TestSavePDFToLocal(t *testing.T) {
// 准备测试数据
userInfo := map[string]interface{}{
"name": "何志勇",
"id_card": "452528197907133014",
"mobile": "18276151590",
"name": "张三",
"id_card": "110101199001011234",
"mobile": "13800138000",
}
// 生成PDF内容

View File

@@ -95,7 +95,7 @@ type Response struct {
Message string `json:"message"`
Success bool `json:"success"`
TransactionID string `json:"transaction_id"` // 流水号
Data map[string]interface{} `json:"data"` // 解密后的数据
Data interface{} `json:"data"` // 解密后的数据
Timeout int64 `json:"timeout"` // 请求耗时(毫秒)
Error string `json:"error,omitempty"`
}
@@ -243,7 +243,7 @@ func (c *Client) Call(req Request) (*Response, error) {
if apiResp.Data != "" {
decryptedData, err := c.decrypt(apiResp.Data)
if err == nil {
var decryptedMap map[string]interface{}
var decryptedMap interface{}
if json.Unmarshal([]byte(decryptedData), &decryptedMap) == nil {
response.Data = decryptedMap
}