正在显示
2 个修改的文件
包含
13 行增加
和
19 行删除
services/filesave/filesave.go
已删除
100644 → 0
1 | -package filesave | ||
2 | - | ||
3 | -import ( | ||
4 | - "fmt" | ||
5 | - | ||
6 | - "github.com/sony/sonyflake" | ||
7 | -) | ||
8 | - | ||
9 | -var sf = sonyflake.NewSonyflake(sonyflake.Settings{}) | ||
10 | - | ||
11 | -func GenerateIDBySonyflake() int64 { | ||
12 | - num, _ := sf.NextID() | ||
13 | - return int64(num) | ||
14 | -} | ||
15 | - | ||
16 | -func GenerateNewName() string { | ||
17 | - id := GenerateIDBySonyflake() | ||
18 | - return fmt.Sprint(id) | ||
19 | -} |
@@ -42,10 +42,23 @@ type PermissionContentObject interface { | @@ -42,10 +42,23 @@ type PermissionContentObject interface { | ||
42 | ObjectMarshal() (string, error) | 42 | ObjectMarshal() (string, error) |
43 | } | 43 | } |
44 | 44 | ||
45 | +type UserObject struct { | ||
46 | + UserId int64 `json:"user_id"` | ||
47 | + CompanyId int64 `json:"company_id"` | ||
48 | + UserCompanyId int64 `json:"user_company_id"` | ||
49 | +} | ||
50 | + | ||
45 | type PermissionContentBase struct { | 51 | type PermissionContentBase struct { |
46 | Check int8 `json:"check"` | 52 | Check int8 `json:"check"` |
47 | } | 53 | } |
48 | 54 | ||
55 | +func (p *PermissionContentBase) ValidDefault(obj UserObject) bool { | ||
56 | + if p.Check == 1 { | ||
57 | + return true | ||
58 | + } | ||
59 | + return false | ||
60 | +} | ||
61 | + | ||
49 | func NewPermissionContentBase() PermissionContentObject { | 62 | func NewPermissionContentBase() PermissionContentObject { |
50 | return &PermissionContentBase{} | 63 | return &PermissionContentBase{} |
51 | } | 64 | } |
-
请 注册 或 登录 后发表评论