Merge pull request #78 from gaohanghang/master

去除 mybatis 模板中的方括号[]、修改模板里的类注释样式(感谢@gaohanghang的PR)
This commit is contained in:
Moshow郑锴 2020-02-05 21:51:23 +08:00 committed by GitHub
commit c94e0048ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 71 additions and 60 deletions

View File

@ -7,8 +7,9 @@ import java.util.List;
import java.util.Map;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@RestController
@RequestMapping("/${classInfo.className?uncap_first}")

View File

@ -4,8 +4,9 @@ import java.util.Date;
import java.util.List;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Data
public class ${classInfo.className} implements Serializable {

View File

@ -6,8 +6,9 @@ import java.util.Date;
import java.util.List;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Data
@ApiModel("${classInfo.classComment}")

View File

@ -2,8 +2,9 @@
import java.util.List;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
public interface I${classInfo.className}DAO {

View File

@ -6,8 +6,9 @@ import org.springframework.stereotype.Repository;
import java.util.List;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Repository
public class ${classInfo.className}DaoImpl implements I${classInfo.className}Dao{

View File

@ -13,8 +13,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Entity
@Data

View File

@ -15,8 +15,9 @@ import java.util.List;
import java.util.Map;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@RestController
@RequestMapping("/${classInfo.className?uncap_first}")

View File

@ -14,8 +14,9 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Repository
public interface ${classInfo.className}Repository extends JpaRepository<${classInfo.className},Integer> {

View File

@ -11,8 +11,9 @@ import java.util.List;
import java.util.Map;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@RestController
@RequestMapping("/${classInfo.className?uncap_first}")

View File

@ -3,8 +3,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Repository
public interface ${classInfo.className}Mapper extends BaseMapper<${classInfo.className}> {

View File

@ -9,9 +9,9 @@ import java.util.List;
import java.util.Map;
/**
* ${classInfo.classComment}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@RestController
@RequestMapping(value = "/${classInfo.className}")
@ -21,7 +21,7 @@ public class ${classInfo.className}Controller {
private ${classInfo.className}Service ${classInfo.className?uncap_first}Service;
/**
* [新增]
* 新增
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
@ -31,7 +31,7 @@ public class ${classInfo.className}Controller {
}
/**
* [刪除]
* 刪除
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
@ -41,7 +41,7 @@ public class ${classInfo.className}Controller {
}
/**
* [更新]
* 更新
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
@ -51,7 +51,7 @@ public class ${classInfo.className}Controller {
}
/**
* [查询] 根据主键 id 查询
* 查询 根据主键 id 查询
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
@ -61,7 +61,7 @@ public class ${classInfo.className}Controller {
}
/**
* [查询] 分页查询
* 查询 分页查询
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/

View File

@ -4,51 +4,51 @@ import org.springframework.stereotype.Repository;
import java.util.List;
/**
* ${classInfo.classComment}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Mapper
@Repository
public interface ${classInfo.className}Mapper {
/**
* [新增]
* 新增
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
int insert(${classInfo.className} ${classInfo.className?uncap_first});
/**
* [刪除]
* 刪除
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
int delete(int id);
/**
* [更新]
* 更新
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
int update(${classInfo.className} ${classInfo.className?uncap_first});
/**
* [查询] 根据主键 id 查询
* 查询 根据主键 id 查询
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
${classInfo.className} load(int id);
/**
* [查询] 分页查询
* 查询 分页查询
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/
List<${classInfo.className}> pageList(int offset,int pagesize);
/**
* [查询] 分页查询 count
* 查询 分页查询 count
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
**/

View File

@ -3,8 +3,9 @@ import java.util.Date;
import java.util.List;
/**
* ${classInfo.classComment}
* @author ${authorName} ${.now?string('yyyy-MM-dd')}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
public class ${classInfo.className} implements Serializable {

View File

@ -1,9 +1,9 @@
import java.util.Map;
/**
* ${classInfo.classComment}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
public interface ${classInfo.className}Service {

View File

@ -7,9 +7,9 @@ import java.util.List;
import java.util.Map;
/**
* ${classInfo.classComment}
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy/MM/dd')}
* @date ${.now?string('yyyy-MM-dd HH:mm:ss')}
*/
@Service
public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service {