refactor(core): refactor snippet

This commit is contained in:
qianmoQ 2024-11-25 23:13:53 +08:00
parent b1d97553a6
commit 0cee044e23
2 changed files with 6 additions and 1 deletions

View File

@ -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;
}

View File

@ -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({