提交 1f90f7c6 authored 作者: 吴德鹏's avatar 吴德鹏

Optimized

上级 c7abd262
......@@ -508,6 +508,7 @@ public class AuthController extends Controller {
private void fillUserNecessayInfo(TbCfUserInfo tbCfUserInfoVo) {
if (tbCfUserInfoVo.getAvatar() == null) tbCfUserInfoVo.setAvatar(domainProperties.getProperty("user.avatar"));
tbCfUserInfoVo.setNick(tbCfUserInfoVo.getAccount());
tbCfUserInfoVo.setUserNo(IdUtil.createIdByDate());
tbCfUserInfoVo.setPhoneFlag(StateConstant.INVALID);
tbCfUserInfoVo.setLoginCount(0);
......
......@@ -56,7 +56,7 @@ public class ItemController {
@RequestParam(value = "pageSize", defaultValue = "6") Integer pageSize,
@RequestParam(value = "order", required = false) String order) {
return new Result<>(repository.findAllByItemCategorytwo(typeTwoId, PageRequest.of(pageNum,pageSize,sort(order))));
return new Result<>(repository.findAllByItemCategorytwoOrderByCreateTimeDesc(typeTwoId, PageRequest.of(pageNum,pageSize,sort(order))));
}
@GetMapping("/queryCategoryTwoByCid/{categoryId}")
......@@ -133,7 +133,7 @@ public class ItemController {
@RequestParam(value = "pageNum", defaultValue = "0") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "6") Integer pageSize,
@RequestParam(value = "order", required = false) String order) {
return new Result<>(repository.findAllByItemDescritionId(typeThreeId, PageRequest.of(pageNum,pageSize,sort(order))));
return new Result<>(repository.findAllByItemDescritionIdOrderByCreateTimeDesc(typeThreeId, PageRequest.of(pageNum,pageSize,sort(order))));
}
private Sort sort(String order){
......
......@@ -12,9 +12,9 @@ import org.springframework.data.repository.query.Param;
import java.util.List;
public interface TbCfStationItemRepository extends PagingAndSortingRepository<TbCfStationItem, String> {
Page<TbCfStationItem> findAllByItemCategorytwo(String category, Pageable pageable);
Page<TbCfStationItem> findAllByItemCategorytwoOrderByCreateTimeDesc(String category, Pageable pageable);
Page<TbCfStationItem> findAllByItemDescritionId(String description, Pageable pageable);
Page<TbCfStationItem> findAllByItemDescritionIdOrderByCreateTimeDesc(String description, Pageable pageable);
Page<TbCfStationItem> findAllByItemLabelContaining(String label, Pageable pageable);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论