user_option.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package models
  15. import "yunion.io/x/onecloud/pkg/cloudcommon/db"
  16. // +onecloud:swagger-gen-ignore
  17. type SUserOptionManager struct {
  18. db.SModelBaseManager
  19. }
  20. var (
  21. UserOptionManager *SUserOptionManager
  22. )
  23. func init() {
  24. UserOptionManager = &SUserOptionManager{
  25. SModelBaseManager: db.NewModelBaseManager(
  26. SUserOption{},
  27. "user_option",
  28. "user_option",
  29. "user_options",
  30. ),
  31. }
  32. UserOptionManager.SetVirtualObject(UserOptionManager)
  33. }
  34. /*
  35. desc user_option;
  36. +--------------+-------------+------+-----+---------+-------+
  37. | Field | Type | Null | Key | Default | Extra |
  38. +--------------+-------------+------+-----+---------+-------+
  39. | user_id | varchar(64) | NO | PRI | NULL | |
  40. | option_id | varchar(4) | NO | PRI | NULL | |
  41. | option_value | text | YES | | NULL | |
  42. +--------------+-------------+------+-----+---------+-------+
  43. */
  44. type SUserOption struct {
  45. db.SModelBase
  46. UserId string `width:"64" charset:"ascii" nullable:"false" primary:"true"`
  47. OptionId string `width:"4" charset:"ascii" nullable:"false" primary:"true"`
  48. OptionValue string `nullable:"true"`
  49. }