update
continuous-integration/drone/push Build is passing Details

master
kgdxpr 4 years ago
parent 599a7ad0d4
commit 417c13d49e

@ -2,9 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="19c8c37d-a056-451c-a29d-fb612b9a3e2f" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/../.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../dsSso/Controller/ControllerOauth2/ControllerOauth2.go" beforeDir="false" afterPath="$PROJECT_DIR$/../dsSso/Controller/ControllerOauth2/ControllerOauth2.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/FileRelate/FileRelateController/FileReleateController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileRelate/FileRelateController/FileReleateController.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/ImRelate/ImRelateController/ImRelateController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/ImRelate/ImRelateController/ImRelateController.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/ImRelate/ImRelateDao/ImRelateDao.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/ImRelate/ImRelateDao/ImRelateDao.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -101,4 +101,15 @@
</map>
</environment>
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/Business/ImRelate/ImRelateController/ImRelateController.go</url>
<line>147</line>
<option name="timeStamp" value="5" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

@ -7,12 +7,14 @@ import (
"encoding/json"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)
//模块的路由配置
func Routers(r *gin.RouterGroup) {
rr := r.Group("/imRelate")
rr.POST("/saveChatRecord", saveChatRecord)
rr.POST("/GetPersonAvatar", GetPersonAvatar)
}
/**
@ -35,7 +37,7 @@ func saveChatRecord(c *gin.Context) {
objectName := c.PostForm("objectName")
if objectName == "RC:TxtMsg" {
//内容。
//文本消息内容。
content := c.PostForm("content")
crs = ImRelateDao.ChatRecordStruct{
SenderUserId: fromId,
@ -52,7 +54,7 @@ func saveChatRecord(c *gin.Context) {
} else if objectName == "RC:ImgMsg" {
//图片base64。
imgBase64 := c.PostForm("imgBase64")
//imgUrl
//图片Url
imgUrl := c.PostForm("imgUrl")
//文件名
fileName := c.PostForm("fileName")
@ -136,3 +138,22 @@ func saveChatRecord(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"success": true, "info": "发送消息成功!"})
}
/**
2021-08-23
*/
func GetPersonAvatar(c *gin.Context) {
personAvatar := make([]map[string]string, 0)
personIds := c.PostForm("personIds")
personId := strings.Split(personIds, ",")
for _, val := range personId {
id := val + "_5"
avatar := ImRelateDao.GetPersonAvatarByUserId(id)
myMap := map[string]string{val: avatar}
personAvatar = append(personAvatar, myMap)
}
josnByte, _ := json.Marshal(personAvatar)
c.JSON(http.StatusOK, gin.H{"success": true, "list": CommonUtil.ConvertJsonStringToMapArray(string(josnByte))})
}

@ -51,6 +51,9 @@ func GetPersonAvatar(personId string, identityId string, w string, h string) str
if resErr != nil {
return avatar
}
if res == nil {
return avatar
}
jsonObj, jsonObjErr := CommonUtil.JsonStringToMap(fmt.Sprintf("%v", res))
if jsonObjErr != nil {
return avatar

Loading…
Cancel
Save