Switchable AC-DC output
You cannot use the same connector for 5V and 220V -- not without killing someone. So just forget about this idea.

I'm thinking of using TRIAC.

Why do you think about such details before thinking of simple things first, like whether you should even be doing it at all...