Skip to content

Commit

Permalink
修改图片审核接口
Browse files Browse the repository at this point in the history
  • Loading branch information
boyyang-love committed Aug 15, 2023
1 parent f64e82d commit 9f0cf9c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions api/upload.api
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type (
}

ExhibitionInfo {
Uid uint `json:"id"`
Uid uint `json:"uid"`
Created int `json:"created"`
Title string `json:"title"`
SubTitle string `json:"sub_title"`
Expand All @@ -83,33 +83,33 @@ type (
// 更新图片墙信息
type (
updateExhibitionReq {
Id uint `form:"id"`
Uid uint `form:"uid"`
Title string `form:"title,optional"`
SubTitle string `form:"sub_title,optional"`
Des string `form:"des,optional"`
}

updateExhibitionRes {
Id uint `json:"id"`
Uid uint `json:"uid"`
}
)

// 审批图片
type (
approvalReq {
Id uint `form:"id"`
Uid uint `form:"uid"`
Status int `form:"status"`
Reason string `form:"reason,optional"`
}

approvalRes {
Id uint `json:"id"`
Uid uint `json:"Uid"`
}
)

type (
delExhibitionReq {
Id uint `form:"id"`
Uid uint `form:"uid"`
}
)

Expand Down
4 changes: 2 additions & 2 deletions internal/logic/exhibition/approval-exhibition-logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func (l *ApprovalExhibitionLogic) ApprovalExhibition(req *types.ApprovalReq) (re

if err = DB.
Model(&models.Exhibition{}).
Where("uid = ?", req.Id).
Where("uid = ?", req.Uid).
Updates(&models.Exhibition{
Status: req.Status,
RejectRes: req.Reason,
}).Error; err == nil {
return &types.ApprovalRes{Id: req.Id}, err, respx.SucMsg{Msg: "状态更新成功"}
return &types.ApprovalRes{Uid: req.Uid}, err, respx.SucMsg{Msg: "状态更新成功"}
} else {
return nil, errorx.NewDefaultError(err.Error()), msg
}
Expand Down
2 changes: 1 addition & 1 deletion internal/logic/exhibition/del-exhibition-logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewDelExhibitionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Del
func (l *DelExhibitionLogic) DelExhibition(req *types.DelExhibitionReq) (err error, msg respx.SucMsg) {
if err = l.svcCtx.DB.
Model(&models.Exhibition{}).
Where("uid = ?", req.Id).
Where("uid = ?", req.Uid).
Delete(&models.Exhibition{}).
Error; err != nil {
return err, msg
Expand Down
4 changes: 2 additions & 2 deletions internal/logic/exhibition/update-exhibition-logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ func (l *UpdateExhibitionLogic) UpdateExhibition(req *types.UpdateExhibitionReq)

if err = DB.
Model(&models.Exhibition{}).
Where("uid = ?", req.Id).
Where("uid = ?", req.Uid).
Updates(&models.Exhibition{
Title: req.Title,
SubTitle: req.SubTitle,
Des: req.Des,
}).Error; err == nil {
return &types.UpdateExhibitionRes{Id: req.Id}, nil, respx.SucMsg{Msg: "更新成功"}
return &types.UpdateExhibitionRes{Uid: req.Uid}, nil, respx.SucMsg{Msg: "更新成功"}
} else {
return nil, err, msg
}
Expand Down
12 changes: 6 additions & 6 deletions internal/types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f0cf9c

Please sign in to comment.