修改GetUserPhoto API请求的参数

This commit is contained in:
2018-12-17 11:31:12 +08:00
parent 98bed05764
commit a7440380c8
3 changed files with 53 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
##set starUML design file to binary ##set starUML design file to binary
*.mdj binary *.mdj binary
############################################################################### ###############################################################################
# Set default behavior to automatically normalize line endings. # Set default behavior to automatically normalize line endings.
+44 -10
View File
@@ -9101,10 +9101,10 @@
}, },
"font": "Arial;13;0", "font": "Arial;13;0",
"left": 1268, "left": 1268,
"top": 481, "top": 505,
"width": 393, "width": 393,
"height": 25, "height": 25,
"text": "Error错误文本,成功为空;" "text": "Error保留,总是为空;"
}, },
{ {
"_type": "UMLNoteView", "_type": "UMLNoteView",
@@ -9144,6 +9144,32 @@
"width": 393, "width": 393,
"height": 25, "height": 25,
"text": "NeedResullt,当此字段不为0时要求服务器返回处理结果" "text": "NeedResullt,当此字段不为0时要求服务器返回处理结果"
},
{
"_type": "UMLNoteView",
"_id": "AAAAAAFnui/PRD4Nkb0=",
"_parent": {
"$ref": "AAAAAAFnCJD5xebaqTo="
},
"font": "Arial;13;0",
"left": 1268,
"top": 376,
"width": 393,
"height": 25,
"text": "User,要获取头像的用户名"
},
{
"_type": "UMLNoteView",
"_id": "AAAAAAFnujFC6j4ew94=",
"_parent": {
"$ref": "AAAAAAFnCJD5xebaqTo="
},
"font": "Arial;13;0",
"left": 1268,
"top": 480,
"width": 393,
"height": 25,
"text": "Length,头像数据长度,为0则头像数据无效;"
} }
] ]
}, },
@@ -10236,7 +10262,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnPanic" "name": "event OnPanic",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10244,7 +10271,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnOffline" "name": "event OnOffline",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10252,7 +10280,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnMessage" "name": "event OnMessage",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10260,7 +10289,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnSendMessageDone" "name": "event OnSendMessageDone",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10268,7 +10298,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnUpdateUserInfoDone" "name": "event OnUpdateUserInfoDone",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10285,7 +10316,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnGetUserListDone" "name": "event OnGetUserListDone",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10293,7 +10325,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp7WMX/VycEU=" "$ref": "AAAAAAFnp7WMX/VycEU="
}, },
"name": "event OnGetUserPhotoDoneHandler" "name": "event OnGetUserPhotoDoneHandler",
"type": ""
}, },
{ {
"_type": "UMLAttribute", "_type": "UMLAttribute",
@@ -10386,7 +10419,8 @@
"_parent": { "_parent": {
"$ref": "AAAAAAFnp8DShvXnMlE=" "$ref": "AAAAAAFnp8DShvXnMlE="
}, },
"name": "callback" "name": "callback",
"type": ""
} }
] ]
}, },
+8 -1
View File
@@ -256,8 +256,15 @@ func (session *Session) GetUserPhotoHandler(headInfo map[string]string) {
head := make(map[string]string) head := make(map[string]string)
head[keyname_token] = headInfo[keyname_token] head[keyname_token] = headInfo[keyname_token]
head[keyname_operation] = headInfo[keyname_operation] head[keyname_operation] = headInfo[keyname_operation]
head["Length"] = "0"
head["Error"] = "" head["Error"] = ""
photo := GetUserPhoto(session.sender.User) var photo []byte
if username, ok := headInfo["User"]; ok {
photo = GetUserPhoto(username)
} else {
photo = GetUserPhoto(session.sender.User)
}
head["Length"] = string(len(photo))
session.SendData(head, photo) session.SendData(head, photo)
} }