feat: revision-check material writes
- add jz_bm_materials.revision (default 1), read-only for GORM
- bump it only on content changes (models.ReviseMaterial)
- PUT /materials/{id} locks the row and answers 409 to a stale revision
- management answers carry revision and updated_at, the student detail
carries revision
This commit is contained in:
@@ -234,6 +234,7 @@ func (h *Handlers) Material(w http.ResponseWriter, r *http.Request) {
|
||||
materialListJSON: newMaterialListJSON(m, int64(len(files))),
|
||||
Body: m.Body,
|
||||
Files: make([]fileJSON, 0, len(files)),
|
||||
Revision: m.Revision,
|
||||
}
|
||||
for i := range files {
|
||||
f := &files[i]
|
||||
|
||||
Reference in New Issue
Block a user