groupMapping.go 357 Bytes
Newer Older
chenweijian's avatar
chenweijian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package group_m

import (
	"hilo-user/domain"
	"hilo-user/myerr/bizerr"
)

func ToTxGroupId(model *domain.Model, imGroupId string) (string, error) {
	if len(imGroupId) <= 0 {
		return "", nil
	}

	gi, err := GetGroupInfo(model, imGroupId)
	if err != nil {
		return "", err
	}
	if gi == nil {
		return "", bizerr.GroupNotFound
	}
	return gi.TxGroupId, nil
}