nsfw images

This commit is contained in:
2025-11-02 19:51:33 +08:00
parent a7f1bcb365
commit 853647edbc
6 changed files with 91 additions and 9 deletions

View File

@@ -28,6 +28,7 @@ type ResourceParams struct {
Article string `json:"article"`
Images []uint `json:"images"`
Gallery []uint `json:"gallery"`
GalleryNsfw []uint `json:"gallery_nsfw"`
}
func CreateResource(uid uint, params *ResourceParams) (uint, error) {
@@ -64,6 +65,7 @@ func CreateResource(uid uint, params *ResourceParams) (uint, error) {
Tags: tags,
UserID: uid,
Gallery: params.Gallery,
GalleryNsfw: params.GalleryNsfw,
}
if r, err = dao.CreateResource(r); err != nil {
return 0, err
@@ -455,6 +457,7 @@ func EditResource(uid, rid uint, params *ResourceParams) error {
r.Article = params.Article
r.Links = params.Links
r.Gallery = params.Gallery
r.GalleryNsfw = params.GalleryNsfw
images := make([]model.Image, len(params.Images))
for i, id := range params.Images {