diff --git a/src/main/java/com/ccsens/defaultwbs/api/PowerController.java b/src/main/java/com/ccsens/defaultwbs/api/PowerController.java new file mode 100644 index 0000000..ad06bdd --- /dev/null +++ b/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 queryPatientList(@ApiParam @Validated @RequestBody CProjectDto.QueryPower params) throws Exception{ + Integer power = powerService.queryUserPower(params.getProjectId(), params.getUserId()); + return JsonResponse.newInstance().ok(power); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5abf242..c3b11fb 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: prod - include: common, util-prod + active: test + include: common, util-test