feat:完善信息
This commit is contained in:
@ -73,7 +73,7 @@ func (c *Instance) Form(params *InstanceParams) error {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("信息不存在")
|
||||
} else if c.TenantUID != mTechnologyInstance.UID {
|
||||
} else if c.ManageUID != mTechnologyInstance.UID {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForDraft &&
|
||||
mTechnologyInstance.Status != model2.TechnologyInstanceStatusForRefuse {
|
||||
@ -105,7 +105,7 @@ func (c *Instance) Form(params *InstanceParams) error {
|
||||
mTechnologyInstance.UpdatedAt = time.Now()
|
||||
return model2.Updates(mTechnologyInstance.TechnologyInstance, mTechnologyInstance.TechnologyInstance)
|
||||
}
|
||||
mTechnologyInstance.UID = c.TenantUID
|
||||
mTechnologyInstance.UID = c.ManageUID
|
||||
mTechnologyInstance.Local.Local = c.local
|
||||
mTechnologyInstance.TenantID = c.TenantID
|
||||
|
||||
@ -122,7 +122,7 @@ func (c *Instance) Shelf(id uint64, status int) error {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("信息不存在")
|
||||
} else if c.TenantUID != mTechnologyInstance.UID {
|
||||
} else if c.ManageUID != mTechnologyInstance.UID {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForAgree {
|
||||
return errors.New("操作错误,当前状态不允许处理上下架")
|
||||
@ -147,7 +147,7 @@ func (c *Instance) Delete(id uint64) error {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("信息不存在")
|
||||
} else if c.TenantUID != mTechnologyInstance.UID {
|
||||
} else if c.ManageUID != mTechnologyInstance.UID {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
}
|
||||
if err = model2.Delete(mTechnologyInstance.TechnologyInstance); err != nil {
|
||||
@ -158,6 +158,6 @@ func (c *Instance) Delete(id uint64) error {
|
||||
|
||||
func NewInstance() InstanceHandle {
|
||||
return func(enterprise *service.SessionEnterprise, local string) *Instance {
|
||||
return &Instance{enterprise, local}
|
||||
return &Instance{SessionEnterprise: enterprise, local: local}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ func (c *Paper) Form(params *PaperParams) error {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("当前论文信息不存在")
|
||||
} else if mTechnologyPaper.UID != c.TenantUID {
|
||||
} else if mTechnologyPaper.UID != c.ManageUID {
|
||||
return errors.New("无权限操作")
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ func (c *Paper) Form(params *PaperParams) error {
|
||||
|
||||
if params.ID <= 0 {
|
||||
mTechnologyPaper.TenantID = c.TenantID
|
||||
mTechnologyPaper.UID = c.TenantUID
|
||||
mTechnologyPaper.UID = c.ManageUID
|
||||
mTechnologyPaper.Local.Local = c.local
|
||||
return model2.Create(mTechnologyPaper.TechnologyPaper)
|
||||
}
|
||||
@ -99,7 +99,7 @@ func (c *Paper) Delete(id uint64) error {
|
||||
|
||||
var count int64
|
||||
|
||||
err := model2.Count(mTechnologyPaper.TechnologyPaper, &count, model2.NewWhere("id", id), model2.NewWhere("uid", c.TenantUID))
|
||||
err := model2.Count(mTechnologyPaper.TechnologyPaper, &count, model2.NewWhere("id", id), model2.NewWhere("uid", c.ManageUID))
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@ -114,6 +114,6 @@ func (c *Paper) Delete(id uint64) error {
|
||||
|
||||
func NewPaper() PaperHandle {
|
||||
return func(enterprise *service.SessionEnterprise, local string) *Paper {
|
||||
return &Paper{enterprise, local}
|
||||
return &Paper{SessionEnterprise: enterprise, local: local}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user