package com.jwipc.sys.controller.pc;

import cn.hutool.core.util.StrUtil;
import com.jwipc.sys.logic.ShortcutLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import static com.jwipc.sys.constant.ModuleConst.MODULE_ROOT;

@RequestMapping(MODULE_ROOT + "/shortcut/rest")
@RequiredArgsConstructor
@RestController
public class ShortcutRestController {
    private final ShortcutLogic shortcutLogic;
    @GetMapping("/user")
    public ResponseEntity getUserShortcut() {
        return ResponseEntity.ok(shortcutLogic.getUserShortcut());
    }
    /**
     * 单新增用户快捷菜单
     *
     * @param userShortcutJson 数据
     * @return
     */
    @PostMapping("saveConfig")
    @ResponseBody
    public ResponseEntity saveConfig(String userShortcutJson) {

        shortcutLogic.saveConfig(userShortcutJson);

        return ResponseEntity.ok(true);
    }
}
