更新
This commit is contained in:
parent
b9c611f235
commit
747adc64ca
23
model/gmodel/a_test.go
Normal file
23
model/gmodel/a_test.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package gmodel
|
||||
|
||||
import (
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
func TestCase1(t *testing.T) {
|
||||
v := `{"base": {"mobile": "18588505404", "company": "fusen", "last_name": "sm", "first_name": "h", "resetaurant": "boy"}, "sub_status": {"notification_email": {"newseleter": false, "order_update": false}, "notification_phone": {"newseleter": true, "order_update": false}}, "logo_selected": {"logo_url": "https://fusenstorage.s3.us-east-2.amazonaws.com/d163cba052dc03e7684a4fa8574a17c629e08b6cd0f47f9c239866949365f807", "logo_selected_id": 5018, "merchant_category": 10, "template_tag_selected": {"color": [["#25211F"], ["#1E1916"]], "version": "2", "template_tag": "C6", "selected_index": 0}}}`
|
||||
|
||||
// log.Println(userId, guestId, v)
|
||||
if logoSelected := gjson.Get(v, "logo_selected"); logoSelected.Exists() {
|
||||
log.Println(logoSelected)
|
||||
log.Println(logoSelected.Get("version"))
|
||||
if ver := logoSelected.Get("version"); ver.Exists() && ver.String() == versionML {
|
||||
log.Println(ver)
|
||||
}
|
||||
}
|
||||
|
||||
// gjson.Get(content, "logo_selected")
|
||||
}
|
|
@ -115,10 +115,8 @@ func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId in
|
|||
return m.getDefaultProfile(ctx, tname)
|
||||
}
|
||||
|
||||
log.Println(userId, guestId, v)
|
||||
if logoSelected := gjson.Get(v, "logo_selected"); logoSelected.Exists() {
|
||||
log.Println(userId, guestId, logoSelected)
|
||||
if ver := logoSelected.Get("version"); ver.Exists() && ver.String() == versionML {
|
||||
if ver := logoSelected.Get("template_tag_selected.version"); ver.Exists() && ver.String() == versionML {
|
||||
log.Println(ver)
|
||||
return info, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user