topic_action.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. // Copyright 2019 Yunion
  15. //
  16. // Licensed under the Apache License, Version 2.0 (the "License");
  17. // you may not use this file except in compliance with the License.
  18. // You may obtain a copy of the License at
  19. //
  20. // http//www.apache.org/licenses/LICENSE-2.0
  21. //
  22. // Unless required by applicable law or agreed to in writing, software
  23. // distributed under the License is distributed on an "AS IS" BASIS,
  24. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  25. // See the License for the specific language governing permissions and
  26. // limitations under the License.
  27. package models
  28. import (
  29. "yunion.io/x/onecloud/pkg/cloudcommon/db"
  30. )
  31. type STopicActionManager struct {
  32. db.SResourceBaseManager
  33. }
  34. var TopicActionManager *STopicActionManager
  35. func init() {
  36. TopicActionManager = &STopicActionManager{
  37. SResourceBaseManager: db.NewResourceBaseManager(
  38. STopicAction{},
  39. "topic_actions_tbl",
  40. "topic_action",
  41. "topic_actions",
  42. ),
  43. }
  44. TopicActionManager.SetVirtualObject(TopicActionManager)
  45. TopicActionManager.TableSpec().AddIndex(false, "topic_id", "action_id", "deleted")
  46. }
  47. type STopicAction struct {
  48. db.SResourceBase
  49. ActionId string `width:"64" nullable:"false" create:"required" update:"user" list:"user"`
  50. TopicId string `width:"64" nullable:"false" create:"required" update:"user" list:"user"`
  51. }