Skip to content

Commit

Permalink
fix 修复权限问题
Browse files Browse the repository at this point in the history
  • Loading branch information
liyupi committed Oct 31, 2022
1 parent 4b64711 commit 4d4aa73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,5 +322,6 @@ npm run build
## 致谢

部分词库来源:[https://github.com/fighting41love/funNLP](https://github.com/fighting41love/funNLP)

示例表信息来源:[https://open.yesapi.cn/list1.html](https://open.yesapi.cn/list1.html)

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.yupi.sqlfather.annotation.AuthCheck;
import com.yupi.sqlfather.common.BaseResponse;
import com.yupi.sqlfather.common.DeleteRequest;
import com.yupi.sqlfather.common.ErrorCode;
Expand Down Expand Up @@ -127,6 +128,7 @@ public BaseResponse<UserVO> getLoginUser(HttpServletRequest request) {
* @return
*/
@PostMapping("/add")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<Long> addUser(@RequestBody UserAddRequest userAddRequest, HttpServletRequest request) {
if (userAddRequest == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR);
Expand All @@ -148,6 +150,7 @@ public BaseResponse<Long> addUser(@RequestBody UserAddRequest userAddRequest, Ht
* @return
*/
@PostMapping("/delete")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<Boolean> deleteUser(@RequestBody DeleteRequest deleteRequest, HttpServletRequest request) {
if (deleteRequest == null || deleteRequest.getId() <= 0) {
throw new BusinessException(ErrorCode.PARAMS_ERROR);
Expand All @@ -164,6 +167,7 @@ public BaseResponse<Boolean> deleteUser(@RequestBody DeleteRequest deleteRequest
* @return
*/
@PostMapping("/update")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<Boolean> updateUser(@RequestBody UserUpdateRequest userUpdateRequest,
HttpServletRequest request) {
if (userUpdateRequest == null || userUpdateRequest.getId() == null) {
Expand All @@ -183,6 +187,7 @@ public BaseResponse<Boolean> updateUser(@RequestBody UserUpdateRequest userUpdat
* @return
*/
@GetMapping("/get")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<UserVO> getUserById(int id, HttpServletRequest request) {
if (id <= 0) {
throw new BusinessException(ErrorCode.PARAMS_ERROR);
Expand All @@ -201,6 +206,7 @@ public BaseResponse<UserVO> getUserById(int id, HttpServletRequest request) {
* @return
*/
@GetMapping("/list")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<List<UserVO>> listUser(UserQueryRequest userQueryRequest, HttpServletRequest request) {
User userQuery = new User();
if (userQueryRequest != null) {
Expand All @@ -224,6 +230,7 @@ public BaseResponse<List<UserVO>> listUser(UserQueryRequest userQueryRequest, Ht
* @return
*/
@GetMapping("/list/page")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<Page<UserVO>> listUserByPage(UserQueryRequest userQueryRequest, HttpServletRequest request) {
long current = 1;
long size = 10;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.yupi.sqlfather.core.builder.sql;

import cn.hutool.db.dialect.DialectFactory;
import com.yupi.sqlfather.common.ErrorCode;
import com.yupi.sqlfather.exception.BusinessException;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down

0 comments on commit 4d4aa73

Please sign in to comment.