diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SnippetEntity.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SnippetEntity.java index 51ebb61b..9e638ce3 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SnippetEntity.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SnippetEntity.java @@ -1,7 +1,9 @@ package io.edurt.datacap.service.entity; import com.fasterxml.jackson.annotation.JsonIncludeProperties; +import com.fasterxml.jackson.annotation.JsonView; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import io.edurt.datacap.common.view.EntityView; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -28,13 +30,16 @@ public class SnippetEntity extends BaseEntity { @Column(name = "description") + @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) private String description; @Column(name = "context") + @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) private String context; @ManyToOne @JoinColumn(name = "user_id") @JsonIncludeProperties(value = {"id", "username", "avatarConfigure"}) + @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) private UserEntity user; } diff --git a/core/datacap-ui/src/views/pages/admin/snippet/SnippetDelete.vue b/core/datacap-ui/src/views/pages/admin/snippet/SnippetDelete.vue index acb7fbb7..c2625492 100644 --- a/core/datacap-ui/src/views/pages/admin/snippet/SnippetDelete.vue +++ b/core/datacap-ui/src/views/pages/admin/snippet/SnippetDelete.vue @@ -79,7 +79,7 @@ export default defineComponent({ { if (this.info) { this.loading = true - SnippetService.deleteById(Number(this.info.id)) + SnippetService.deleteByCode(this.info.code!) .then(response => { if (response.status) { this.$Message.success({