update Page.size to long

This commit is contained in:
Timi
2025-12-08 16:58:42 +08:00
parent bc2c920705
commit 6839dafdb9
10 changed files with 34 additions and 14 deletions

View File

@ -23,7 +23,7 @@ public interface ArticleMapper extends BaseMapper<Article, Long> {
long countByKeyword(String keyword); long countByKeyword(String keyword);
List<Article> selectByKeyword(String keyword, Long offset, int limit); List<Article> selectByKeyword(String keyword, Long offset, long limit);
@Select("UPDATE `article` SET `likes` = `likes` + 1 WHERE `id` = #{articleId}") @Select("UPDATE `article` SET `likes` = `likes` + 1 WHERE `id` = #{articleId}")
void like(Long articleId); void like(Long articleId);

View File

@ -376,12 +376,25 @@ public class CommonController {
} }
} }
/**
* 上传临时文件
*
* @param files
* @return
*/
@AOPLog @AOPLog
@PostMapping("/temp/file/upload") @PostMapping("/temp/file/upload")
public List<TempFileResponse> uploadFile(@RequestParam("file") List<MultipartFile> files) { public List<TempFileResponse> uploadFile(@RequestParam("file") List<MultipartFile> files) {
return tempFileService.store(files); return tempFileService.store(files);
} }
/**
* 读取临时文件
*
* @param fileId
* @param req
* @param resp
*/
@AOPLog @AOPLog
@RequestRateLimit @RequestRateLimit
@IgnoreGlobalReturn @IgnoreGlobalReturn
@ -406,6 +419,13 @@ public class CommonController {
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} }
} }
/**
* 下载临时文件
*
* @param fileId
* @param resp
*/
@AOPLog @AOPLog
@RequestRateLimit @RequestRateLimit
@IgnoreGlobalReturn @IgnoreGlobalReturn

View File

@ -36,11 +36,11 @@ public interface CommentMapper extends BaseMapper<Comment, Long> {
long countAll(Comment.BizType bizType, Long bizId); long countAll(Comment.BizType bizType, Long bizId);
List<CommentView> list(Comment.BizType bizType, Long bizId, Long offset, int limit, LinkedHashMap<String, OrderType> orderMap); List<CommentView> list(Comment.BizType bizType, Long bizId, Long offset, long limit, LinkedHashMap<String, OrderType> orderMap);
long countByUserId(Long userId); long countByUserId(Long userId);
List<CommentView> listByUserId(Long userId, Long offset, int limit, LinkedHashMap<String, OrderType> orderMap); List<CommentView> listByUserId(Long userId, Long offset, long limit, LinkedHashMap<String, OrderType> orderMap);
@Update("UPDATE comment SET deleted_at = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) WHERE user_id = #{userId} ") @Update("UPDATE comment SET deleted_at = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) WHERE user_id = #{userId} ")
void deleteByUserId(Long userId); void deleteByUserId(Long userId);

View File

@ -25,7 +25,7 @@ public interface CommentReplyMapper extends BaseMapper<CommentReply, Long> {
long countByBizType(CommentReplyPage.BizType bizType, Long bizId); long countByBizType(CommentReplyPage.BizType bizType, Long bizId);
@Select("SELECT * FROM comment_reply WHERE ${bizType.column} = #{bizId} AND ignored_at IS NULL" + NOT_DELETE + PAGE) @Select("SELECT * FROM comment_reply WHERE ${bizType.column} = #{bizId} AND ignored_at IS NULL" + NOT_DELETE + PAGE)
List<CommentReplyView> listByBizType(CommentReplyPage.BizType bizType, Long bizId, Long offset, int limit); List<CommentReplyView> listByBizType(CommentReplyPage.BizType bizType, Long bizId, Long offset, long limit);
@Update("UPDATE comment_reply SET deleted_at = " + UNIX_TIME + " WHERE sender_id = #{userId} OR receiver_id = #{userId}") @Update("UPDATE comment_reply SET deleted_at = " + UNIX_TIME + " WHERE sender_id = #{userId} OR receiver_id = #{userId}")
void deleteByUserId(Long userId); void deleteByUserId(Long userId);

View File

@ -21,15 +21,15 @@ public interface IconMapper extends BaseMapper<Icon, Long> {
long countByName(String name); long countByName(String name);
@Select("SELECT * FROM icon WHERE name LIKE CONCAT('%', #{name}, '%')" + PAGE) @Select("SELECT * FROM icon WHERE name LIKE CONCAT('%', #{name}, '%')" + PAGE)
List<Icon> listByName(String name, long offset, int limit); List<Icon> listByName(String name, long offset, long limit);
long countByLabel(String lang, String label); long countByLabel(String lang, String label);
List<Icon> listByLabel(String lang, String label, long offset, int limit); List<Icon> listByLabel(String lang, String label, long offset, long limit);
@Select("SELECT COUNT(1) FROM icon WHERE unicode = #{unicode}" + NOT_DELETE) @Select("SELECT COUNT(1) FROM icon WHERE unicode = #{unicode}" + NOT_DELETE)
long countByUnicode(String unicode); long countByUnicode(String unicode);
@Select("SELECT * FROM icon WHERE unicode = #{unicode}" + PAGE) @Select("SELECT * FROM icon WHERE unicode = #{unicode}" + PAGE)
List<Icon> listByUnicode(String unicode, long offset, int limit); List<Icon> listByUnicode(String unicode, long offset, long limit);
} }

View File

@ -31,5 +31,5 @@ public interface IssueMapper extends BaseMapper<Issue, Long> {
* @param limit 数据量 * @param limit 数据量
* @return 反馈列表 * @return 反馈列表
*/ */
List<Issue> listByIssuePage(@Param("issuePage") IssuePage issuePage, long offset, int limit); List<Issue> listByIssuePage(@Param("issuePage") IssuePage issuePage, long offset, long limit);
} }

View File

@ -19,5 +19,5 @@ public interface MergeMapper extends BaseMapper<Merge, Long> {
long countByMergePage(@Param("mergePage") MergePage mergePage); long countByMergePage(@Param("mergePage") MergePage mergePage);
List<Merge> listByMergePage(@Param("mergePage") MergePage mergePage, long offset, int limit); List<Merge> listByMergePage(@Param("mergePage") MergePage mergePage, long offset, long limit);
} }

View File

@ -16,7 +16,7 @@ public interface ReleaseMapper extends BaseMapper<Release, Long> {
@Select("SELECT COUNT(1) FROM git_release WHERE repository_id = #{repositoryId}" + NOT_DELETE) @Select("SELECT COUNT(1) FROM git_release WHERE repository_id = #{repositoryId}" + NOT_DELETE)
long countByRepositoryId(long repositoryId); long countByRepositoryId(long repositoryId);
List<ReleaseView> listByRepositoryId(long repositoryId, long offset, int limit); List<ReleaseView> listByRepositoryId(long repositoryId, long offset, long limit);
@Select("SELECT * FROM git_release WHERE repository_id = #{repositoryId}" + NOT_DELETE + "ORDER BY created_at DESC" + LIMIT_1) @Select("SELECT * FROM git_release WHERE repository_id = #{repositoryId}" + NOT_DELETE + "ORDER BY created_at DESC" + LIMIT_1)
Release queryLatestByRepositoryId(long repositoryId); Release queryLatestByRepositoryId(long repositoryId);

View File

@ -1,10 +1,10 @@
package com.imyeyu.api.modules.git.vo.issue; package com.imyeyu.api.modules.git.vo.issue;
import com.imyeyu.api.modules.common.entity.Comment;
import com.imyeyu.spring.bean.Page;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import com.imyeyu.api.modules.common.entity.Comment;
import com.imyeyu.spring.bean.Page;
/** /**
* @author 夜雨 * @author 夜雨
@ -13,7 +13,7 @@ import com.imyeyu.spring.bean.Page;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class CommentPage extends Page { public class CommentPage extends Page<Comment> {
private Comment.BizType bizType; private Comment.BizType bizType;

View File

@ -12,5 +12,5 @@ public interface ActionMapper {
long count(Long repoId, String branch, ActionLogDTO.Operation operation); long count(Long repoId, String branch, ActionLogDTO.Operation operation);
List<ActionLogDTO> list(Long repoId, String branch, ActionLogDTO.Operation operation, long offset, int limit); List<ActionLogDTO> list(Long repoId, String branch, ActionLogDTO.Operation operation, long offset, long limit);
} }