package com.zanxiang.game.module.manage.controller;

import com.zanxiang.erp.security.annotation.PreAuthorize;
import com.zanxiang.game.module.manage.pojo.params.RoleOperateParam;
import com.zanxiang.game.module.manage.service.IRoleOperateService;
import com.zanxiang.module.util.pojo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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("/role/operate")
@Slf4j
public class RoleOperateController {

    @Autowired
    private IRoleOperateService roleOperateService;

    @PostMapping(value = "/modify")
    @PreAuthorize(permissionKey = "manage:roleOperate:modify")
    public ResultVO<Boolean> modify(@Validated @RequestBody RoleOperateParam param) {
        return ResultVO.ok(roleOperateService.modify(param));
    }
}
