正在显示
100 个修改的文件
包含
1516 行增加
和
0 行删除
dsl/api/http/auth.yaml
0 → 100644
dsl/api/http/clientVersion.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: clientVersion | ||
| 5 | + path: /client-versions | ||
| 6 | + endpoints: | ||
| 7 | + - method: createClientVersion | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateClientVersion | ||
| 11 | + route: | ||
| 12 | + put: /{id} | ||
| 13 | + - method: getClientVersion | ||
| 14 | + route: | ||
| 15 | + get: /{id} | ||
| 16 | + - method: removeClientVersion | ||
| 17 | + route: | ||
| 18 | + delete: /{id} | ||
| 19 | + - method: listClientVersion | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/api/http/projectModule.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: projectModule | ||
| 5 | + path: /project-modules | ||
| 6 | + endpoints: | ||
| 7 | + - method: createProjectModule | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateProjectModule | ||
| 11 | + route: | ||
| 12 | + put: /{projectModuleId} | ||
| 13 | + - method: getProjectModule | ||
| 14 | + route: | ||
| 15 | + get: /{projectModuleId} | ||
| 16 | + - method: removeProjectModule | ||
| 17 | + route: | ||
| 18 | + delete: /{projectModuleId} | ||
| 19 | + - method: listProjectModule | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/api/http/projectModuleFiles.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: projectModuleFiles | ||
| 5 | + path: /project-module-filess | ||
| 6 | + endpoints: | ||
| 7 | + - method: createProjectModuleFiles | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateProjectModuleFiles | ||
| 11 | + route: | ||
| 12 | + put: /{projectModuleFilesId} | ||
| 13 | + - method: getProjectModuleFiles | ||
| 14 | + route: | ||
| 15 | + get: /{projectModuleFilesId} | ||
| 16 | + - method: removeProjectModuleFiles | ||
| 17 | + route: | ||
| 18 | + delete: /{projectModuleFilesId} | ||
| 19 | + - method: listProjectModuleFiles | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/api/http/projectModuleVersion.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: projectModuleVersion | ||
| 5 | + path: /project-module-versions | ||
| 6 | + endpoints: | ||
| 7 | + - method: createProjectModuleVersion | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateProjectModuleVersion | ||
| 11 | + route: | ||
| 12 | + put: /{projectModuleVersionId} | ||
| 13 | + - method: getProjectModuleVersion | ||
| 14 | + route: | ||
| 15 | + get: /{projectModuleVersionId} | ||
| 16 | + - method: removeProjectModuleVersion | ||
| 17 | + route: | ||
| 18 | + delete: /{projectModuleVersionId} | ||
| 19 | + - method: listProjectModuleVersion | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/api/http/rbac.yaml
0 → 100644
dsl/api/http/role.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: role | ||
| 5 | + path: /roles | ||
| 6 | + endpoints: | ||
| 7 | + - method: createRole | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateRole | ||
| 11 | + route: | ||
| 12 | + put: /{Id} | ||
| 13 | + - method: getRole | ||
| 14 | + route: | ||
| 15 | + get: /{Id} | ||
| 16 | + - method: removeRole | ||
| 17 | + route: | ||
| 18 | + delete: /{Id} | ||
| 19 | + - method: listRole | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/api/http/task.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: task | ||
| 5 | + path: /tasks | ||
| 6 | + endpoints: | ||
| 7 | + - method: createTask | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateTask | ||
| 11 | + route: | ||
| 12 | + put: /{taskId} | ||
| 13 | + - method: getTask | ||
| 14 | + route: | ||
| 15 | + get: /{taskId} | ||
| 16 | + - method: removeTask | ||
| 17 | + route: | ||
| 18 | + delete: /{taskId} | ||
| 19 | + - method: listTask | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/api/http/users.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: HttpApi | ||
| 3 | +metadata: | ||
| 4 | + service: users | ||
| 5 | + path: /users | ||
| 6 | + endpoints: | ||
| 7 | + - method: createUsers | ||
| 8 | + route: | ||
| 9 | + post: / | ||
| 10 | + - method: updateUsers | ||
| 11 | + route: | ||
| 12 | + put: /{Id} | ||
| 13 | + - method: getUsers | ||
| 14 | + route: | ||
| 15 | + get: /{Id} | ||
| 16 | + - method: removeUsers | ||
| 17 | + route: | ||
| 18 | + delete: /{Id} | ||
| 19 | + - method: listUsers | ||
| 20 | + route: | ||
| 21 | + get: / | ||
| 22 | + params: | ||
| 23 | + - name: offset | ||
| 24 | + - name: limit |
dsl/attributes/access/AccessCode.yaml
0 → 100644
dsl/attributes/access/AccessName.yaml
0 → 100644
dsl/attributes/access/AccessType.yaml
0 → 100644
dsl/attributes/access/Action.yaml
0 → 100644
dsl/attributes/access/Icon.yaml
0 → 100644
dsl/attributes/access/Module.yaml
0 → 100644
dsl/attributes/access/Object.yaml
0 → 100644
dsl/attributes/access/Option.yaml
0 → 100644
dsl/attributes/access/Status.yaml
0 → 100644
dsl/attributes/auth/accessToken.yaml
0 → 100644
dsl/attributes/auth/expiresIn.yaml
0 → 100644
dsl/attributes/auth/refreshToken.yaml
0 → 100644
dsl/attributes/common/CreateTime.yaml
0 → 100644
dsl/attributes/common/Id.yaml
0 → 100644
dsl/attributes/common/Name.yaml
0 → 100644
dsl/attributes/common/ParentId.yaml
0 → 100644
dsl/attributes/common/Sort.yaml
0 → 100644
dsl/attributes/common/UpdateTime.yaml
0 → 100644
dsl/attributes/common/aa.yaml
0 → 100644
dsl/attributes/common/description.yaml
0 → 100644
dsl/attributes/common/sortById.yaml
0 → 100644
dsl/attributes/common/status.yaml
0 → 100644
dsl/attributes/count.yaml
0 → 100644
dsl/attributes/limit.yaml
0 → 100644
dsl/attributes/offset.yaml
0 → 100644
dsl/attributes/projectModule/projectKey.yaml
0 → 100644
dsl/attributes/projectModule/version.yaml
0 → 100644
dsl/attributes/projectModuleFiles/path.yaml
0 → 100644
dsl/attributes/projectModuleFiles/tag.yaml
0 → 100644
dsl/attributes/role/RoleName.yaml
0 → 100644
dsl/attributes/table/AccessId.yaml
0 → 100644
dsl/attributes/table/RoleId.yaml
0 → 100644
dsl/attributes/table/projectModuleId.yaml
0 → 100644
dsl/attributes/table/usersId.yaml
0 → 100644
dsl/attributes/task/taskId.yaml
0 → 100644
dsl/attributes/task/taskName.yaml
0 → 100644
dsl/attributes/users/AdminType.yaml
0 → 100644
dsl/attributes/users/Passwd.yaml
0 → 100644
dsl/attributes/users/Phone.yaml
0 → 100644
dsl/attributes/users/Roles.yaml
0 → 100644
dsl/attributes/users/Status.yaml
0 → 100644
dsl/pkg/application/factory/repository.go
0 → 100644
| 1 | + | ||
| 2 | +func CreateAccessRepository(options map[string]interface{}) (domain.AccessRepository, error) { | ||
| 3 | + var transactionContext *pg.TransactionContext | ||
| 4 | + if value, ok := options["transactionContext"]; ok { | ||
| 5 | + transactionContext = value.(*pg.TransactionContext) | ||
| 6 | + } | ||
| 7 | + return repository.NewAccessRepository(transactionContext) | ||
| 8 | +} | ||
| 9 | +func CreateAccessRepository(options map[string]interface{}) (domain.AccessRepository, error) { | ||
| 10 | + var transactionContext *pg.TransactionContext | ||
| 11 | + if value, ok := options["transactionContext"]; ok { | ||
| 12 | + transactionContext = value.(*pg.TransactionContext) | ||
| 13 | + } | ||
| 14 | + return repository.NewAccessRepository(transactionContext) | ||
| 15 | +} | ||
| 16 | +func CreateAccessRepository(options map[string]interface{}) (domain.AccessRepository, error) { | ||
| 17 | + var transactionContext *pg.TransactionContext | ||
| 18 | + if value, ok := options["transactionContext"]; ok { | ||
| 19 | + transactionContext = value.(*pg.TransactionContext) | ||
| 20 | + } | ||
| 21 | + return repository.NewAccessRepository(transactionContext) | ||
| 22 | +} |
dsl/pkg/domain/access.go
0 → 100644
| 1 | +package domain | ||
| 2 | + | ||
| 3 | +// 权限 | ||
| 4 | +type Access struct { | ||
| 5 | + // dcc | ||
| 6 | + Id int64 `json:"id"` | ||
| 7 | + // 父级Id | ||
| 8 | + ParentId int64 `json:"parentId"` | ||
| 9 | + // 权限名称 | ||
| 10 | + AccessName string `json:"accessName"` | ||
| 11 | + // 权限名称 | ||
| 12 | + AccessCode string `json:"accessCode"` | ||
| 13 | + // 权限类型 menu button data | ||
| 14 | + AccessType string `json:"accessType"` | ||
| 15 | + // 排序 | ||
| 16 | + Sort int `json:"sort"` | ||
| 17 | + // 请求对象 接口地址/对象 | ||
| 18 | + Object string `json:"object"` | ||
| 19 | + // 操作方法 httpMethod/read/write | ||
| 20 | + Action string `json:"action"` | ||
| 21 | + // 所属功能模块 | ||
| 22 | + Module string `json:"module"` | ||
| 23 | + // 图标 | ||
| 24 | + Icon string `json:"icon"` | ||
| 25 | + // 状态 1-启用 0-禁用 | ||
| 26 | + Status int `json:"status"` | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +type AccessRepository interface { | ||
| 30 | + Save(access *Access) (*Access, error) | ||
| 31 | + Remove(access *Access) (*Access, error) | ||
| 32 | + FindOne(queryOptions map[string]interface{}) (*Access, error) | ||
| 33 | + Find(queryOptions map[string]interface{}) (int64, []*Access, error) | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +func (access *Access) Identify() interface{} { | ||
| 37 | + if access.Id == 0 { | ||
| 38 | + return nil | ||
| 39 | + } | ||
| 40 | + return access.Id | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +func (access *Access) Update(data map[string]interface{}) error { | ||
| 44 | + if Id, ok := data["Id"]; ok { | ||
| 45 | + access.Id = Id.(int64) | ||
| 46 | + } | ||
| 47 | + if ParentId, ok := data["ParentId"]; ok { | ||
| 48 | + access.ParentId = ParentId.(int64) | ||
| 49 | + } | ||
| 50 | + if AccessName, ok := data["AccessName"]; ok { | ||
| 51 | + access.AccessName = AccessName.(string) | ||
| 52 | + } | ||
| 53 | + if AccessCode, ok := data["AccessCode"]; ok { | ||
| 54 | + access.AccessCode = AccessCode.(string) | ||
| 55 | + } | ||
| 56 | + if AccessType, ok := data["AccessType"]; ok { | ||
| 57 | + access.AccessType = AccessType.(string) | ||
| 58 | + } | ||
| 59 | + if Sort, ok := data["Sort"]; ok { | ||
| 60 | + access.Sort = Sort.(int) | ||
| 61 | + } | ||
| 62 | + if Object, ok := data["Object"]; ok { | ||
| 63 | + access.Object = Object.(string) | ||
| 64 | + } | ||
| 65 | + if Action, ok := data["Action"]; ok { | ||
| 66 | + access.Action = Action.(string) | ||
| 67 | + } | ||
| 68 | + if Module, ok := data["Module"]; ok { | ||
| 69 | + access.Module = Module.(string) | ||
| 70 | + } | ||
| 71 | + if Icon, ok := data["Icon"]; ok { | ||
| 72 | + access.Icon = Icon.(string) | ||
| 73 | + } | ||
| 74 | + if Status, ok := data["Status"]; ok { | ||
| 75 | + access.Status = Status.(int) | ||
| 76 | + } | ||
| 77 | + return nil | ||
| 78 | +} |
dsl/pkg/infrastructure/pg/models/access.go
0 → 100644
| 1 | +package models | ||
| 2 | + | ||
| 3 | +type Access struct { | ||
| 4 | + TableName string `pg:"accesss,alias:access"` | ||
| 5 | + // dcc | ||
| 6 | + Id int64 | ||
| 7 | + // 父级Id | ||
| 8 | + ParentId int64 | ||
| 9 | + // 权限名称 | ||
| 10 | + AccessName string | ||
| 11 | + // 权限名称 | ||
| 12 | + AccessCode string | ||
| 13 | + // 权限类型 menu button data | ||
| 14 | + AccessType string | ||
| 15 | + // 排序 | ||
| 16 | + Sort int | ||
| 17 | + // 请求对象 接口地址/对象 | ||
| 18 | + Object string | ||
| 19 | + // 操作方法 httpMethod/read/write | ||
| 20 | + Action string | ||
| 21 | + // 所属功能模块 | ||
| 22 | + Module string | ||
| 23 | + // 图标 | ||
| 24 | + Icon string | ||
| 25 | + // 状态 1-启用 0-禁用 | ||
| 26 | + Status int | ||
| 27 | +} |
| 1 | +package repository | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "fmt" | ||
| 5 | + | ||
| 6 | + "github.com/go-pg/pg" | ||
| 7 | + pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | ||
| 8 | + "github.com/tiptok/godevp/pkg/domain" | ||
| 9 | + "github.com/tiptok/godevp/pkg/infrastructure/pg/models" | ||
| 10 | +) | ||
| 11 | + | ||
| 12 | +type AccessRepository struct { | ||
| 13 | + transactionContext *pgTransaction.TransactionContext | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +func (repository *AccessRepository) nextIdentify() (int64, error) { | ||
| 17 | + return 0, nil | ||
| 18 | +} | ||
| 19 | +func (repository *AccessRepository) Save(access *domain.Access) (*domain.Access, error) { | ||
| 20 | + tx := repository.transactionContext.PgTx | ||
| 21 | + if access.Identify() == nil { | ||
| 22 | + _, err := repository.nextIdentify() | ||
| 23 | + if err != nil { | ||
| 24 | + return access, err | ||
| 25 | + } | ||
| 26 | + if _, err := tx.QueryOne( | ||
| 27 | + pg.Scan(&access.Id, &access.ParentId, &access.AccessName, &access.AccessCode, &access.AccessType, &access.Sort, &access.Object, &access.Action, &access.Module, &access.Icon, &access.Status), | ||
| 28 | + "INSERT INTO accesss (id, parent_id, access_name, access_code, access_type, sort, object, action, module, icon, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id, parent_id, access_name, access_code, access_type, sort, object, action, module, icon, status", | ||
| 29 | + access.Id, access.ParentId, access.AccessName, access.AccessCode, access.AccessType, access.Sort, access.Object, access.Action, access.Module, access.Icon, access.Status); err != nil { | ||
| 30 | + return access, err | ||
| 31 | + } | ||
| 32 | + } else { | ||
| 33 | + if _, err := tx.QueryOne( | ||
| 34 | + pg.Scan(&access.Id, &access.ParentId, &access.AccessName, &access.AccessCode, &access.AccessType, &access.Sort, &access.Object, &access.Action, &access.Module, &access.Icon, &access.Status), | ||
| 35 | + "UPDATE accesss SET id=?, parent_id=?, access_name=?, access_code=?, access_type=?, sort=?, object=?, action=?, module=?, icon=?, status=? WHERE id=? RETURNING id, parent_id, access_name, access_code, access_type, sort, object, action, module, icon, status", | ||
| 36 | + access.Id, access.ParentId, access.AccessName, access.AccessCode, access.AccessType, access.Sort, access.Object, access.Action, access.Module, access.Icon, access.Status, access.Identify()); err != nil { | ||
| 37 | + return access, err | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + return access, nil | ||
| 41 | +} | ||
| 42 | +func (repository *AccessRepository) Remove(access *domain.Access) (*domain.Access, error) { | ||
| 43 | + tx := repository.transactionContext.PgTx | ||
| 44 | + accessModel := new(models.Access) | ||
| 45 | + accessModel.Id = access.Identify().(int64) | ||
| 46 | + if _, err := tx.Model(accessModel).WherePK().Delete(); err != nil { | ||
| 47 | + return access, err | ||
| 48 | + } | ||
| 49 | + return access, nil | ||
| 50 | +} | ||
| 51 | +func (repository *AccessRepository) FindOne(queryOptions map[string]interface{}) (*domain.Access, error) { | ||
| 52 | + tx := repository.transactionContext.PgTx | ||
| 53 | + accessModel := new(models.Access) | ||
| 54 | + query := tx.Model(accessModel) | ||
| 55 | + if accessId, ok := queryOptions["accessId"]; ok { | ||
| 56 | + query = query.Where("access.id = ?", accessId) | ||
| 57 | + } | ||
| 58 | + if err := query.First(); err != nil { | ||
| 59 | + if err.Error() == "pg: no rows in result set" { | ||
| 60 | + return nil, fmt.Errorf("没有此资源") | ||
| 61 | + } else { | ||
| 62 | + return nil, err | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + if accessModel.Id == 0 { | ||
| 66 | + return nil, nil | ||
| 67 | + } else { | ||
| 68 | + return repository.transformPgModelToDomainModel(accessModel) | ||
| 69 | + } | ||
| 70 | +} | ||
| 71 | +func (repository *AccessRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.Access, error) { | ||
| 72 | + tx := repository.transactionContext.PgTx | ||
| 73 | + var accessModels []*models.Access | ||
| 74 | + accesss := make([]*domain.Access, 0) | ||
| 75 | + query := tx.Model(&accessModels) | ||
| 76 | + if offset, ok := queryOptions["offset"]; ok { | ||
| 77 | + offset := offset.(int) | ||
| 78 | + if offset > -1 { | ||
| 79 | + query = query.Offset(offset) | ||
| 80 | + } | ||
| 81 | + } else { | ||
| 82 | + query = query.Offset(0) | ||
| 83 | + } | ||
| 84 | + if limit, ok := queryOptions["limit"]; ok { | ||
| 85 | + limit := limit.(int) | ||
| 86 | + if limit > -1 { | ||
| 87 | + query = query.Limit(limit) | ||
| 88 | + } | ||
| 89 | + } else { | ||
| 90 | + query = query.Limit(20) | ||
| 91 | + } | ||
| 92 | + if count, err := query.Order("id DESC").SelectAndCount(); err != nil { | ||
| 93 | + return 0, accesss, err | ||
| 94 | + } else { | ||
| 95 | + for _, accessModel := range accessModels { | ||
| 96 | + if access, err := repository.transformPgModelToDomainModel(accessModel); err != nil { | ||
| 97 | + return 0, accesss, err | ||
| 98 | + } else { | ||
| 99 | + accesss = append(accesss, access) | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + return int64(count), accesss, nil | ||
| 103 | + } | ||
| 104 | +} | ||
| 105 | +func (repository *AccessRepository) transformPgModelToDomainModel(accessModel *models.Access) (*domain.Access, error) { | ||
| 106 | + return &domain.Access{ | ||
| 107 | + Id: accessModel.Id, | ||
| 108 | + ParentId: accessModel.ParentId, | ||
| 109 | + AccessName: accessModel.AccessName, | ||
| 110 | + AccessCode: accessModel.AccessCode, | ||
| 111 | + AccessType: accessModel.AccessType, | ||
| 112 | + Sort: accessModel.Sort, | ||
| 113 | + Object: accessModel.Object, | ||
| 114 | + Action: accessModel.Action, | ||
| 115 | + Module: accessModel.Module, | ||
| 116 | + Icon: accessModel.Icon, | ||
| 117 | + Status: accessModel.Status, | ||
| 118 | + }, nil | ||
| 119 | +} | ||
| 120 | +func NewAccessRepository(transactionContext *pgTransaction.TransactionContext) (*AccessRepository, error) { | ||
| 121 | + if transactionContext == nil { | ||
| 122 | + return nil, fmt.Errorf("transactionContext参数不能为nil") | ||
| 123 | + } else { | ||
| 124 | + return &AccessRepository{ | ||
| 125 | + transactionContext: transactionContext, | ||
| 126 | + }, nil | ||
| 127 | + } | ||
| 128 | +} |
dsl/project.yaml
0 → 100644
dsl/schemas/access.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: access | ||
| 5 | + description: 权限 | ||
| 6 | + attributes: | ||
| 7 | + - ref: Id | ||
| 8 | + required: true | ||
| 9 | + - ref: ParentId | ||
| 10 | + required: true | ||
| 11 | + - ref: AccessName | ||
| 12 | + required: true | ||
| 13 | + - ref: AccessCode | ||
| 14 | + required: true | ||
| 15 | + - ref: AccessType | ||
| 16 | + required: true | ||
| 17 | + - ref: Sort | ||
| 18 | + required: true | ||
| 19 | + - ref: Object | ||
| 20 | + required: true | ||
| 21 | + - ref: Action | ||
| 22 | + required: true | ||
| 23 | + - ref: Module | ||
| 24 | + required: true | ||
| 25 | + - ref: Icon | ||
| 26 | + required: true | ||
| 27 | + - ref: Status | ||
| 28 | + required: true |
dsl/schemas/authAccess.yaml
0 → 100644
dsl/schemas/authRole.yaml
0 → 100644
dsl/schemas/authUser.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: authUser | ||
| 5 | + description: 权限用户 | ||
| 6 | + attributes: | ||
| 7 | + - name: id | ||
| 8 | + description: 用户id | ||
| 9 | + type: | ||
| 10 | + primitive: int64 | ||
| 11 | + - name: adminType | ||
| 12 | + description: 管理员类型 1:超级管理员 2:普通账号 | ||
| 13 | + type: | ||
| 14 | + primitive: int | ||
| 15 | + - name: name | ||
| 16 | + description: 名称 | ||
| 17 | + type: | ||
| 18 | + primitive: string | ||
| 19 | + - name: phone | ||
| 20 | + description: 电话 | ||
| 21 | + type: | ||
| 22 | + primitive: string | ||
| 23 | + - name: roles | ||
| 24 | + description: 角色列表 | ||
| 25 | + type: | ||
| 26 | + array: authRole |
dsl/schemas/clientPackageInfo.yaml
0 → 100644
dsl/schemas/clientVersion.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: clientVersion | ||
| 5 | + description: 客户端版本信息 | ||
| 6 | + attributes: | ||
| 7 | + - ref: Id | ||
| 8 | + required: true | ||
| 9 | + - name: commiter | ||
| 10 | + description: 提交人 | ||
| 11 | + type: | ||
| 12 | + primitive: string | ||
| 13 | + - name: projectName | ||
| 14 | + description: 项目名称 | ||
| 15 | + type: | ||
| 16 | + primitive: string | ||
| 17 | + - name: version | ||
| 18 | + description: 版本号 | ||
| 19 | + type: | ||
| 20 | + primitive: string | ||
| 21 | + - name: title | ||
| 22 | + description: 标题 | ||
| 23 | + type: | ||
| 24 | + primitive: string | ||
| 25 | + - name: remark | ||
| 26 | + description: 其他备注信息 | ||
| 27 | + type: | ||
| 28 | + primitive: string | ||
| 29 | + - name: clientPackageInfo | ||
| 30 | + description: 客户端安装包信息 | ||
| 31 | + type: | ||
| 32 | + array: clientPackageInfo | ||
| 33 | + - name: createTime | ||
| 34 | + description: 创建时间 | ||
| 35 | + type: | ||
| 36 | + primitive: datetime |
dsl/schemas/menu.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: menu | ||
| 5 | + description: 菜单 | ||
| 6 | + attributes: | ||
| 7 | + - name: id | ||
| 8 | + description: 编号 | ||
| 9 | + type: | ||
| 10 | + primitive: int64 | ||
| 11 | + - name: parentId | ||
| 12 | + description: 父级id | ||
| 13 | + type: | ||
| 14 | + primitive: int64 | ||
| 15 | + - name: name | ||
| 16 | + description: 菜单名称 | ||
| 17 | + type: | ||
| 18 | + primitive: string | ||
| 19 | + - name: code | ||
| 20 | + description: 菜单code | ||
| 21 | + type: | ||
| 22 | + primitive: string | ||
| 23 | + - name: sort | ||
| 24 | + description: 排序 | ||
| 25 | + type: | ||
| 26 | + primitive: int | ||
| 27 | + - name: icon | ||
| 28 | + description: 图标地址 | ||
| 29 | + type: | ||
| 30 | + primitive: string | ||
| 31 | + - name: status | ||
| 32 | + description: 状态 1-启用 0-禁用 | ||
| 33 | + type: | ||
| 34 | + primitive: int |
dsl/schemas/projectModule.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: projectModule | ||
| 5 | + description: 项目模块 | ||
| 6 | + attributes: | ||
| 7 | + - name: id | ||
| 8 | + type: | ||
| 9 | + primitive: int64 | ||
| 10 | + description: 唯一标识 | ||
| 11 | + required: true | ||
| 12 | + - ref: projectName | ||
| 13 | + required: true | ||
| 14 | + - ref: projectKey | ||
| 15 | + required: true | ||
| 16 | + - ref: description | ||
| 17 | + required: true | ||
| 18 | + - ref: status | ||
| 19 | + required: true | ||
| 20 | + - ref: CreateTime | ||
| 21 | + required: true | ||
| 22 | + - ref: UpdateTime | ||
| 23 | + required: true | ||
| 24 | + - name: projectModuleVersion | ||
| 25 | + required: true | ||
| 26 | + description: 项目模板版本信息 | ||
| 27 | + type: | ||
| 28 | + schema: projectModuleVersion |
dsl/schemas/projectModuleFiles.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: projectModuleFiles | ||
| 5 | + description: 项目模板文件 | ||
| 6 | + attributes: | ||
| 7 | + - name: id | ||
| 8 | + type: | ||
| 9 | + primitive: int64 | ||
| 10 | + description: 唯一标识 | ||
| 11 | + - ref: projectModuleId | ||
| 12 | + required: true | ||
| 13 | + - ref: projectModuleVersionId | ||
| 14 | + required: true | ||
| 15 | + - ref: fileType | ||
| 16 | + required: true | ||
| 17 | + - ref: codeBlock | ||
| 18 | + required: true | ||
| 19 | + - ref: ParentId | ||
| 20 | + required: true | ||
| 21 | + - ref: Sort | ||
| 22 | + required: true | ||
| 23 | + - name: remark | ||
| 24 | + type: | ||
| 25 | + primitive: string | ||
| 26 | + description: 备注信息 | ||
| 27 | + - ref: CreateTime | ||
| 28 | + required: true | ||
| 29 | + - ref: UpdateTime | ||
| 30 | + required: true | ||
| 31 | + - ref: path | ||
| 32 | + required: true | ||
| 33 | + - ref: tag | ||
| 34 | + required: true |
dsl/schemas/projectModuleVersion.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: projectModuleVersion | ||
| 5 | + description: 项目模块版本 | ||
| 6 | + attributes: | ||
| 7 | + - name: id | ||
| 8 | + type: | ||
| 9 | + primitive: int64 | ||
| 10 | + description: 唯一标识 | ||
| 11 | + - ref: projectModuleId | ||
| 12 | + required: true | ||
| 13 | + - name: version | ||
| 14 | + description: 版本号 | ||
| 15 | + required: true | ||
| 16 | + type: | ||
| 17 | + primitive: int64 | ||
| 18 | + - ref: description | ||
| 19 | + required: true | ||
| 20 | + - ref: status | ||
| 21 | + required: true | ||
| 22 | + - ref: CreateTime | ||
| 23 | + required: true | ||
| 24 | + - ref: UpdateTime | ||
| 25 | + required: true |
dsl/schemas/role.yaml
0 → 100644
dsl/schemas/roleAccess.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: roleAccess | ||
| 5 | + description: 角色权限 | ||
| 6 | + attributes: | ||
| 7 | + - ref: Id | ||
| 8 | + required: true | ||
| 9 | + - ref: RoleId | ||
| 10 | + required: true | ||
| 11 | + - ref: AccessId | ||
| 12 | + required: true | ||
| 13 | + - ref: Object | ||
| 14 | + required: true | ||
| 15 | + - ref: Action | ||
| 16 | + required: true | ||
| 17 | + - ref: Option | ||
| 18 | + required: true |
dsl/schemas/task.yaml
0 → 100644
dsl/schemas/users.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Schema | ||
| 3 | +metadata: | ||
| 4 | + name: users | ||
| 5 | + description: 用户实体 | ||
| 6 | + attributes: | ||
| 7 | + - ref: Id | ||
| 8 | + required: true | ||
| 9 | + - ref: Name | ||
| 10 | + required: true | ||
| 11 | + - ref: Phone | ||
| 12 | + required: true | ||
| 13 | + - ref: Passwd | ||
| 14 | + required: true | ||
| 15 | + - ref: Roles | ||
| 16 | + required: true | ||
| 17 | + - ref: Status | ||
| 18 | + required: true | ||
| 19 | + - ref: AdminType | ||
| 20 | + required: true | ||
| 21 | + - ref: CreateTime | ||
| 22 | + required: true | ||
| 23 | + - ref: UpdateTime | ||
| 24 | + required: true |
dsl/services/auth/methods/login.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: login | ||
| 5 | + type: command | ||
| 6 | + description: 登录 | ||
| 7 | + payload: | ||
| 8 | + - name: username | ||
| 9 | + type: | ||
| 10 | + primitive: string | ||
| 11 | + description: 用户名 | ||
| 12 | + required: true | ||
| 13 | + - name: password | ||
| 14 | + type: | ||
| 15 | + primitive: string | ||
| 16 | + description: 密码 | ||
| 17 | + required: true | ||
| 18 | + result: | ||
| 19 | + - name: access | ||
| 20 | + type: | ||
| 21 | + schema: authAccess |
dsl/services/auth/methods/profile.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: profile | ||
| 5 | + type: command | ||
| 6 | + description: 获得当前用户数据 | ||
| 7 | + payload: | ||
| 8 | + - name: userId | ||
| 9 | + type: | ||
| 10 | + primitive: int64 | ||
| 11 | + required: true | ||
| 12 | + result: | ||
| 13 | + - name: menus | ||
| 14 | + type: | ||
| 15 | + array: menu | ||
| 16 | + - name: user | ||
| 17 | + type: | ||
| 18 | + schema: authUser |
dsl/services/auth/methods/refresh.yaml
0 → 100644
dsl/services/auth/service.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: createClientVersion | ||
| 5 | + type: command | ||
| 6 | + description: 创建 | ||
| 7 | + payload: | ||
| 8 | + - name: commiter | ||
| 9 | + description: 提交人 | ||
| 10 | + type: | ||
| 11 | + primitive: string | ||
| 12 | + - name: projectName | ||
| 13 | + description: 项目名称 | ||
| 14 | + type: | ||
| 15 | + primitive: string | ||
| 16 | + - name: version | ||
| 17 | + description: 版本号 | ||
| 18 | + type: | ||
| 19 | + primitive: string | ||
| 20 | + - name: title | ||
| 21 | + description: 标题 | ||
| 22 | + type: | ||
| 23 | + primitive: string | ||
| 24 | + - name: remark | ||
| 25 | + description: 其他备注信息 | ||
| 26 | + type: | ||
| 27 | + primitive: string | ||
| 28 | + - name: clientPackageInfo | ||
| 29 | + description: 客户端安装包信息 | ||
| 30 | + type: | ||
| 31 | + array: clientPackageInfo | ||
| 32 | + result: | ||
| 33 | + - name: clientVersion | ||
| 34 | + type: | ||
| 35 | + schema: clientVersion |
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: listClientVersion | ||
| 5 | + type: query | ||
| 6 | + description: 返回列表 | ||
| 7 | + payload: | ||
| 8 | + - ref: offset | ||
| 9 | + required: true | ||
| 10 | + - ref: limit | ||
| 11 | + required: true | ||
| 12 | + result: | ||
| 13 | + - ref: count | ||
| 14 | + required: true | ||
| 15 | + - name: clientVersions | ||
| 16 | + type: | ||
| 17 | + array: clientVersion |
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: updateClientVersion | ||
| 5 | + type: command | ||
| 6 | + description: 更新 | ||
| 7 | + payload: | ||
| 8 | + - ref: Id | ||
| 9 | + required: true | ||
| 10 | + - name: commiter | ||
| 11 | + description: 提交人 | ||
| 12 | + type: | ||
| 13 | + primitive: string | ||
| 14 | + - name: projectName | ||
| 15 | + description: 项目名称 | ||
| 16 | + type: | ||
| 17 | + primitive: string | ||
| 18 | + - name: version | ||
| 19 | + description: 版本号 | ||
| 20 | + type: | ||
| 21 | + primitive: string | ||
| 22 | + - name: title | ||
| 23 | + description: 标题 | ||
| 24 | + type: | ||
| 25 | + primitive: string | ||
| 26 | + - name: remark | ||
| 27 | + description: 其他备注信息 | ||
| 28 | + type: | ||
| 29 | + primitive: string | ||
| 30 | + - name: clientPackageInfo | ||
| 31 | + description: 客户端安装包信息 | ||
| 32 | + type: | ||
| 33 | + array: clientPackageInfo | ||
| 34 | + result: | ||
| 35 | + - name: clientVersion | ||
| 36 | + type: | ||
| 37 | + schema: clientVersion |
dsl/services/clientVersion/service.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: createProjectModule | ||
| 5 | + type: command | ||
| 6 | + description: 创建 | ||
| 7 | + payload: | ||
| 8 | + - ref: projectName | ||
| 9 | + required: true | ||
| 10 | + - ref: projectKey | ||
| 11 | + required: true | ||
| 12 | + - ref: description | ||
| 13 | + required: true | ||
| 14 | + - ref: status | ||
| 15 | + required: true | ||
| 16 | + result: | ||
| 17 | + - name: projectModule | ||
| 18 | + type: | ||
| 19 | + schema: projectModule |
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: listProjectModule | ||
| 5 | + type: query | ||
| 6 | + description: 返回列表 | ||
| 7 | + payload: | ||
| 8 | + - ref: offset | ||
| 9 | + required: true | ||
| 10 | + - ref: limit | ||
| 11 | + required: true | ||
| 12 | + result: | ||
| 13 | + - ref: count | ||
| 14 | + required: true | ||
| 15 | + - name: projectModule | ||
| 16 | + type: | ||
| 17 | + array: projectModule |
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: updateProjectModule | ||
| 5 | + type: command | ||
| 6 | + description: 更新 | ||
| 7 | + payload: | ||
| 8 | + - ref: projectModuleId | ||
| 9 | + required: true | ||
| 10 | + - ref: projectName | ||
| 11 | + required: true | ||
| 12 | + - ref: projectKey | ||
| 13 | + required: true | ||
| 14 | + - ref: description | ||
| 15 | + required: true | ||
| 16 | + - ref: status | ||
| 17 | + required: true | ||
| 18 | + result: | ||
| 19 | + - name: projectModule | ||
| 20 | + type: | ||
| 21 | + schema: projectModule |
dsl/services/projectModule/service.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: createProjectModuleFiles | ||
| 5 | + type: command | ||
| 6 | + description: 创建 | ||
| 7 | + payload: | ||
| 8 | + - ref: projectModuleId | ||
| 9 | + required: true | ||
| 10 | + - ref: projectModuleVersionId | ||
| 11 | + required: true | ||
| 12 | + - ref: fileType | ||
| 13 | + required: true | ||
| 14 | + - ref: codeBlock | ||
| 15 | + required: true | ||
| 16 | + - ref: ParentId | ||
| 17 | + required: true | ||
| 18 | + - ref: Sort | ||
| 19 | + required: true | ||
| 20 | + - name: remark | ||
| 21 | + type: | ||
| 22 | + primitive: string | ||
| 23 | + description: 备注信息 | ||
| 24 | + result: | ||
| 25 | + - name: projectModuleFiles | ||
| 26 | + type: | ||
| 27 | + schema: projectModuleFiles |
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: listProjectModuleFiles | ||
| 5 | + type: query | ||
| 6 | + description: 返回列表 | ||
| 7 | + payload: | ||
| 8 | + - ref: offset | ||
| 9 | + required: true | ||
| 10 | + - ref: limit | ||
| 11 | + required: true | ||
| 12 | + result: | ||
| 13 | + - ref: count | ||
| 14 | + required: true | ||
| 15 | + - name: projectModuleFiles | ||
| 16 | + type: | ||
| 17 | + array: projectModuleFiles |
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: updateProjectModuleFiles | ||
| 5 | + type: command | ||
| 6 | + description: 更新 | ||
| 7 | + payload: | ||
| 8 | + - ref: projectModuleFilesId | ||
| 9 | + required: true | ||
| 10 | + - ref: codeBlock | ||
| 11 | + required: true | ||
| 12 | + - name: remark | ||
| 13 | + type: | ||
| 14 | + primitive: string | ||
| 15 | + description: 备注信息 | ||
| 16 | + result: | ||
| 17 | + - name: projectModuleFiles | ||
| 18 | + type: | ||
| 19 | + schema: projectModuleFiles |
dsl/services/projectModuleFiles/service.yaml
0 → 100644
| 1 | +version: v1 | ||
| 2 | +kind: Method | ||
| 3 | +metadata: | ||
| 4 | + name: createProjectModuleVersion | ||
| 5 | + type: command | ||
| 6 | + description: 创建 | ||
| 7 | + payload: | ||
| 8 | + - ref: projectModuleId | ||
| 9 | + required: true | ||
| 10 | + - name: version | ||
| 11 | + description: 唯一标识 | ||
| 12 | + required: true | ||
| 13 | + type: | ||
| 14 | + primitive: int64 | ||
| 15 | + - ref: description | ||
| 16 | + required: true | ||
| 17 | + result: | ||
| 18 | + - name: projectModuleVersion | ||
| 19 | + type: | ||
| 20 | + schema: projectModuleVersion |
-
请 注册 或 登录 后发表评论