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


class PatrolConfig {
    static LIST: string = "/v1/patrol/list"
    static ADD: string = "/v1/patrol"
    static DELETE: string = "/v1/patrol"
    static EDIT: string = "/v1/patrol"
    static ACCESS: string = "/v1/patrol/accept"
    static Fish: string = "/v1/patrol/fish"

}
class PatrolStore extends BaseStore<TagDataType> {
    constructor() {
        super(PatrolConfig)
        makeObservable(this, {
            access: action,
            fish: action,
        })
    }
    async access(id: number, param: any) {
        await baseHttp.put(PatrolConfig.ACCESS + "/" + id, param)
        this.getlist()
    }

    async fish(id: number) {
        await baseHttp.put(PatrolConfig.Fish + "/" + id, {})
        this.getlist()
    }
}
export const patrolStore = new PatrolStore()

