Exemplo n.º 1
0
// 获取项目成员列表
func (c *Tower) ProjectMembers(id string) ([]Member, error) {
	var (
		url      = "https://tower.im/api/v2/projects/" + id + "/members"
		response []Member
	)
	if _, err := requests.Get(url, c.authHeader(), &response); err != nil {
		return response, err
	}
	return response, nil
}
Exemplo n.º 2
0
// 获取团队项目列表
func (c *Tower) Projects(guid string) ([]Project, error) {
	var (
		url      = "https://tower.im/api/v2/teams/" + guid + "/projects"
		response []Project
	)
	if _, err := requests.Get(url, c.authHeader(), &response); err != nil {
		return response, err
	}
	return response, nil
}
Exemplo n.º 3
0
// 获取团队信息
func (c *Tower) TeamInfo(guid string) (TeamInfo, error) {
	var (
		url      = "https://tower.im/api/v2/teams/" + guid
		response TeamInfo
	)
	if _, err := requests.Get(url, c.authHeader(), &response); err != nil {
		return response, err
	}
	return response, nil
}
Exemplo n.º 4
0
// 获取项目任务清单列表
func (c *Tower) TodoLists(projectID string) ([]TodoList, error) {
	var (
		url      = "https://tower.im/api/v2/projects/" + projectID + "/todolists"
		response []TodoList
	)
	if _, err := requests.Get(url, c.authHeader(), &response); err != nil {
		return response, err
	}
	return response, nil
}
Exemplo n.º 5
0
func (c *Tower) Todos(id string, since, till time.Time, count, completed int) ([]Todo, error) {
	var (
		url      = "https://tower.im/api/v2/todolists/" + id + "/todos"
		response TodoList
		request  = struct {
			Since     time.Time `json:"since,omitempty"`
			Till      time.Time `json:"till,omitempty"`
			Count     int       `json:"count,,omitempty"`
			Completed int       `json:"completed"`
		}{
			Since:     since,
			Till:      till,
			Count:     count,
			Completed: completed,
		}
	)

	if _, err := requests.Get(url, c.authHeader(), &response); err != nil {
		return response, err
	}
	return response, nil
}