|
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.lang.reflect.ParameterizedType;
|
|
import java.lang.reflect.ParameterizedType;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
|
|
public abstract class BaseService<T> extends ServiceImpl<com.baomidou.mybatisplus.core.mapper.BaseMapper<T>, T> {
|
|
public abstract class BaseService<T> extends ServiceImpl<com.baomidou.mybatisplus.core.mapper.BaseMapper<T>, T> {
|
|
|
|
|
|
|
@@ -72,18 +73,20 @@ public abstract class BaseService<T> extends ServiceImpl<com.baomidou.mybatisplu
|
|
|
@Transactional(
|
|
@Transactional(
|
|
|
rollbackFor = {Exception.class}
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
)
|
|
|
- public ResponseResultVO<Boolean> disable(Long id) {
|
|
|
|
|
|
|
+ public ResponseResultVO<Boolean> disable(String id) {
|
|
|
UpdateWrapper<T> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<T> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.set(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("unValid")).eq(getPrimaryKey(), id).eq(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("isValid"));
|
|
|
|
|
|
|
+ UUID uuid = UUID.fromString(id);
|
|
|
|
|
+ updateWrapper.set(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("unValid")).eq(getPrimaryKey(), uuid).eq(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("isValid"));
|
|
|
return super.update(updateWrapper) ? ResponseResultUtil.success() : ResponseResultUtil.error(ResponseCodeEnum.DISABLE_FAIL);
|
|
return super.update(updateWrapper) ? ResponseResultUtil.success() : ResponseResultUtil.error(ResponseCodeEnum.DISABLE_FAIL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Transactional(
|
|
@Transactional(
|
|
|
rollbackFor = {Exception.class}
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
)
|
|
|
- public ResponseResultVO<Boolean> enable(Long id) {
|
|
|
|
|
|
|
+ public ResponseResultVO<Boolean> enable(String id) {
|
|
|
UpdateWrapper<T> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<T> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.set(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("isValid")).eq(getPrimaryKey(), id).eq(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("unValid"));
|
|
|
|
|
|
|
+ UUID uuid = UUID.fromString(id);
|
|
|
|
|
+ updateWrapper.set(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("isValid")).eq(getPrimaryKey(), uuid).eq(String.valueOf(PojoConfig.VALUES.get("validKey")), PojoConfig.VALUES.get("unValid"));
|
|
|
return super.update(updateWrapper) ? ResponseResultUtil.success() : ResponseResultUtil.error(ResponseCodeEnum.ENABLE_FAIL);
|
|
return super.update(updateWrapper) ? ResponseResultUtil.success() : ResponseResultUtil.error(ResponseCodeEnum.ENABLE_FAIL);
|
|
|
}
|
|
}
|
|
|
|
|
|