准备有空开发一个管理端代码生成器

1

选择项目架构。

  1. 前后端一体的mysql+redis+spring boot+spring mvc+mybatis plus+shiro+jsp+jquery+bootstrap+tomcat。
  2. 前后端一体的mysql+redis+spring boot+spring mvc+mybatis plus+shiro+freemarker/thymeleaf+jquery+bootstrap+tomcat
  3. 前后端分离的mysql+redis+spring boot+spring mvc+mybatis plus+shiro+jwt+vue+elementUI+nginx+tomcat
  4. 前后端分离的mysql+redis+spring cloud+spring boot+spring mvc+mybatis plus+jwt+shiro+vue+elementUI+nginx+tomcat

确定管理员和用户是同一张表还是不同表。
确定前端密码加密方式(md5、rsa、des、aes)。
确定数据库密码加密方式(md5、rsa、des、aes)。

2

勾选基础功能。

  1. 文件上传下载,支持配置文件切换上传方式(alioss、awsoss、ftp、local)。
  2. 发送短信,支持配置文件切换短信接口提供商(ali、tencent、chuanlan)。
  3. 发送邮件。
  4. 图形验证码。
  5. 国际化。
  6. 翻译,支持配置文件切换翻译接口提供商(baidu、google、youdao、microsoft、kingsoft)。
  7. AOP全局日志、异常、事务。
  8. 注册(邮箱、手机号)
  9. 登录(邮箱、手机号)
  10. 忘记密码
  11. 修改密码
  12. 修改账户信息
  13. 记住账号密码/记住token
  14. 网页端第三方登录跳转方式(wechat、qq、weibo、google、facebook、twitter)
  15. 网页端第三方登录扫码方式(wechat、qq、weibo、google、facebook、twitter)
  16. APP端第三方登录(wechat、qq、weibo、google、facebook、twitter)

3

提供每个表的建表语句即可。

drop table if exists `news`;
create table `news` (
`id` int primary key not null auto_increment,
news_type tinyint not null default 1 comment '新闻类型,1自有新闻,2合作伙伴新闻',
source_id  int comment '新闻来源表id,source_news表,外键,如果为空则表示该新闻为原创文章',
partner varchar(50) comment '合作伙伴,partner新闻合作伙伴表id,外键',
`media` varchar(50) comment '来源媒体,新闻来源的媒体,外键,对应media表id',
`newsid` varchar(50) comment '源ID,新闻合作伙伴推送过来时自带的新闻id',
`author` varchar(50) comment '作者,新闻发布的作者',
`digest` varchar(200) comment '新闻内容摘要,允许为null',
`content` text not null comment '新闻内容,含相关页面标签如<p>等',
`ctext` text not null comment '新闻内容,不含相关页面标签',
`title` varchar(200) not null comment '标题',
`img1` varchar(200) comment '图片链接1',
`img2` varchar(200) comment '图片链接2',
`img3` varchar(200) comment '图片链接3',
`newsurl` varchar(200) comment 'http链接,新闻详情指向的URL',
`newsurlhttps` varchar(200) comment 'https链接,新闻详情指向的https URL',
`source_channel` varchar(50) comment '源频道,源频道是合作方提供,到底是频道id还是频道name不用管,用映射关系表和我们的频道进行对应',
`copyright` varchar(500) comment '版权说明',
`type` tinyint default 1 comment '新闻类型,1普通新闻,2图文新闻',
is_contain_image tinyint default 0 comment'是否包含图片,0未知,1包含,2不包含',
image_count int default 0 comment'图片个数',
`newstime` datetime comment '新闻发生时间',
push_time datetime comment '发布时间,此发布时间是在我们系统发布时间,与source_news表的push_time无关',
`remark` varchar(200) comment '备注',
create_admin_user_id  int comment '创建人,发布人用户(管理端)id,外键',
update_admin_user_id int comment '最后修改人',
push_admin_user_id int comment '最后发布人',
`valid` tinyint not null default '1' comment '状态,0=无效,1=有效,3=已删除',
`is_auto_import` tinyint not null default 3 comment '是否系统自动导入,1系统自动导入,2人为手动导入,3非导入',
`is_not_review` tinyint not null default 1 comment '是否免审,1需要审核,2无需审核',
`status` tinyint not null default 1 comment  '发布状态,1草稿(未修改),2已发布待审核,3审核已驳回,4审核已通过',
`weight_type` tinyint not null default 3 comment '权重类型,1置顶,2热门,3普通',
`weight` int not null default 1 comment '权重值,值越大,权重越高',
`weight_start_time` datetime comment '权重开始时间,如果为空则表示立即生效',
`weight_end_time` datetime comment '权重结束时间,如果为空则表示永久生效',
`weightstr` varchar(2000) not null default '00' comment '所有标签的权重值拼接的字符串',
approve_admin_user_id varchar(50) comment '审批人id,如有多个按分号;分隔',
approve_time datetime comment '最后审核通过时间',
update_time datetime comment '修改时间',
create_time timestamp not null default current_timestamp comment '录入时间'
) engine=innodb default charset=utf8 comment='新闻表';

4

点击生成。

5

修改生成后的代码。

生成的结果:
1.能生成完整的前端代码。
2.提供基础的表格json配置文件:

{
	"data" : "id",
	"table" : "news",
	"showName" : "<input type=\"checkbox\" class=\"ace\" id=\"all_selected_checkbox\" οnclick=\"PublicModule.selectedAllRow(this);\"/><label class=\"lbl\" for=\"all_selected_checkbox\">ID</label>",
	"style" : "width: 3%;",
	"align" : "center"
},{
	"data" : "source_id",//数据库列名
	"field" : "sourceId",//实体类属性名
	"showName" : " 新闻来源表id",//显示的列名
	"style" : "width: 3%;",//列的css样式,一般只设置宽度即可
	"searchType" : "browse",//搜索类型,即在表格上方的搜索区域中,该字段使用什么搜索方式,
	"refTable" : "source",//该字段所引用的表的表名
	"refId" : "id",//该字段所引用的表的列名
	"refName" : "name",//最终显示引用的表的列名
	"refWhere" : "1=1"//引用的表的条件
},{
	"data" : "partner",
	"showName" : " 合作伙伴",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "media",
	"showName" : " 来源媒体",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "newsid",
	"showName" : " 源ID",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "author",
	"showName" : " 作者",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "digest",
	"showName" : " 新闻内容摘要",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "title",
	"showName" : " 标题",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "newsurl",
	"showName" : " http链接",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "newsurlhttps",
	"showName" : " https链接",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "source_channel",
	"showName" : " 源频道",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "copyright",
	"showName" : " 版权说明",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "type_name",
	"field" : "type",
	"showName" : " 新闻类型",
	"style" : "width: 3%;",
	"searchType" : "option",
},{
	"data" : "is_contain_image_name",
	"field" : "isContainImage",
	"showName" : " 是否包含图片",
	"style" : "width: 3%;",
	"searchType" : "option",
},{
	"data" : "newstime",
	"showName" : " 新闻发生时间",
	"style" : "width: 6%;",
	"searchType" : "date",
	"addType" : "none",
	"editType" : "none",
	"searchWhereKey" : "between",
},{
	"data" : "push_time",
	"showName" : " 发布时间",
	"style" : "width: 6%;",
	"searchType" : "date",
	"addType" : "none",
	"editType" : "none",
	"searchWhereKey" : "between",
},{
	"data" : "remark",
	"showName" : " 备注",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "create_admin_user_id",
	"field" : "createAdminUserId",
	"showName" : " 创建人",
	"style" : "width: 3%;",
	"searchType" : "browse",
	"refTable" : "create_admin_user",
	"refId" : "id",
	"refName" : "name",
	"refWhere" : "1=1"
},{
	"data" : "valid_name",
	"field" : "valid",
	"showName" : " 状态",
	"style" : "width: 3%;",
	"searchType" : "option",
},{
	"data" : "is_auto_import_name",
	"field" : "isAutoImport",
	"showName" : " 是否系统自动导入",
	"style" : "width: 3%;",
	"searchType" : "option",
},{
	"data" : "is_not_review_name",
	"field" : "isNotReview",
	"showName" : " 是否免审",
	"style" : "width: 3%;",
	"searchType" : "option",
},{
	"data" : "status_name",
	"field" : "status",
	"showName" : " 新闻状态",
	"style" : "width: 3%;",
	"searchType" : "option",
},{
	"data" : "approve_admin_user_id",
	"field" : "approveAdminUserId",
	"showName" : " 审批人id",
	"style" : "width: 3%;",
	"searchType" : "browse",
	"refTable" : "approve_admin_user",
	"refId" : "id",
	"refName" : "name",
	"refWhere" : "1=1"
},{
	"data" : "approve_time",
	"showName" : " 最后审核通过时间",
	"style" : "width: 6%;",
	"searchType" : "date",
	"addType" : "none",
	"editType" : "none",
	"searchWhereKey" : "between",
},{
	"data" : "update_time",
	"showName" : " 修改时间",
	"style" : "width: 6%;",
	"searchType" : "date",
	"addType" : "none",
	"editType" : "none",
	"searchWhereKey" : "between",
},{
	"data" : "create_time",
	"showName" : " 录入时间",
	"style" : "width: 6%;",
	"searchType" : "date",
	"addType" : "none",
	"editType" : "none",
	"searchWhereKey" : "between",
},{
	"data" : "content",
	"showName" : " 新闻内容",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "ctext",
	"showName" : " 新闻内容",
	"style" : "width: 3%;",
	"searchType" : "text",
},{
	"data" : "",
	"showName" : "操作",
	"align" : "center"
}

控制列在前端的展示很简单,因为列在前端展示一共有:
1.表格列
2.搜索条件
3.新增数据
4.修改信息
5.展示详情

只需要控制是否在上述功能区域中是否显示、如何显示即可。

目前本人已开发出了一个简略版的mysql+spring boot+spring mvc+mybatis+shiro+jsp+jquery+bootstrap+tomcat

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值