feat(report): integrate report handling into application
- Added Report and AdminReport handlers to manage report-related functionalities. - Updated router and wire generation to include new report services and handlers. - Enhanced error handling in report and admin report handlers to return appropriate status codes. - Refactored notification logic in admin report service to utilize a dedicated notification repository and push service.
This commit is contained in:
@@ -101,7 +101,7 @@ func (h *AdminReportHandler) Handle(c *gin.Context) {
|
||||
zap.String("id", id),
|
||||
zap.String("action", req.Action),
|
||||
)
|
||||
response.Error(c, err.Error())
|
||||
response.Error(c, 500, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ func (h *AdminReportHandler) BatchHandle(c *gin.Context) {
|
||||
zap.Error(err),
|
||||
zap.Int("count", len(req.IDs)),
|
||||
)
|
||||
response.Error(c, err.Error())
|
||||
response.Error(c, 500, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ func (h *ReportHandler) Create(c *gin.Context) {
|
||||
zap.String("target_type", req.TargetType),
|
||||
zap.String("target_id", req.TargetID),
|
||||
)
|
||||
response.Error(c, err.Error())
|
||||
response.Error(c, 500, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user