实现商户注册、管理员审核商户申请接口
This commit is contained in:
5
internal/controller/merchant/merchant.go
Normal file
5
internal/controller/merchant/merchant.go
Normal file
@ -0,0 +1,5 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package merchant
|
||||
15
internal/controller/merchant/merchant_new.go
Normal file
15
internal/controller/merchant/merchant_new.go
Normal file
@ -0,0 +1,15 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package merchant
|
||||
|
||||
import (
|
||||
"server/api/merchant"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() merchant.IMerchantV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
19
internal/controller/merchant/merchant_v1_audit.go
Normal file
19
internal/controller/merchant/merchant_v1_audit.go
Normal file
@ -0,0 +1,19 @@
|
||||
package merchant
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/merchant/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Audit(ctx context.Context, req *v1.AuditReq) (res *v1.AuditRes, err error) {
|
||||
adminId := g.RequestFromCtx(ctx).GetCtxVar("adminId").Int64()
|
||||
_, err = service.Merchant().Audit(ctx, &model.MerchantAuditIn{Id: req.Id, AuditStatus: req.AuditStatus, AuditRemark: req.AuditRemark, AdminId: adminId, RejectReason: req.RejectReason})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.AuditRes{}, nil
|
||||
}
|
||||
14
internal/controller/merchant/merchant_v1_create.go
Normal file
14
internal/controller/merchant/merchant_v1_create.go
Normal file
@ -0,0 +1,14 @@
|
||||
package merchant
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"server/api/merchant/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
|
||||
return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
||||
}
|
||||
20
internal/controller/merchant/merchant_v1_list.go
Normal file
20
internal/controller/merchant/merchant_v1_list.go
Normal file
@ -0,0 +1,20 @@
|
||||
package merchant
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/merchant/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
|
||||
out, err := service.Merchant().List(ctx, &model.MerchantListIn{Page: req.Page, Size: req.Size, AuditStatus: req.AuditStatus, Status: req.Status})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ListRes{
|
||||
List: out.List,
|
||||
Total: out.Total,
|
||||
}, nil
|
||||
}
|
||||
14
internal/controller/merchant/merchant_v1_update.go
Normal file
14
internal/controller/merchant/merchant_v1_update.go
Normal file
@ -0,0 +1,14 @@
|
||||
package merchant
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"server/api/merchant/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) {
|
||||
return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
||||
}
|
||||
Reference in New Issue
Block a user