You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: account.go
    path of file: ./repos/mayfly-go/server/internal/sys/api
    
    the code of the file until where you have to start completion: package api

import (
	"mayfly-go/internal/common/utils"
	msgapp "mayfly-g
    
func (a *Account) getAccountRoles(accountId uint64) []*vo.AccountRoleVO {
	vos := make([]*vo.AccountRoleVO, 0)

	accountRoles, err := a.RoleApp.GetAccountRoles(accountId)
	biz.ErrIsNil(err)

	if len(accountRoles) == 0 {
		return vos
	}

	// 获取角色信息进行组装
	roleIds := collx.ArrayMap[*entity.AccountRole, uint64](accountRoles, func(val *entity.AccountRole) uint64 {
		return val.RoleId
	})
	roles, err := a.RoleApp.ListByQuery(&entity.RoleQuery{Ids: roleIds})
	biz.ErrIsNil(err)
	roleId2Role := collx.ArrayToMap[*entity.Role, uint64](roles, func(val *entity.Role) uint64 {
		return val.Id
	})

	for _, ac := range accountRoles {
		role := roleId2Role[ac.RoleId]
		if role == nil {
			continue
		}
		vos = append(vos, &vo.AccountRoleVO{
			RoleId:     ac.RoleId,
			RoleName:   role.Name,
			Code:       role.Code,
			Status:     role.Status,
			CreateTime: ac.CreateTime, // 分配时间
			Creator:    ac.Creator,    // 分配者
		})
	}

	return vos
}