|
|
@@ -12,13 +12,13 @@ type BizController struct {
|
|
|
}
|
|
|
|
|
|
func (c *BizController) BeforeActivation(b mvc.BeforeActivation) {
|
|
|
- b.Handle("GET", "/", "GetList" )
|
|
|
- b.Handle("GET", "/data", "GetTreeData")
|
|
|
- b.Handle("GET", "/page", "GetPage" )
|
|
|
- b.Handle("GET", "/{modelId:int64}", "GetById" )
|
|
|
- b.Handle("POST", "/add", "Create" )
|
|
|
- b.Handle("PUT", "/update", "Update" )
|
|
|
- b.Handle("DELETE", "/{modelId:int64}", "DeleteByID" )
|
|
|
+ b.Handle("GET", "/", "GetList" )
|
|
|
+ b.Handle("GET", "/data", "GetTreeData" )
|
|
|
+ b.Handle("GET", "/page", "GetPage" )
|
|
|
+ b.Handle("GET", "/{modelId:int64}", "GetById" )
|
|
|
+ b.Handle("POST", "/add", "Create" )
|
|
|
+ b.Handle("PUT", "/update", "Update" )
|
|
|
+ b.Handle("DELETE", "/{modelId:int64}", "DeleteByID" )
|
|
|
}
|
|
|
|
|
|
func (c *BizController) GetList() *JsonResult {
|
|
|
@@ -50,7 +50,7 @@ func (c *BizController) GetPage() *JsonResult {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (c *BizController) GetById(modelId int64) *JsonResult {
|
|
|
+func (c *BizController) GetById(modelId int64)*JsonResult {
|
|
|
|
|
|
data, err := c.Service.GetById(modelId)
|
|
|
if err != nil {
|
|
|
@@ -60,7 +60,7 @@ func (c *BizController) GetById(modelId int64) *JsonResult {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (c *BizController) Create() *JsonResult {
|
|
|
+func (c *BizController) Create()*JsonResult {
|
|
|
userId := c.GetCurUserId()
|
|
|
|
|
|
mod := datamodels.Biz{}
|
|
|
@@ -77,7 +77,7 @@ func (c *BizController) Create() *JsonResult {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (c *BizController) Update() *JsonResult {
|
|
|
+func (c *BizController) Update()*JsonResult {
|
|
|
userId := c.GetCurUserId()
|
|
|
|
|
|
mod := datamodels.Biz{}
|
|
|
@@ -93,7 +93,7 @@ func (c *BizController) Update() *JsonResult {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (c *BizController) DeleteByID(modelId int64) *JsonResult {
|
|
|
+func (c *BizController) DeleteByID(modelId int64)*JsonResult {
|
|
|
userId := c.GetCurUserId()
|
|
|
|
|
|
m := make(map[string]interface{})
|