base_function.go 978 B

123456789101112131415161718192021222324252627282930
  1. package entity
  2. import (
  3. . "app.yhyue.com/moapp/jybase/common"
  4. . "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/db"
  5. )
  6. var Base_function = base_function{}
  7. //功能原始表
  8. type base_function struct {
  9. Id int64
  10. Appid string
  11. Name string //功能名称
  12. Code string //功能代码
  13. Status int64 //0:不可用 1:可用
  14. Haspower int64 //能否生成用户权益;0:否 1:是
  15. Version string //版本号
  16. Power_rule int64 //校验权限规则;1:仅周期 2:周期+数量 3:周期+频率+数量
  17. Power_type int64 //权限类型;1:互斥 2:兼容
  18. }
  19. //根据代码查找功能详情
  20. func (b *base_function) FindByCode(appid, code string) *base_function {
  21. list := Mysql_BaseService.SelectBySql(`select * from base_function where appid=? and code=? and status=1 limit 1`, appid, code)
  22. if list != nil && len(*list) == 1 {
  23. return JsonUnmarshal((*list)[0], &base_function{}).(*base_function)
  24. }
  25. return nil
  26. }