|
@@ -8,7 +8,9 @@ import cn.reghao.devops.web.admin.sys.model.po.NotifyReceiver;
|
|
|
import cn.reghao.jutil.jdk.result.WebResult;
|
|
import cn.reghao.jutil.jdk.result.WebResult;
|
|
|
import cn.reghao.jutil.jdk.string.StringRegexp;
|
|
import cn.reghao.jutil.jdk.string.StringRegexp;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
@@ -31,6 +33,8 @@ public class ReceiverController {
|
|
|
this.emailAccountRepository = emailAccountRepository;
|
|
this.emailAccountRepository = emailAccountRepository;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "添加通知接收")
|
|
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@PostMapping(value = "/save", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@PostMapping(value = "/save", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String saveReceiver(@Validated NotifyReceiver notifyReceiver) {
|
|
public String saveReceiver(@Validated NotifyReceiver notifyReceiver) {
|
|
|
String type = notifyReceiver.getType();
|
|
String type = notifyReceiver.getType();
|
|
@@ -57,6 +61,8 @@ public class ReceiverController {
|
|
|
return WebResult.success();
|
|
return WebResult.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "更新通知接收")
|
|
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@PostMapping(value = "/edit", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@PostMapping(value = "/edit", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String editReceiver(@Validated NotifyReceiver notifyReceiver) {
|
|
public String editReceiver(@Validated NotifyReceiver notifyReceiver) {
|
|
|
String name = notifyReceiver.getName();
|
|
String name = notifyReceiver.getName();
|
|
@@ -71,6 +77,8 @@ public class ReceiverController {
|
|
|
return WebResult.success();
|
|
return WebResult.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "删除通知接收")
|
|
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@DeleteMapping(value = "/delete/{name}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@DeleteMapping(value = "/delete/{name}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String deleteReceiver(@PathVariable("name") String name) {
|
|
public String deleteReceiver(@PathVariable("name") String name) {
|
|
|
NotifyReceiver notifyReceiver = notifyReceiverRepository.findByName(name);
|
|
NotifyReceiver notifyReceiver = notifyReceiverRepository.findByName(name);
|