feat:完善产品详情
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
||||
type Manage struct{}
|
||||
|
||||
type (
|
||||
// enterpriseForm 企业信息
|
||||
// enterpriseForm 设备信息
|
||||
enterpriseForm struct {
|
||||
Mode int `json:"mode" form:"mode" binding:"required"`
|
||||
Title string `json:"title" form:"title" binding:"required"`
|
||||
@ -164,3 +164,29 @@ func (*Manage) EquipmentDelete(c *gin.Context) {
|
||||
Delete(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Manage) CompanyDetail(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewCompany()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
|
||||
Detail(form.Convert())
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Manage) CompanyProduct(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
api.PageForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewCompany()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
|
||||
Product(form.Convert(), form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user