package com.xzzn.web.controller.system;

import com.xzzn.common.core.controller.BaseController;
import com.xzzn.common.core.domain.AjaxResult;
import com.xzzn.ems.domain.vo.BizRemarkBatchGetRequest;
import com.xzzn.ems.domain.vo.BizRemarkSaveRequest;
import com.xzzn.ems.service.ISysBizRemarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/bizRemark")
public class SysBizRemarkController extends BaseController
{
    @Autowired
    private ISysBizRemarkService sysBizRemarkService;

    @PostMapping("/batchGet")
    public AjaxResult batchGet(@RequestBody BizRemarkBatchGetRequest request)
    {
        return success(sysBizRemarkService.getRemarkMap(request.getBizType(), request.getBizKey1(), request.getBizKey2List()));
    }

    @PostMapping("/save")
    public AjaxResult save(@RequestBody BizRemarkSaveRequest request)
    {
        return toAjax(sysBizRemarkService.saveRemark(request, getUsername()));
    }
}
