github.com/s7techlab/cckit@v0.10.5/examples/cars/cars_noacces_control.go (about)

     1  // Simple CRUD chaincode for store information about cars
     2  package cars
     3  
     4  import (
     5  	"github.com/s7techlab/cckit/router"
     6  	p "github.com/s7techlab/cckit/router/param"
     7  )
     8  
     9  func NewWithoutAccessControl() *router.Chaincode {
    10  	r := router.New(`cars_without_access_control`) // also initialized logger with "cars" prefix
    11  
    12  	r.Group(`car`).
    13  		Query(`List`, queryCars).                                             // chain code method name is carList
    14  		Query(`Get`, queryCar, p.String(`id`)).                               // chain code method name is carGet, method has 1 string argument "id"
    15  		Invoke(`Register`, invokeCarRegister, p.Struct(`car`, &CarPayload{})) // allow access to everyone
    16  	return router.NewChaincode(r)
    17  }