[haiyang] add generic for resolve by name