// 档案分类
import { action, makeObservable, observable } from "mobx";
import BaseStore from "./baseStore";
import baseHttp from "@/service/base";
import { TagDataType } from "@/model/userModel";

class SysConfig {
    static LISTBannler: string = "/v1/sys/banner"
    static ADDBanner: string = "/v1/sys/banner"
    static LIST: string = "/v1/sys/drop"
    static ADD: string = "/v1/sys/drop" 
    static DELETE: string = "/v1/sys/drop"
}
class SysStore extends BaseStore<TagDataType> {
    constructor() {
        super(SysConfig)
        makeObservable(this, {
            addBanner: action,
            getbanner: action,
            bannerList: observable,
        })
    }
    
    async addBanner(param: any) {
        await baseHttp.post(SysConfig.ADDBanner, param)
        this.getbanner();
    }
    async getbanner() {
        let res = await baseHttp.get(SysConfig.LISTBannler, {})
        this.bannerList = res.data.record
    }
    bannerList:Array<any> = []
}
export const sysStore = new SysStore()

