Skip to content

Commit e334fee

Browse files
Merge pull request #29 from larksuite/feature/repair_third_week
java sdk接口补全
2 parents 7c6d928 + df4dfad commit e334fee

26 files changed

Lines changed: 774 additions & 4 deletions

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.larksuite.project</groupId>
88
<artifactId>oapi-sdk</artifactId>
9-
<version>1.0.25</version>
9+
<version>1.0.26</version>
1010
<build>
1111
<plugins>
1212
<plugin>

src/main/java/com/lark/project/service/comment/builder/CreateCommentReq.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import com.lark.project.core.annotation.Body;
2121
import com.lark.project.core.annotation.Path;
2222

23+
import java.util.List;
24+
2325
public class CreateCommentReq {
2426
@Path
2527
@SerializedName("project_key")
@@ -111,9 +113,14 @@ public Builder content(String content) {
111113
return this;
112114
}
113115

116+
public Builder richText(List<Object> richText) {
117+
this.body.setRichText(richText);
118+
return this;
119+
}
120+
114121
public CreateCommentReq build() {
115122
return new CreateCommentReq(this);
116123
}
117124

118125
}
119-
}
126+
}

src/main/java/com/lark/project/service/comment/builder/CreateCommentReqBody.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,29 @@
1818

1919
import com.google.gson.annotations.SerializedName;
2020

21+
import java.util.List;
22+
2123

2224
public class CreateCommentReqBody {
2325
@SerializedName("content")
2426
private String content;
2527

28+
@SerializedName("rich_text")
29+
private List<Object> richText;
30+
2631
public String getContent() {
2732
return this.content;
2833
}
2934

3035
public void setContent(String content) {
3136
this.content = content;
3237
}
38+
39+
public List<Object> getRichText() {
40+
return this.richText;
41+
}
42+
43+
public void setRichText(List<Object> richText) {
44+
this.richText = richText;
45+
}
3346
}

src/main/java/com/lark/project/service/comment/builder/UpdateCommentReq.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import com.lark.project.core.annotation.Body;
2121
import com.lark.project.core.annotation.Path;
2222

23+
import java.util.List;
24+
2325
public class UpdateCommentReq {
2426
@Path
2527
@SerializedName("project_key")
@@ -129,9 +131,14 @@ public Builder content(String content) {
129131
return this;
130132
}
131133

134+
public Builder richText(List<Object> richText) {
135+
this.body.setRichText(richText);
136+
return this;
137+
}
138+
132139
public UpdateCommentReq build() {
133140
return new UpdateCommentReq(this);
134141
}
135142

136143
}
137-
}
144+
}

src/main/java/com/lark/project/service/comment/builder/UpdateCommentReqBody.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,29 @@
1818

1919
import com.google.gson.annotations.SerializedName;
2020

21+
import java.util.List;
22+
2123

2224
public class UpdateCommentReqBody {
2325
@SerializedName("content")
2426
private String content;
2527

28+
@SerializedName("rich_text")
29+
private List<Object> richText;
30+
2631
public String getContent() {
2732
return this.content;
2833
}
2934

3035
public void setContent(String content) {
3136
this.content = content;
3237
}
38+
39+
public List<Object> getRichText() {
40+
return this.richText;
41+
}
42+
43+
public void setRichText(List<Object> richText) {
44+
this.richText = richText;
45+
}
3346
}

src/main/java/com/lark/project/service/workitem/WorkItemService.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,25 @@ public interface WorkItemService {
136136
* <p>对应 OpenAPI:{@code GET /open_api/task_result}</p>
137137
*/
138138
public GetTaskResultResp getTaskResult(GetTaskResultReq req, RequestOptions reqOptions) throws Exception;
139+
140+
/**
141+
* 交付物信息批量查询(WBS)
142+
*
143+
* <p>对应 OpenAPI:{@code POST /open_api/work_item/deliverable/batch_query}</p>
144+
*/
145+
public BatchQueryDeliverableResp batchQueryDeliverable(BatchQueryDeliverableReq req, RequestOptions reqOptions) throws Exception;
146+
147+
/**
148+
* 冻结/解冻工作项
149+
*
150+
* <p>对应 OpenAPI:{@code PUT /open_api/work_item/freeze}</p>
151+
*/
152+
public FreezeWorkItemResp freezeWorkItem(FreezeWorkItemReq req, RequestOptions reqOptions) throws Exception;
153+
154+
/**
155+
* 获取工作项操作记录
156+
*
157+
* <p>对应 OpenAPI:{@code POST /open_api/op_record/work_item/list}</p>
158+
*/
159+
public ListWorkItemOpRecordResp listWorkItemOpRecord(ListWorkItemOpRecordReq req, RequestOptions reqOptions) throws Exception;
139160
}

src/main/java/com/lark/project/service/workitem/WorkItemServiceImpl.java

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,4 +776,73 @@ public BotJoinChatResp botJoinChat(BotJoinChatReq req, RequestOptions reqOptions
776776

777777
return resp;
778778
}
779+
780+
// 交付物信息批量查询(WBS)
781+
public BatchQueryDeliverableResp batchQueryDeliverable(BatchQueryDeliverableReq req, RequestOptions reqOptions) throws Exception {
782+
if (reqOptions == null) {
783+
reqOptions = new RequestOptions();
784+
}
785+
786+
RawResponse httpResponse = Transport.doSend(config, reqOptions, "POST"
787+
, "/open_api/work_item/deliverable/batch_query"
788+
, false
789+
, req);
790+
791+
BatchQueryDeliverableResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchQueryDeliverableResp.class);
792+
if (resp == null) {
793+
log.error(Logs.formatReq(req, httpResponse, "/open_api/work_item/deliverable/batch_query"));
794+
throw new IllegalArgumentException(ErrConstants.RESULT_ILLEGAL);
795+
}
796+
797+
resp.setRawResponse(httpResponse);
798+
resp.setRequest(req);
799+
800+
return resp;
801+
}
802+
803+
// 冻结/解冻工作项
804+
public FreezeWorkItemResp freezeWorkItem(FreezeWorkItemReq req, RequestOptions reqOptions) throws Exception {
805+
if (reqOptions == null) {
806+
reqOptions = new RequestOptions();
807+
}
808+
809+
RawResponse httpResponse = Transport.doSend(config, reqOptions, "PUT"
810+
, "/open_api/work_item/freeze"
811+
, false
812+
, req);
813+
814+
FreezeWorkItemResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, FreezeWorkItemResp.class);
815+
if (resp == null) {
816+
log.error(Logs.formatReq(req, httpResponse, "/open_api/work_item/freeze"));
817+
throw new IllegalArgumentException(ErrConstants.RESULT_ILLEGAL);
818+
}
819+
820+
resp.setRawResponse(httpResponse);
821+
resp.setRequest(req);
822+
823+
return resp;
824+
}
825+
826+
// 获取工作项操作记录
827+
public ListWorkItemOpRecordResp listWorkItemOpRecord(ListWorkItemOpRecordReq req, RequestOptions reqOptions) throws Exception {
828+
if (reqOptions == null) {
829+
reqOptions = new RequestOptions();
830+
}
831+
832+
RawResponse httpResponse = Transport.doSend(config, reqOptions, "POST"
833+
, "/open_api/op_record/work_item/list"
834+
, false
835+
, req);
836+
837+
ListWorkItemOpRecordResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ListWorkItemOpRecordResp.class);
838+
if (resp == null) {
839+
log.error(Logs.formatReq(req, httpResponse, "/open_api/op_record/work_item/list"));
840+
throw new IllegalArgumentException(ErrConstants.RESULT_ILLEGAL);
841+
}
842+
843+
resp.setRawResponse(httpResponse);
844+
resp.setRequest(req);
845+
846+
return resp;
847+
}
779848
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.lark.project.service.workitem.builder;
2+
3+
import com.lark.project.core.annotation.Body;
4+
import java.util.List;
5+
6+
public class BatchQueryDeliverableReq {
7+
@Body
8+
private BatchQueryDeliverableReqBody body;
9+
10+
public BatchQueryDeliverableReq() {
11+
}
12+
13+
public BatchQueryDeliverableReq(Builder builder) {
14+
this.body = builder.body;
15+
}
16+
17+
public static Builder newBuilder() {
18+
return new Builder();
19+
}
20+
21+
public BatchQueryDeliverableReqBody getBatchQueryDeliverableReqBody() {
22+
return this.body;
23+
}
24+
25+
public void setBatchQueryDeliverableReqBody(BatchQueryDeliverableReqBody body) {
26+
this.body = body;
27+
}
28+
29+
public static class Builder {
30+
private BatchQueryDeliverableReqBody body;
31+
32+
public Builder() {
33+
body = new BatchQueryDeliverableReqBody();
34+
}
35+
36+
public Builder projectKey(String projectKey) {
37+
this.body.setProjectKey(projectKey);
38+
return this;
39+
}
40+
41+
public Builder workItemIds(List<Long> workItemIds) {
42+
this.body.setWorkItemIds(workItemIds);
43+
return this;
44+
}
45+
46+
public BatchQueryDeliverableReq build() {
47+
return new BatchQueryDeliverableReq(this);
48+
}
49+
}
50+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.lark.project.service.workitem.builder;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import java.util.List;
5+
6+
public class BatchQueryDeliverableReqBody {
7+
@SerializedName("project_key")
8+
private String projectKey;
9+
@SerializedName("work_item_ids")
10+
private List<Long> workItemIds;
11+
12+
public String getProjectKey() { return projectKey; }
13+
public void setProjectKey(String projectKey) { this.projectKey = projectKey; }
14+
15+
public List<Long> getWorkItemIds() { return workItemIds; }
16+
public void setWorkItemIds(List<Long> workItemIds) { this.workItemIds = workItemIds; }
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.lark.project.service.workitem.builder;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import com.lark.project.core.response.BaseResponse;
5+
import com.lark.project.service.workitem.model.Deliverable;
6+
import java.util.List;
7+
8+
public class BatchQueryDeliverableResp extends BaseResponse {
9+
@SerializedName("data")
10+
private List<Deliverable> data;
11+
12+
public List<Deliverable> getData() {
13+
return data;
14+
}
15+
16+
public void setData(List<Deliverable> data) {
17+
this.data = data;
18+
}
19+
}

0 commit comments

Comments
 (0)