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.
27 lines
479 B
27 lines
479 B
package addr
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"recook/internal/back"
|
|
"recook/internal/dbc"
|
|
"recook/internal/model/user"
|
|
"recook/tools"
|
|
)
|
|
|
|
type queryListParam struct {
|
|
UserID uint `json:"userID" validate:"required"`
|
|
}
|
|
|
|
func QueryList(c *gin.Context) {
|
|
var p queryListParam
|
|
err := tools.ParseParams(&p, c)
|
|
if err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
|
|
var list []user.Addr
|
|
dbc.DB.Find(&list, "user_id = ?", p.UserID)
|
|
back.Suc(c, "操作成功", &list)
|
|
}
|