Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit bcc2aac

Browse files
committed
update Activities Get* APIs, with variadic support
1 parent 60ba74b commit bcc2aac

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

api/routers/activities/team/team.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,21 @@ func New(c api.ApiClient) (a) {
3737
}
3838

3939
// List all oTask/Activity records within a team
40-
func (r a) GetList(company string, team string) (*http.Response, []byte) {
41-
return r.getByType(company, team, "")
40+
func (r a) GetList(company string, team string, params ...map[string]string) (*http.Response, []byte) {
41+
var p map[string]string
42+
if params != nil {
43+
p = params[0]
44+
}
45+
return r.getByType(company, team, "", p)
4246
}
4347

4448
// List all oTask/Activity records within a team by specified code(s)
45-
func (r a) GetSpecificList(company string, team string, code string) (*http.Response, []byte) {
46-
return r.getByType(company, team, code)
49+
func (r a) GetSpecificList(company string, team string, code string, params ...map[string]string) (*http.Response, []byte) {
50+
var p map[string]string
51+
if params != nil {
52+
p = params[0]
53+
}
54+
return r.getByType(company, team, code, p)
4755
}
4856

4957
// Create an oTask/Activity record within a team
@@ -72,11 +80,11 @@ func (r a) UpdateBatch(company string, params map[string]string) (*http.Response
7280
}
7381

7482
// Get by type
75-
func (r a) getByType(company string, team string, code string) (*http.Response, []byte) {
83+
func (r a) getByType(company string, team string, code string, params map[string]string) (*http.Response, []byte) {
7684
url := ""
7785
if code != "" {
7886
url = "/" + code;
7987
}
8088

81-
return r.client.Get("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/tasks" + url, nil)
89+
return r.client.Get("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/tasks" + url, params)
8290
}

0 commit comments

Comments
 (0)