sys-auth-log-service-base.ts 5.3 KB
Newer Older
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
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';



/**
 * 认证日志服务对象基类
 *
 * @export
 * @class SysAuthLogServiceBase
 * @extends {EntityServie}
 */
export default class SysAuthLogServiceBase extends EntityService {

    /**
     * Creates an instance of  SysAuthLogServiceBase.
     * 
     * @param {*} [opts={}]
     * @memberof  SysAuthLogServiceBase
     */
    constructor(opts: any = {}) {
        super(opts);
    }

    /**
     * 初始化基础数据
     *
     * @memberof SysAuthLogServiceBase
     */
    public initBasicData(){
        this.APPLYDEKEY ='sysauthlog';
        this.APPDEKEY = 'logid';
        this.APPDENAME = 'sysauthlogs';
        this.APPDETEXT = 'username';
        this.APPNAME = 'web';
        this.SYSTEMNAME = 'ibzuaa';
    }

// 实体接口

    /**
     * Select接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
51
            let res:any = Http.getInstance().get(`/sysauthlogs/${context.sysauthlog}/select`,isloading);
52
            
53
            return res;
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    }

    /**
     * Create接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let masterData:any = {};
        Object.assign(data,masterData);
        if(!data.srffrontuf || data.srffrontuf !== "1"){
            data[this.APPDEKEY] = null;
        }
        if(data.srffrontuf){
            delete data.srffrontuf;
        }
        let tempContext:any = JSON.parse(JSON.stringify(context));
        let res:any = await Http.getInstance().post(`/sysauthlogs`,data,isloading);
76
        
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
        return res;
    }

    /**
     * Update接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let masterData:any = {};
        Object.assign(data,masterData);
            let res:any = await  Http.getInstance().put(`/sysauthlogs/${context.sysauthlog}`,data,isloading);
93
            
94 95 96 97 98 99 100 101 102 103 104 105 106
            return res;
    }

    /**
     * Remove接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
107 108
            let res:any = Http.getInstance().delete(`/sysauthlogs/${context.sysauthlog}`,isloading);
            return res;
109 110 111 112 113 114 115 116 117 118 119 120 121
    }

    /**
     * Get接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
            let res:any = await Http.getInstance().get(`/sysauthlogs/${context.sysauthlog}`,isloading);
122
            
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
            return res;
    }

    /**
     * GetDraft接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let res:any = await  Http.getInstance().get(`/sysauthlogs/getdraft`,isloading);
        res.data.sysauthlog = data.sysauthlog;
138
        
139 140 141 142 143 144 145 146 147 148 149 150 151
        return res;
    }

    /**
     * CheckKey接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
152 153
            let res:any = Http.getInstance().post(`/sysauthlogs/${context.sysauthlog}/checkkey`,data,isloading);
            return res;
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
    }

    /**
     * Save接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let masterData:any = {};
        Object.assign(data,masterData);
            let res:any = await  Http.getInstance().post(`/sysauthlogs/${context.sysauthlog}/save`,data,isloading);
169
            
170 171 172 173 174 175 176 177 178 179 180 181 182 183
            return res;
    }

    /**
     * FetchDefault接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof SysAuthLogServiceBase
     */
    public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let tempData:any = JSON.parse(JSON.stringify(data));
184 185
        let res:any = Http.getInstance().get(`/sysauthlogs/fetchdefault`,tempData,isloading);
        return res;
186 187
    }
}