Skip to content

Commit 13fca93

Browse files
Merge pull request #45 from larksuite/feat/generator_0714
Feat/generator 0714
2 parents 58f3b1d + 37682f2 commit 13fca93

4 files changed

Lines changed: 84 additions & 1 deletion

File tree

core/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
package core
1818

19-
const version = "v1.0.22"
19+
const version = "v1.0.23"

v2/service/workitem/api.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ const APIPath_SwitchBackToWbsViewDraft = "/open_api/:project_key/wbs_view_draft/
156156

157157
const APIPath_UniversalSearch = "/open_api/view_search/universal_search"
158158

159+
const APIPath_UpdateAiEntity = "/open_api/ai_entity/update"
160+
159161
const APIPath_UpdateCompoundFieldValue = "/open_api/work_item/field_value/update_compound_field"
160162

161163
const APIPath_UpdateField = "/open_api/:project_key/field/:work_item_type_key"
@@ -1976,6 +1978,30 @@ func (a *WorkItemService) UniversalSearch(ctx context.Context, req *UniversalSea
19761978
return resp, err
19771979
}
19781980

1981+
/*
1982+
* @name: OAPIUpdateAiEntity
1983+
* @desc: 【AI草组】更新AI实体
1984+
*/
1985+
func (a *WorkItemService) UpdateAiEntity(ctx context.Context, req *UpdateAiEntityReq, options ...core.RequestOptionFunc) (*UpdateAiEntityResp, error) {
1986+
// 发起请求
1987+
apiReq := req.apiReq
1988+
apiReq.ApiPath = APIPath_UpdateAiEntity
1989+
apiReq.HttpMethod = "PUT"
1990+
apiResp, err := core.Request(ctx, apiReq, a.config, options...)
1991+
if err != nil {
1992+
a.config.Logger.Error(ctx, fmt.Sprintf("[UpdateAiEntity] fail to invoke api, error: %v", err.Error()))
1993+
return nil, err
1994+
}
1995+
// 反序列响应结果
1996+
resp := &UpdateAiEntityResp{APIResp: apiResp}
1997+
err = apiResp.JSONUnmarshalBody(resp, a.config)
1998+
if err != nil {
1999+
a.config.Logger.Error(ctx, fmt.Sprintf("[UpdateAiEntity] fail to unmarshal response body, error: %v", err.Error()))
2000+
return nil, err
2001+
}
2002+
return resp, err
2003+
}
2004+
19792005
/*
19802006
* @name: OAPIUpdateCompoundFieldValue
19812007
* @desc: 增量更新复合字段

v2/service/workitem/builder.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4716,6 +4716,55 @@ func (builder *UniversalSearchReqBuilder) Build() *UniversalSearchReq {
47164716
return req
47174717
}
47184718

4719+
type UpdateAiEntityReq struct {
4720+
apiReq *core.APIReq
4721+
}
4722+
type UpdateAiEntityReqBody struct {
4723+
UpdateAiEntityParam []UpdateAiEntityParam `json:"update_ai_entity_param,omitempty"`
4724+
ProjectKey *string `json:"project_key,omitempty"`
4725+
UserKey *string `json:"user_key,omitempty"`
4726+
}
4727+
type UpdateAiEntityResp struct {
4728+
*core.APIResp `json:"-"`
4729+
core.CodeError
4730+
}
4731+
4732+
type UpdateAiEntityReqBuilder struct {
4733+
apiReq *core.APIReq
4734+
}
4735+
4736+
func NewUpdateAiEntityReqBuilder() *UpdateAiEntityReqBuilder {
4737+
builder := &UpdateAiEntityReqBuilder{}
4738+
builder.apiReq = &core.APIReq{
4739+
PathParams: core.PathParams{},
4740+
QueryParams: core.QueryParams{},
4741+
Body: &UpdateAiEntityReqBody{},
4742+
}
4743+
return builder
4744+
}
4745+
4746+
func (builder *UpdateAiEntityReqBuilder) UpdateAiEntityParam(updateAiEntityParam []UpdateAiEntityParam) *UpdateAiEntityReqBuilder {
4747+
builder.apiReq.Body.(*UpdateAiEntityReqBody).UpdateAiEntityParam = updateAiEntityParam
4748+
return builder
4749+
}
4750+
4751+
func (builder *UpdateAiEntityReqBuilder) ProjectKey(projectKey string) *UpdateAiEntityReqBuilder {
4752+
builder.apiReq.Body.(*UpdateAiEntityReqBody).ProjectKey = &projectKey
4753+
return builder
4754+
}
4755+
4756+
4757+
func (builder *UpdateAiEntityReqBuilder) UserKey(userKey string) *UpdateAiEntityReqBuilder {
4758+
builder.apiReq.Body.(*UpdateAiEntityReqBody).UserKey = &userKey
4759+
return builder
4760+
}
4761+
4762+
func (builder *UpdateAiEntityReqBuilder) Build() *UpdateAiEntityReq {
4763+
req := &UpdateAiEntityReq{}
4764+
req.apiReq = builder.apiReq
4765+
return req
4766+
}
4767+
47194768
type UpdateCompoundFieldValueReq struct {
47204769
apiReq *core.APIReq
47214770
}

v2/service/workitem/model.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,6 +2181,14 @@ type UnionDelivery struct {
21812181

21822182
}
21832183

2184+
type UpdateAiEntityParam struct {
2185+
2186+
EntityID *string `json:"entity_id,omitempty"`
2187+
2188+
Status *string `json:"status,omitempty"`
2189+
2190+
}
2191+
21842192
type UpdateWorkingHourRecord struct {
21852193

21862194
ID *int64 `json:"id,omitempty"`

0 commit comments

Comments
 (0)