package com.lxzn.nc.controller; import com.lxzn.api.nc.UserPermButtonControllerApi; import com.lxzn.framework.model.response.CommonCode; import com.lxzn.framework.model.response.QueryListResponseResult; import com.lxzn.nc.service.IUserPermButtonService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Collections; import java.util.List; @RestController @RequestMapping("/nc/user") public class UserPermButtonController implements UserPermButtonControllerApi { @Autowired private IUserPermButtonService userPermButtonService; @Override @GetMapping("/get/button/perms") public QueryListResponseResult getCurrentUserButtonPerms(@RequestParam("param") String param, @RequestParam("flag") Integer flag, @RequestParam(value = "objectId", required = false) String objectId, @RequestParam(value = "relativeParam", required = false) String relativeParam, @RequestParam(value = "relativeObjectId", required = false) String relativeObjectId) { List perms = userPermButtonService.getCurrentUserButtonPerms(param, flag, objectId, relativeParam, relativeObjectId); if(perms == null) perms = Collections.emptyList(); return new QueryListResponseResult(CommonCode.SUCCESS, perms); } }