feat: 完成镜像拉取、推送、导入、导出功能

This commit is contained in:
ssongliu
2022-10-10 15:14:49 +08:00
committed by ssongliu
parent dcbf92ac12
commit 2cb1b57069
17 changed files with 968 additions and 6 deletions

View File

@@ -8,12 +8,16 @@ import (
"github.com/gin-gonic/gin"
)
func (b *BaseApi) GetRepoList(c *gin.Context) {
func (b *BaseApi) SearchRepo(c *gin.Context) {
var req dto.PageInfo
if err := c.ShouldBindJSON(&req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
if err := global.VALID.Struct(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
total, list, err := imageRepoService.Page(req)
if err != nil {
@@ -27,6 +31,16 @@ func (b *BaseApi) GetRepoList(c *gin.Context) {
})
}
func (b *BaseApi) ListRepo(c *gin.Context) {
list, err := imageRepoService.List()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, list)
}
func (b *BaseApi) CreateRepo(c *gin.Context) {
var req dto.ImageRepoCreate
if err := c.ShouldBindJSON(&req); err != nil {