system-param.prisma 881 B

1234567891011121314151617181920212223242526272829303132333435
  1. // enums
  2. enum ParamSide {
  3. client // 客户端
  4. server // 后端
  5. }
  6. enum ParamDataType {
  7. url
  8. number
  9. time // store as unix seconds (string/int in API; here we keep Int)
  10. switch // 0/1
  11. text
  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. type ParamDataType @map("type") // 数据类型
  19. name String
  20. value String // <= 500 chars (enforce in service/DTO)
  21. remark String? // <= 500
  22. createAt Int @map("create_at")
  23. updateAt Int @map("update_at")
  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. }