Browse Source

Merge branch 'develop' of http://101.201.121.115:3000/leo/LAPP_Acura_MES_Backend into feature_me

pull/48/head
zhangxin 3 years ago
parent
commit
f8b4dee110
3 changed files with 10 additions and 7 deletions
  1. +1
    -1
      services/me/ProductFamily.service.go
  2. +4
    -1
      services/me/implments/ProductFamily.service.impl.go
  3. +5
    -5
      web/controllers/me/ProductFamily.rest.go

+ 1
- 1
services/me/ProductFamily.service.go View File

@ -57,7 +57,7 @@ type ProductFamilyService interface {
* @Date : 2021-10-19 14:04:53
*
******************************************************************************/
DeleteOne(*global.User, string) error
DeleteOne(*global.User, string, string) error
/******************************************************************************
*
* @Function Name : SelectOne


+ 4
- 1
services/me/implments/ProductFamily.service.impl.go View File

@ -201,7 +201,7 @@ func (impl *ProductFamilyServiceImplement) Association(user *global.User, entity
* @Reference LAPP_ACURA_MOM_BACKEND/services/me/ProductFamilyService.DeleteOne
*
******************************************************************************/
func (impl *ProductFamilyServiceImplement) DeleteOne(user *global.User, productFamilyId string) error {
func (impl *ProductFamilyServiceImplement) DeleteOne(user *global.User, productFamilyId string, projectId string) error {
grmi.Log(user, "/services/me/implments/ProductFamily.service.impl.go", "DeleteOneProductFamily", "删除一个ProductFamily")
@ -216,6 +216,9 @@ func (impl *ProductFamilyServiceImplement) DeleteOne(user *global.User, productF
if record == nil {
return grmi.NewBusinessError("不存在指定记录!")
}
if record.ProjectId != projectId {
return grmi.NewBusinessError("项目号与配置不匹配!")
}
err = dao.DeleteOne(productFamilyId)
if err != nil {
return err


+ 5
- 5
web/controllers/me/ProductFamily.rest.go View File

@ -131,7 +131,7 @@ func RegisterAssociationProductFamily(party router.Party, path string, method fu
* @Date : 2021-10-19 14:04:53
*
******************************************************************************/
func RegisterIDOfProductFamily(party router.Party, httpMethod string, path string, method func(*global.User, string) error) {
func RegisterIDOfProductFamily(party router.Party, httpMethod string, path string, method func(*global.User, string, string) error) {
party.Handle(httpMethod, path, func(ctx iris.Context) {
user, ok := jwts.ParseToken(ctx)
@ -142,8 +142,8 @@ func RegisterIDOfProductFamily(party router.Party, httpMethod string, path strin
var err error = nil
productFamilyId := ctx.Params().GetString("productFamilyId")
err = method(user, productFamilyId)
projectId := ctx.Params().GetString("projectId")
err = method(user, productFamilyId, projectId)
if err != nil {
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
return
@ -193,9 +193,9 @@ func RegisterInsertOneProductFamily(party router.Party, path string, method func
* @Date : 2021-10-19 14:04:53
*
******************************************************************************/
func RegisterDeleteOneProductFamily(party router.Party, path string, method func(*global.User, string) error) {
func RegisterDeleteOneProductFamily(party router.Party, path string, method func(*global.User, string, string) error) {
RegisterIDOfProductFamily(party, "DELETE", path+"/{productFamilyId:string}", method)
RegisterIDOfProductFamily(party, "DELETE", path+"/{projectId:string}/{productFamilyId:string}", method)
}
/******************************************************************************


Loading…
Cancel
Save