|
|
@ -14,8 +14,9 @@ export interface PatchOpts {
|
|
|
|
name?: string
|
|
|
|
name?: string
|
|
|
|
icon?: string
|
|
|
|
icon?: string
|
|
|
|
des?: string
|
|
|
|
des?: string
|
|
|
|
participate?: string
|
|
|
|
|
|
|
|
init_role_id?: string
|
|
|
|
init_role_id?: string
|
|
|
|
|
|
|
|
typ?: string
|
|
|
|
|
|
|
|
status?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function Patch(app_id: string, json: PatchOpts) {
|
|
|
|
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 })
|
|
|
@ -28,8 +29,9 @@ export function Delete(app_id: string) {
|
|
|
|
export interface PostOpts {
|
|
|
|
export interface PostOpts {
|
|
|
|
name: string
|
|
|
|
name: string
|
|
|
|
icon: string
|
|
|
|
icon: string
|
|
|
|
des: string
|
|
|
|
des?: string
|
|
|
|
participate: string
|
|
|
|
typ: string
|
|
|
|
|
|
|
|
status: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function Post(json: PostOpts) {
|
|
|
|
export function Post(json: PostOpts) {
|
|
|
|
return webapi.Post<models.App>(`/app`, { json })
|
|
|
|
return webapi.Post<models.App>(`/app`, { json })
|
|
|
@ -38,25 +40,25 @@ export function Post(json: PostOpts) {
|
|
|
|
export interface ListOpts {
|
|
|
|
export interface ListOpts {
|
|
|
|
name?: string
|
|
|
|
name?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function List(json: ListOpts) {
|
|
|
|
export function List(query: ListQuery) {
|
|
|
|
return webapi.Get<models.App[]>(`/app`, { json })
|
|
|
|
return webapi.Get<models.App[]>(`/app`, { query })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AppUserGetOpts {
|
|
|
|
export interface AppUserGetOpts {
|
|
|
|
user_id: string
|
|
|
|
user_id: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function AppUserGet(app_user_id: string, app_id: string, json: AppUserGetOpts) {
|
|
|
|
export function AppUserGet(app_id: string, app_user_id: string, query: AppUserGetQuery) {
|
|
|
|
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}`, { query })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AppUserPatchOpts {
|
|
|
|
export interface AppUserPatchOpts {
|
|
|
|
status?: string
|
|
|
|
status?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function AppUserPatch(app_user_id: string, app_id: string, json: AppUserPatchOpts) {
|
|
|
|
export function AppUserPatch(app_id: string, app_user_id: string, json: AppUserPatchOpts) {
|
|
|
|
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) {
|
|
|
|
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}`, {})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -64,8 +66,8 @@ export interface AppUserListOpts {
|
|
|
|
user_id?: string
|
|
|
|
user_id?: string
|
|
|
|
status?: string
|
|
|
|
status?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function AppUserList(app_id: string, json: AppUserListOpts) {
|
|
|
|
export function AppUserList(app_id: string, query: AppUserListQuery) {
|
|
|
|
return webapi.Get<models.AppUser[]>(`/app/${app_id}/app_user`, { json })
|
|
|
|
return webapi.Get<models.AppUser[]>(`/app/${app_id}/app_user`, { query })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AppUserPostOpts {
|
|
|
|
export interface AppUserPostOpts {
|
|
|
@ -76,12 +78,8 @@ 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 {
|
|
|
|
export function ResourceList(app_id: string) {
|
|
|
|
created_at?: Date
|
|
|
|
return webapi.Get<models.Resource[]>(`/app/${app_id}/resource`, {})
|
|
|
|
updated_at?: Date
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ResourceList(app_id: string, query: ResourceListQuery) {
|
|
|
|
|
|
|
|
return webapi.Get<models.Resource[]>(`/app/${app_id}/resource`, { query })
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface ResourcePostOpts {
|
|
|
|
export interface ResourcePostOpts {
|
|
|
@ -95,15 +93,28 @@ export function ResourcePost(app_id: string, json: ResourcePostOpts) {
|
|
|
|
export interface ResourceDeleteOpts {
|
|
|
|
export interface ResourceDeleteOpts {
|
|
|
|
name: string
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export function ResourceDelete(app_id: string, json: ResourceDeleteOpts) {
|
|
|
|
export function ResourceGet(app_id: string, resource_id: string) {
|
|
|
|
return webapi.Delete<models.Resource>(`/app/${app_id}/resource`, { json })
|
|
|
|
return webapi.Get<models.Resource>(`/app/${app_id}/resource/${resource_id}`, {})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function ResourceGet(app_id: string) {
|
|
|
|
export interface ResourcePatchOpts {
|
|
|
|
return webapi.Get<models.Resource>(`/app/${app_id}/resource`, {})
|
|
|
|
des?: string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ResourcePatch(app_id: string, resource_id: string, json: ResourcePatchOpts) {
|
|
|
|
|
|
|
|
return webapi.Patch<models.Resource>(`/app/${app_id}/resource/${resource_id}`, { json })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function ResourcePatch(app_id: string) {
|
|
|
|
export function ResourceDelete(app_id: string, resource_id: string) {
|
|
|
|
return webapi.Patch<models.Resource>(`/app/${app_id}/resource`, {})
|
|
|
|
return webapi.Delete<models.Resource>(`/app/${app_id}/resource/${resource_id}`, {})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export interface ListQuery {
|
|
|
|
|
|
|
|
name?: string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AppUserGetQuery {
|
|
|
|
|
|
|
|
user_id: string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AppUserListQuery {
|
|
|
|
|
|
|
|
user_id?: string
|
|
|
|
|
|
|
|
status?: string
|
|
|
|
|
|
|
|
}
|
|
|
|