You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
912 B
TypeScript

//
// Copyright (C) 2024 veypi <i@veypi.com>
1 year ago
// 2024-10-11 14:36:07
// Distributed under terms of the MIT license.
//
import webapi from "./webapi"
import * as models from "./models"
12 months ago
1 year ago
export function Get(role_id: string) {
1 year ago
return webapi.Get<models.Role>(`/role/${role_id}`, {})
}
1 year ago
export interface PatchOpts {
1 year ago
name?: string
des?: string
app_id?: string
}
1 year ago
export function Patch(role_id: string, json: PatchOpts) {
return webapi.Patch<models.Role>(`/role/${role_id}`, { json })
}
1 year ago
export function Delete(role_id: string) {
1 year ago
return webapi.Delete<models.Role>(`/role/${role_id}`, {})
}
1 year ago
export interface PostOpts {
1 year ago
name: string
des: string
app_id: string
}
export function Post(json: PostOpts) {
return webapi.Post<models.Role>(`/role`, { json })
}
12 months ago
export interface ListQuery {
1 year ago
name?: string
}
12 months ago
export function List(query: ListQuery) {
return webapi.Get<models.Role[]>(`/role`, { query })
1 year ago
}