feat:
1.add auto-clean
This commit is contained in:
@@ -155,4 +155,24 @@ public class KioskApiController {
|
||||
List<PriceListApiVO> list = kioskApiService.priceList(id);
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动清理时限查询
|
||||
*
|
||||
* @return Integer
|
||||
*/
|
||||
@GetMapping("/auto-clean-seconds")
|
||||
@Operation(summary = "价格查询")
|
||||
public R<Integer> autoCleanSeconds() {
|
||||
return R.data(kioskApiService.autoCleanSeconds());
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理照片
|
||||
*/
|
||||
@PostMapping("/clean-photos")
|
||||
@Operation(summary = "清理照片")
|
||||
public R cleanPhotos() {
|
||||
return R.status(kioskApiService.cleanPhotos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,8 @@ public interface IKioskApiService {
|
||||
|
||||
List<PriceListApiVO> priceList(Long id);
|
||||
|
||||
Integer autoCleanSeconds();
|
||||
|
||||
boolean cleanPhotos();
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.springblade.modules.kiosk.service.*;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IDeptService;
|
||||
import org.springblade.modules.system.service.IDictBizService;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -45,6 +46,8 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
|
||||
private final IDictBizService dictService;
|
||||
|
||||
private final IParamService paramService;
|
||||
|
||||
private final ICategoryService categoryService;
|
||||
|
||||
private final IPhotoAttachmentService photoAttachmentService;
|
||||
@@ -68,6 +71,8 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
|
||||
private static final String categoryType = "category_type";
|
||||
|
||||
private static final String autoCleanKey = "kiosk.default.autoCleanSeconds";
|
||||
|
||||
private static final Integer taxPercent = 15;
|
||||
|
||||
@Override
|
||||
@@ -322,4 +327,14 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer autoCleanSeconds() {
|
||||
String value = paramService.getValue(autoCleanKey);
|
||||
return Integer.valueOf(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cleanPhotos() {
|
||||
return photoAttachmentService.update(Wrappers.<PhotoAttachmentEntity>lambdaUpdate().eq(PhotoAttachmentEntity::getCreateUser, AuthUtil.getUserId()).set(PhotoAttachmentEntity::getStatus, 2));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user