DictionaryController.ts
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包
// endregion
/**
* 字典表(Dictionary) 控制层
* @author gonglei
* @since 2022-04-18 16:06:57
*/
export const DictionaryController = {
/**
* 根据租户新增字典表
* @param dictionary
* @return Dictionary
*/
addDictionary(axios: AxiosStatic, dictionary: any): Promise<AxiosResponse<Dictionary>> {
return axios.post("dictionary/addDictionary", dictionary);
},
/**
* 启用禁用字典表
* @param dictionaryId
* @param enabled
* @return boolean
*/
enableDictionary(
axios: AxiosStatic,
dictionaryId: number,
enabled: boolean,
): Promise<AxiosResponse<boolean>> {
return axios.post("dictionary/enableDictionary", null, {
params: { dictionaryId, enabled },
});
},
/**
* 查询全部启用字典表
* @param dictionaryName
* @return List
*/
getDictionariesByName(axios: AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Dictionary[]>> {
return axios.get("dictionary/getDictionariesByName", { params: { dictionaryName } });
},
/**
* 根据id查询字典表
* @param dictionaryId
* @return Dictionary
*/
getDictionaryById(axios: AxiosStatic, dictionaryId: number): Promise<AxiosResponse<Dictionary>> {
return axios.get("dictionary/getDictionaryById", { params: { dictionaryId } });
},
/**
* 查询租户下简单字典表
* @param dictionaryName
* @return List
*/
getEnabledDictionsByName(axios: AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Diction[]>> {
return axios.get("dictionary/getEnabledDictionsByName", { params: { dictionaryName } });
},
/**
*/
removeDictionaryById(axios: AxiosStatic, dictionaryId: number): Promise<AxiosResponse<number>> {
return axios.delete("dictionary/removeDictionaryById", { params: { dictionaryId } });
},
/**
* 修改字典表
* @param dictionary
* @return Dictionary
*/
updateDictionary(axios: AxiosStatic, dictionary: any): Promise<AxiosResponse<Dictionary>> {
return axios.post("dictionary/updateDictionary", dictionary);
},
// region 前端扩展代码区
// endregion
};