| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.api.model.operation.XpNotification; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.dto.NotificationDto; |
| | | import com.xiaopeng.operation.service.IXpNotificationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.parameters.RequestBody; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/xp-notification") |
| | | @RestController |
| | | @RequestMapping("/api/v1/notification") |
| | | @Api(tags = "管理后台-消息通知设置") |
| | | public class XpNotificationController { |
| | | |
| | | @Autowired |
| | | private IXpNotificationService xpNotificationService; |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取消息通知设置列表") |
| | | public R<List<XpNotification>> list() { |
| | | List<XpNotification> list = xpNotificationService.list(); |
| | | return R.ok(list); |
| | | } |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改设置") |
| | | public R<List<XpNotification>> update(@RequestBody NotificationDto notificationDto) { |
| | | List<XpNotification> notifications = notificationDto.getNotifications(); |
| | | xpNotificationService.updateBatchById(notifications); |
| | | return R.ok(); |
| | | } |
| | | } |