feat: integrate AI candidate review and automatic publication
This commit is contained in:
@@ -40,6 +40,28 @@ func bindProviders(r *gin.Engine, options IdentityOptions) {
|
||||
}
|
||||
success(c, http.StatusOK, config)
|
||||
})
|
||||
admin.POST("/providers/model_review/copy-primary", func(c *gin.Context) {
|
||||
if !sameOrigin(c.Request) {
|
||||
fail(c, apperror.ErrForbidden)
|
||||
return
|
||||
}
|
||||
if options.Providers == nil {
|
||||
fail(c, apperror.ErrUnavailable)
|
||||
return
|
||||
}
|
||||
var input struct {
|
||||
ExpectedVersion int64 `json:"expected_version"`
|
||||
}
|
||||
if !decode(c, &input) {
|
||||
return
|
||||
}
|
||||
result, err := options.Providers.CopyPrimaryToReview(c.Request.Context(), currentUser(c), c.Writer.Header().Get("X-Request-ID"), input.ExpectedVersion)
|
||||
if err != nil {
|
||||
fail(c, err)
|
||||
return
|
||||
}
|
||||
success(c, http.StatusOK, result)
|
||||
})
|
||||
admin.GET("/audit-events", func(c *gin.Context) {
|
||||
list, err := options.Providers.Audit(c.Request.Context(), currentUser(c))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user