code generate templement and generated codes for ElasticInbox