package com.siwei.rsmonitoring.controller;

import com.siwei.common.core.domain.R;
import com.siwei.common.core.web.controller.BaseController;
import com.siwei.common.core.web.domain.AjaxResult;
import com.siwei.rsmonitoring.domain.TDkAuditflowRecord;
import com.siwei.rsmonitoring.service.ITDkAuditflowRecordService;
import com.siwei.rsmonitoring.service.ITDkAuditflowTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/test")
public class TestController extends BaseController {
    @Autowired
    private ITDkAuditflowRecordService dkAuditflowRecordService;
    @Autowired
    private ITDkAuditflowTypeService tDkAuditflowTypeService;

    @PostMapping
    public AjaxResult add(@RequestBody TDkAuditflowRecord tDkAuditflowRecord) {
        dkAuditflowRecordService.refreshTDkAuditflowRecord(tDkAuditflowRecord);
        return toAjax(1);
    }

    @GetMapping("cache")
    public R<Boolean> cache() {
        tDkAuditflowTypeService.cacheTDkAuditflowType();
        return R.ok(true);
    }

}
