feat: 初始化前端和后端项目
- 创建前端项目结构,包括 Vue 3、Uni-app 等相关配置 - 添加后端项目结构,使用 Express 和 TypeORM 连接数据库 - 实现基本的体重记录 CRUD 功能 - 配置项目相关文件,如 .gitignore、.npmrc 等
This commit is contained in:
27
server/entity/WeightRecord.js
Normal file
27
server/entity/WeightRecord.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const EntitySchema = require("typeorm").EntitySchema;
|
||||
|
||||
module.exports = new EntitySchema({
|
||||
name: "WeightRecord",
|
||||
tableName: "weight_records",
|
||||
columns: {
|
||||
id: {
|
||||
primary: true,
|
||||
type: "int",
|
||||
generated: true
|
||||
},
|
||||
date: {
|
||||
type: "date"
|
||||
},
|
||||
weight: {
|
||||
type: "float"
|
||||
},
|
||||
unit: {
|
||||
type: "varchar",
|
||||
length: 10
|
||||
},
|
||||
createdAt: {
|
||||
type: "timestamp",
|
||||
createDate: true
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user