feat: Device short code lookup
This commit is contained in:
parent
5f1a546bbe
commit
ffe589ff77
@ -22,6 +22,7 @@ type (
|
|||||||
Unscoped bool `form:"unscoped,omitempty"`
|
Unscoped bool `form:"unscoped,omitempty"`
|
||||||
SubscribeId *int64 `form:"subscribe_id,omitempty"`
|
SubscribeId *int64 `form:"subscribe_id,omitempty"`
|
||||||
UserSubscribeId *int64 `form:"user_subscribe_id,omitempty"`
|
UserSubscribeId *int64 `form:"user_subscribe_id,omitempty"`
|
||||||
|
ShortCode string `form:"short_code,omitempty"`
|
||||||
}
|
}
|
||||||
// GetUserListResponse
|
// GetUserListResponse
|
||||||
GetUserListResponse {
|
GetUserListResponse {
|
||||||
|
|||||||
@ -939,10 +939,10 @@ func RegisterHandlers(router *gin.Engine, serverCtx *svc.ServiceContext) {
|
|||||||
serverGroupRouter.GET("/user", server.GetServerUserListHandler(serverCtx))
|
serverGroupRouter.GET("/user", server.GetServerUserListHandler(serverCtx))
|
||||||
}
|
}
|
||||||
|
|
||||||
serverGroupRouterV2 := router.Group("/v2/server")
|
serverV2GroupRouter := router.Group("/v2/server")
|
||||||
|
|
||||||
{
|
{
|
||||||
// Get Server Protocol Config
|
// Get Server Protocol Config
|
||||||
serverGroupRouterV2.GET("/:server_id", server.QueryServerProtocolConfigHandler(serverCtx))
|
serverV2GroupRouter.GET("/:server_id", server.QueryServerProtocolConfigHandler(serverCtx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,7 @@ func (l *GetUserListLogic) GetUserList(req *types.GetUserListRequest) (*types.Ge
|
|||||||
Unscoped: req.Unscoped,
|
Unscoped: req.Unscoped,
|
||||||
SubscribeId: req.SubscribeId,
|
SubscribeId: req.SubscribeId,
|
||||||
UserSubscribeId: req.UserSubscribeId,
|
UserSubscribeId: req.UserSubscribeId,
|
||||||
|
ShortCode: req.ShortCode,
|
||||||
Order: "DESC",
|
Order: "DESC",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -61,6 +61,7 @@ type UserFilterParams struct {
|
|||||||
UserId *int64
|
UserId *int64
|
||||||
SubscribeId *int64
|
SubscribeId *int64
|
||||||
UserSubscribeId *int64
|
UserSubscribeId *int64
|
||||||
|
ShortCode string
|
||||||
Order string // Order by id, e.g., "desc"
|
Order string // Order by id, e.g., "desc"
|
||||||
Unscoped bool // Whether to include soft-deleted records
|
Unscoped bool // Whether to include soft-deleted records
|
||||||
}
|
}
|
||||||
@ -146,6 +147,10 @@ func (m *customUserModel) QueryPageList(ctx context.Context, page, size int, fil
|
|||||||
conn = conn.Joins("LEFT JOIN user_subscribe ON user.id = user_subscribe.user_id").
|
conn = conn.Joins("LEFT JOIN user_subscribe ON user.id = user_subscribe.user_id").
|
||||||
Where("user_subscribe.subscribe_id =? and `status` IN (0,1)", *filter.SubscribeId)
|
Where("user_subscribe.subscribe_id =? and `status` IN (0,1)", *filter.SubscribeId)
|
||||||
}
|
}
|
||||||
|
if filter.ShortCode != "" {
|
||||||
|
conn = conn.Joins("LEFT JOIN user_device ON user.id = user_device.user_id").
|
||||||
|
Where("user_device.short_code LIKE ?", "%"+filter.ShortCode+"%")
|
||||||
|
}
|
||||||
if filter.Order != "" {
|
if filter.Order != "" {
|
||||||
conn = conn.Order(fmt.Sprintf("user.id %s", filter.Order))
|
conn = conn.Order(fmt.Sprintf("user.id %s", filter.Order))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1100,6 +1100,7 @@ type GetUserListRequest struct {
|
|||||||
Unscoped bool `form:"unscoped,omitempty"`
|
Unscoped bool `form:"unscoped,omitempty"`
|
||||||
SubscribeId *int64 `form:"subscribe_id,omitempty"`
|
SubscribeId *int64 `form:"subscribe_id,omitempty"`
|
||||||
UserSubscribeId *int64 `form:"user_subscribe_id,omitempty"`
|
UserSubscribeId *int64 `form:"user_subscribe_id,omitempty"`
|
||||||
|
ShortCode string `form:"short_code,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetUserListResponse struct {
|
type GetUserListResponse struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user