app_token.lsc 1.73 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: wanghaitao  
$Date: 2016-01-16 下午04:38:31  
$Revision: 1.0  
$Purpose: APP,
-->
<a:service xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
            /**
             *read me
             *1.bm部分需改为相应系统的逻辑,此处逻辑为hr系统,仅供参考
             *2.session、cookie部分不用修改,如果出现session、cookie方面的问题,可检查此处的session、cookie(如'/session/@session_id'是否有值)
             *3.调试函数:println(Object);会将Object打印在控制台(如应用服务器tomcat的控制台)。例如:println($session.toXML());会将session对象以xml格式打印出来。
             */
             try {
                var result,
                parameter = $ctx.parameter,
                app_token_bm,
                msg;
                app_token_bm = new ModelService('price_app.hls_app_token');  
                parameter.p_token ? app_token_bm.execute() : null;
                result = {
                    head: {
                        message: " ",
                        code: $ctx.success ? 'success' : 'failure'
                    }
                };
                /*test*/
                // result.head.message = model_len;


            } catch (e) {
                println(e);
            } finally {
                //执行finally代码,将result对象回写
                $ctx.parameter.json = JSON.stringify(result);
            }
            ]]></s:server-script>
            </a:init-procedure>
            <a:service-output output="/parameter/@json"/>
            </a:service>