mirror of https://github.com/sunface/rust-course
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
400 B
21 lines
400 B
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/imdotdev/im.dev/server/internal/session"
|
|
"github.com/imdotdev/im.dev/server/pkg/common"
|
|
)
|
|
|
|
func GetUsers(c *gin.Context) {
|
|
query := c.Query("query")
|
|
users, err := session.GetUsers(query)
|
|
if err != nil {
|
|
c.JSON(err.Status, common.RespError(err.Message))
|
|
return
|
|
}
|
|
|
|
c.JSON(http.StatusOK, common.RespSuccess(users))
|
|
}
|