增加用户免押额度筛选
This commit is contained in:
@@ -38,8 +38,9 @@ func parsePagination(c *gin.Context) (int, int) {
|
||||
func (h *Handler) List(c *gin.Context) {
|
||||
page, pageSize := parsePagination(c)
|
||||
query := ListQuery{
|
||||
Keyword: strings.TrimSpace(c.Query("keyword")),
|
||||
Status: strings.TrimSpace(c.Query("status")),
|
||||
Keyword: strings.TrimSpace(c.Query("keyword")),
|
||||
Status: strings.TrimSpace(c.Query("status")),
|
||||
HasDepositFreeQuota: parseBoolQuery(c.Query("has_deposit_free_quota")),
|
||||
}
|
||||
result, err := h.service.List(c.Request.Context(), page, pageSize, query)
|
||||
if err != nil {
|
||||
@@ -49,6 +50,15 @@ func (h *Handler) List(c *gin.Context) {
|
||||
response.OK(c, result)
|
||||
}
|
||||
|
||||
func parseBoolQuery(value string) bool {
|
||||
switch strings.ToLower(strings.TrimSpace(value)) {
|
||||
case "1", "true", "yes", "on":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) Freeze(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user