go_firefly 开发脚手架,基于事件方式注册路由,使用xml 作为sql文件
Layui: https://www.layui.com/demo/
juicer: https://github.com/PaulGuo/Juicer
gin框架: https://github.com/gin-gonic/gin
goview: https://github.com/foolin/goview
GoMybatis:https://github.com/zhuxiujia/GoMybatis
eventbus:https://github.com/asaskevich/EventBus
Mysql: 5.6+
git clone https://github.com/wzhsh90/go_firefly.git
cd go_firefly
go run main.go
CREATE TABLE `sys_company_t`
(
`id` char(24) NOT NULL,
`com_name` varchar(100) DEFAULT NULL,
`com_desc` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"https://raw.githubusercontent.com/zhuxiujia/GoMybatis/master/mybatis-3-mapper.dtd">
<mapper>
<resultMap id="BaseResultMap" tables="sys_company_t">
<result column="id" property="Id" langType="string"/>
<result column="com_desc" property="ComDesc" langType="string"/>
<result column="com_name" property="ComName" langType="string"/>
</resultMap>
<sql id="base_col">
id,com_name,com_desc
</sql>
<insertTemplete/>
<select id="list">
select <include refid="base_col"/> from sys_company_t
<where>
<if test="name!=''">
and com_name like #{name}
</if>
</where>
limit #{pageIndex},#{pageSize}
</select>
<select id="listCount">
select count(*) from sys_company_t
<where>
<if test="name!=''">
and com_name like #{name}
</if>
</where>
</select>
<select id="existName">
select count(*) from sys_company_t where com_name=#{name}
</select>
<select id="Get">
select <include refid="base_col"/> from sys_company_t where id=#{id}
</select>
<delete id="del">
delete from sys_company_t where id=#{id}
</delete>
<update id="update">
update sys_company_t set com_name=#{ComName},com_desc=#{ComDesc} where id=#{id}
</update>
</mapper>
***** * 默认用户/名称: FireFly / firefly
默认运行开发模式
go run main.go= go run main.go --env dev
go run #开发模式: go run main.go --env dev
go run #生产模式: cargo run main.go --env prod
rust 版本: git clone https://github.com/wzhsh90/rust_firefly.git