23 lines
424 B
Go
23 lines
424 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"strconv"
|
|
|
|
"0451meishiditu/backend/internal/models"
|
|
"0451meishiditu/backend/internal/resp"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func (h *Handlers) AdminUserGet(c *gin.Context) {
|
|
id64, _ := strconv.ParseUint(c.Param("id"), 10, 64)
|
|
var u models.User
|
|
if err := h.db.First(&u, uint(id64)).Error; err != nil {
|
|
resp.Fail(c, http.StatusNotFound, "not found")
|
|
return
|
|
}
|
|
resp.OK(c, u)
|
|
}
|
|
|