jhipster入门
环境: 阿里云linux
/////////////////////////////////////////////////////////////////////
yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
yum install npm
mkdir -p /data/qianbao/
mkdir /data/qianbao/software /data/qianbao/server /data/qianbao/tool /data/qianbao/temp /data/qianbao/source
mkdir 21-point
cd 21-point
npm install git
npm install bower -g
npm install node-sass //{"allow_root": true }
bower install --allow-root
git clone https://github.com/mraible/21-points.git
http://plato.qianbaocard.org/article/63
tar zxvf apache-maven-3.0.5-bin.tar.gz (例如安装目录为: /home/homer/Apache-maven/apache-maven-3.0.5)
3, 安装
1) 编辑 /etc/profile
sudo vi /etc/profile
2) 配置
配置maven安装目录: // 安装目录
export MAVEN_HOME=/usr/app/apache-maven-3.5.0
export PATH={PATH}
source /etc/profile
1. 加速你的maven
在pom.xml 中加入:
<repositories><!-- 代码库 -->
<repository>
<id>maven-ali</id>
<url>"="http://maven.aliyun.com/nexus/content/groups/public/;
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
build.gradle中,加入:
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
}
2. 加速你的npm
21point下运行: npm config set registry https://registry.npm.taobao.org
鉴于国内的环境,node-sass实在是太难安装了,可以直接通过淘宝的npm镜像来安装。
1.安装cnpm(https://npm.taobao.org/)
npm install -g cnpm --registry=https://registry.npm.taobao.org
2.在项目文件夹下安装
npm install
报错的话运行:
npm install phantomjs-prebuilt@2.1.12 --ignore-scripts
cnpm install --save-dev node-sass
cnpm install --save-dev css-loader
cnpm install --save-dev postcss-loader
cnpm install --save-dev sass-loader
说明:--save-dev自动将node-sass加入到项目文件夹下的package.json中
出现错误执行:npm rebuild node-sass
在你的项目目录下运行:yarn install
Install npm dependencies with the command npm install
Install bower dependencies with the command bower install
Run the initial setup using gulp with the command gulp install
3. 加速你的docker
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://ym4b9bn1.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
////////////////////////////////////////////////////////////////////////////////////////////////////////////linux
fedora :
sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo 或
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
sudo yum install yarn## OR ##sudo dnf install yarn
# 安装node管理工具
source ~/.nvm/nvm.sh
# 安装
nvm ls # 显示服务器所有可用的 Node.js
nvm use 0.12.0
# 设置每次启动默认版本
$ nvm alias default 0.12.0
////////////////////////////////////////////////////////////////////////////////////////////////////////////linux
Binary is fine
21-points@2.0.0 /usr/projects/21-points
├─┬ gulp-sass@2.3.2
│ └─┬ node-sass@3.13.1
│ ├── cross-spawn@3.0.1
│ ├─┬ gaze@1.1.2
│ │ └─┬ globule@1.2.0
│ │ └── lodash@4.17.4
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ └─┬ npmlog@4.1.2
│ └── gauge@2.7.4
└─┬ node-sass@4.5.3
├── lodash.mergewith@4.6.0
├─┬ request@2.81.0
│ ├── caseless@0.12.0
│ ├── form-data@2.1.4
│ ├── har-validator@4.2.1
│ ├─┬ http-signature@1.1.1
│ │ └── assert-plus@0.2.0
│ ├── qs@6.4.0
│ ├── tough-cookie@2.3.2
│ ├── tunnel-agent@0.6.0
│ └── uuid@3.1.0
└── stdout-stream@1.4.0
////////////////////////////////////////////////jdl命令//jhipster import-jdl yours.jdl
DEFAULT_MIN_LENGTH = 1
DEFAULT_SHORT_LENGTH = 64
DEFAULT_MEDIUM_LENGTH = 128
DEFAULT_LONG_LENGTH = 256
DEFAULT_LARGE_LENGTH = 1024
DEFAULT_MAX_LENGTH = 4096
/** 基础:帮助主题 */
entity HelpTopic(vinci_com_help_topic) {
id Long required, //主题ID
name String required maxlength(DEFAULT_SHORT_LENGTH), //主题名称
platform String required maxlength(20), //适用平台
parentId Integer max(11) ,/**DEFAULT '1',父ID,1:超级父类**/
status Integer required max(2), //状态
createUser String maxlength(DEFAULT_SHORT_LENGTH), //创建用户
createDate Instant, //创建时间
lastModifiedUser String maxlength(DEFAULT_SHORT_LENGTH), //最后修改用户
lastModifiedDate Instant, //最后修改时间
ordinal Integer required, //排序序号
}
/** 基础:帮助项内容 */
entity HelpItem(vinci_com_help_item) {
title String required maxlength(DEFAULT_MEDIUM_LENGTH), //标题
helpTopicId Long required, /**帮助主题外键*/
content String required maxlength(DEFAULT_LARGE_LENGTH), //内容
status Integer required max(2), //状态
createUser String maxlength(DEFAULT_SHORT_LENGTH), //创建用户
createDate Instant, //创建时间
lastModifiedUser String maxlength(DEFAULT_SHORT_LENGTH), //最后修改用户
lastModifiedDate Instant, //最后修改时间
ordinal Integer required, //排序序号
}
relationship OneToMany {
HelpTopic{helpItems} to HelpItem
}
////////////////////////////////////////////////使用注意事项///////////////////
1, 生成oneToMany时,需要
把liquibase中的外键删除掉,并把对应domain里的manyToOne端不需要的属性删除
2,可以使用@Query(value = "xxx", nativeQuery = true)但是不推荐
3,把需要显示的字段去掉@JesonIgnore=true
4,一般表名需要大写,字段名需要小写
////////////////////////////spring-boot
mvn spring-boot:run -Dspring.profiles.active=zslin
///////////////////////////////////////////////////////jpa
http://www.datanucleus.org/products/datanucleus/jpa/query.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App