feat(用户模块): 添加用户类型查询 (#438)

This commit is contained in:
tancong 2023-11-08 10:53:33 +08:00 committed by GitHub
parent 4f1c89ccc2
commit d9603381e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -12,11 +12,14 @@ import org.hswebframework.web.authorization.annotation.Resource;
import org.hswebframework.web.authorization.annotation.SaveAction;
import org.hswebframework.web.authorization.exception.UnAuthorizedException;
import org.jetlinks.community.auth.entity.UserDetail;
import org.jetlinks.community.auth.enums.UserEntityType;
import org.jetlinks.community.auth.enums.UserEntityTypes;
import org.jetlinks.community.auth.service.UserDetailService;
import org.jetlinks.community.auth.service.request.SaveUserDetailRequest;
import org.jetlinks.community.auth.service.request.SaveUserRequest;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@RestController
@ -99,4 +102,11 @@ public class UserDetailController {
.flatMap(tp2 -> userDetailService.saveUserDetail(tp2.getT1().getUser().getId(), tp2.getT2()));
}
@GetMapping("/types")
@Operation(summary = "获取所有用户类型")
@Authorize(merge = false)
public Flux<UserEntityType> getUserEntityTypes() {
return Flux.fromIterable(UserEntityTypes.getAllType());
}
}