houyaf 3 жил өмнө
parent
commit
aaf11332e3

+ 7 - 9
web/controllers/api_controller.go

@@ -37,8 +37,8 @@ func (c *ApiController) GetList() *JsonResult {
 }
 
 func (c *ApiController) GetPage() *JsonResult {
-    params     := c.buildParams()
-    moduleId   := c.Ctx.URLParamInt64Default("moduleId", 0)
+    params   := c.buildParams()
+    moduleId := c.Ctx.URLParamInt64Default("moduleId", 0)
     if moduleId <= 0 {
         return ResultErr("参数不完整", nil)
     }
@@ -62,9 +62,8 @@ func (c *ApiController) GetById(moduleId, apiId int64) *JsonResult {
 }
 
 func (c *ApiController) Create() *JsonResult {
-    userId     := c.GetCurUserId()
-    
-    api := datamodels.Api{}
+    userId := c.GetCurUserId()
+    api    := datamodels.Api{}
     if err := c.Ctx.ReadJSON(&api); err != nil {
         return ResultErr("读取数据失败", nil)
     }
@@ -78,9 +77,8 @@ func (c *ApiController) Create() *JsonResult {
 }
 
 func (c *ApiController) Update() *JsonResult {
-    userId     := c.GetCurUserId()
-    
-    api := datamodels.Api{}
+    userId := c.GetCurUserId()
+    api    := datamodels.Api{}
     if err := c.Ctx.ReadJSON(&api); err != nil {
         return ResultErr("读取数据失败", nil)
     }
@@ -105,7 +103,7 @@ func (c *ApiController) DeleteByID(moduleId, apiId int64) *JsonResult {
     userId := c.GetCurUserId()
     
     m := make(map[string]interface{})
-    m["moduleId"]     = moduleId
+    m["moduleId"]  = moduleId
     m["apiId"]     = apiId
     m["deletedBy"] = userId
     if err := c.Service.Delete(m); err != nil {