DictionaryController.ts
2.33 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
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包
// endregion
/**
* 字典表(Dictionary) 控制层
* @author gonglei
* @since 2022-04-18 16:06:57
*/
export class DictionaryController{
/**
* 根据租户新增字典表
* @param dictionary
* @return Dictionary
*/
static addDictionary(axios:AxiosStatic, dictionary: any): Promise<AxiosResponse<Dictionary>> {
return axios.post('dictionary/addDictionary', dictionary);
}
/**
* 启用禁用字典表
* @param dictionaryId
* @param enabled
* @return boolean
*/
static enableDictionary(axios:AxiosStatic, dictionaryId: number, enabled: boolean): Promise<AxiosResponse<boolean>> {
return axios.post('dictionary/enableDictionary', null, {params: {dictionaryId: dictionaryId,enabled: enabled}});
}
/**
* 查询全部启用字典表
* @param dictionaryName
* @return List
*/
static getDictionariesByName(axios:AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Dictionary[]>> {
return axios.get('dictionary/getDictionariesByName', {params: {dictionaryName: dictionaryName}});
}
/**
* 根据id查询字典表
* @param dictionaryId
* @return Dictionary
*/
static getDictionaryById(axios:AxiosStatic, dictionaryId: number): Promise<AxiosResponse<Dictionary>> {
return axios.get('dictionary/getDictionaryById', {params: {dictionaryId: dictionaryId}});
}
/**
* 查询租户下简单字典表
* @param dictionaryName
* @return List
*/
static getEnabledDictionsByName(axios:AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Diction[]>> {
return axios.get('dictionary/getEnabledDictionsByName', {params: {dictionaryName: dictionaryName}});
}
/**
*/
static removeDictionaryById(axios:AxiosStatic, dictionaryId: number): Promise<AxiosResponse<number>> {
return axios.delete('dictionary/removeDictionaryById', {params: {dictionaryId: dictionaryId}});
}
/**
* 修改字典表
* @param dictionary
* @return Dictionary
*/
static updateDictionary(axios:AxiosStatic, dictionary: any): Promise<AxiosResponse<Dictionary>> {
return axios.post('dictionary/updateDictionary', dictionary);
}
// region 前端扩展代码区
// endregion
}