Skip to content

Commit 739327e

Browse files
committed
feat.repair 7 interfaces
1 parent 4d7292d commit 739327e

20 files changed

+727
-0
lines changed

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+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.lark.project.service.workitem.builder;
2+
3+
import com.lark.project.core.annotation.Body;
4+
5+
public class FreezeWorkItemReq {
6+
@Body
7+
private FreezeWorkItemReqBody body;
8+
9+
public FreezeWorkItemReq() {
10+
}
11+
12+
public FreezeWorkItemReq(Builder builder) {
13+
this.body = builder.body;
14+
}
15+
16+
public static Builder newBuilder() {
17+
return new Builder();
18+
}
19+
20+
public FreezeWorkItemReqBody getFreezeWorkItemReqBody() {
21+
return this.body;
22+
}
23+
24+
public void setFreezeWorkItemReqBody(FreezeWorkItemReqBody body) {
25+
this.body = body;
26+
}
27+
28+
public static class Builder {
29+
private FreezeWorkItemReqBody body;
30+
31+
public Builder() {
32+
body = new FreezeWorkItemReqBody();
33+
}
34+
35+
public Builder projectKey(String projectKey) {
36+
this.body.setProjectKey(projectKey);
37+
return this;
38+
}
39+
40+
public Builder workItemID(Long workItemID) {
41+
this.body.setWorkItemID(workItemID);
42+
return this;
43+
}
44+
45+
public Builder isFrozen(Boolean isFrozen) {
46+
this.body.setIsFrozen(isFrozen);
47+
return this;
48+
}
49+
50+
public FreezeWorkItemReq build() {
51+
return new FreezeWorkItemReq(this);
52+
}
53+
}
54+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.lark.project.service.workitem.builder;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
5+
public class FreezeWorkItemReqBody {
6+
@SerializedName("project_key")
7+
private String projectKey;
8+
@SerializedName("work_item_id")
9+
private Long workItemID;
10+
@SerializedName("is_frozen")
11+
private Boolean isFrozen;
12+
13+
public String getProjectKey() { return projectKey; }
14+
public void setProjectKey(String projectKey) { this.projectKey = projectKey; }
15+
16+
public Long getWorkItemID() { return workItemID; }
17+
public void setWorkItemID(Long workItemID) { this.workItemID = workItemID; }
18+
19+
public Boolean getIsFrozen() { return isFrozen; }
20+
public void setIsFrozen(Boolean isFrozen) { this.isFrozen = isFrozen; }
21+
}
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 com.lark.project.core.response.BaseResponse;
5+
6+
public class FreezeWorkItemResp extends BaseResponse {
7+
@SerializedName("data")
8+
private Object data;
9+
10+
public Object getData() {
11+
return data;
12+
}
13+
14+
public void setData(Object data) {
15+
this.data = data;
16+
}
17+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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 ListWorkItemOpRecordReq {
7+
@Body
8+
private ListWorkItemOpRecordReqBody body;
9+
10+
public ListWorkItemOpRecordReq() {
11+
}
12+
13+
public ListWorkItemOpRecordReq(Builder builder) {
14+
this.body = builder.body;
15+
}
16+
17+
public static Builder newBuilder() {
18+
return new Builder();
19+
}
20+
21+
public ListWorkItemOpRecordReqBody getListWorkItemOpRecordReqBody() {
22+
return this.body;
23+
}
24+
25+
public void setListWorkItemOpRecordReqBody(ListWorkItemOpRecordReqBody body) {
26+
this.body = body;
27+
}
28+
29+
public static class Builder {
30+
private ListWorkItemOpRecordReqBody body;
31+
32+
public Builder() {
33+
body = new ListWorkItemOpRecordReqBody();
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 Builder startFrom(String startFrom) {
47+
this.body.setStartFrom(startFrom);
48+
return this;
49+
}
50+
51+
public Builder operator(List<String> operator) {
52+
this.body.setOperator(operator);
53+
return this;
54+
}
55+
56+
public Builder operatorType(List<String> operatorType) {
57+
this.body.setOperatorType(operatorType);
58+
return this;
59+
}
60+
61+
public Builder sourceType(List<String> sourceType) {
62+
this.body.setSourceType(sourceType);
63+
return this;
64+
}
65+
66+
public Builder source(List<String> source) {
67+
this.body.setSource(source);
68+
return this;
69+
}
70+
71+
public Builder operationType(List<String> operationType) {
72+
this.body.setOperationType(operationType);
73+
return this;
74+
}
75+
76+
public Builder start(Long start) {
77+
this.body.setStart(start);
78+
return this;
79+
}
80+
81+
public Builder end(Long end) {
82+
this.body.setEnd(end);
83+
return this;
84+
}
85+
86+
public Builder opRecordModule(List<String> opRecordModule) {
87+
this.body.setOpRecordModule(opRecordModule);
88+
return this;
89+
}
90+
91+
public Builder pageSize(Long pageSize) {
92+
this.body.setPageSize(pageSize);
93+
return this;
94+
}
95+
96+
public ListWorkItemOpRecordReq build() {
97+
return new ListWorkItemOpRecordReq(this);
98+
}
99+
}
100+
}

0 commit comments

Comments
 (0)