feat:完善项目信息
This commit is contained in:
7
app/api/admin/controller/technology/basic.go
Normal file
7
app/api/admin/controller/technology/basic.go
Normal file
@ -0,0 +1,7 @@
|
||||
package technology
|
||||
|
||||
import model2 "SciencesServer/app/common/model"
|
||||
|
||||
func handleExamine(iModel model2.IModel, status int) {
|
||||
|
||||
}
|
@ -230,6 +230,11 @@ func (c *Patent) Bind(id, uid uint64) error {
|
||||
})
|
||||
}
|
||||
|
||||
// Examine 审核操作
|
||||
func (c *Patent) Examine() {
|
||||
|
||||
}
|
||||
|
||||
// Delete 删除操作
|
||||
func (c *Patent) Delete(id uint64) error {
|
||||
mSysPatent := model.NewSysPatent()
|
||||
|
@ -83,6 +83,29 @@ func (c *Product) Form() {
|
||||
|
||||
}
|
||||
|
||||
// Examine 审核操作
|
||||
func (c *Product) Examine(id uint64, status int, remark string) error {
|
||||
mTechnologyProduct := model.NewTechnologyProduct()
|
||||
mTechnologyProduct.ID = id
|
||||
|
||||
isExist, err := model2.FirstField(mTechnologyProduct.TechnologyProduct, []string{"id", "tenant_id", "status"})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("操作错误,产品信息不存在或已被删除")
|
||||
}
|
||||
if c.TenantID > 0 && mTechnologyProduct.TenantID != c.TenantID {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
}
|
||||
if mTechnologyProduct.Status != model2.TechnologyStatusKindForExamining {
|
||||
return errors.New("操作错误,当前产品状态不允许审核")
|
||||
}
|
||||
return model2.Updates(mTechnologyProduct.TechnologyProduct, map[string]interface{}{
|
||||
"status": status,
|
||||
})
|
||||
}
|
||||
|
||||
// Delete 删除操作
|
||||
func (c *Product) Delete(id uint64) error {
|
||||
mTechnologyProduct := model.NewTechnologyProduct()
|
||||
|
Reference in New Issue
Block a user