package com.fs.hisStore.controller;

import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.enums.BusinessType;
import com.fs.hisStore.domain.FsStoreCanvasScrm;
import com.fs.hisStore.service.IFsStoreCanvasScrmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 画布信息Controller
 *
 * @author fs
 * @date 2022-08-29
 */
@RestController
@RequestMapping("/store/store/storeCanvas")
public class FsStoreCanvasScrmController extends BaseController
{
    @Autowired
    private IFsStoreCanvasScrmService fsStoreCanvasService;



    /**
     * 获取画布信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('store:storeCanvas:query')")
    @GetMapping(value = "/{terminal}")
    public AjaxResult getInfo(@PathVariable("terminal") Integer terminal)
    {

        return AjaxResult.success(fsStoreCanvasService.selectFsStoreCanvasByTerminal(terminal));
    }


    /**
     * 修改画布信息
     */
    @PreAuthorize("@ss.hasPermi('store:storeCanvas:edit')")
    @Log(title = "画布信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody FsStoreCanvasScrm fsStoreCanvas)
    {
        return toAjax(fsStoreCanvasService.updateFsStoreCanvas(fsStoreCanvas));
    }


}
