@@ -19,7 +19,15 @@ func NewTransactionController() TransactionController {
1919 return TransactionController {}
2020}
2121
22- // GetTransactions -
22+ // GetTransactions godoc
23+ // @Summary Get Transactions
24+ // @Schemes
25+ // @Description List transactions
26+ // @Param ledger path string true "ledger"
27+ // @Accept json
28+ // @Produce json
29+ // @Success 200 {object} storage.Store{}
30+ // @Router /{ledger}/transactions [get]
2331func (ctl * TransactionController ) GetTransactions (c * gin.Context ) {
2432 l , _ := c .Get ("ledger" )
2533 cursor , err := l .(* ledger.Ledger ).FindTransactions (
@@ -42,7 +50,15 @@ func (ctl *TransactionController) GetTransactions(c *gin.Context) {
4250 )
4351}
4452
45- // PostTransaction -
53+ // PostTransactions godoc
54+ // @Summary Commit a new transaction to the ledger
55+ // @Schemes
56+ // @Description Commit a new transaction to the ledger
57+ // @Param ledger path string true "ledger"
58+ // @Accept json
59+ // @Produce json
60+ // @Success 200 {string} string ""
61+ // @Router /{ledger}/transactions [post]
4662func (ctl * TransactionController ) PostTransaction (c * gin.Context ) {
4763 l , _ := c .Get ("ledger" )
4864
@@ -65,7 +81,15 @@ func (ctl *TransactionController) PostTransaction(c *gin.Context) {
6581 )
6682}
6783
68- // RevertTransaction -
84+ // RevertTransaction godoc
85+ // @Summary Revert transaction
86+ // @Schemes
87+ // @Param ledger path string true "ledger"
88+ // @Param reference path string true "reference"
89+ // @Accept json
90+ // @Produce json
91+ // @Success 200 {string} string ""
92+ // @Router /{ledger}/transactions/{reference}/revert [post]
6993func (ctl * TransactionController ) RevertTransaction (c * gin.Context ) {
7094 l , _ := c .Get ("ledger" )
7195 err := l .(* ledger.Ledger ).RevertTransaction (c .Param ("transactionId" ))
@@ -84,7 +108,15 @@ func (ctl *TransactionController) RevertTransaction(c *gin.Context) {
84108 )
85109}
86110
87- // PostTransactionMetadata -
111+ // PostTransactionMetadata godoc
112+ // @Summary Set metadata on transaction
113+ // @Schemes
114+ // @Param ledger path string true "ledger"
115+ // @Param reference path string true "reference"
116+ // @Accept json
117+ // @Produce json
118+ // @Success 200 {string} string ""
119+ // @Router /{ledger}/transactions/{reference}/metadata [post]
88120func (ctl * TransactionController ) PostTransactionMetadata (c * gin.Context ) {
89121 l , _ := c .Get ("ledger" )
90122
0 commit comments