mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-28 21:39:06 +08:00
33 lines
833 B
Go
33 lines
833 B
Go
|
package v1
|
||
|
|
||
|
import (
|
||
|
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
|
||
|
"github.com/1Panel-dev/1Panel/app/dto"
|
||
|
"github.com/1Panel-dev/1Panel/constant"
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func (b *BaseApi) AppSearch(c *gin.Context) {
|
||
|
var req dto.AppRequest
|
||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||
|
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
list, err := appService.Page(req)
|
||
|
if err != nil {
|
||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
helper.SuccessWithData(c, list)
|
||
|
}
|
||
|
|
||
|
func (b *BaseApi) AppSync(c *gin.Context) {
|
||
|
if err := appService.Sync(); err != nil {
|
||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||
|
return
|
||
|
}
|
||
|
helper.SuccessWithData(c, "")
|
||
|
}
|