The invention discloses a
code generation method and a device of a service function. The method comprises: the
xml data template entered by the user is received, the
xml data template is then parsed,The table structure data corresponding to the table structure information of the code to be generated is obtained, the code template of the code to be generated is obtained according to the path information of the code template, and finally the code file to be generated is parsed and generated according to the table structure data and the code template of the code to be generated by the freemakertechnology. As user only needs to input the
xml data template, the code file can be obtain without manual coding, the time occupied by the developer in repetitive work can be effectively reduce, and the research and development efficiency is greatly improved; Further, since the code file in the embodiment of the invention is generated based on the
xml data template, the method provided by the embodiment of the invention can facilitate the unified management of the code and improve the
readability and the development quality.