- 创建前端项目结构,包括 Vue 3、Uni-app 等相关配置 - 添加后端项目结构,使用 Express 和 TypeORM 连接数据库 - 实现基本的体重记录 CRUD 功能 - 配置项目相关文件,如 .gitignore、.npmrc 等
28 lines
557 B
JavaScript
28 lines
557 B
JavaScript
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
|
|
}
|
|
}
|
|
});
|