chore: seed migration objects batch 5
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/imabusereason"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var ImAbuseReason = cImAbuseReason{}
|
||||
|
||||
type cImAbuseReason struct{}
|
||||
|
||||
func (c *cImAbuseReason) List(ctx context.Context, req *imabusereason.ListReq) (res *imabusereason.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImAbuseReason().List(ctx, &req.ImAbuseReasonListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.ImAbuseReasonModel{}
|
||||
}
|
||||
res = new(imabusereason.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cImAbuseReason) Edit(ctx context.Context, req *imabusereason.EditReq) (res *imabusereason.EditRes, err error) {
|
||||
err = service.SysImAbuseReason().Edit(ctx, &req.ImAbuseReasonEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cImAbuseReason) Delete(ctx context.Context, req *imabusereason.DeleteReq) (res *imabusereason.DeleteRes, err error) {
|
||||
err = service.SysImAbuseReason().Delete(ctx, &req.ImAbuseReasonDeleteInp)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user