Browse Source

查询权限接口

master
ma 4 years ago
parent
commit
3779fc4e63
  1. 35
      src/main/java/com/ccsens/defaultwbs/api/PowerController.java
  2. 4
      src/main/resources/application.yml

35
src/main/java/com/ccsens/defaultwbs/api/PowerController.java

@ -0,0 +1,35 @@
package com.ccsens.defaultwbs.api;
import com.ccsens.common.bean.dto.CProjectDto;
import com.ccsens.common.service.IPowerService;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "权限相关" , description = "")
@RestController
@RequestMapping("/power")
@Slf4j
public class PowerController {
@Resource
private IPowerService powerService;
@ApiOperation(value = "查询用户在项目中的权限", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<Integer> queryPatientList(@ApiParam @Validated @RequestBody CProjectDto.QueryPower params) throws Exception{
Integer power = powerService.queryUserPower(params.getProjectId(), params.getUserId());
return JsonResponse.newInstance().ok(power);
}
}

4
src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: prod
include: common, util-prod
active: test
include: common, util-test

Loading…
Cancel
Save