package com.boman.system.api;

import com.boman.domain.constant.ServiceNameConstants;
import com.boman.domain.dto.AjaxResult;
import com.boman.domain.SysMenu;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author tjf
 * @Date: 2021/04/13/9:53
 */
@FeignClient(contextId = "remoteSysMenuService", value = ServiceNameConstants.SYSTEM_SERVICE)
public interface RemoteSysMenuService {

    /**
     * 新增菜单
     *
     * @param menu 菜单
     * @return
     */
    @PostMapping("/menu")
    public AjaxResult add(@Validated @RequestBody SysMenu menu);

    /**
     * 查询菜单信息
     *
     * @param menu
     * @return
     */
    @PostMapping("/menu/listAll")
    public List<SysMenu> listAll(@Validated @RequestBody SysMenu menu);

    /**
     * 删除菜单
     * @param id
     * @return
     */
    @DeleteMapping("/menu/remove/{id}")
    public AjaxResult remove(@PathVariable("id") Long id);

    @PutMapping("/menu")
    public AjaxResult edit(@Validated @RequestBody SysMenu menu);


}
