feat: 新增按状态批量删除链接功能
主要修改: 1. 在LinkController中新增按状态批量删除链接的接口,允许用户根据指定状态批量删除自己创建的链接。 2. 在LinkStatusService中实现批量删除逻辑,确保用户只能删除自己的链接,并进行状态验证。 3. 更新LinkTaskMapper和对应的XML文件,增加查询和删除链接任务的相关方法。 技术细节: - 通过新增的批量删除功能,提升了用户对链接的管理能力,确保操作的安全性和有效性,同时优化了数据库操作的灵活性。
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package com.gameplatform.server.model.dto.link;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 按狀態批量刪除鏈接請求DTO
|
||||
*
|
||||
* @author GamePlatform
|
||||
*/
|
||||
@Schema(description = "按狀態批量刪除鏈接請求")
|
||||
public class BatchDeleteByStatusRequest {
|
||||
|
||||
@NotEmpty(message = "要刪除的狀態列表不能為空")
|
||||
@Size(max = 10, message = "單次最多只能指定10個狀態")
|
||||
@Schema(description = "要刪除的鏈接狀態列表,可選值:NEW、USING、LOGGED_IN、COMPLETED、REFUNDED、EXPIRED",
|
||||
example = "[\"EXPIRED\", \"REFUNDED\"]", required = true)
|
||||
private List<String> statusList;
|
||||
|
||||
@Schema(description = "是否確認刪除,必須設置為true才能執行刪除操作", example = "true", required = true)
|
||||
private Boolean confirmDelete = false;
|
||||
|
||||
public BatchDeleteByStatusRequest() {}
|
||||
|
||||
public BatchDeleteByStatusRequest(List<String> statusList, Boolean confirmDelete) {
|
||||
this.statusList = statusList;
|
||||
this.confirmDelete = confirmDelete;
|
||||
}
|
||||
|
||||
public List<String> getStatusList() {
|
||||
return statusList;
|
||||
}
|
||||
|
||||
public void setStatusList(List<String> statusList) {
|
||||
this.statusList = statusList;
|
||||
}
|
||||
|
||||
public Boolean getConfirmDelete() {
|
||||
return confirmDelete;
|
||||
}
|
||||
|
||||
public void setConfirmDelete(Boolean confirmDelete) {
|
||||
this.confirmDelete = confirmDelete;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user