diff --git a/server/internal/handler/app.go b/server/internal/handler/app.go index 76488c6..e7c08e4 100644 --- a/server/internal/handler/app.go +++ b/server/internal/handler/app.go @@ -24,6 +24,9 @@ type AppListRequest struct { PageNo int `form:"pageNo" binding:"required"` PageSize int `form:"pageSize" binding:"required"` AppType string `form:"appType"` + Name string `form:"name"` + Code string `form:"code"` + GroupId string `form:"groupId"` } func (h *AppHandler) List(c *gin.Context) { @@ -66,6 +69,15 @@ func (h *AppHandler) List(c *gin.Context) { if req.AppType != "" { whereClause += " AND service_id = '" + req.AppType + "'" } + if req.Name != "" { + whereClause += " AND name LIKE '%" + req.Name + "%'" + } + if req.Code != "" { + whereClause += " AND code LIKE '%" + req.Code + "%'" + } + if req.GroupId != "" { + whereClause += " AND group_id = " + req.GroupId + } total, _ := dao.Engine.Where(whereClause).Count(&model.Application{}) dao.Engine.Where(whereClause).Limit(req.PageSize, (req.PageNo-1)*req.PageSize).Find(&apps) diff --git a/web/src/views/app/AppList.vue b/web/src/views/app/AppList.vue index 6428240..45ec049 100644 --- a/web/src/views/app/AppList.vue +++ b/web/src/views/app/AppList.vue @@ -1,13 +1,31 @@