|
|
|
@ -113,7 +113,6 @@ func (p *PhotoHandler) UpdatePhoto(ctx *gin.Context) (interface{}, error) {
|
|
|
|
|
}
|
|
|
|
|
photoParam := ¶m.Photo{}
|
|
|
|
|
err = ctx.ShouldBindJSON(photoParam)
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
e := validator.ValidationErrors{}
|
|
|
|
|
if errors.As(err, &e) {
|
|
|
|
@ -136,6 +135,21 @@ func (p *PhotoHandler) DeletePhoto(ctx *gin.Context) (interface{}, error) {
|
|
|
|
|
return nil, p.PhotoService.Delete(ctx, id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *PhotoHandler) DeletePhotoBatch(ctx *gin.Context) (interface{}, error) {
|
|
|
|
|
photosParam := make([]int32, 0)
|
|
|
|
|
err := ctx.ShouldBindJSON(&photosParam)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, xerr.WithStatus(err, xerr.StatusBadRequest).WithMsg("parameter error")
|
|
|
|
|
}
|
|
|
|
|
for _, id := range photosParam {
|
|
|
|
|
err := p.PhotoService.Delete(ctx, id)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *PhotoHandler) ListPhotoTeams(ctx *gin.Context) (interface{}, error) {
|
|
|
|
|
return p.PhotoService.ListTeams(ctx)
|
|
|
|
|
}
|
|
|
|
|