liujie
2026-05-12 76b3532393aa98c2daaeb67caeefa2ab9556e866
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTargetedServiceController.java
@@ -13,6 +13,9 @@
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.utils.bean.BeanUtils;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.common.log.annotation.AdminOperationLog;
import com.xiaopeng.common.log.enums.AdminBusinessType;
import com.xiaopeng.common.log.enums.AdminOperationType;
import com.xiaopeng.common.security.service.TokenService;
import com.xiaopeng.operation.dto.WhitelistAddDto;
import com.xiaopeng.operation.dto.WhitelistEditDto;
@@ -76,6 +79,12 @@
     */
    @PostMapping("/api/v1/targetedService/add")
    @ApiOperation(value = "定向服务-添加", tags = {"管理后台-定向服务添加"})
    @AdminOperationLog(
            businessType = AdminBusinessType.TARGETED_SERVICE,
            operationType = AdminOperationType.ADD,
            content = "新增定向服务",
            appendRequestData = true
    )
    public R add(@Validated @RequestBody XpTargetedServiceVo dto) {
        SysUser sysUser = tokenService.getLoginUser().getSysUser();
        xpTargetedServiceService.add(dto, sysUser);
@@ -88,6 +97,12 @@
     */
    @PostMapping("/api/v1/targetedService/edit")
    @ApiOperation(value = "定向服务-修改", tags = {"管理后台-定向服务修改"})
    @AdminOperationLog(
            businessType = AdminBusinessType.TARGETED_SERVICE,
            operationType = AdminOperationType.EDIT,
            content = "编辑定向服务",
            appendRequestData = true
    )
    public R edit(@Validated @RequestBody XpTargetedServiceVo dto) {
        if(dto.getId() == null){
            return R.fail("ID不能为空");
@@ -107,6 +122,12 @@
     */
    @PostMapping("/api/v1/targetedService/updateStatus")
    @ApiOperation(value = "定向服务-修改状态", tags = {"管理后台-定向服务修改状态"})
    @AdminOperationLog(
            businessType = AdminBusinessType.TARGETED_SERVICE,
            operationTypeExpression = "#p1 == 1 ? T(com.xiaopeng.common.log.enums.AdminOperationType).ENABLE : T(com.xiaopeng.common.log.enums.AdminOperationType).DISABLE",
            contentExpression = "(#p1 == 1 ? '启用定向服务,id=' : '禁用定向服务,id=') + #p0",
            appendRequestData = false
    )
    public R updateStatus(@RequestParam Long id, @RequestParam Integer status) {
        if (id == null) {
            return R.fail("ID不能为空");
@@ -130,6 +151,12 @@
     */
    @PostMapping("/api/v1/targetedService/deleteByIds")
    @ApiOperation(value = "定向服务-批量删除", tags = {"管理后台-定向服务批量删除"})
    @AdminOperationLog(
            businessType = AdminBusinessType.TARGETED_SERVICE,
            operationType = AdminOperationType.DELETE,
            contentExpression = "'批量删除定向服务,ids=' + #p0.ids",
            appendRequestData = false
    )
    public R deleteByIds(@RequestBody XpTargetedServiceQuery query ) {
        if(CollUtil.isEmpty(query.getIds())){
            return R.fail("ID列表不能为空");