init2
This commit is contained in:
48
doc/easycode/service.java.vm
Normal file
48
doc/easycode/service.java.vm
Normal file
@@ -0,0 +1,48 @@
|
||||
##导入宏定义
|
||||
$!{define.vm}
|
||||
##保存文件(宏定义)
|
||||
#save("/entity", ".java")
|
||||
##包路径(宏定义)
|
||||
#setPackageSuffix("entity")
|
||||
|
||||
##实现列进行排除
|
||||
#set($temp = $tool.newHashSet("id", "createDept", "createTime", "updateTime", "createTime", "updateUser", "createUser", "status", "isDeleted"))
|
||||
#set($newList = $tool.newArrayList())
|
||||
#foreach($column in $tableInfo.fullColumn)
|
||||
##默认不包含
|
||||
#set($contant = true)
|
||||
#foreach($item in $temp)
|
||||
#if($column.name==$item)
|
||||
#set($contant = false)
|
||||
#end
|
||||
#end
|
||||
#if($contant)
|
||||
##带有反回值的方法调用时使用$tool.call来消除返回值
|
||||
$tool.call($newList.add($column))
|
||||
#end
|
||||
#end
|
||||
##重新保存
|
||||
$tableInfo.setFullColumn($newList)
|
||||
##自动导入包(全局变量)
|
||||
$!{autoImport.vm}
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
##表注释(宏定义)
|
||||
#tableComment("实体类")
|
||||
@Data
|
||||
@TableName("$!{tableInfo.obj.name}")
|
||||
@ApiModel(value = "$!{tableInfo.name}对象", description = "$!{tableInfo.comment}")
|
||||
public class $!{tableInfo.name} extends BaseEntity {
|
||||
#foreach($column in $tableInfo.fullColumn)
|
||||
|
||||
#if(${column.comment})@ApiModelProperty("${column.comment}")
|
||||
#end
|
||||
@TableField("$column.obj.name")
|
||||
private $!{tool.getClsNameByFullName($column.type)} $!{column.name};
|
||||
#end
|
||||
}
|
||||
34
doc/easycode/serviceImpl.java.vm
Normal file
34
doc/easycode/serviceImpl.java.vm
Normal file
@@ -0,0 +1,34 @@
|
||||
##导入宏定义
|
||||
$!{define.vm}
|
||||
|
||||
##设置表后缀(宏定义)
|
||||
#setTableSuffix("ServiceImpl")
|
||||
|
||||
##保存文件(宏定义)
|
||||
#save("/service/impl", "ServiceImpl.java")
|
||||
|
||||
##包路径(宏定义)
|
||||
#setPackageSuffix("service.impl")
|
||||
##定义实体对象名
|
||||
#set($entityName = $!tool.firstLowerCase($!tableInfo.name))
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import $!{tableInfo.savePackageName}.mapper.$!{tableInfo.name}Mapper;
|
||||
import $!{tableInfo.savePackageName}.entity.$!{tableInfo.name};
|
||||
import $!{tableInfo.savePackageName}.service.$!{tableInfo.name}Service;
|
||||
|
||||
|
||||
##表注释(宏定义)
|
||||
#tableComment("服务实现")
|
||||
@Service("$!{entityName}Service")
|
||||
public class $!{tableName} extends BaseServiceImpl<$!{tableInfo.name}Mapper, $!{tableInfo.name}> implements $!{tableInfo.name}Service {
|
||||
|
||||
@Override
|
||||
public IPage<$!{tableInfo.name}> selectPage(IPage<$!{tableInfo.name}> page, $!{tableInfo.name} $entityName) {
|
||||
return page.setRecords(baseMapper.selectPage(page, $entityName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
76
doc/script/service.sh
Normal file
76
doc/script/service.sh
Normal file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
#设置jar文件名
|
||||
APP_NAME=fly-admin-api.jar
|
||||
|
||||
#使用说明,用来提示输入参数
|
||||
usage() {
|
||||
echo "Usage: sh 执行脚本.sh [start|stop|restart|status]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#检查程序是否在运行
|
||||
is_exist(){
|
||||
pid=`ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}' `
|
||||
#如果不存在返回1,存在返回0
|
||||
if [ -z "${pid}" ]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
#启动方法
|
||||
start(){
|
||||
is_exist
|
||||
if [ $? -eq "0" ]; then
|
||||
echo "${APP_NAME} is already running. pid=${pid} ."
|
||||
else
|
||||
nohup java -Xms1024m -Xmx1024m -jar $APP_NAME --spring.profiles.active=prod > /dev/null 2>&1 &
|
||||
fi
|
||||
}
|
||||
|
||||
#停止方法
|
||||
stop(){
|
||||
is_exist
|
||||
if [ $? -eq "0" ]; then
|
||||
kill -9 $pid
|
||||
else
|
||||
echo "${APP_NAME} is not running"
|
||||
fi
|
||||
}
|
||||
|
||||
#输出运行状态
|
||||
status(){
|
||||
is_exist
|
||||
if [ $? -eq "0" ]; then
|
||||
echo "${APP_NAME} is running. Pid is ${pid}"
|
||||
else
|
||||
echo "${APP_NAME} is NOT running."
|
||||
fi
|
||||
}
|
||||
|
||||
#重启
|
||||
restart(){
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
#根据输入参数,选择执行对应方法,不输入则执行使用说明
|
||||
case "$1" in
|
||||
"start")
|
||||
start
|
||||
;;
|
||||
"stop")
|
||||
stop
|
||||
;;
|
||||
"status")
|
||||
status
|
||||
;;
|
||||
"restart")
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user