|
|
@@ -1,11 +1,13 @@
|
|
|
package shop.alien.storeplatform.controller;
|
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
-import lombok.Data;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
|
+import shop.alien.entity.store.vo.SubAccountVo;
|
|
|
+import shop.alien.storeplatform.dto.AssignRolesDto;
|
|
|
+import shop.alien.storeplatform.dto.CreateAccountDto;
|
|
|
import shop.alien.storeplatform.service.StorePlatformUserRoleService;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -116,39 +118,25 @@ public class StorePlatformUserRoleController {
|
|
|
return R.fail("创建账号并分配角色失败");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 分配角色请求DTO
|
|
|
- */
|
|
|
- @Data
|
|
|
- @ApiModel(value = "AssignRolesDto", description = "分配角色请求参数")
|
|
|
- static class AssignRolesDto {
|
|
|
- @ApiModelProperty(value = "用户ID", required = true)
|
|
|
- private Integer userId;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "角色ID列表", required = true)
|
|
|
- private List<Long> roleIds;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "店铺ID", required = true)
|
|
|
- private Integer storeId;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 创建账号请求DTO
|
|
|
- */
|
|
|
- @Data
|
|
|
- @ApiModel(value = "CreateAccountDto", description = "创建账号请求参数")
|
|
|
- static class CreateAccountDto {
|
|
|
- @ApiModelProperty(value = "手机号", required = true)
|
|
|
- private String phone;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "账号名称")
|
|
|
- private String accountName;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "店铺ID", required = true)
|
|
|
- private Integer storeId;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "角色ID", required = true)
|
|
|
- private Long roleId;
|
|
|
+ @ApiOperation("查询当前店铺下的子账号列表")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "店铺ID", dataType = "int", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "accountName", value = "账号名称(模糊查询)", dataType = "String", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "phone", value = "手机号(模糊查询)", dataType = "String", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "roleName", value = "角色名称(模糊查询)", dataType = "String", paramType = "query", required = false)
|
|
|
+ })
|
|
|
+ @GetMapping("/querySubAccounts")
|
|
|
+ public R<List<SubAccountVo>> querySubAccounts(
|
|
|
+ @RequestParam("storeId") Integer storeId,
|
|
|
+ @RequestParam(value = "accountName", required = false) String accountName,
|
|
|
+ @RequestParam(value = "phone", required = false) String phone,
|
|
|
+ @RequestParam(value = "roleName", required = false) String roleName) {
|
|
|
+ log.info("StorePlatformUserRoleController.querySubAccounts?storeId={}, accountName={}, phone={}, roleName={}",
|
|
|
+ storeId, accountName, phone, roleName);
|
|
|
+ List<SubAccountVo> subAccountList = storePlatformUserRoleService.querySubAccounts(
|
|
|
+ storeId, accountName, phone, roleName);
|
|
|
+ return R.data(subAccountList);
|
|
|
}
|
|
|
}
|
|
|
|