⚡Perfect: 统一返回格式
This commit is contained in:
@@ -4,6 +4,8 @@ import cn.hezhaohui.webhook.entity.GiteaPushEvent;
|
||||
import cn.hezhaohui.webhook.service.HookService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatusCode;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -19,9 +21,9 @@ public class HookController {
|
||||
private HookService hookService;
|
||||
|
||||
@PostMapping
|
||||
public void handlePush(@RequestBody GiteaPushEvent event) {
|
||||
public ResponseEntity<String> handlePush(@RequestBody GiteaPushEvent event) {
|
||||
log.info(event.toString());
|
||||
|
||||
hookService.handlePush(event);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user