puzhibing
2026-02-26 da6a14067bbb3e98d8a1a41c6d7d9883b09e5fee
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpCruisePlanController.java
@@ -4,16 +4,27 @@
import com.xiaopeng.api.model.operation.XpCruisePlan;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.dto.XpCruisePlanAddDTO;
import com.xiaopeng.operation.dto.XpCruisePlanEditDTO;
import com.xiaopeng.operation.query.CruisePlanQuery;
import com.xiaopeng.operation.service.IXpCruisePlanService;
import com.xiaopeng.operation.vo.XpCruisePlanDetailVO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.ApiParam;
/**
 * <p>
@@ -23,6 +34,7 @@
 * @author mitao
 * @since 2026-02-26
 */
@Validated
@RestController
@RequiredArgsConstructor(onConstructor_ = @Lazy)
public class XpCruisePlanController {
@@ -34,5 +46,32 @@
        return R.ok(xpCruisePlanService.getPageList(query));
    }
    @ApiOperation(value = "新增巡游计划", tags = {"管理后台-巡游计划"})
    @PostMapping(value = {"/api/v1/xp-cruise-plan/add"})
    public R<?> add(@Valid @RequestBody XpCruisePlanAddDTO dto){
        xpCruisePlanService.add(dto);
        return R.ok();
    }
    @ApiOperation(value = "编辑巡游计划", tags = {"管理后台-巡游计划"})
    @PostMapping(value = {"/api/v1/xp-cruise-plan/edit"})
    public R<?> edit(@Valid @RequestBody XpCruisePlanEditDTO dto){
        xpCruisePlanService.edit(dto);
        return R.ok();
    }
    @ApiOperation(value = "删除巡游计划", tags = {"管理后台-巡游计划"})
    @DeleteMapping(value = {"/api/v1/xp-cruise-plan/deleteById/{id}"})
    public R<?> deleteById(@ApiParam(name = "id", value = "巡游计划ID") @PathVariable Long id){
        xpCruisePlanService.deleteById(id);
        return R.ok();
    }
    @ApiOperation(value = "巡游计划详情", tags = {"管理后台-巡游计划"})
    @GetMapping(value = {"/api/v1/xp-cruise-plan/detail"})
    public R<XpCruisePlanDetailVO> detail(@ApiParam(name = "id", value = "巡游计划ID") @RequestParam Long id){
        return R.ok(xpCruisePlanService.detail(id));
    }
}