houyaf 3 年 前
コミット
a2047b355c

+ 7 - 7
pkg/system/controller/art_cat_controller.go

@@ -51,8 +51,8 @@ func (c *ArtCatController) GetById(artCatId int64) *JsonResult {
 }
 
 func (c *ArtCatController) Create() *JsonResult {
-    ocId    := c.GetCurOcId()
-    userId  := c.GetCurUserId()
+    ocId   := c.GetCurOcId()
+    userId := c.GetCurUserId()
 
     artCat := &datamodel.ArtCat{}
 
@@ -70,8 +70,8 @@ func (c *ArtCatController) Create() *JsonResult {
 }
 
 func (c *ArtCatController) Update() *JsonResult {
-    ocId    := c.GetCurOcId()
-    userId  := c.GetCurUserId()
+    ocId   := c.GetCurOcId()
+    userId := c.GetCurUserId()
 
     artCat := &datamodel.ArtCat{}
     if err := c.Ctx.ReadJSON(artCat); err != nil {
@@ -88,12 +88,12 @@ func (c *ArtCatController) Update() *JsonResult {
 }
 
 func (c *ArtCatController) DeleteByID(artCatId int64) *JsonResult {
-    ocId := c.GetCurOcId()
+    ocId   := c.GetCurOcId()
     userId := c.GetCurUserId()
 
     m := make(map[string]interface{})
-    m["ocId"] = ocId
-    m["artCatId"] = artCatId
+    m["ocId"]      = ocId
+    m["artCatId"]  = artCatId
     m["deletedBy"] = userId
     if err := c.Service.Delete(m); err != nil {
         return ResultErr(err.Error(), nil)

+ 4 - 4
pkg/system/controller/art_controller.go

@@ -69,8 +69,8 @@ func (c *ArtController) Create() *JsonResult {
 }
 
 func (c *ArtController) Update() *JsonResult {
-    ocId    := c.GetCurOcId()
-    userId  := c.GetCurUserId()
+    ocId   := c.GetCurOcId()
+    userId := c.GetCurUserId()
     art := &datamodel.Art{}
     if err := c.Ctx.ReadJSON(&art); err != nil {
         return ResultErr("读取数据失败", nil)
@@ -90,8 +90,8 @@ func (c *ArtController) DeleteByID(artId int64) *JsonResult {
     userId := c.GetCurUserId()
 
     m := make(map[string]interface{})
-    m["ocId"] = ocId
-    m["artId"] = artId
+    m["ocId"]      = ocId
+    m["artId"]     = artId
     m["deletedBy"] = userId
 
     if err := c.Service.Delete(m); err != nil {

+ 2 - 3
pkg/system/controller/company_profile_controller.go

@@ -12,8 +12,8 @@ type CompanyProfileController struct {
 }
 
 func (c *CompanyProfileController) BeforeActivation(b mvc.BeforeActivation) {
-    b.Handle("GET", "/",            "GetById")
-    b.Handle("PUT", "/update",      "Update")
+    b.Handle("GET",     "/",                "GetById"   )
+    b.Handle("PUT",     "/update",          "Update"    )
 }
 
 func (c *CompanyProfileController) GetById() *JsonResult {
@@ -30,7 +30,6 @@ func (c *CompanyProfileController) Update() *JsonResult {
     ocId := c.GetCurOcId()
 
     cmp := &datamodel.Company{OcId: ocId}
-
     if err := c.Ctx.ReadJSON(cmp); err != nil {
         return ResultErr(err.Error(), nil)
     }

+ 5 - 6
pkg/system/controller/doc_cat_controller.go

@@ -51,11 +51,10 @@ func (c *DocCatController) GetById(docCatId int64) *JsonResult {
 }
 
 func (c *DocCatController) Create() *JsonResult {
-    ocId := c.GetCurOcId()
+    ocId   := c.GetCurOcId()
     userId := c.GetCurUserId()
 
     docCat := &datamodel.DocCat{}
-
     if err := c.Ctx.ReadJSON(docCat); err != nil {
         return ResultErr("读取数据失败", nil)
     }
@@ -70,7 +69,7 @@ func (c *DocCatController) Create() *JsonResult {
 }
 
 func (c *DocCatController) Update() *JsonResult {
-    ocId := c.GetCurOcId()
+    ocId   := c.GetCurOcId()
     userId := c.GetCurUserId()
 
     docCat := &datamodel.DocCat{}
@@ -88,12 +87,12 @@ func (c *DocCatController) Update() *JsonResult {
 }
 
 func (c *DocCatController) DeleteByID(docCatId int64) *JsonResult {
-    ocId := c.GetCurOcId()
+    ocId   := c.GetCurOcId()
     userId := c.GetCurUserId()
 
     m := make(map[string]interface{})
-    m["ocId"] = ocId
-    m["docCatId"] = docCatId
+    m["ocId"]      = ocId
+    m["docCatId"]  = docCatId
     m["deletedBy"] = userId
     if err := c.Service.Delete(m); err != nil {
         return ResultErr(err.Error(), nil)