Skip to content

Commit 94c24f0

Browse files
committed
kotlin
1 parent 3245a0a commit 94c24f0

File tree

10 files changed

+1071
-998
lines changed

10 files changed

+1071
-998
lines changed

api/src/main/java/info/xiaomo/api/dao/base/CommonDao.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
* @author : xiaomo
1919
* github: https://github.com/xiaomoinfo
2020
21-
21+
* <p>
2222
* Date: 2016/4/1 20:46
2323
* Description: 公共dao层
2424
* Copyright(©) 2015 by xiaomo.
2525
**/
2626
@Repository
27-
@Transactional
27+
@Transactional(rollbackFor = {})
2828
public class CommonDao {
2929

3030
@PersistenceContext

api/src/main/java/info/xiaomo/api/service/UserService.java

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import info.xiaomo.api.model.UserModel;
55
import info.xiaomo.core.exception.UserNotFoundException;
66
import org.springframework.data.domain.Page;
7-
import org.springframework.transaction.annotation.Isolation;
8-
import org.springframework.transaction.annotation.Propagation;
9-
import org.springframework.transaction.annotation.Transactional;
107

118
import java.util.List;
129

@@ -25,19 +22,56 @@
2522
**/
2623
public interface UserService {
2724

25+
/**
26+
* 根据id查用户
27+
*
28+
* @param id id
29+
* @return UserModel
30+
*/
2831
UserModel findUserById(Long id);
2932

30-
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
33+
/**
34+
* 根据邮件查用户
35+
* @param email email
36+
* @return UserModel
37+
*/
3138
UserModel findUserByEmail(String email);
3239

40+
/**
41+
* 添加用户
42+
* @param model model
43+
* @return UserModel
44+
*/
3345
UserModel addUser(UserModel model);
3446

47+
/**
48+
* 更新用户
49+
* @param model model
50+
* @return UserModel
51+
* @throws UserNotFoundException UserNotFoundException
52+
*/
3553
UserModel updateUser(UserModel model) throws UserNotFoundException;
3654

55+
/**
56+
* 查找所有 带分页
57+
* @param start start
58+
* @param pageSize pageSize
59+
* @return Page
60+
*/
3761
Page<UserModel> findAll(int start, int pageSize);
3862

63+
/**
64+
* 查找所有 不带分页
65+
* @return List
66+
*/
3967
List<UserModel> findAll();
4068

69+
/**
70+
* 删除用户
71+
* @param id id
72+
* @return UserModel
73+
* @throws UserNotFoundException
74+
*/
4175
UserModel deleteUserById(Long id) throws UserNotFoundException;
4276

4377
}

core/src/main/java/info/xiaomo/core/untils/FileUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ private static void list(List<File> list, File file,
641641
}
642642
}
643643
if (file.isDirectory()) {
644-
File files[] = file.listFiles();
644+
File[] files = file.listFiles();
645645
for (File file1 : files != null ? files : new File[0]) {
646646
list(list, file1, filter);
647647
}

core/src/main/java/info/xiaomo/core/untils/HtmlUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Today the best performance as tomorrow newest starter!
1010
* Created by IntelliJ IDEA.
1111
* <p>
12+
*
1213
* @author : xiaomo
1314
* github: https://github.com/syoubaku
1415
@@ -27,7 +28,7 @@ public class HtmlUtil {
2728
* @return 是否包含html标签
2829
*/
2930
public static boolean containsHTMLTag(String str) {
30-
if (StringUtil.Companion.isBlank(str)) {
31+
if (StringUtil.isBlank(str)) {
3132
return false;
3233
}
3334

core/src/main/java/info/xiaomo/core/untils/SqlUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static String sqlHolder(int size) {
4242
*/
4343
public static String sql4DB(String sql, String dbtype) {
4444
if (!"oracle".equalsIgnoreCase(dbtype)) {
45-
sql = StringUtil.Companion.toISO(sql);
45+
sql = StringUtil.toISO(sql);
4646
}
4747
return sql;
4848
}

0 commit comments

Comments
 (0)