@@ -9,10 +9,10 @@ import {
9
9
Post ,
10
10
Body ,
11
11
} from '@nestjs/common' ;
12
- import { ApiTags , ApiBearerAuth , ApiOperation , ApiCreatedResponse } from '@nestjs/swagger' ;
12
+ import { ApiTags , ApiBearerAuth , ApiOperation , ApiOkResponse } from '@nestjs/swagger' ;
13
13
import { AuthGuard } from '@src/guard/auth/auth.guard' ;
14
14
import { AccountRoleService } from '../../services/account-role/account-role.service' ;
15
- import { AccountRoleListResDto , RoleAccountListDto } from './dto /account.role.res.dto ' ;
15
+ import { AccountRoleListVo , RoleAccountListVo } from './vo /account.role.vo ' ;
16
16
import { DistributionRoleDto } from './dto/distribution.role.dto' ;
17
17
import { ApiAuth } from '@src/decorators/api.auth' ;
18
18
@@ -25,21 +25,21 @@ export class AccountRoleController {
25
25
constructor ( private readonly accountRoleService : AccountRoleService ) { }
26
26
27
27
@ApiOperation ( { summary : '获取角色列表' , description : '根据当前的账号id获取角色已经授权的角色' } )
28
- @ApiCreatedResponse ( {
29
- type : AccountRoleListResDto ,
28
+ @ApiOkResponse ( {
29
+ type : AccountRoleListVo ,
30
30
isArray : true ,
31
31
description : '根据账号ID查询授权角色返回值' ,
32
32
} )
33
33
@HttpCode ( HttpStatus . OK )
34
34
@Get ( ':accountId' )
35
35
async accountRoleListByAccountId (
36
36
@Param ( 'accountId' , new ParseIntPipe ( ) ) accountId : number ,
37
- ) : Promise < AccountRoleListResDto [ ] | undefined > {
37
+ ) : Promise < AccountRoleListVo [ ] | undefined > {
38
38
return this . accountRoleService . accountRoleListByAccountId ( accountId ) ;
39
39
}
40
40
41
41
@ApiOperation ( { summary : '给账号分配角色' , description : '给当前账号分配角色' } )
42
- @ApiCreatedResponse ( {
42
+ @ApiOkResponse ( {
43
43
type : String ,
44
44
description : '给账号授权角色返回值' ,
45
45
} )
@@ -50,13 +50,13 @@ export class AccountRoleController {
50
50
}
51
51
52
52
@ApiOperation ( { summary : '根据全部的角色' , description : '给账号分配角色的时候使用' } )
53
- @ApiCreatedResponse ( {
54
- type : RoleAccountListDto ,
53
+ @ApiOkResponse ( {
54
+ type : RoleAccountListVo ,
55
55
isArray : true ,
56
56
description : '角色返回列表' ,
57
57
} )
58
58
@Get ( )
59
- async roleList ( ) : Promise < RoleAccountListDto [ ] > {
59
+ async roleList ( ) : Promise < RoleAccountListVo [ ] > {
60
60
return await this . accountRoleService . roleList ( ) ;
61
61
}
62
62
}
0 commit comments