Skip to content

Commit c6331d7

Browse files
committed
update service.java.vm
1 parent ef4d155 commit c6331d7

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

src/main/java/cn/devcxl/generator/CodeGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void main(String[] args) {
5252
VelocityContext context = VelocityUtils.prepareContext(configuration, entityInfo);
5353

5454

55-
String template = "templates/xml/mapper.xml.vm" ;
55+
String template = "templates/java/service.java.vm" ;
5656
StringWriter sw = new StringWriter();
5757
Template tpl = Velocity.getTemplate(template, Velocity.ENCODING_DEFAULT);
5858
tpl.merge(context, sw);

src/main/java/cn/devcxl/generator/utils/VelocityUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static VelocityContext prepareContext(Configuration configuration, Entity
3131
velocityContext.put("entity", entityInfo);
3232
velocityContext.put("tableName", entityInfo.getTableName());
3333
velocityContext.put("ClassName", entityInfo.getClassName());
34-
velocityContext.put("className", StringUtils.uncapitalize(entityInfo.getClassName()));
34+
velocityContext.put("className", GeneratorUtils.toLowerCaseCamelCase(entityInfo.getClassName()));
3535
velocityContext.put("packageName", packageName);
3636
velocityContext.put("author", author);
3737
velocityContext.put("datetime", DateUtil.today());

src/main/resources/templates/java/service.java.vm

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,31 @@ public interface I${ClassName}Service {
1515

1616
/**
1717
* 查询${ClassName}
18-
* @param Query${ClassName}
19-
* @param pageRequest
18+
* @param query${ClassName} ${entity.name}列表查询条件
19+
* @param pageRequest 分页查询参数
2020
* @return ${ClassName} 分页集合
21-
* */
22-
PageResponse<${ClassName}> select${ClassName}Page(Query${ClassName} query${className}, PageRequest pageRequest);
21+
**/
22+
PageResponse<${ClassName}> select${ClassName}Page(Query${ClassName} query${ClassName}, PageRequest pageRequest);
23+
24+
/**
25+
* 添加${ClassName}
26+
* @param ${className}
27+
* @return
28+
**/
29+
CommonResp<?> add(${ClassName} ${className});
30+
31+
/**
32+
* 删除${ClassName}
33+
* @param id
34+
* @return
35+
**/
36+
CommonResp<?> delete(${primaryKeyField.fieldType.javaShortType} id);
37+
38+
/**
39+
* 修改${ClassName}
40+
* @param ${className}
41+
* @return
42+
**/
43+
CommonResp<?> update(${ClassName} ${className});
2344

2445
}

0 commit comments

Comments
 (0)