|
|
@@ -51,15 +51,14 @@ func (c *GroupCatController) GetById(groupCatId int64) *JsonResult {
|
|
|
}
|
|
|
|
|
|
func (c *GroupCatController) Create() *JsonResult {
|
|
|
- ocId := c.GetCurOcId()
|
|
|
- userId := c.GetCurUserId()
|
|
|
+ ocId := c.GetCurOcId()
|
|
|
+ userId := c.GetCurUserId()
|
|
|
groupCat := datamodel.GroupCat{}
|
|
|
-
|
|
|
if err := c.Ctx.ReadJSON(&groupCat); err != nil {
|
|
|
return ResultErr("读取数据失败", nil)
|
|
|
}
|
|
|
|
|
|
- groupCat.OcId = ocId
|
|
|
+ groupCat.OcId = ocId
|
|
|
groupCat.CreatedBy = userId
|
|
|
if err := c.Service.Create(&groupCat); err != nil {
|
|
|
return ResultErr(err.Error(), nil)
|
|
|
@@ -69,7 +68,7 @@ func (c *GroupCatController) Create() *JsonResult {
|
|
|
}
|
|
|
|
|
|
func (c *GroupCatController) Update() *JsonResult {
|
|
|
- ocId := c.GetCurOcId()
|
|
|
+ ocId := c.GetCurOcId()
|
|
|
userId := c.GetCurUserId()
|
|
|
|
|
|
groupCat := datamodel.GroupCat{}
|
|
|
@@ -77,7 +76,7 @@ func (c *GroupCatController) Update() *JsonResult {
|
|
|
return ResultErr("读取数据失败", nil)
|
|
|
}
|
|
|
|
|
|
- groupCat.OcId = ocId
|
|
|
+ groupCat.OcId = ocId
|
|
|
groupCat.UpdatedBy = userId
|
|
|
if err := c.Service.Update(&groupCat); err != nil {
|
|
|
return ResultErr(err.Error(), nil)
|
|
|
@@ -91,9 +90,9 @@ func (c *GroupCatController) DeleteByID(groupCatId int64) *JsonResult {
|
|
|
userId := c.GetCurUserId()
|
|
|
|
|
|
m := make(map[string]interface{})
|
|
|
- m["ocId"] = ocId
|
|
|
+ m["ocId"] = ocId
|
|
|
m["groupCatId"] = groupCatId
|
|
|
- m["deletedBy"] = userId
|
|
|
+ m["deletedBy"] = userId
|
|
|
if err := c.Service.Delete(m); err != nil {
|
|
|
return ResultErr(err.Error(), nil)
|
|
|
} else {
|