fix:合图调整
This commit is contained in:
parent
eb2012c5d1
commit
1b5e9623a0
@ -92,7 +92,10 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
|||||||
hashKeyData.GuestId = 0
|
hashKeyData.GuestId = 0
|
||||||
hashKeyData.UserId = 0
|
hashKeyData.UserId = 0
|
||||||
hashKeyData.LogoUrl = *userMaterialInfo.ResourceUrl
|
hashKeyData.LogoUrl = *userMaterialInfo.ResourceUrl
|
||||||
var resourceId string = hash.JsonHashKey(hashKeyData)
|
var hashKeyDataMap map[string]interface{}
|
||||||
|
hashKeyDataB, _ := json.Marshal(hashKeyData)
|
||||||
|
json.Unmarshal(hashKeyDataB, &hashKeyDataMap)
|
||||||
|
var resourceId string = hash.JsonHashKey(hashKeyDataMap)
|
||||||
|
|
||||||
fmt.Println("hashKeyData:", hashKeyData)
|
fmt.Println("hashKeyData:", hashKeyData)
|
||||||
|
|
||||||
|
@ -5,13 +5,12 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
|
||||||
"sort"
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
func JsonHashKey(v interface{}) string {
|
func JsonHashKey(v interface{}) string {
|
||||||
|
|
||||||
if reflect.TypeOf(v).Kind() == reflect.String {
|
if _, ok := v.(string); ok {
|
||||||
var obj interface{}
|
var obj interface{}
|
||||||
err := json.Unmarshal([]byte(v.(string)), &obj)
|
err := json.Unmarshal([]byte(v.(string)), &obj)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user