From 741884942c3ab0c15dca0bd663a614c25ec63a71 Mon Sep 17 00:00:00 2001 From: shuzijun Date: Tue, 24 Aug 2021 11:47:27 +0800 Subject: [PATCH] fix Question ID --- .../actions/editor/AbstractEditAction.java | 2 +- .../actions/editor/OpenSolutionAction.java | 2 +- .../plugin/actions/tree/FavoriteAction.java | 2 +- .../plugin/listener/TreeWillListener.java | 3 +- .../leetcode/plugin/manager/CodeManager.java | 37 +++++++++---------- .../plugin/manager/FavoriteManager.java | 24 +++++++++++- .../plugin/manager/QuestionManager.java | 14 +++---- .../leetcode/plugin/manager/ViewManager.java | 27 +++++++++----- .../leetcode/plugin/model/LeetcodeEditor.java | 12 +++--- .../shuzijun/leetcode/plugin/model/Tag.java | 6 +-- .../plugin/setting/ProjectConfig.java | 4 +- .../leetcode/plugin/utils/FileUtils.java | 4 +- src/main/resources/i18n/info_zh.properties | 2 +- 13 files changed, 84 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/AbstractEditAction.java b/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/AbstractEditAction.java index 06e7a35f..66883ea9 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/AbstractEditAction.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/AbstractEditAction.java @@ -28,7 +28,7 @@ public void actionPerformed(AnActionEvent anActionEvent, Config config) { if (leetcodeEditor == null) { return; } - Question question = ViewManager.getQuestionById(leetcodeEditor.getQuestionId(), anActionEvent.getProject()); + Question question = ViewManager.getQuestionById(leetcodeEditor.getFrontendQuestionId(), anActionEvent.getProject()); if (question == null) { MessageUtils.getInstance(anActionEvent.getProject()).showInfoMsg("info", PropertiesUtils.getInfo("tree.null")); return; diff --git a/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/OpenSolutionAction.java b/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/OpenSolutionAction.java index 0cd5ce0a..ef974362 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/OpenSolutionAction.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/actions/editor/OpenSolutionAction.java @@ -30,7 +30,7 @@ public void update(@NotNull AnActionEvent anActionEvent) { if (leetcodeEditor == null) { return; } - Question question = ViewManager.getDumbQuestionById(leetcodeEditor.getQuestionId(), anActionEvent.getProject()); + Question question = ViewManager.getDumbQuestionById(leetcodeEditor.getFrontendQuestionId(), anActionEvent.getProject()); if (question == null) { anActionEvent.getPresentation().setEnabled(false); return; diff --git a/src/main/java/com/shuzijun/leetcode/plugin/actions/tree/FavoriteAction.java b/src/main/java/com/shuzijun/leetcode/plugin/actions/tree/FavoriteAction.java index 7903fefd..d9a8bf35 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/actions/tree/FavoriteAction.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/actions/tree/FavoriteAction.java @@ -37,7 +37,7 @@ public boolean isSelected(AnActionEvent anActionEvent) { if (question == null) { return false; } - return tag.getQuestions().contains(question.getQuestionId()); + return tag.getFrontendQuestionId().contains(question.getFrontendQuestionId()); } @Override diff --git a/src/main/java/com/shuzijun/leetcode/plugin/listener/TreeWillListener.java b/src/main/java/com/shuzijun/leetcode/plugin/listener/TreeWillListener.java index 532029b9..7afee187 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/listener/TreeWillListener.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/listener/TreeWillListener.java @@ -54,7 +54,8 @@ public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException ProgressManager.getInstance().run(new Task.Backgroundable(project, PluginConstant.LEETCODE_EDITOR_TREE,false) { @Override public void run(@NotNull ProgressIndicator progressIndicator) { - loadData(question,node,selPath,tree,toolWindow); + //loadData(question,node,selPath,tree,toolWindow); + MessageUtils.showMsg(toolWindow.getContentManager().getComponent(), MessageType.INFO, "info", "Temporarily disabled"); } }); throw new ExpandVetoException(event); diff --git a/src/main/java/com/shuzijun/leetcode/plugin/manager/CodeManager.java b/src/main/java/com/shuzijun/leetcode/plugin/manager/CodeManager.java index 4702ef61..b971a224 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/manager/CodeManager.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/manager/CodeManager.java @@ -31,7 +31,7 @@ public static void openCode(Question question, Project project) { return; } - if (!fillQuestion(question, project)) { + if (!fillQuestion(question, codeTypeEnum, project)) { return; } @@ -46,11 +46,9 @@ public static void openCode(Question question, Project project) { if (file.exists()) { FileUtils.openFileEditorAndSaveState(file,project,question,fillPath,true); } else { - if (getQuestion(question, codeTypeEnum, project)) { - question.setContent(CommentUtils.createComment(question.getContent(), codeTypeEnum,config)); - FileUtils.saveFile(file, VelocityUtils.convert(config.getCustomTemplate(), question)); - FileUtils.openFileEditorAndSaveState(file,project,question,fillPath,true); - } + question.setContent(CommentUtils.createComment(question.getContent(), codeTypeEnum, config)); + FileUtils.saveFile(file, VelocityUtils.convert(config.getCustomTemplate(), question)); + FileUtils.openFileEditorAndSaveState(file, project, question, fillPath, true); } } @@ -64,7 +62,7 @@ public static void openContent(Question question, Project project,boolean isOpen return; } - if (!fillQuestion(question, project)) { + if (!fillQuestion(question,codeTypeEnum, project)) { return; } @@ -75,11 +73,8 @@ public static void openContent(Question question, Project project,boolean isOpen if (file.exists()) { FileUtils.openFileEditorAndSaveState(file,project,question,fillPath,isOpen); } else { - if (getQuestion(question, codeTypeEnum, project)) { - FileUtils.saveFile(file, question.getContent()); - FileUtils.openFileEditorAndSaveState(file,project,question,fillPath,isOpen); - } - + FileUtils.saveFile(file, question.getContent()); + FileUtils.openFileEditorAndSaveState(file, project, question, fillPath, isOpen); } } @@ -95,8 +90,8 @@ private static boolean getQuestion(Question question, CodeTypeEnum codeTypeEnum, JSONObject jsonObject = JSONObject.parseObject(body).getJSONObject("data").getJSONObject("question"); + question.setQuestionId(jsonObject.getString("questionId")); question.setContent(getContent(jsonObject)); - question.setTestCase(jsonObject.getString("sampleTestCase")); JSONArray jsonArray = jsonObject.getJSONArray("codeSnippets"); @@ -136,7 +131,7 @@ public static void SubmitCode(Question question, Project project) { return; } - if (!fillQuestion(question, project)) { + if (!fillQuestion(question,codeTypeEnum, project)) { return; } @@ -178,7 +173,7 @@ public static void RunCodeCode(Question question, Project project) { return; } - if (!fillQuestion(question, project)) { + if (!fillQuestion(question,codeTypeEnum, project)) { return; } @@ -199,7 +194,9 @@ public static void RunCodeCode(Question question, Project project) { JSONObject returnObj = JSONObject.parseObject(body); ProgressManager.getInstance().run(new RunCodeCheckTask(returnObj, project, question.getTestCase())); MessageUtils.getInstance(project).showInfoMsg("info", PropertiesUtils.getInfo("request.pending")); - } else { + }else if (response != null && response.getStatusCode() == 429) { + MessageUtils.getInstance(project).showWarnMsg("error", "Please wait for the result."); + }else { LogUtils.LOG.error("RuncodeCode failure " + response == null ? "" : response.getBody()); MessageUtils.getInstance(project).showWarnMsg("error", PropertiesUtils.getInfo("request.failed")); } @@ -244,7 +241,7 @@ public static void setTestCaeAndLang(Question question, CodeTypeEnum codeTypeEnu MessageUtils.getInstance(project).showWarnMsg("info", PropertiesUtils.getInfo("config.code")); return; } - if (!fillQuestion(question, project)) { + if (!fillQuestion(question,codeTypeEnum, project)) { return; } @@ -279,7 +276,7 @@ public static void setTestCaeAndLang(Question question, CodeTypeEnum codeTypeEnu } - private static boolean fillQuestion(Question question, Project project) { + public static boolean fillQuestion(Question question,CodeTypeEnum codeTypeEnum, Project project) { if (Constant.NODETYPE_ITEM.equals(question.getNodeType())) { ExploreManager.getItem(question); @@ -288,9 +285,11 @@ private static boolean fillQuestion(Question question, Project project) { return false; } else { question.setNodeType(Constant.NODETYPE_DEF); - return true; } } + if (StringUtils.isBlank(question.getQuestionId())){ + return getQuestion(question,codeTypeEnum,project); + } return true; } diff --git a/src/main/java/com/shuzijun/leetcode/plugin/manager/FavoriteManager.java b/src/main/java/com/shuzijun/leetcode/plugin/manager/FavoriteManager.java index 3660aae0..57a4e27d 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/manager/FavoriteManager.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/manager/FavoriteManager.java @@ -2,8 +2,10 @@ import com.alibaba.fastjson.JSONObject; import com.intellij.openapi.project.Project; +import com.shuzijun.leetcode.plugin.model.CodeTypeEnum; import com.shuzijun.leetcode.plugin.model.Question; import com.shuzijun.leetcode.plugin.model.Tag; +import com.shuzijun.leetcode.plugin.setting.PersistentConfig; import com.shuzijun.leetcode.plugin.utils.*; /** @@ -16,6 +18,15 @@ public static void addQuestionToFavorite(Tag tag, Question question, Project pro MessageUtils.getInstance(project).showWarnMsg("info", PropertiesUtils.getInfo("login.not")); return ; } + CodeTypeEnum codeTypeEnum = CodeTypeEnum.getCodeTypeEnum(PersistentConfig.getInstance().getInitConfig().getCodeType()); + if (codeTypeEnum == null) { + MessageUtils.getInstance(project).showWarnMsg("info", PropertiesUtils.getInfo("config.code")); + return; + } + + if(!CodeManager.fillQuestion(question,codeTypeEnum,project)){ + return; + } try { HttpRequest httpRequest = HttpRequest.post(URLUtils.getLeetcodeGraphql(),"application/json"); @@ -27,7 +38,7 @@ public static void addQuestionToFavorite(Tag tag, Question question, Project pro String body = response.getBody(); JSONObject object = JSONObject.parseObject(body).getJSONObject("data").getJSONObject("addQuestionToFavorite"); if (object.getBoolean("ok")) { - tag.getQuestions().add(question.getQuestionId()); + tag.getFrontendQuestionId().add(question.getFrontendQuestionId()); } else { MessageUtils.getInstance(project).showWarnMsg("info", object.getString("error")); } @@ -44,6 +55,15 @@ public static void removeQuestionFromFavorite(Tag tag, Question question,Project MessageUtils.getInstance(project).showWarnMsg("info", PropertiesUtils.getInfo("login.not")); return ; } + CodeTypeEnum codeTypeEnum = CodeTypeEnum.getCodeTypeEnum(PersistentConfig.getInstance().getInitConfig().getCodeType()); + if (codeTypeEnum == null) { + MessageUtils.getInstance(project).showWarnMsg("info", PropertiesUtils.getInfo("config.code")); + return; + } + + if(!CodeManager.fillQuestion(question,codeTypeEnum,project)){ + return; + } try { HttpRequest httpRequest = HttpRequest.post(URLUtils.getLeetcodeGraphql(),"application/json"); @@ -55,7 +75,7 @@ public static void removeQuestionFromFavorite(Tag tag, Question question,Project String body = response.getBody(); JSONObject object = JSONObject.parseObject(body).getJSONObject("data").getJSONObject("removeQuestionFromFavorite"); if (object.getBoolean("ok")) { - tag.getQuestions().remove(question.getQuestionId()); + tag.getFrontendQuestionId().remove(question.getFrontendQuestionId()); } else { MessageUtils.getInstance(project).showWarnMsg("info", object.getString("error")); } diff --git a/src/main/java/com/shuzijun/leetcode/plugin/manager/QuestionManager.java b/src/main/java/com/shuzijun/leetcode/plugin/manager/QuestionManager.java index ce22a5c0..e22d5376 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/manager/QuestionManager.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/manager/QuestionManager.java @@ -148,7 +148,7 @@ public String apply(Question question) { Tag tag = new Tag(); tag.setName(key); for (Question question : questionImmutableMap.get(key)) { - tag.addQuestion(question.getQuestionId()); + tag.addFrontendQuestionId(question.getFrontendQuestionId()); } difficultyList.add(tag); } @@ -179,7 +179,7 @@ public String apply(Question question) { Tag tag = new Tag(); tag.setName(key); for (Question question : questionImmutableMap.get(key)) { - tag.addQuestion(question.getQuestionId()); + tag.addFrontendQuestionId(question.getFrontendQuestionId()); } statusList.add(tag); } @@ -256,7 +256,7 @@ private static List parseQuestion(String str, Boolean isPremium) { question.setTitle(object.getString("titleCn")); } question.setLeaf(Boolean.TRUE); - question.setQuestionId(object.getString("frontendQuestionId")); + //question.setQuestionId(object.getString("frontendQuestionId")); question.setFrontendQuestionId(object.getString("frontendQuestionId")); question.setAcceptance(object.getDouble("acRate")); try { @@ -298,7 +298,7 @@ private static List parseQuestion(String str, Boolean isPremium) { return questionList; } - private static void translation(List questions) { + /* private static void translation(List questions) { if (URLUtils.isCn() && !PersistentConfig.getInstance().getConfig().getEnglishContent()) { @@ -338,7 +338,7 @@ private static void translation(List questions) { } } - } + }*/ private static void questionOfToday() { if (URLUtils.isCn()) { @@ -377,7 +377,7 @@ private static List parseTag(String str) { tag.setName(name); JSONArray questionArray = object.getJSONArray("questions"); for (int j = 0; j < questionArray.size(); j++) { - tag.addQuestion(questionArray.getInteger(j).toString()); + tag.addFrontendQuestionId(questionArray.getInteger(j).toString()); } tags.add(tag); } @@ -424,7 +424,7 @@ private static List parseList(String str) { tag.setName(name); JSONArray questionArray = object.getJSONArray("questions"); for (int j = 0; j < questionArray.size(); j++) { - tag.addQuestion(questionArray.getInteger(j).toString()); + tag.addFrontendQuestionId(questionArray.getInteger(j).toString()); } tags.add(tag); } diff --git a/src/main/java/com/shuzijun/leetcode/plugin/manager/ViewManager.java b/src/main/java/com/shuzijun/leetcode/plugin/manager/ViewManager.java index b5949f11..fac7f45a 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/manager/ViewManager.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/manager/ViewManager.java @@ -13,6 +13,7 @@ import com.shuzijun.leetcode.plugin.utils.MessageUtils; import com.shuzijun.leetcode.plugin.utils.PropertiesUtils; import com.shuzijun.leetcode.plugin.window.WindowFactory; +import org.apache.commons.lang.StringUtils; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; @@ -62,14 +63,14 @@ public static void loadServiceData(JTree tree, Project project, String categoryS question = Maps.uniqueIndex(questionList.iterator(), new Function() { @Override public String apply(Question question) { - return question.getQuestionId(); + return question.getFrontendQuestionId(); } }); filter.put(Constant.FIND_TYPE_DIFFICULTY, QuestionManager.getDifficulty()); - filter.put(Constant.FIND_TYPE_STATUS, QuestionManager.getStatus()); - filter.put(Constant.FIND_TYPE_LISTS, QuestionManager.getLists()); - filter.put(Constant.FIND_TYPE_TAGS, QuestionManager.getTags()); + //filter.put(Constant.FIND_TYPE_STATUS, QuestionManager.getStatus()); + // filter.put(Constant.FIND_TYPE_LISTS, QuestionManager.getLists()); + // filter.put(Constant.FIND_TYPE_TAGS, QuestionManager.getTags()); Temporarily disabled filter.put(Constant.FIND_TYPE_CATEGORY, QuestionManager.getCategory(categorySlug)); @@ -140,12 +141,20 @@ public static void update(JTree tree) { TreeSet tagQuestionList = null; for (Tag tag : tagList) { if (tag.isSelect()) { - TreeSet temp = tag.getQuestions(); + TreeSet temp = tag.getFrontendQuestionId(); if (tagQuestionList == null) { tagQuestionList = new TreeSet(new Comparator() { @Override public int compare(String arg0, String arg1) { - return Integer.valueOf(arg0).compareTo(Integer.valueOf(arg1)); + if (StringUtils.isNumeric(arg0) && StringUtils.isNumeric(arg1)) { + return Integer.valueOf(arg0).compareTo(Integer.valueOf(arg1)); + } else if (StringUtils.isNumeric(arg0)) { + return -1; + } else if (StringUtils.isNumeric(arg1)) { + return 1; + } else { + return arg0.compareTo(arg1); + } } }); tagQuestionList.addAll(temp); @@ -279,11 +288,11 @@ public static Question getDumbQuestionById(String id, Project project) { private static void addChild(DefaultMutableTreeNode rootNode, List Lists, Map questionMap) { if (!Lists.isEmpty()) { for (Tag tag : Lists) { - long qCnt = tag.getQuestions().stream().filter(q -> questionMap.get(q) != null).count(); + long qCnt = tag.getFrontendQuestionId().stream().filter(q -> questionMap.get(q) != null).count(); DefaultMutableTreeNode tagNode = new DefaultMutableTreeNode(new Question(String.format("%s(%d)", tag.getName(), qCnt))); rootNode.add(tagNode); - for (String key : tag.getQuestions()) { + for (String key : tag.getFrontendQuestionId()) { if (questionMap.get(key) != null) { tagNode.add(new DefaultMutableTreeNode(questionMap.get(key))); } @@ -309,7 +318,7 @@ public static void position(JTree tree, JBScrollPane scrollPane, Question questi for (int i = 0, j = node.getChildCount(); i < j; i++) { DefaultMutableTreeNode childNode = (DefaultMutableTreeNode) node.getChildAt(i); Question nodeData = (Question) childNode.getUserObject(); - if (nodeData.getQuestionId().equals(question.getQuestionId())) { + if (nodeData.getFrontendQuestionId().equals(question.getFrontendQuestionId())) { TreePath toShowPath = new TreePath(childNode.getPath()); tree.setSelectionPath(toShowPath); Rectangle bounds = tree.getPathBounds(toShowPath); diff --git a/src/main/java/com/shuzijun/leetcode/plugin/model/LeetcodeEditor.java b/src/main/java/com/shuzijun/leetcode/plugin/model/LeetcodeEditor.java index 125fcd21..f0a71745 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/model/LeetcodeEditor.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/model/LeetcodeEditor.java @@ -13,9 +13,9 @@ public class LeetcodeEditor { private String path; /** - * questionId + * frontendQuestionId */ - private String questionId; + private String frontendQuestionId; /** @@ -39,12 +39,12 @@ public void setPath(String path) { this.path = path; } - public String getQuestionId() { - return questionId; + public String getFrontendQuestionId() { + return frontendQuestionId; } - public void setQuestionId(String questionId) { - this.questionId = questionId; + public void setFrontendQuestionId(String frontendQuestionId) { + this.frontendQuestionId = frontendQuestionId; } public String getContentPath() { diff --git a/src/main/java/com/shuzijun/leetcode/plugin/model/Tag.java b/src/main/java/com/shuzijun/leetcode/plugin/model/Tag.java index 91fee981..56b8a906 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/model/Tag.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/model/Tag.java @@ -45,11 +45,11 @@ public void setName(String name) { this.name = name; } - public TreeSet getQuestions() { + public TreeSet getFrontendQuestionId() { return questions; } - public void addQuestion(String questionId) { - questions.add(questionId); + public void addFrontendQuestionId(String frontendQuestionId) { + questions.add(frontendQuestionId); } public String getType() { diff --git a/src/main/java/com/shuzijun/leetcode/plugin/setting/ProjectConfig.java b/src/main/java/com/shuzijun/leetcode/plugin/setting/ProjectConfig.java index 1ffa246e..f981dea5 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/setting/ProjectConfig.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/setting/ProjectConfig.java @@ -38,7 +38,7 @@ public void loadState(@NotNull ProjectConfig.InnerState innerState) { this.innerState = innerState; idProjectConfig.clear(); this.innerState.projectConfig.forEach((s, leetcodeEditor) -> { - idProjectConfig.put(leetcodeEditor.getQuestionId(),leetcodeEditor); + idProjectConfig.put(leetcodeEditor.getFrontendQuestionId(),leetcodeEditor); }); } @@ -53,7 +53,7 @@ public LeetcodeEditor getDefEditor(String questionId) { } public void addLeetcodeEditor(LeetcodeEditor leetcodeEditor) { - idProjectConfig.put(leetcodeEditor.getQuestionId(), leetcodeEditor); + idProjectConfig.put(leetcodeEditor.getFrontendQuestionId(), leetcodeEditor); if(StringUtils.isNotBlank(leetcodeEditor.getPath())) { innerState.projectConfig.put(leetcodeEditor.getPath(), leetcodeEditor); } diff --git a/src/main/java/com/shuzijun/leetcode/plugin/utils/FileUtils.java b/src/main/java/com/shuzijun/leetcode/plugin/utils/FileUtils.java index f6ada5dd..82b3f733 100644 --- a/src/main/java/com/shuzijun/leetcode/plugin/utils/FileUtils.java +++ b/src/main/java/com/shuzijun/leetcode/plugin/utils/FileUtils.java @@ -227,8 +227,8 @@ public static void openFileEditor(File file, Project project) { public static void openFileEditorAndSaveState(File file, Project project, Question question, BiConsumer consumer,boolean isOpen) { ApplicationManager.getApplication().invokeAndWait(() -> { VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file); - LeetcodeEditor leetcodeEditor = ProjectConfig.getInstance(project).getDefEditor(question.getQuestionId()); - leetcodeEditor.setQuestionId(question.getQuestionId()); + LeetcodeEditor leetcodeEditor = ProjectConfig.getInstance(project).getDefEditor(question.getFrontendQuestionId()); + leetcodeEditor.setFrontendQuestionId(question.getFrontendQuestionId()); consumer.accept(leetcodeEditor,vf.getPath()); ProjectConfig.getInstance(project).addLeetcodeEditor(leetcodeEditor); if(isOpen) { diff --git a/src/main/resources/i18n/info_zh.properties b/src/main/resources/i18n/info_zh.properties index 48cef985..67db8bc2 100644 --- a/src/main/resources/i18n/info_zh.properties +++ b/src/main/resources/i18n/info_zh.properties @@ -36,7 +36,7 @@ updata=leetcode editor\u65B0\u7248\u672C {0} \u53D1\u5E03,\u8BF7\u53CA\u65F6\u66 user.email=\u60A8\u5C1A\u672A\u9A8C\u8BC1\u81EA\u5DF1\u7684\u5E10\u6237\n\u5728\u9A8C\u8BC1\u7535\u5B50\u90AE\u4EF6\u4E4B\u524D\uFF0C\u60A8\u65E0\u6CD5\u5C06\u4EE3\u7801\u63D0\u4EA4\u7ED9\u8BC4\u5224\u7CFB\u7EDF\u3002\n\u60A8\u53EF\u4EE5\u5728\u4E2A\u4EBA\u8D44\u6599\u9875\u9762\u4E2D\u91CD\u65B0\u53D1\u9001\u9A8C\u8BC1\u7535\u5B50\u90AE\u4EF6\u6216\u66F4\u6539\u7535\u5B50\u90AE\u4EF6\u3002 template.variable=${0}question.title{1}\t\u9898\u76EE\u6807\u9898\t\u793A\u4F8B:\u4E24\u6570\u4E4B\u548C\n${0}question.titleSlug{1}\t\u9898\u76EE\u6807\u8BB0\t\u793A\u4F8B:two-sum\n${0}question.frontendQuestionId{1}\t\u9898\u76EE\u7F16\u53F7\n${0}question.content{1}\t\u9898\u76EE\u63CF\u8FF0\n${0}question.code{1}\t\u9898\u76EE\u4EE3\u7801\n$!velocityTool.camelCaseName(str)\t\u8F6C\u6362\u5B57\u7B26\u4E3A\u5927\u9A7C\u5CF0\u6837\u5F0F\uFF08\u5F00\u5934\u5B57\u6BCD\u5927\u5199\uFF09\n$!velocityTool.smallCamelCaseName(str)\t\u8F6C\u6362\u5B57\u7B26\u4E3A\u5C0F\u9A7C\u5CF0\u6837\u5F0F\uFF08\u5F00\u5934\u5B57\u6BCD\u5C0F\u5199\uFF09\n$!velocityTool.snakeCaseName(str)\t\u8F6C\u6362\u5B57\u7B26\u4E3A\u86C7\u5F62\u6837\u5F0F\n$!velocityTool.leftPadZeros(str,n)\t\u5728\u5B57\u7B26\u4E32\u7684\u5DE6\u8FB9\u586B\u51450\uFF0C\u4F7F\u5B57\u7B26\u4E32\u7684\u957F\u5EA6\u81F3\u5C11\u4E3An\n$!velocityTool.date()\t\u83B7\u53D6\u5F53\u524D\u65F6\u95F4 tree.load=\u8BF7\u5148\u52A0\u8F7D\u9898\u76EE -tree.null=\u83B7\u53D6\u9898\u76EE\u4E3A\u7A7A +tree.null=\u83B7\u53D6\u9898\u76EE\u4E3A\u7A7A,\u8BF7\u5C1D\u8BD5\u91CD\u65B0\u4ECE\u9762\u677F\u6253\u5F00\u9898\u76EE tree.select=\u8BF7\u5728\u5217\u8868\u4E2D\u9009\u62E9\u4E00\u4E2A\u6709\u6548\u7684\u9898\u76EE Lang=zh_CN browser.login.success=\u767B\u5F55\u6210\u529F,\u8BF7\u624B\u52A8\u5173\u95ED\u6B64\u7A97\u53E3 \ No newline at end of file