uint ->int
This commit is contained in:
parent
d8fbc61280
commit
1493c66778
|
@ -6,12 +6,15 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserListRequest struct {
|
type UserListRequest struct {
|
||||||
Page int `json:"page" validate:"required" form:"page" example:"1"`
|
Page int `json:"page" validate:"required" form:"page" example:"1"`
|
||||||
Limit int `json:"limit" validate:"required" form:"limit" example:"10"`
|
Limit int `json:"limit" validate:"required" form:"limit" example:"10"`
|
||||||
Tel string `json:"tel" form:"tel" example:"155555555"`
|
Tel string `json:"tel" form:"tel" example:"155555555"`
|
||||||
Status int `json:"status" form:"status" example:"1"`
|
Status int `json:"status" form:"status" example:"1"`
|
||||||
Name string `json:"name" form:"name" example:"46516"`
|
Name string `json:"name" form:"name" example:"46516"`
|
||||||
UserIds []string `json:"user_ids"`
|
DtalkUserId string `json:"dtalk_user_id"`
|
||||||
|
DtalkDepId string `json:"dtalk_dep_id"`
|
||||||
|
WxOpenId string `json:"wx_open_id"`
|
||||||
|
UserIds []string `json:"user_ids"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserInfoRequest struct {
|
type UserInfoRequest struct {
|
||||||
|
|
|
@ -35,7 +35,7 @@ func RegisterAdminRoute(router *gin.Engine) {
|
||||||
user.POST("/list", backend.UserList)
|
user.POST("/list", backend.UserList)
|
||||||
user.POST("/add", backend.UserAdd)
|
user.POST("/add", backend.UserAdd)
|
||||||
user.POST("/edit", backend.UserEdit)
|
user.POST("/edit", backend.UserEdit)
|
||||||
user.POST("/del", backend.UserDel)
|
user.DELETE("/del", backend.UserDel)
|
||||||
}
|
}
|
||||||
//数据库管理
|
//数据库管理
|
||||||
sql := v1.Group("/sql")
|
sql := v1.Group("/sql")
|
||||||
|
|
|
@ -12,12 +12,24 @@ import (
|
||||||
func GetListByWhere(request *backend.UserListRequest, page int, limit int) (count int64, UserListInfo []cronusermodel.CronUser, err error) {
|
func GetListByWhere(request *backend.UserListRequest, page int, limit int) (count int64, UserListInfo []cronusermodel.CronUser, err error) {
|
||||||
cond := builder.NewCond()
|
cond := builder.NewCond()
|
||||||
|
|
||||||
|
if request.Name != "" {
|
||||||
|
cond = cond.And(builder.Like{"name", request.Name})
|
||||||
|
}
|
||||||
if request.Tel != "" {
|
if request.Tel != "" {
|
||||||
cond = cond.And(builder.Like{"tel", request.Tel})
|
cond = cond.And(builder.Like{"tel", request.Tel})
|
||||||
}
|
}
|
||||||
if request.Status != 0 {
|
if request.Status != 0 {
|
||||||
cond = cond.And(builder.Eq{"status": request.Status})
|
cond = cond.And(builder.Eq{"status": request.Status})
|
||||||
}
|
}
|
||||||
|
if request.DtalkDepId != "" {
|
||||||
|
cond = cond.And(builder.Like{"dtalk_dep_id", request.DtalkDepId})
|
||||||
|
}
|
||||||
|
if request.DtalkUserId != "" {
|
||||||
|
cond = cond.And(builder.Like{"dtalk_user_id", request.DtalkUserId})
|
||||||
|
}
|
||||||
|
if request.DtalkUserId != "" {
|
||||||
|
cond = cond.And(builder.Like{"dtalk_user_id", request.DtalkUserId})
|
||||||
|
}
|
||||||
if len(request.UserIds) > 0 {
|
if len(request.UserIds) > 0 {
|
||||||
// 使用IN查询
|
// 使用IN查询
|
||||||
cond = cond.And(builder.In("user_id", request.UserIds))
|
cond = cond.And(builder.In("user_id", request.UserIds))
|
||||||
|
|
Loading…
Reference in New Issue