veypi 2 months ago
parent fe77d154a0
commit d8544a48dd

@ -1,6 +1,6 @@
// //
// Copyright (C) 2024 veypi <i@veypi.com> // Copyright (C) 2024 veypi <i@veypi.com>
// 2024-10-11 00:18:06 // 2024-10-11 14:36:07
// Distributed under terms of the MIT license. // Distributed under terms of the MIT license.
// //

@ -1,6 +1,6 @@
// //
// Copyright (C) 2024 veypi <i@veypi.com> // Copyright (C) 2024 veypi <i@veypi.com>
// 2024-10-11 00:18:06 // 2024-10-11 14:36:07
// Distributed under terms of the MIT license. // Distributed under terms of the MIT license.
// //
@ -13,14 +13,6 @@ export function Get(app_id: string, json: GetOpts) {
return webapi.Get<models.App>(`/app/${app_id}`, { json }) return webapi.Get<models.App>(`/app/${app_id}`, { json })
} }
export function AppUserDelete(app_user_id: string, app_id: string) {
return webapi.Delete<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { })
}
export function ResourcePatch(app_id: string) {
return webapi.Patch<models.Resource>(`/app/${app_id}/resource`, { })
}
export interface PatchOpts { export interface PatchOpts {
name?: string name?: string
icon?: string icon?: string
@ -32,6 +24,10 @@ export function Patch(app_id: string, json: PatchOpts) {
return webapi.Patch<models.App>(`/app/${app_id}`, { json }) return webapi.Patch<models.App>(`/app/${app_id}`, { json })
} }
export function Delete(app_id: string) {
return webapi.Delete<models.App>(`/app/${app_id}`, { })
}
export interface PostOpts { export interface PostOpts {
name: string name: string
icon: string icon: string
@ -42,34 +38,6 @@ export function Post(json: PostOpts) {
return webapi.Post<models.App>(`/app`, { json }) return webapi.Post<models.App>(`/app`, { json })
} }
export interface AppUserListOpts {
user_id?: string
status?: string
}
export function AppUserList(app_id: string, json: AppUserListOpts) {
return webapi.Get<models.AppUser>(`/app/${app_id}/app_user`, { json })
}
export interface ResourceListQuery {
created_at?: Date
updated_at?: Date
}
export function ResourceList(app_id: string, query: ResourceListQuery) {
return webapi.Get<models.Resource>(`/app/${app_id}/resource`, { query })
}
export interface ResourcePostOpts {
name: string
des: string
}
export function ResourcePost(app_id: string, json: ResourcePostOpts) {
return webapi.Post<models.Resource>(`/app/${app_id}/resource`, { json })
}
export function Delete(app_id: string) {
return webapi.Delete<models.App>(`/app/${app_id}`, { })
}
export interface ListOpts { export interface ListOpts {
name?: string name?: string
} }
@ -84,10 +52,6 @@ export function AppUserGet(app_user_id: string, app_id: string, json: AppUserGet
return webapi.Get<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { json }) return webapi.Get<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { json })
} }
export function ResourceGet(app_id: string) {
return webapi.Get<models.Resource>(`/app/${app_id}/resource`, { })
}
export interface AppUserPatchOpts { export interface AppUserPatchOpts {
status?: string status?: string
} }
@ -95,6 +59,18 @@ export function AppUserPatch(app_user_id: string, app_id: string, json: AppUserP
return webapi.Patch<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { json }) return webapi.Patch<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { json })
} }
export function AppUserDelete(app_user_id: string, app_id: string) {
return webapi.Delete<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { })
}
export interface AppUserListOpts {
user_id?: string
status?: string
}
export function AppUserList(app_id: string, json: AppUserListOpts) {
return webapi.Get<models.AppUser>(`/app/${app_id}/app_user`, { json })
}
export interface AppUserPostOpts { export interface AppUserPostOpts {
status: string status: string
user_id: string user_id: string
@ -103,6 +79,22 @@ export function AppUserPost(app_id: string, json: AppUserPostOpts) {
return webapi.Post<models.AppUser>(`/app/${app_id}/app_user`, { json }) return webapi.Post<models.AppUser>(`/app/${app_id}/app_user`, { json })
} }
export interface ResourceListQuery {
created_at?: Date
updated_at?: Date
}
export function ResourceList(app_id: string, query: ResourceListQuery) {
return webapi.Get<models.Resource>(`/app/${app_id}/resource`, { query })
}
export interface ResourcePostOpts {
name: string
des: string
}
export function ResourcePost(app_id: string, json: ResourcePostOpts) {
return webapi.Post<models.Resource>(`/app/${app_id}/resource`, { json })
}
export interface ResourceDeleteOpts { export interface ResourceDeleteOpts {
name: string name: string
} }
@ -110,3 +102,11 @@ export function ResourceDelete(app_id: string, json: ResourceDeleteOpts) {
return webapi.Delete<models.Resource>(`/app/${app_id}/resource`, { json }) return webapi.Delete<models.Resource>(`/app/${app_id}/resource`, { json })
} }
export function ResourceGet(app_id: string) {
return webapi.Get<models.Resource>(`/app/${app_id}/resource`, { })
}
export function ResourcePatch(app_id: string) {
return webapi.Patch<models.Resource>(`/app/${app_id}/resource`, { })
}

@ -1,3 +1,4 @@
import * as user from "./user" import * as user from "./user"
import * as token from "./token" import * as token from "./token"
import * as role from "./role" import * as role from "./role"

@ -1,15 +1,17 @@
export interface Access { export interface Access {
created_at: Date
updated_at: Date
app_id: string app_id: string
app?: App
user_id?: string user_id?: string
user?: User
role_id?: string role_id?: string
role?: Role
name: string name: string
t_id: string tid: string
level: number level: number
} }
export interface App { export interface App {
id: string
created_at: Date
updated_at: Date
name: string name: string
icon: string icon: string
des: string des: string
@ -18,62 +20,59 @@ export interface App {
init_role?: Role init_role?: Role
init_url: string init_url: string
user_count: number user_count: number
key: string
} }
export interface AppUser { export interface AppUser {
id: string
created_at: Date
updated_at: Date
app_id: string app_id: string
app?: App
user_id: string user_id: string
user?: User
status: string status: string
} }
export interface Resource { export interface Resource {
created_at: Date
updated_at: Date
app_id: string app_id: string
app?: App
name: string name: string
des: string des: string
} }
export interface Role { export interface Role {
id: string
created_at: Date
updated_at: Date
name: string name: string
des: string des: string
app_id: string app_id: string
app?: App
user_count: number user_count: number
access: any
}
export interface Testb {
test_id: String
test?: Test
name: String
}
export interface Test {
name: String
} }
export interface Token { export interface Token {
id: string
created_at: Date
updated_at: Date
user_id: string user_id: string
user?: User
app_id: string app_id: string
app?: App
expired_at: Date expired_at: Date
over_perm: string over_perm: string
device: string device: string
ip: string
} }
export interface User { export interface User {
id: string
created_at: Date
updated_at: Date
username: string username: string
nickname: string nickname: string
icon: string icon: string
email: string email: string
phone: string phone: string
status: number status: number
salt: string
code: string
} }
export interface UserRole { export interface UserRole {
id: string
created_at: Date
updated_at: Date
user_id: string user_id: string
user?: User
role_id: string role_id: string
role?: Role
app_id: string app_id: string
app?: App
status: string status: string
} }

@ -1,18 +1,11 @@
// //
// Copyright (C) 2024 veypi <i@veypi.com> // Copyright (C) 2024 veypi <i@veypi.com>
// 2024-10-11 00:18:06 // 2024-10-11 14:36:07
// Distributed under terms of the MIT license. // Distributed under terms of the MIT license.
// //
import webapi from "./webapi" import webapi from "./webapi"
import * as models from "./models" import * as models from "./models"
export interface ListOpts {
name?: string
}
export function List(json: ListOpts) {
return webapi.Get<models.Role>(`/role`, { json })
}
export function Get(role_id: string) { export function Get(role_id: string) {
return webapi.Get<models.Role>(`/role/${role_id}`, { }) return webapi.Get<models.Role>(`/role/${role_id}`, { })
} }
@ -39,3 +32,10 @@ export function Post(json: PostOpts) {
return webapi.Post<models.Role>(`/role`, { json }) return webapi.Post<models.Role>(`/role`, { json })
} }
export interface ListOpts {
name?: string
}
export function List(json: ListOpts) {
return webapi.Get<models.Role>(`/role`, { json })
}

@ -1,33 +1,19 @@
// //
// Copyright (C) 2024 veypi <i@veypi.com> // Copyright (C) 2024 veypi <i@veypi.com>
// 2024-10-11 00:18:06 // 2024-10-11 14:36:07
// Distributed under terms of the MIT license. // Distributed under terms of the MIT license.
// //
import webapi from "./webapi" import webapi from "./webapi"
import * as models from "./models" import * as models from "./models"
export function Delete(token_id: string) {
return webapi.Delete<models.Token>(`/token/${token_id}`, {})
}
export interface ListOpts {
user_id: string
app_id: string
}
export function List(json: ListOpts) {
return webapi.Get<models.Token>(`/token`, { json })
}
export interface TokenSaltOpts { export interface TokenSaltOpts {
username: string username: string
typ?: string typ?: string
} }
// keep // keep
export function TokenSalt(json: TokenSaltOpts) { export function TokenSalt(json: TokenSaltOpts) {
return webapi.Post<{ id: string, salt: string }>(`/token/salt`, { json }) return webapi.Post<{ id: string, salt: string }>(`/token/salt`, { json })
} }
export interface PostOpts { export interface PostOpts {
user_id: string user_id: string
token?: string token?: string
@ -38,11 +24,11 @@ export interface PostOpts {
over_perm?: string over_perm?: string
device?: string device?: string
} }
// keep // keep
export function Post(json: PostOpts) { export function Post(json: PostOpts) {
return webapi.Post<string>(`/token`, { json }) return webapi.Post<string>(`/token`, { json })
} }
export function Get(token_id: string) { export function Get(token_id: string) {
return webapi.Get<models.Token>(`/token/${token_id}`, {}) return webapi.Get<models.Token>(`/token/${token_id}`, {})
} }
@ -55,3 +41,15 @@ export function Patch(token_id: string, json: PatchOpts) {
return webapi.Patch<models.Token>(`/token/${token_id}`, { json }) return webapi.Patch<models.Token>(`/token/${token_id}`, { json })
} }
export function Delete(token_id: string) {
return webapi.Delete<models.Token>(`/token/${token_id}`, {})
}
export interface ListOpts {
user_id: string
app_id: string
}
export function List(json: ListOpts) {
return webapi.Get<models.Token>(`/token`, { json })
}

@ -1,11 +1,31 @@
// //
// Copyright (C) 2024 veypi <i@veypi.com> // Copyright (C) 2024 veypi <i@veypi.com>
// 2024-10-11 00:18:06 // 2024-10-11 14:35:47
// Distributed under terms of the MIT license. // Distributed under terms of the MIT license.
// //
import webapi from "./webapi" import webapi from "./webapi"
import * as models from "./models" import * as models from "./models"
export function Get(user_id: string) {
return webapi.Get<models.User>(`/user/${user_id}`, {})
}
export interface PatchOpts {
username?: string
nickname?: string
icon?: string
email?: string
phone?: string
status?: number
}
export function Patch(user_id: string, json: PatchOpts) {
return webapi.Patch<models.User>(`/user/${user_id}`, { json })
}
export function Delete(user_id: string) {
return webapi.Delete<models.User>(`/user/${user_id}`, {})
}
export interface PostOpts { export interface PostOpts {
username: string username: string
nickname?: string nickname?: string
@ -19,8 +39,19 @@ export function Post(json: PostOpts) {
return webapi.Post<models.User>(`/user`, { json }) return webapi.Post<models.User>(`/user`, { json })
} }
export interface ListOpts {
username?: string
nickname?: string
email?: string
phone?: string
status?: number
}
export function List(json: ListOpts) {
return webapi.Get<models.User>(`/user`, { json })
}
export function UserRoleGet(user_role_id: string, user_id: string) { export function UserRoleGet(user_role_id: string, user_id: string) {
return webapi.Get<models.UserRole>(`/user/${user_id}/user_role/${user_role_id}`, { }) return webapi.Get<models.UserRole>(`/user/${user_id}/user_role/${user_role_id}`, {})
} }
export interface UserRolePatchOpts { export interface UserRolePatchOpts {
@ -47,19 +78,6 @@ export function UserRolePost(user_id: string, json: UserRolePostOpts) {
return webapi.Post<models.UserRole>(`/user/${user_id}/user_role`, { json }) return webapi.Post<models.UserRole>(`/user/${user_id}/user_role`, { json })
} }
export interface UserLoginOpts {
pwd: String
typ: String
}
export function Get(user_id: string) {
return webapi.Get<models.User>(`/user/${user_id}`, { })
}
export function Delete(user_id: string) {
return webapi.Delete<models.User>(`/user/${user_id}`, { })
}
export interface UserRoleListOpts { export interface UserRoleListOpts {
status?: string status?: string
} }
@ -67,26 +85,3 @@ export function UserRoleList(user_id: string, json: UserRoleListOpts) {
return webapi.Get<models.UserRole>(`/user/${user_id}/user_role`, { json }) return webapi.Get<models.UserRole>(`/user/${user_id}/user_role`, { json })
} }
export interface PatchOpts {
username?: string
nickname?: string
icon?: string
email?: string
phone?: string
status?: number
}
export function Patch(user_id: string, json: PatchOpts) {
return webapi.Patch<models.User>(`/user/${user_id}`, { json })
}
export interface ListOpts {
username?: string
nickname?: string
email?: string
phone?: string
status?: number
}
export function List(json: ListOpts) {
return webapi.Get<models.User>(`/user`, { json })
}

@ -1,6 +1,6 @@
// //
// Copyright (C) 2024 veypi <i@veypi.com> // Copyright (C) 2024 veypi <i@veypi.com>
// 2024-10-11 01:39:37 // 2024-10-11 14:37:08
// Distributed under terms of the MIT license. // Distributed under terms of the MIT license.
// //

Loading…
Cancel
Save