mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-11-29 18:48:23 +08:00
refactor(core): refactor snippet
This commit is contained in:
parent
b1d97553a6
commit
0cee044e23
@ -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;
|
||||
}
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user