feat:完善信息
This commit is contained in:
@ -89,6 +89,17 @@ func (*Technology) PatentExamine(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func (*Technology) PatentShelf(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := technology.NewPatent()(api.GetSession()(c).(*session.Admin)).Shelf(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Technology) PatentDelete(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
@ -209,6 +220,17 @@ func (*Technology) ProductExamine(c *gin.Context) {
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Technology) ProductShelf(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := technology.NewProduct()(api.GetSession()(c).(*session.Admin)).Shelf(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Technology) ProductDelete(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
@ -259,6 +281,17 @@ func (*Technology) AchievementDetail(c *gin.Context) {
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Technology) AchievementShelf(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := technology.NewAchievement()(api.GetSession()(c).(*session.Admin)).Shelf(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Technology) AchievementDelete(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
@ -337,6 +370,17 @@ func (*Technology) Project(c *gin.Context) {
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Technology) ProjectShelf(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := technology.NewProject()(api.GetSession()(c).(*session.Admin)).Shelf(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Technology) ProjectDelete(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
|
@ -103,6 +103,11 @@ func (c *Achievement) Examine(id uint64, status int, remark string) error {
|
||||
return handleExamine(mTechnologyAchievement.TechnologyAchievement, c.UID, model2.SysUserExamineLogKindForAchievement, status, remark)
|
||||
}
|
||||
|
||||
// Shelf 上下架
|
||||
func (c *Achievement) Shelf(id uint64) error {
|
||||
return controller.NewShelf(controller.WithShelfSessionAdmin(c.Admin)).Handle(model2.NewTechnologyAchievement(), id)
|
||||
}
|
||||
|
||||
func (c *Achievement) Delete(id uint64) error {
|
||||
mTechnologyAchievement := model.NewTechnologyAchievement()
|
||||
mTechnologyAchievement.ID = id
|
||||
|
@ -230,9 +230,8 @@ func (c *Patent) Bind(id, uid uint64) error {
|
||||
})
|
||||
}
|
||||
|
||||
// Examine 审核操作
|
||||
func (c *Patent) Examine() {
|
||||
|
||||
func (c *Patent) Shelf(id uint64) error {
|
||||
return controller.NewShelf(controller.WithShelfSessionAdmin(c.Admin)).Handle(model2.NewSysPatent(), id)
|
||||
}
|
||||
|
||||
// Delete 删除操作
|
||||
|
@ -49,13 +49,12 @@ func (c *Product) Instance(tenantID uint64, title string, page, pageSize int) (*
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list := make([]*ProductInfo, 0)
|
||||
list := make([]*ProductInfo, len(out))
|
||||
|
||||
for _, v := range out {
|
||||
list = append(list, &ProductInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
Area: v.FormatBasic(),
|
||||
})
|
||||
for k, v := range out {
|
||||
list[k] = &ProductInfo{
|
||||
ID: v.GetEncodeID(), Area: v.FormatBasic(),
|
||||
}
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, err
|
||||
}
|
||||
@ -104,6 +103,11 @@ func (c *Product) Examine(id uint64, status int, remark string) error {
|
||||
return handleExamine(mTechnologyProduct.TechnologyProduct, c.UID, model2.SysUserExamineLogKindForProduct, status, remark)
|
||||
}
|
||||
|
||||
// Shelf 上下架操作
|
||||
func (c *Product) Shelf(id uint64) error {
|
||||
return controller.NewShelf(controller.WithShelfSessionAdmin(c.Admin)).Handle(model2.NewTechnologyProduct(), id)
|
||||
}
|
||||
|
||||
// Delete 删除操作
|
||||
func (c *Product) Delete(id uint64) error {
|
||||
mTechnologyProduct := model.NewTechnologyProduct()
|
||||
|
@ -46,17 +46,23 @@ func (c *Project) Instance(tenantID uint64, title string, page, pageSize int) (*
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list := make([]*ProjectInstance, 0)
|
||||
list := make([]*ProjectInstance, len(out))
|
||||
|
||||
for _, v := range out {
|
||||
list = append(list, &ProjectInstance{
|
||||
for k, v := range out {
|
||||
list[k] = &ProjectInstance{
|
||||
ID: v.GetEncodeID(), TenantID: v.GetEncodeTenantID(),
|
||||
TechnologyProject: v.TechnologyProject, Area: v.FormatBasic(),
|
||||
})
|
||||
}
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
// Shelf 上下架操作
|
||||
func (c *Project) Shelf(id uint64) error {
|
||||
return controller.NewShelf(controller.WithShelfSessionAdmin(c.Admin)).
|
||||
Handle(model2.NewTechnologyProject(), id)
|
||||
}
|
||||
|
||||
// Delete 删除操作
|
||||
func (c *Project) Delete(id uint64) error {
|
||||
mTechnologyProject := model.NewTechnologyProject()
|
||||
|
Reference in New Issue
Block a user