base_function.go 860 B

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