feat:完善项目
This commit is contained in:
@ -2,7 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"ArmedPolice/app/common/model"
|
||||
"ArmedPolice/app/controller/supplier"
|
||||
"ArmedPolice/app/controller/manage"
|
||||
"ArmedPolice/app/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@ -29,7 +29,7 @@ func (*Supplier) Material(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := supplier.NewInstance()(getSession()(c).(*service.Session)).
|
||||
data, err := manage.NewSupplier()(getSession()(c).(*service.Session)).
|
||||
List(form.Name, form.Mobile, model.ManageSupplierKindForMaterial, form.Page, form.PageSize)
|
||||
APIResponse(err, data)
|
||||
}
|
||||
@ -41,7 +41,7 @@ func (*Supplier) MaterialAdd(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := supplier.NewInstance()(getSession()(c).(*service.Session)).Form(&supplier.InstanceParams{
|
||||
err := manage.NewSupplier()(getSession()(c).(*service.Session)).Form(&manage.SupplierParams{
|
||||
Name: form.Name, Mobile: form.Mobile, Address: form.Address, Remark: form.Remark,
|
||||
Kind: model.ManageSupplierKindForMaterial,
|
||||
})
|
||||
@ -57,7 +57,7 @@ func (*Supplier) MaterialEdit(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := supplier.NewInstance()(getSession()(c).(*service.Session)).Form(&supplier.InstanceParams{
|
||||
err := manage.NewSupplier()(getSession()(c).(*service.Session)).Form(&manage.SupplierParams{
|
||||
ID: form.Convert(), Name: form.Name, Mobile: form.Mobile, Address: form.Address, Remark: form.Remark,
|
||||
Kind: model.ManageSupplierKindForMaterial,
|
||||
})
|
||||
@ -71,7 +71,7 @@ func (*Supplier) MaterialDelete(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := supplier.NewInstance()(getSession()(c).(*service.Session)).Delete(form.Convert())
|
||||
err := manage.NewSupplier()(getSession()(c).(*service.Session)).Delete(form.Convert())
|
||||
APIResponse(err)
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ func (*Supplier) Repair(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := supplier.NewInstance()(getSession()(c).(*service.Session)).
|
||||
data, err := manage.NewSupplier()(getSession()(c).(*service.Session)).
|
||||
List(form.Name, form.Mobile, model.ManageSupplierKindForRepair, form.Page, form.PageSize)
|
||||
APIResponse(err, data)
|
||||
}
|
||||
@ -97,7 +97,7 @@ func (*Supplier) RepairAdd(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := supplier.NewInstance()(getSession()(c).(*service.Session)).Form(&supplier.InstanceParams{
|
||||
err := manage.NewSupplier()(getSession()(c).(*service.Session)).Form(&manage.SupplierParams{
|
||||
Name: form.Name, Mobile: form.Mobile, Address: form.Address, Remark: form.Remark,
|
||||
Kind: model.ManageSupplierKindForRepair,
|
||||
})
|
||||
@ -113,7 +113,7 @@ func (*Supplier) RepairEdit(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := supplier.NewInstance()(getSession()(c).(*service.Session)).Form(&supplier.InstanceParams{
|
||||
err := manage.NewSupplier()(getSession()(c).(*service.Session)).Form(&manage.SupplierParams{
|
||||
ID: form.Convert(), Name: form.Name, Mobile: form.Mobile, Address: form.Address, Remark: form.Remark,
|
||||
Kind: model.ManageSupplierKindForRepair,
|
||||
})
|
||||
@ -127,6 +127,6 @@ func (*Supplier) RepairDelete(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := supplier.NewInstance()(getSession()(c).(*service.Session)).Delete(form.Convert())
|
||||
err := manage.NewSupplier()(getSession()(c).(*service.Session)).Delete(form.Convert())
|
||||
APIResponse(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user