Compare commits

...

2 Commits

Author SHA1 Message Date
hxf13 646cea9ab2 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	maku-framework/src/main/resources/auth.yml
2024-07-18 13:55:43 +08:00
周添峰 4b175b085b Merge remote-tracking branch 'origin/master'
# Conflicts:
#	maku-framework/src/main/resources/auth.yml
2024-07-18 13:53:29 +08:00
6 changed files with 32 additions and 6 deletions

View File

@ -10,4 +10,3 @@ auth:
- /sys/third/callback/** - /sys/third/callback/**
- /sys/third/render/** - /sys/third/render/**
- /upload/** - /upload/**
- /

View File

@ -9,4 +9,12 @@ auth:
- /swagger-ui/** - /swagger-ui/**
- /doc.html - /doc.html
- / - /
- /maku/t_user/login
- /maku/t_user/updateUser
- /maku/t_user/register
- /maku/t_user/logout
- /user/login - /user/login
- /maku/t_book/list/search
- /maku/t_book/{id}
- /user/login

View File

@ -47,6 +47,16 @@ public class TBookController {
return Result.ok(entity); return Result.ok(entity);
} }
@GetMapping("/list/search")
@Operation(summary = "根据书名查询书籍")
@Parameter
public Result<TBookEntity> getByName(@RequestParam String name){
TBookEntity entity = tBookService.getByName(name);
return Result.ok(entity);
}
@GetMapping("page") @GetMapping("page")
@Operation(summary = "分页") @Operation(summary = "分页")
@ -57,12 +67,12 @@ public class TBookController {
return Result.ok(page); return Result.ok(page);
} }
@GetMapping("{id}") @GetMapping("{id}")
@Operation(summary = "信息") @Operation(summary = "信息")
@PreAuthorize("hasAuthority('maku:t_book:info')") // @PreAuthorize("hasAuthority('maku:t_book:info')")
public Result<TBookVO> get(@PathVariable("id") Long id){ public Result<TBookVO> get(@PathVariable("id") Long id){
TBookEntity entity = tBookService.getById(id); TBookEntity entity = tBookService.getById(id);
return Result.ok(TBookConvert.INSTANCE.convert(entity)); return Result.ok(TBookConvert.INSTANCE.convert(entity));
} }

View File

@ -24,4 +24,5 @@ public interface TBookService extends BaseService<TBookEntity> {
void delete(List<Long> idList); void delete(List<Long> idList);
TBookEntity getByName(String name);
} }

View File

@ -61,4 +61,12 @@ public class TBookServiceImpl extends BaseServiceImpl<TBookDao, TBookEntity> imp
removeByIds(idList); removeByIds(idList);
} }
@Override
public TBookEntity getByName(String name) {
LambdaQueryWrapper<TBookEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(TBookEntity::getBookName, name);
return baseMapper.selectOne(wrapper);
}
} }

View File

@ -2,9 +2,9 @@ spring:
data: data:
redis: redis:
database: 0 database: 0
host: 127.0.0.1 host: localhost
port: 6379 port: 6379
password: 123456 # password: 123456
#timeout: 6000ms # 连接超时时长(毫秒) #timeout: 6000ms # 连接超时时长(毫秒)
datasource: datasource:
dynamic: dynamic: