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