| | |
| | | package test |
| | | |
| | | import ( |
| | | "github.com/flipped-aurora/gin-vue-admin/server/global" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/model/common/response" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/model/test" |
| | | testReq "github.com/flipped-aurora/gin-vue-admin/server/model/test/request" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/service" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/utils" |
| | | "github.com/gin-gonic/gin" |
| | | "go.uber.org/zap" |
| | | "srm/global" |
| | | "srm/model/common/request" |
| | | "srm/model/common/response" |
| | | "srm/model/test" |
| | | testReq "srm/model/test/request" |
| | | "srm/service" |
| | | "srm/utils" |
| | | ) |
| | | |
| | | type SupplierApi struct { |
| | |
| | | var s test.Supplier |
| | | err := c.ShouldBindJSON(&s) |
| | | if err != nil { |
| | | response.FailWithMessage(err.Error(), c) |
| | | return |
| | | } |
| | | verify := utils.Rules{ |
| | | "Name": {utils.NotEmpty()}, |
| | | "ResponsiblePersonId": {utils.NotEmpty()}, |
| | | } |
| | | if err := utils.Verify(s, verify); err != nil { |
| | | response.FailWithMessage(err.Error(), c) |
| | | return |
| | | } |