完善book接口
This commit is contained in:
parent
d1e6e5e15a
commit
49d75b44e1
|
@ -8,7 +8,6 @@ auth:
|
|||
- /swagger-ui.html
|
||||
- /swagger-ui/**
|
||||
- /doc.html
|
||||
- /
|
||||
- /maku/t_user/login
|
||||
- /maku/t_user/updateUser
|
||||
- /maku/t_user/register
|
||||
|
|
|
@ -29,11 +29,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
public class TBookCollectionController {
|
||||
private final TBookCollectionService tBookCollectionService;
|
||||
@GetMapping("/book/buy")
|
||||
@Operation(summary = "购买书籍")
|
||||
public Result<List<TBookCollectionVO>> getBookCollectionByUserId(@PathVariable Long id) {
|
||||
return Result.ok(tBookCollectionService.getPhoneByUseId(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.maku.maku.vo.TBookCollectionVO;
|
|||
import net.maku.maku.query.TBookCollectionQuery;
|
||||
import net.maku.maku.entity.TBookCollectionEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -24,6 +25,5 @@ public interface TBookCollectionService extends BaseService<TBookCollectionEntit
|
|||
|
||||
void delete(List<Long> idList);
|
||||
|
||||
List<TBookCollectionVO> getPhoneByUseId(Long id);
|
||||
|
||||
void save(Integer userId, Integer bookId, Date currentTime);
|
||||
}
|
|
@ -4,23 +4,21 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import net.maku.framework.common.utils.PageResult;
|
||||
import net.maku.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import net.maku.maku.convert.TBookCollectionConvert;
|
||||
import net.maku.maku.entity.TBookCollectionEntity;
|
||||
import net.maku.maku.entity.TBookEntity;
|
||||
import net.maku.maku.entity.TUserEntity;
|
||||
import net.maku.maku.query.TBookCollectionQuery;
|
||||
import net.maku.maku.service.TUserService;
|
||||
import net.maku.maku.vo.TBookCollectionVO;
|
||||
import net.maku.maku.dao.TBookCollectionDao;
|
||||
import net.maku.maku.service.TBookCollectionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -69,8 +67,19 @@ public class TBookCollectionServiceImpl extends BaseServiceImpl<TBookCollectionD
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<TBookCollectionVO> getPhoneByUseId(Long id) {
|
||||
return List.of();
|
||||
public void save(Integer userId, Integer bookId, Date currentTime) {
|
||||
TBookCollectionEntity entity = new TBookCollectionEntity();
|
||||
entity.setUserId(userId);
|
||||
entity.setBookId(bookId);
|
||||
entity.setCreateTime(currentTime);
|
||||
// 可以根据需要设置其它字段,例如自增id字段和lastModifiedTime字段(如果需要)
|
||||
|
||||
// 假设lastModifiedTime可以为空,可以根据需要设置
|
||||
|
||||
|
||||
// 使用 MyBatis Plus 的 save 方法保存实体
|
||||
this.save(entity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ spring:
|
|||
database: 0
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: 123456
|
||||
#timeout: 6000ms # 连接超时时长(毫秒)
|
||||
datasource:
|
||||
dynamic:
|
||||
|
|
Loading…
Reference in New Issue
Block a user