func()

in user-center-wecom/company.go [227:244]


func (c *Company) formatDepartmentAndPosition(departmentIDs []int, position string) string {
	var departmentName []string
	for _, t := range departmentIDs {
		name := c.fullDepartmentName(t)
		if len(name) == 0 {
			continue
		}
		departmentName = append(departmentName, name)
	}
	var desc []string
	if dep := strings.Join(departmentName, ","); len(dep) > 0 {
		desc = append(desc, fmt.Sprintf("部门:%s", dep))
	}
	if len(position) > 0 {
		desc = append(desc, fmt.Sprintf("职位:%s", position))
	}
	return strings.Join(desc, "\n")
}