fix tags mapping

This commit is contained in:
xushuhui 2022-04-20 18:20:29 +08:00
parent 454319b8d4
commit 1658b02926
2 changed files with 3 additions and 3 deletions

View File

@ -9,8 +9,8 @@ type User struct {
Name string `json:"name" elastic_mapping:"name:{type:keyword}"`
Phone string `json:"phone" elastic_mapping:"phone:{type:keyword}"`
Email string `json:"email" elastic_mapping:"email:{type:keyword}"`
Roles []UserRole `json:"roles" elastic_mapping:"roles:{type:text}"`
Tags []string `json:"tags" elastic_mapping:"tags:{type:text}"`
Roles []UserRole `json:"roles"`
Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:text}"`
}
type UserRole struct {
Id string `json:"id" elastic_mapping:"id:{type:keyword}"`

View File

@ -150,7 +150,7 @@ func (h Rbac) SearchUser(w http.ResponseWriter, r *http.Request, ps httprouter.P
return
}
h.WriteOKJSON(w, core.Response{Hit: res.Result, Total: res.Total})
h.WriteOKJSON(w, res)
return
}