package entity import ( . "app.yhyue.com/moapp/jybase/common" . "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/db" ) var Base_function = base_function{} //功能原始表 type base_function struct { Id int64 Appid string Name string //功能名称 Code string //功能代码 Status int64 //0:不可用 1:可用 Haspower int64 //能否生成用户权益;0:否 1:是 Version string //版本号 Function_type int64 //1:消耗型(比如:信息发布,需要扣减) 2:固额型(比如:关注条数,不需要扣减) 3:配额型(比如:搜索结果条数) Power_rule int64 //校验权限规则;1:仅周期 2:周期+数量 3:周期+频率+数量 Power_type int64 //权限类型;1:互斥 2:兼容 } //根据代码查找功能详情 func (b *base_function) FindByCode(appid, code string) *base_function { list := Mysql_BaseService.SelectBySql(`select * from base_function where appid=? and code=? and status=1 limit 1`, appid, code) if list != nil && len(*list) == 1 { return JsonUnmarshal((*list)[0], &base_function{}).(*base_function) } return nil }