Usage of gateway in TTN application

That is not possible. And it would not be useful as messages received by a gateway are (still) encrypted, only when a message is available at application level has it been decrypted.

Gateways do not have decoder functions. There is nothing that can be decided at that point. Only at application level the data is decrypted and can it be decoded.

No that is not possible. Gateways and nodes provide totally different functions in a LoRaWAN network and using one for the functions provided by the other is not possible.

The key question is why you want to use gateway level messages in stead of application level messages. What do you think you gain by using gateway messages?