Skip to content

Commit 121018c

Browse files
committed
1. 修复interface模版的bug
1 parent a27842a commit 121018c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/com/tml/otowbackend/engine/generator/funpack/pack/SelectFunctionPack.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ private MetaMethod getSelectMethod(){
3939
ReqTemplate reqUser = new ReqTemplate(reqPackagePath, "id");
4040
MetaMethodParam metaMethodParam = new MetaMethodParam("Integer",reqUser.getAllPackagePath(), "id");
4141
metaMethodParam.addAnnotations(List.of(Path_Variable));
42-
String body = String.format("%s.%s(%s);", getParamString("classLower"), selectServiceMethod, "id");
43-
return new MetaMethod(selectServiceMethod, List.of(metaMethodParam), body);
42+
String body = "return " + String.format("%s.%s(%s);", getParamString("classLower"), selectServiceMethod, "id");
43+
MetaMethod metaMethod = new MetaMethod(selectServiceMethod, List.of(metaMethodParam), body);
44+
metaMethod.setReturnRes(getParamString("className"));
45+
return metaMethod;
4446
}
4547

4648
@Override

src/main/java/com/tml/otowbackend/engine/generator/template/meta/MetaMethod.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,8 @@ public void setIsStatic(boolean isStatic) {
150150
public static MetaMethod justStringReinder(String methodBody) {
151151
return new MetaMethod(methodBody);
152152
}
153+
154+
public void setReturnRes(String returnRes) {
155+
this.returnRes = returnRes;
156+
}
153157
}

0 commit comments

Comments
 (0)