feat:完善产品详情

This commit is contained in:
henry
2021-12-08 17:46:47 +08:00
parent 10a7e9cacd
commit adc698840c
11 changed files with 223 additions and 6 deletions

View File

@ -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)
}