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"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="19c8c37d-a056-451c-a29d-fb612b9a3e2f" name="Default Changelist" comment=""> <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$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/ImRelate/ImRelateController/ImRelateController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/ImRelate/ImRelateController/ImRelateController.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$/Business/ImRelate/ImRelateDao/ImRelateDao.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/ImRelate/ImRelateDao/ImRelateDao.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -101,4 +101,15 @@
</map> </map>
</environment> </environment>
</component> </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> </project>

@ -7,12 +7,14 @@ import (
"encoding/json" "encoding/json"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"net/http" "net/http"
"strings"
) )
//模块的路由配置 //模块的路由配置
func Routers(r *gin.RouterGroup) { func Routers(r *gin.RouterGroup) {
rr := r.Group("/imRelate") rr := r.Group("/imRelate")
rr.POST("/saveChatRecord", saveChatRecord) rr.POST("/saveChatRecord", saveChatRecord)
rr.POST("/GetPersonAvatar", GetPersonAvatar)
} }
/** /**
@ -35,7 +37,7 @@ func saveChatRecord(c *gin.Context) {
objectName := c.PostForm("objectName") objectName := c.PostForm("objectName")
if objectName == "RC:TxtMsg" { if objectName == "RC:TxtMsg" {
//内容。 //文本消息内容。
content := c.PostForm("content") content := c.PostForm("content")
crs = ImRelateDao.ChatRecordStruct{ crs = ImRelateDao.ChatRecordStruct{
SenderUserId: fromId, SenderUserId: fromId,
@ -52,7 +54,7 @@ func saveChatRecord(c *gin.Context) {
} else if objectName == "RC:ImgMsg" { } else if objectName == "RC:ImgMsg" {
//图片base64。 //图片base64。
imgBase64 := c.PostForm("imgBase64") imgBase64 := c.PostForm("imgBase64")
//imgUrl //图片Url
imgUrl := c.PostForm("imgUrl") imgUrl := c.PostForm("imgUrl")
//文件名 //文件名
fileName := c.PostForm("fileName") fileName := c.PostForm("fileName")
@ -136,3 +138,22 @@ func saveChatRecord(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"success": true, "info": "发送消息成功!"}) 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 { if resErr != nil {
return avatar return avatar
} }
if res == nil {
return avatar
}
jsonObj, jsonObjErr := CommonUtil.JsonStringToMap(fmt.Sprintf("%v", res)) jsonObj, jsonObjErr := CommonUtil.JsonStringToMap(fmt.Sprintf("%v", res))
if jsonObjErr != nil { if jsonObjErr != nil {
return avatar return avatar

Loading…
Cancel
Save