package org.usc.wechat.mp.sdk.vo.menu;

/**
 *
 * @author Shunli
 */
public enum MenuType {
    CLICK("click") {
        @Override
        protected SingleMenuInfo buildSingleMenuInfo(SingleMenuInfo menuInfo, String menuUrlOrKey) {
            menuInfo.setKey(menuUrlOrKey);
            return menuInfo;
        }
    },
    VIEW("view") {
        @Override
        protected SingleMenuInfo buildSingleMenuInfo(SingleMenuInfo menuInfo, String menuUrlOrKey) {
            menuInfo.setUrl(menuUrlOrKey);
            return menuInfo;
        }
    },
    ;

    private String type;

    private MenuType(String type) {
        this.type = type;
    }

    protected abstract SingleMenuInfo buildSingleMenuInfo(SingleMenuInfo menuInfo, String menuUrlOrKey);

    public SingleMenuInfo buildSingleMenuInfo(String menuName, String menuUrlOrKey) {
        return buildSingleMenuInfo(new SingleMenuInfo(menuName, type), menuUrlOrKey);
    }

}

@@ -107,217 +107,8 @@
 ck%22)
- %7B%0A        @Override%0A        protected SingleMenuInfo buildSingleMenuInfo(SingleMenuInfo menuInfo, String menuUrlOrKey) %7B%0A            menuInfo.setKey(menuUrlOrKey);%0A            return menuInfo;%0A        %7D%0A    %7D
 ,%0A  
@@ -335,16 +335,240 @@
   %7D,%0A   
+ SCANCODE_PUSH(%22scancode_push%22),%0A    SCANCODE_WAITMSG(%22scancode_waitmsg%22),%0A    PIC_SYSPHOTO(%22pic_sysphoto%22),%0A    PIC_PHOTO_OR_ALBUM(%22pic_photo_or_album%22),%0A    PIC_WEIXIN(%22pic_weixin%22),%0A    LOCATION_SELECT(%22location_select%22),
  ;%0A%0A    
@@ -676,17 +676,8 @@
 ted 
-abstract 
 Sing
@@ -752,17 +752,88 @@
 rlOrKey)
-;
+ %7B%0A        menuInfo.setKey(menuUrlOrKey);%0A        return menuInfo;%0A    %7D
 %0A%0A    pu

support new menus types.