|
| 1 | +//go:build windows |
| 2 | +// +build windows |
| 3 | + |
| 4 | +package tables |
| 5 | + |
| 6 | +import ( |
| 7 | + "github.com/dean2021/sysql/extend/tables/system" |
| 8 | + "github.com/dean2021/sysql/table" |
| 9 | +) |
| 10 | + |
| 11 | +func init() { |
| 12 | + t := &UsersTable{} |
| 13 | + err := table.Register(t, t.Name()) |
| 14 | + if err != nil { |
| 15 | + panic(err) |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +type UsersTable struct{} |
| 20 | + |
| 21 | +func (p *UsersTable) Name() string { |
| 22 | + return "users" |
| 23 | +} |
| 24 | + |
| 25 | +func (p *UsersTable) Columns() table.TableColumns { |
| 26 | + return table.TableColumns{ |
| 27 | + {Name: "sid", Type: table.TEXT_TYPE, Options: table.INDEX}, |
| 28 | + {Name: "name", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 29 | + {Name: "accountType", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, |
| 30 | + {Name: "caption", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 31 | + {Name: "description", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 32 | + {Name: "disabled", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, // Assuming boolean is represented as integer |
| 33 | + {Name: "domain", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 34 | + {Name: "fullName", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 35 | + {Name: "installDate", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 36 | + {Name: "localAccount", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, // Assuming boolean is represented as integer |
| 37 | + {Name: "lockout", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, // Assuming boolean is represented as integer |
| 38 | + {Name: "passwordChangeable", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, // Assuming boolean is represented as integer |
| 39 | + {Name: "passwordExpires", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, // Assuming boolean is represented as integer |
| 40 | + {Name: "passwordRequired", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, // Assuming boolean is represented as integer |
| 41 | + {Name: "sidType", Type: table.INTEGER_TYPE, Options: table.DEFAULT}, |
| 42 | + {Name: "status", Type: table.TEXT_TYPE, Options: table.DEFAULT}, |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +func (p *UsersTable) Generate(context *table.QueryContext) (table.TableRows, error) { |
| 47 | + list, err := system.GenUsers(context) |
| 48 | + if err != nil { |
| 49 | + return nil, err |
| 50 | + } |
| 51 | + return list, nil |
| 52 | +} |
0 commit comments