🔖 发布一个版本。 v1.4.0 新增代码生成

This commit is contained in:
冷冷 committed 2018-08-02 22:16:14 +08:00
1 parent 4e6ce28340
commit cbceb44fb4
18 files changed
+246 -99

No files matched your search

@@ -5,7 +5,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.pig4cloud.pigx.common.core.constant.CommonConstant;
import com.baomidou.mybatisplus.plugins.Page;
import com.pig4cloud.pigx.common.core.util.Query;
import ${package}.${moduleName}.entity.${className};
@@ -21,7 +21,7 @@ import java.util.Map;
* @date ${datetime}
*/
@RestController
@RequestMapping("${moduleName}/${pathName}")
@RequestMapping("/${pathName}")
public class ${className}Controller {
@Autowired
private ${className}Service ${classname}Service;
@@ -34,7 +34,6 @@ public class ${className}Controller {
*/
@GetMapping("/page")
public Page page(@RequestParam Map<String, Object> params) {
params.put(CommonConstant.DEL_FLAG, CommonConstant.STATUS_NORMAL);
return ${classname}Service.selectPage(new Query<>(params), new EntityWrapper<>());
}
@@ -1,5 +1,6 @@
package ${package}.${moduleName}.entity;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
@@ -19,7 +20,7 @@ import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("${tableName}")
public class ${className} implements Serializable {
public class ${className} extends Model<${className}> {
private static final long serialVersionUID = 1L;
#foreach ($column in $columns)
@@ -31,4 +32,12 @@ public class ${className} implements Serializable {
#end
private $column.attrType $column.lowerAttrName;
#end
/**
* 主键值
*/
@Override
protected Serializable pkVal() {
return this.$pk.columnName;
}
}
@@ -6,7 +6,7 @@
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="${package}.${moduleName}.entity.${className}" id="${classname}Map">
#foreach($column in $columns)
<result property="${column.attrname}" column="${column.columnName}"/>
<result property="${column.lowerAttrName}" column="${column.columnName}"/>
#end
</resultMap>
@@ -1,11 +1,13 @@
-- 该脚本不要执行,请完善 ID 对应关系,注意层级关系 !!!!
-- 菜单SQL
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '1', 'views/${moduleName}/${pathName}/index', '', '0', 'client', 'icon-bangzhushouji', '8', '0', '2018-01-20 13:17:19', '8', '2018-07-29 13:38:19', '${comments}管理');
values ( '1', 'views/${moduleName}/${pathName}/index', '菜单ID', '0', '${pathName}', 'icon-bangzhushouji', '8', '0', '2018-01-20 13:17:19', '8', '2018-07-29 13:38:19', '${comments}管理');
-- 菜单对应按钮SQL
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '8', null, '${moduleName}_${pathName}_add', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '0', '2018-07-29 13:38:59', '${comments}新增');
values ( '子按钮ID1', null, '${moduleName}_${pathName}_add', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '0', '2018-07-29 13:38:59', '${comments}新增');
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '8', null, '${moduleName}_${pathName}_edit', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '${comments}修改');
values ( '子按钮ID2', null, '${moduleName}_${pathName}_edit', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '${comments}修改');
insert into `pigx`.`sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
values ( '8', null, '${moduleName}_${pathName}_del', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除');
values ( '子按钮ID3', null, '${moduleName}_${pathName}_del', '1', null, '1', '81', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除');