v3
veypi 2 weeks ago
parent 1ad9cb686f
commit 9e157d0f0e

@ -14,8 +14,8 @@ export interface PatchOpts {
name?: string name?: string
icon?: string icon?: string
des?: string des?: string
init_role_id?: string
typ?: string typ?: string
init_role_id?: string
status?: string status?: string
} }
export function Patch(app_id: string, json: PatchOpts) { export function Patch(app_id: string, json: PatchOpts) {
@ -37,14 +37,14 @@ export function Post(json: PostOpts) {
return webapi.Post<models.App>(`/app`, { json }) return webapi.Post<models.App>(`/app`, { json })
} }
export interface ListOpts { export interface ListQuery {
name?: string name?: string
} }
export function List(query: ListQuery) { export function List(query: ListQuery) {
return webapi.Get<models.App[]>(`/app`, { query }) return webapi.Get<models.App[]>(`/app`, { query })
} }
export interface AppUserGetOpts { export interface AppUserGetQuery {
user_id: string user_id: string
} }
export function AppUserGet(app_id: string, app_user_id: string, query: AppUserGetQuery) { export function AppUserGet(app_id: string, app_user_id: string, query: AppUserGetQuery) {
@ -62,7 +62,7 @@ export function AppUserDelete(app_id: string, app_user_id: string) {
return webapi.Delete<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, {}) return webapi.Delete<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, {})
} }
export interface AppUserListOpts { export interface AppUserListQuery {
user_id?: string user_id?: string
status?: string status?: string
} }
@ -78,21 +78,6 @@ 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 function ResourceList(app_id: string) {
return webapi.Get<models.Resource[]>(`/app/${app_id}/resource`, {})
}
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 {
name: string
}
export function ResourceGet(app_id: string, resource_id: string) { export function ResourceGet(app_id: string, resource_id: string) {
return webapi.Get<models.Resource>(`/app/${app_id}/resource/${resource_id}`, {}) return webapi.Get<models.Resource>(`/app/${app_id}/resource/${resource_id}`, {})
} }
@ -108,13 +93,15 @@ export function ResourceDelete(app_id: string, resource_id: string) {
return webapi.Delete<models.Resource>(`/app/${app_id}/resource/${resource_id}`, {}) return webapi.Delete<models.Resource>(`/app/${app_id}/resource/${resource_id}`, {})
} }
export interface ListQuery { export function ResourceList(app_id: string) {
name?: string return webapi.Get<models.Resource[]>(`/app/${app_id}/resource`, {})
} }
export interface AppUserGetQuery {
user_id: string export interface ResourcePostOpts {
name: string
des: string
} }
export interface AppUserListQuery { export function ResourcePost(app_id: string, json: ResourcePostOpts) {
user_id?: string return webapi.Post<models.Resource>(`/app/${app_id}/resource`, { json })
status?: string
} }

Loading…
Cancel
Save