package district

import (
	"context"
	"git.noahlan.cn/n-admin/n-admin-server/rpc/core/internal/svc"
	"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
)

func init() {
	svc.DistrictHelperInst.SetGetDistrictNameFn(func(ctx context.Context, svcCtx *svc.ServiceContext, code, separator string) (*core.GetDistrictNameResp, error) {
		l := NewGetDistrictNameLogic(ctx, svcCtx)
		resp, err := l.GetDistrictName(&core.GetDistrictNameReq{
			Code:      code,
			Separator: separator,
		})
		if err != nil {
			return nil, err
		}
		return resp, nil
	})
}
