@@ -21,6 +21,7 @@ public interface FileDAO {
21
21
* 获取文件权限
22
22
*
23
23
* @param id 文件编号
24
+ *
24
25
* @return {@link BaseAuthRecord}
25
26
*/
26
27
@ Select ("select is_downloadable,is_uploadable,is_deletable,is_updatable,is_visible from file where id=#{id}" )
@@ -30,6 +31,7 @@ public interface FileDAO {
30
31
* 通过编号获取文件
31
32
*
32
33
* @param id 编号
34
+ *
33
35
* @return {@link File}
34
36
*/
35
37
@ Select ("select * from file where id=#{id}" )
@@ -39,6 +41,7 @@ public interface FileDAO {
39
41
* 通过ID获取本地路径
40
42
*
41
43
* @param fileId 文件编号
44
+ *
42
45
* @return {@link String}
43
46
*/
44
47
@ Select ("select local_url from file where id=#{id}" )
@@ -48,6 +51,7 @@ public interface FileDAO {
48
51
* 通过编号删除文件
49
52
*
50
53
* @param id 编号
54
+ *
51
55
* @return 是否删除成功
52
56
*/
53
57
@ Delete ("delete from file where id=#{id}" )
@@ -57,6 +61,7 @@ public interface FileDAO {
57
61
* 通过本地路径获取文件编号
58
62
*
59
63
* @param visitUrl 本地路径
64
+ *
60
65
* @return 编号
61
66
*/
62
67
@ Select ("select id from file where visit_url=#{visitUrl}" )
@@ -66,6 +71,7 @@ public interface FileDAO {
66
71
* 通过本地路径获取文件编号
67
72
*
68
73
* @param localUrl 本地路径
74
+ *
69
75
* @return 编号
70
76
*/
71
77
@ Select ("select id from file where local_url=#{localUrl}" )
@@ -75,6 +81,7 @@ public interface FileDAO {
75
81
* 通过访问路径获取本地文件路径
76
82
*
77
83
* @param visitUrl 访问路径
84
+ *
78
85
* @return {@link String}
79
86
*/
80
87
@ Select ("select local_url from file where visit_url=#{visitUrl}" )
@@ -84,6 +91,7 @@ public interface FileDAO {
84
91
* 通过访问路径删除
85
92
*
86
93
* @param visitUrl 访问路径
94
+ *
87
95
* @return 是否删除成功
88
96
*/
89
97
@ Delete ("delete from file where visit_url=#{visitUrl}" )
@@ -93,6 +101,7 @@ public interface FileDAO {
93
101
* 通过本地路径删除
94
102
*
95
103
* @param localUrl 本地路径
104
+ *
96
105
* @return 是否删除成功
97
106
*/
98
107
@ Delete ("delete from file where local_url=#{localUrl}" )
@@ -102,6 +111,7 @@ public interface FileDAO {
102
111
* 检查本地路径
103
112
*
104
113
* @param localUrl 本地路径
114
+ *
105
115
* @return {@link Integer}
106
116
*/
107
117
@ Select ("select count(*) from file where local_url=#{localUrl}" )
@@ -111,6 +121,7 @@ public interface FileDAO {
111
121
* 检查访问路径
112
122
*
113
123
* @param visitUrl 访问路径
124
+ *
114
125
* @return {@link Integer}
115
126
*/
116
127
@ Select ("select count(*) from file where visit_url=#{visitUrl}" )
@@ -120,6 +131,7 @@ public interface FileDAO {
120
131
* 添加一个文件
121
132
*
122
133
* @param file {@link File}
134
+ *
123
135
* @return 是否添加成功
124
136
*/
125
137
@ Insert ("insert into file(name,suffix,local_url,visit_url,size,description,tag,user_id,category_id," +
@@ -156,6 +168,7 @@ public interface FileDAO {
156
168
* 更新文件基本信息
157
169
*
158
170
* @param file 文件
171
+ *
159
172
* @return 是否更新成功
160
173
*/
161
174
@ Update ("update file set name=#{name},suffix=#{suffix},local_url=#{localUrl},visit_url=#{visitUrl}," +
@@ -172,6 +185,7 @@ public interface FileDAO {
172
185
* @param isVisible 可查权限
173
186
* @param isDeletable 删除权限
174
187
* @param isUpdatable 上传权限
188
+ *
175
189
* @return 是否更新成功
176
190
*/
177
191
@ UpdateProvider (type = FileSqlProvider .class , method = "updateAuthById" )
@@ -262,6 +276,7 @@ boolean updateAuthById(@Param("id") long id, @Param("isDownloadable") int isDown
262
276
* 获取文件信息
263
277
*
264
278
* @param visitUrl 访问链接
279
+ *
265
280
* @return {@link File}
266
281
*/
267
282
@ Select ("select * from file where visit_url=#{visitUrl}" )
@@ -275,10 +290,11 @@ boolean updateAuthById(@Param("id") long id, @Param("isDownloadable") int isDown
275
290
* @param categoryId 分类编号
276
291
* @param orderBy 排序方式
277
292
* @param search 搜索
293
+ *
278
294
* @return {@link List}
279
295
*/
280
296
@ SelectProvider (type = FileSqlProvider .class , method = "getAll" )
281
- List <FileRecord > getAll (@ Param ("userId" ) int userId , @ Param ("offset" ) int offset , @ Param ("categoryId" ) int
297
+ List <FileRecord > listAll (@ Param ("userId" ) int userId , @ Param ("offset" ) int offset , @ Param ("categoryId" ) int
282
298
categoryId , @ Param ("orderBy" ) String orderBy , @ Param ("search" ) String search );
283
299
284
300
/**
@@ -287,10 +303,11 @@ List<FileRecord> getAll(@Param("userId") int userId, @Param("offset") int offset
287
303
* @param userId 用户编号
288
304
* @param offset 偏移
289
305
* @param search 搜索
306
+ *
290
307
* @return {@link List}
291
308
*/
292
309
@ SelectProvider (type = FileSqlProvider .class , method = "getUserUploaded" )
293
- List <FileRecord > getUserUploaded (@ Param ("userId" ) int userId , @ Param ("offset" ) int offset , @ Param ("search" )
310
+ List <FileRecord > listUserUploaded (@ Param ("userId" ) int userId , @ Param ("offset" ) int offset , @ Param ("search" )
294
311
String search );
295
312
296
313
/**
@@ -299,10 +316,11 @@ List<FileRecord> getUserUploaded(@Param("userId") int userId, @Param("offset") i
299
316
* @param userId 用户编号
300
317
* @param offset 偏移
301
318
* @param search 搜索
319
+ *
302
320
* @return {@link List}
303
321
*/
304
322
@ SelectProvider (type = FileSqlProvider .class , method = "getUserDownloaded" )
305
- List <FileRecord > getUserDownloaded (@ Param ("userId" ) int userId , @ Param ("offset" ) int offset , @ Param ("search" )
323
+ List <FileRecord > listUserDownloaded (@ Param ("userId" ) int userId , @ Param ("offset" ) int offset , @ Param ("search" )
306
324
String search );
307
325
308
326
/**
@@ -313,9 +331,10 @@ List<FileRecord> getUserDownloaded(@Param("userId") int userId, @Param("offset")
313
331
* @param categoryId 分类编号,不用分类编号作为条件时设置值小于等于0即可
314
332
* @param fileName 文件名,不使用文件名作为条件时设置值为空即可
315
333
* @param offset 偏移
334
+ *
316
335
* @return 上传记录
317
336
*/
318
337
@ SelectProvider (type = FileSqlProvider .class , method = "getBasicBy" )
319
- List <FileBasicRecord > getBasicBy (@ Param ("userId" ) int userId , @ Param ("fileId" ) long fileId , @ Param ("fileName" )
338
+ List <FileBasicRecord > listBasicBy (@ Param ("userId" ) int userId , @ Param ("fileId" ) long fileId , @ Param ("fileName" )
320
339
String fileName , @ Param ("categoryId" ) int categoryId , @ Param ("offset" ) int offset );
321
340
}
0 commit comments