Documentation
¶
Index ¶
- Variables
- func ProductCreateAction(req *http.Request) (interface{}, error)
- func ProductCreateProcess(ctx context.Context, param *ProductCreateParam) (*ibasic.Product, error)
- func ProductDeleteAction(req *http.Request) (interface{}, error)
- func ProductListAction(req *http.Request) (interface{}, error)
- func ProductOneAction(req *http.Request) (interface{}, error)
- func ProductUpdateAction(req *http.Request) (interface{}, error)
- type ProductCreateParam
- type ProductData
- type ProductListParam
- type ProductUpdateParam
Constants ¶
This section is empty.
Variables ¶
var ProductCreateEndpoint = &xreq.Endpoint{ Path: "/products", Method: http.MethodPost, Handler: xreq.Convert(ProductCreateAction), Authorizer: iauth.FA(iauth.FeatureProduct, iauth.ActionCreate), }
ProductCreateRoute route Auto Gen By ctrl, Modify as U Need
var ProductDeleteEndpoint = &xreq.Endpoint{ Path: "/products/{product_name}", Method: http.MethodDelete, Handler: xreq.Convert(ProductDeleteAction), Authorizer: iauth.FAP(iauth.FeatureProduct, iauth.ActionDelete), }
ProductDeleteEndpoint Auto Gen By ctrl, Modify as U Need
var ProductListEndpoint = &xreq.Endpoint{ Path: "/products", Method: http.MethodGet, Handler: xreq.Convert(ProductListAction), Authorizer: iauth.FA(iauth.FeatureProduct, iauth.ActionRead), }
ProductListRoute route Auto Gen By ctrl, Modify as U Need
var ProductOneEndpoint = &xreq.Endpoint{ Path: "/products/{product_name}", Method: http.MethodGet, Handler: xreq.Convert(ProductOneAction), Authorizer: iauth.FAP(iauth.FeatureProduct, iauth.ActionRead), }
ProductOneRoute route Auto Gen By ctrl, Modify as U Need
var ProductUpdateEndpoint = &xreq.Endpoint{ Path: "/products/{product_name}", Method: http.MethodPatch, Handler: xreq.Convert(ProductUpdateAction), Authorizer: iauth.FAP(iauth.FeatureProduct, iauth.ActionUpdate), }
ProductUpdateRoute Auto Gen By ctrl, Modify as U Need
var Routers = []*xreq.Endpoint{ ProductOneEndpoint, ProductListEndpoint, ProductDeleteEndpoint, ProductUpdateEndpoint, ProductCreateEndpoint, }
Functions ¶
func ProductCreateAction ¶
ProductCreateAction add one Auto Gen By ctrl, Modify as U Need
func ProductCreateProcess ¶
func ProductDeleteAction ¶
ProductDeleteAction delete product Auto Gen By ctrl, Modify as U Need
func ProductListAction ¶
ProductListAction get list Auto Gen By ctrl, Modify as U Need
func ProductOneAction ¶
ProductOneAction get one Auto Gen By ctrl, Modify as U Need
func ProductUpdateAction ¶
ProductUpdateAction 更新 Auto Gen By ctrl, Modify as U Need
Types ¶
type ProductCreateParam ¶
type ProductCreateParam struct {
Name string `json:"name" validate:"required,min=2"`
Description string `json:"description"`
MailList []string `json:"mail_list"`
PhoneList []string `json:"phone_list"`
ContactPersonList []string `json:"contact_person_list"`
}
ProductCreateParam Param Auto Gen By ctrl, Modify as U Need
type ProductData ¶
type ProductData struct {
Id int64 `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
MailList []string `json:"mail_list"`
PhoneList []string `json:"phone_list"`
ContactPersonList []string `json:"contact_person_list"`
}
ProductData one response Auto Gen By ctrl, Modify as U Need
type ProductListParam ¶
type ProductUpdateParam ¶
type ProductUpdateParam struct {
// Name *string `uri:"name" validate:"required,min=2"`
Description *string `json:"description"`
MailList []string `json:"mail_list"`
PhoneList []string `json:"phone_list"`
ContactPersonList []string `json:"contact_person_list"`
}
ProductUpdateParam Auto Gen By ctrl, Modify as U Need