Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add helpdesk Richtext other type params #140

Open
wants to merge 1 commit into
base: v2_main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,7 @@

package com.lark.oapi.service.helpdesk.v1.model;

import com.lark.oapi.core.response.EmptyData;
import com.lark.oapi.service.helpdesk.v1.enums.*;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.SerializedName;
import com.lark.oapi.core.annotation.Body;
import com.lark.oapi.core.annotation.Path;
import com.lark.oapi.core.annotation.Query;

import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

import com.lark.oapi.core.utils.Strings;
import com.lark.oapi.core.response.BaseResponse;

public class Richtext {
/**
Expand All @@ -41,6 +28,42 @@ public class Richtext {
*/
@SerializedName("type")
private String type;
/**
* 图像key:type=img生效
* <p> 示例值:img_b07ffac0-19c1-48a3-afca-599f8ea825fj
*/
@SerializedName("key")
private String key;
/**
* 图片来源:type=img生效
* <p> 示例值:https://link.to.image/image.jpg
*/
@SerializedName("src")
private String src;
/**
* 图像高度:type=img生效
* <p> 示例值:1080
*/
@SerializedName("height")
private Integer height;
/**
* 图像宽度:type=img生效
* <p> 示例值:1920
*/
@SerializedName("width")
private Integer width;
/**
* 链接:type=hyperlink生效
* <p> 示例值:https://bytedance.com
*/
@SerializedName("url")
private String url;
/**
* 链接:type=hyperlink生效
* <p> 示例值:字节跳动
*/
@SerializedName("text")
private String text;

// builder 开始
public Richtext() {
Expand All @@ -57,6 +80,36 @@ public Richtext(Builder builder) {
* <p> 示例值:text
*/
this.type = builder.type;
/**
* 图像key:type=img生效
* <p> 示例值:img_b07ffac0-19c1-48a3-afca-599f8ea825fj
*/
this.key = builder.key;
/**
* 图片来源:type=img生效
* <p> 示例值:https://link.to.image/image.jpg
*/
this.src = builder.src;
/**
* 图像高度:type=img生效
* <p> 示例值:1080
*/
this.height = builder.height;
/**
* 图像宽度:type=img生效
* <p> 示例值:1920
*/
this.width = builder.width;
/**
* 链接:type=hyperlink生效
* <p> 示例值:https://bytedance.com
*/
this.url = builder.url;
/**
* 链接:type=hyperlink生效
* <p> 示例值:字节跳动
*/
this.text = builder.text;
}

public static Builder newBuilder() {
Expand All @@ -79,6 +132,54 @@ public void setType(String type) {
this.type = type;
}

public String getKey() {
return key;
}

public void setKey(String key) {
this.key = key;
}

public String getSrc() {
return src;
}

public void setSrc(String src) {
this.src = src;
}

public Integer getHeight() {
return height;
}

public void setHeight(Integer height) {
this.height = height;
}

public Integer getWidth() {
return width;
}

public void setWidth(Integer width) {
this.width = width;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}

public static class Builder {
/**
* 内容
Expand All @@ -90,7 +191,36 @@ public static class Builder {
* <p> 示例值:text
*/
private String type;

/**
* 图像key:type=img生效
* <p> 示例值:img_b07ffac0-19c1-48a3-afca-599f8ea825fj
*/
private String key;
/**
* 图片来源:type=img生效
* <p> 示例值:https://link.to.image/image.jpg
*/
private String src;
/**
* 图像高度:type=img生效
* <p> 示例值:1080
*/
private Integer height;
/**
* 图像宽度:type=img生效
* <p> 示例值:1920
*/
private Integer width;
/**
* 链接:type=hyperlink生效
* <p> 示例值:https://bytedance.com
*/
private String url;
/**
* 链接:type=hyperlink生效
* <p> 示例值:字节跳动
*/
private String text;
/**
* 内容
* <p> 示例值:我的答案
Expand All @@ -103,7 +233,6 @@ public Builder content(String content) {
return this;
}


/**
* 类型
* <p> 示例值:text
Expand All @@ -116,6 +245,59 @@ public Builder type(String type) {
return this;
}

/**
* 图像key:type=img生效
* <p> 示例值:img_b07ffac0-19c1-48a3-afca-599f8ea825fj
*/
public Builder key(String key) {
this.key = key;
return this;
}

/**
* 图片来源:type=img生效
* <p> 示例值:https://link.to.image/image.jpg
*/
public Builder src(String src) {
this.src = src;
return this;
}

/**
* 图像高度:type=img生效
* <p> 示例值:1080
*/
public Builder height(Integer height) {
this.height = height;
return this;
}

/**
* 图像宽度:type=img生效
* <p> 示例值:1920
*/
public Builder width(Integer width) {
this.width = width;
return this;
}

/**
* 链接:type=hyperlink生效
* <p> 示例值:https://bytedance.com
*/
public Builder width(String url) {
this.url = url;
return this;
}

/**
* 链接:type=hyperlink生效
* <p> 示例值:字节跳动
*/
public Builder text(String text) {
this.text = text;
return this;
}

public Richtext build() {
return new Richtext(this);
Expand Down