正在显示
4 个修改的文件
包含
24 行增加
和
3 行删除
@@ -19,7 +19,7 @@ mysql_db_name = "${MYSQL_DB_NAME||opportunity_dev}" | @@ -19,7 +19,7 @@ mysql_db_name = "${MYSQL_DB_NAME||opportunity_dev}" | ||
19 | ##redis相关配置 | 19 | ##redis相关配置 |
20 | redis_add = "${REDIS_HOST||127.0.0.1}" | 20 | redis_add = "${REDIS_HOST||127.0.0.1}" |
21 | redis_add_port = "${REDIS_PORT||6379}" | 21 | redis_add_port = "${REDIS_PORT||6379}" |
22 | -redis_auth = "123456" | 22 | +redis_auth = "" |
23 | ##log相关配置 | 23 | ##log相关配置 |
24 | ##out_put:"console","file" | 24 | ##out_put:"console","file" |
25 | log_output = "file" | 25 | log_output = "file" |
1 | package controllers | 1 | package controllers |
2 | 2 | ||
3 | -import "oppmg/protocol" | 3 | +import ( |
4 | + "oppmg/protocol" | ||
5 | +) | ||
4 | 6 | ||
5 | type AuditController struct { | 7 | type AuditController struct { |
6 | BaseController | 8 | BaseController |
@@ -21,7 +23,6 @@ func (this *AuditController) AuditList() { | @@ -21,7 +23,6 @@ func (this *AuditController) AuditList() { | ||
21 | // } | 23 | // } |
22 | // uid := this.GetUserId() | 24 | // uid := this.GetUserId() |
23 | // companyId := this.GetCompanyId() | 25 | // companyId := this.GetCompanyId() |
24 | - | ||
25 | msg = protocol.NewReturnResponse(nil, nil) | 26 | msg = protocol.NewReturnResponse(nil, nil) |
26 | return | 27 | return |
27 | } | 28 | } |
@@ -19,6 +19,7 @@ type PermissionOptionObject interface { | @@ -19,6 +19,7 @@ type PermissionOptionObject interface { | ||
19 | // StringUnmarshal(string) error | 19 | // StringUnmarshal(string) error |
20 | // ObjectMarshal() string | 20 | // ObjectMarshal() string |
21 | GetValidFunc(string) func(UserObject) bool | 21 | GetValidFunc(string) func(UserObject) bool |
22 | + MergeObject(string) error | ||
22 | } | 23 | } |
23 | 24 | ||
24 | //PermissionBase 路由对应的权限 | 25 | //PermissionBase 路由对应的权限 |
1 | package rbac | 1 | package rbac |
2 | 2 | ||
3 | +import ( | ||
4 | + "encoding/json" | ||
5 | +) | ||
6 | + | ||
3 | type UserObject struct { | 7 | type UserObject struct { |
4 | UserId int64 `json:"user_id"` | 8 | UserId int64 `json:"user_id"` |
5 | CompanyId int64 `json:"company_id"` | 9 | CompanyId int64 `json:"company_id"` |
@@ -37,6 +41,16 @@ func (p *PermissionOptionBase) GetValidFunc(k string) func(UserObject) bool { | @@ -37,6 +41,16 @@ func (p *PermissionOptionBase) GetValidFunc(k string) func(UserObject) bool { | ||
37 | return nil | 41 | return nil |
38 | } | 42 | } |
39 | 43 | ||
44 | +func (p *PermissionOptionBase) MergeObject(jsonString string) error { | ||
45 | + var obj PermissionBase | ||
46 | + err := json.Unmarshal([]byte(jsonString), &obj) | ||
47 | + if err != nil { | ||
48 | + return err | ||
49 | + } | ||
50 | + // if o | ||
51 | + return nil | ||
52 | +} | ||
53 | + | ||
40 | // //StringUnmarshal PermissionOptionBase 接口实现 | 54 | // //StringUnmarshal PermissionOptionBase 接口实现 |
41 | // func (p *PermissionOptionBase) StringUnmarshal(s string) error { | 55 | // func (p *PermissionOptionBase) StringUnmarshal(s string) error { |
42 | // err := json.Unmarshal([]byte(s), p) | 56 | // err := json.Unmarshal([]byte(s), p) |
@@ -119,6 +133,11 @@ func (p *OptionOpportunity) GetValidFunc(k string) func(UserObject) bool { | @@ -119,6 +133,11 @@ func (p *OptionOpportunity) GetValidFunc(k string) func(UserObject) bool { | ||
119 | return nil | 133 | return nil |
120 | } | 134 | } |
121 | 135 | ||
136 | +//MergeObject PermissionOptionBase 接口实现 | ||
137 | +func (p *OptionOpportunity) MergeObject(string) error { | ||
138 | + return nil | ||
139 | +} | ||
140 | + | ||
122 | func (p *OptionOpportunity) ValidCheck(obj UserObject) bool { | 141 | func (p *OptionOpportunity) ValidCheck(obj UserObject) bool { |
123 | if p.Check > 0 { | 142 | if p.Check > 0 { |
124 | return true | 143 | return true |
-
请 注册 或 登录 后发表评论