mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
style: 调整代码风格 null == xx => xx == null(更符合大众风格)
This commit is contained in:
@@ -42,7 +42,7 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi
|
||||
@Override
|
||||
protected RequestMappingInfo getMappingForMethod(@NonNull Method method, @NonNull Class<?> handlerType) {
|
||||
RequestMappingInfo requestMappingInfo = super.getMappingForMethod(method, handlerType);
|
||||
if (null == requestMappingInfo) {
|
||||
if (requestMappingInfo == null) {
|
||||
return null;
|
||||
}
|
||||
// 如果没有声明 @CrudRequestMapping 注解,直接返回
|
||||
|
@@ -56,7 +56,7 @@ public class PageResp<L> extends BasePageResp<L> {
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <T, L> PageResp<L> build(Page<T> page, Class<L> targetClass) {
|
||||
if (null == page) {
|
||||
if (page == null) {
|
||||
return empty();
|
||||
}
|
||||
return new PageResp<>(BeanUtil.copyToList(page.getRecords(), targetClass), page.getTotalRow());
|
||||
@@ -70,7 +70,7 @@ public class PageResp<L> extends BasePageResp<L> {
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <L> PageResp<L> build(Page<L> page) {
|
||||
if (null == page) {
|
||||
if (page == null) {
|
||||
return empty();
|
||||
}
|
||||
return new PageResp<>(page.getRecords(), page.getTotalRow());
|
||||
|
@@ -220,7 +220,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
|
||||
* @param obj 待填充信息
|
||||
*/
|
||||
protected void fill(Object obj) {
|
||||
if (null == obj) {
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
OperateTemplate operateTemplate = SpringUtil.getBean(OperateTemplate.class);
|
||||
|
@@ -56,7 +56,7 @@ public class PageResp<L> extends BasePageResp<L> {
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <T, L> PageResp<L> build(IPage<T> page, Class<L> targetClass) {
|
||||
if (null == page) {
|
||||
if (page == null) {
|
||||
return empty();
|
||||
}
|
||||
return new PageResp<>(BeanUtil.copyToList(page.getRecords(), targetClass), page.getTotal());
|
||||
@@ -70,7 +70,7 @@ public class PageResp<L> extends BasePageResp<L> {
|
||||
* @return 分页信息
|
||||
*/
|
||||
public static <L> PageResp<L> build(IPage<L> page) {
|
||||
if (null == page) {
|
||||
if (page == null) {
|
||||
return empty();
|
||||
}
|
||||
return new PageResp<>(page.getRecords(), page.getTotal());
|
||||
|
@@ -311,7 +311,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseIdD
|
||||
* @param obj 待填充信息
|
||||
*/
|
||||
protected void fill(Object obj) {
|
||||
if (null == obj) {
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
OperateTemplate operateTemplate = SpringUtil.getBean(OperateTemplate.class);
|
||||
|
@@ -82,7 +82,7 @@ public class DefaultDataPermissionHandler implements DataPermissionHandler {
|
||||
for (Method method : methodArr) {
|
||||
DataPermission dataPermission = method.getAnnotation(DataPermission.class);
|
||||
String name = method.getName();
|
||||
if (null == dataPermission || !CharSequenceUtil.equalsAny(methodName, name, name + "_COUNT")) {
|
||||
if (dataPermission == null || !CharSequenceUtil.equalsAny(methodName, name, name + "_COUNT")) {
|
||||
continue;
|
||||
}
|
||||
if (dataPermissionUserContextProvider.isFilter()) {
|
||||
|
Reference in New Issue
Block a user