package com.wanyue.inside.busniess;

import com.wanyue.common.CommonAppConfig;

public  class HtmlHelper{
        private StringBuilder mStringBuilder;
        public HtmlHelper() {
            mStringBuilder = new StringBuilder();
        }

        public static HtmlHelper newHtmlHelper(){
            return new HtmlHelper();
        }

        public  HtmlHelper appendUrl(String url){
            if(mStringBuilder==null){
               mStringBuilder = new StringBuilder();
            }
            mStringBuilder.append(CommonAppConfig.HOST)
            .append(url);
            return this;
        }

        public HtmlHelper appendParm(String key,String value){
            if(mStringBuilder==null){
                mStringBuilder = new StringBuilder();
            }
            mStringBuilder.append("&").append(key).append("=").append(value);
            return this;
        }
        
        public HtmlHelper appendUToken(){
             appendParm("uid",CommonAppConfig.getUid())
            .appendParm("token",CommonAppConfig.getToken());
             return this;
        }

        public String create(){
            if(mStringBuilder!=null){
                return  mStringBuilder.toString(); 
            }
             return null;
        }
    }