mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-01-08 02:37:40 +08:00
(improvement)(headless) add tag logic (#831)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.request;
|
||||
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TagDeleteReq {
|
||||
|
||||
private List<Long> ids;
|
||||
private List<Long> itemIds;
|
||||
private TagDefineType type;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.request;
|
||||
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class TagFilterPageReq extends PageSchemaItemReq {
|
||||
|
||||
@NotNull
|
||||
private Long tagObjectId;
|
||||
|
||||
private TagDefineType tagDefineType;
|
||||
}
|
||||
@@ -1,33 +1,20 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.request;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.TagDefineParams;
|
||||
import com.tencent.supersonic.common.pojo.RecordInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.TagType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class TagReq extends SchemaItem {
|
||||
public class TagReq extends RecordInfo {
|
||||
|
||||
private Long modelId;
|
||||
private Map<String, Object> ext = new HashMap<>();
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
private TagDefineType tagDefineType;
|
||||
private TagDefineParams tagDefineParams;
|
||||
|
||||
public String getTypeParamsJson() {
|
||||
return JSONObject.toJSONString(tagDefineParams);
|
||||
}
|
||||
|
||||
public String getExtJson() {
|
||||
return Objects.nonNull(ext) && ext.size() > 0 ? JSONObject.toJSONString(ext) : "";
|
||||
}
|
||||
|
||||
public TagType getType() {
|
||||
return TagType.getType(tagDefineType);
|
||||
}
|
||||
@NotNull
|
||||
private Long itemId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.TagDefineParams;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class TagResp extends SchemaItem {
|
||||
public class TagResp {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long domainId;
|
||||
|
||||
@@ -20,20 +17,22 @@ public class TagResp extends SchemaItem {
|
||||
|
||||
private String modelName;
|
||||
|
||||
private String type;
|
||||
private Long tagObjectId;
|
||||
|
||||
private String tagObjectName;
|
||||
|
||||
private Boolean isCollect;
|
||||
|
||||
private boolean hasAdminRes;
|
||||
|
||||
private Map<String, Object> ext = new HashMap<>();
|
||||
private String tagDefineType;
|
||||
|
||||
private TagDefineType tagDefineType = TagDefineType.FIELD;
|
||||
private Long itemId;
|
||||
|
||||
private TagDefineParams tagDefineParams;
|
||||
private String name;
|
||||
|
||||
public String getExpr() {
|
||||
return tagDefineParams.getExpr();
|
||||
}
|
||||
private String bizName;
|
||||
|
||||
private String description;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user