Compare commits
2 Commits
a95ed43a2c
...
646cea9ab2
Author | SHA1 | Date | |
---|---|---|---|
|
646cea9ab2 | ||
|
4b175b085b |
|
@ -10,4 +10,3 @@ auth:
|
|||
- /sys/third/callback/**
|
||||
- /sys/third/render/**
|
||||
- /upload/**
|
||||
- /
|
|
@ -9,4 +9,12 @@ auth:
|
|||
- /swagger-ui/**
|
||||
- /doc.html
|
||||
- /
|
||||
- /user/login
|
||||
- /maku/t_user/login
|
||||
- /maku/t_user/updateUser
|
||||
- /maku/t_user/register
|
||||
- /maku/t_user/logout
|
||||
- /user/login
|
||||
- /maku/t_book/list/search
|
||||
- /maku/t_book/{id}
|
||||
- /user/login
|
||||
|
||||
|
|
|
@ -47,6 +47,16 @@ public class TBookController {
|
|||
|
||||
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")
|
||||
@Operation(summary = "分页")
|
||||
|
@ -57,12 +67,12 @@ public class TBookController {
|
|||
return Result.ok(page);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
@PreAuthorize("hasAuthority('maku:t_book:info')")
|
||||
// @PreAuthorize("hasAuthority('maku:t_book:info')")
|
||||
public Result<TBookVO> get(@PathVariable("id") Long id){
|
||||
TBookEntity entity = tBookService.getById(id);
|
||||
|
||||
return Result.ok(TBookConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
|
|
|
@ -24,4 +24,5 @@ public interface TBookService extends BaseService<TBookEntity> {
|
|||
|
||||
void delete(List<Long> idList);
|
||||
|
||||
TBookEntity getByName(String name);
|
||||
}
|
|
@ -61,4 +61,12 @@ public class TBookServiceImpl extends BaseServiceImpl<TBookDao, TBookEntity> imp
|
|||
removeByIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TBookEntity getByName(String name) {
|
||||
LambdaQueryWrapper<TBookEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(TBookEntity::getBookName, name);
|
||||
return baseMapper.selectOne(wrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -2,9 +2,9 @@ spring:
|
|||
data:
|
||||
redis:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: 123456
|
||||
# password: 123456
|
||||
#timeout: 6000ms # 连接超时时长(毫秒)
|
||||
datasource:
|
||||
dynamic:
|
||||
|
|
Loading…
Reference in New Issue
Block a user