system-param.prisma 871 B

1234567891011121314151617181920212223242526272829303132333435
  1. // enums
  2. enum ParamSide {
  3. client // 客户端
  4. server // 后端
  5. }
  6. enum ParamDataType {
  7. number
  8. text
  9. url
  10. time // store as unix seconds (string/int in API; here we keep Int)
  11. switch // 0/1
  12. }
  13. model SystemParam {
  14. // UI numeric ID (you’ll set this in service: last+1)
  15. id Int @id @map("_id") @db.Int
  16. // 业务字段
  17. side ParamSide // 参数类型: client/server
  18. dataType ParamDataType // 数据类型
  19. name String
  20. value String // <= 500 chars (enforce in service/DTO)
  21. remark String? // <= 500
  22. createAt BigInt @default(0) // 创建时间
  23. updateAt BigInt @default(0) // 更新时间
  24. // indexes
  25. @@index([updateAt(sort: Desc)])
  26. @@index([side, type])
  27. @@unique([side, name]) // avoid duplicate key names under same side
  28. @@map("systemParams")
  29. }