27 lines
686 B
Go
27 lines
686 B
Go
package sys
|
|
|
|
import (
|
|
"context"
|
|
"hotgo/api/admin/imregistration"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
var ImRegistration = cImRegistration{}
|
|
|
|
type cImRegistration struct{}
|
|
|
|
func (c *cImRegistration) Get(ctx context.Context, req *imregistration.GetReq) (res *imregistration.GetRes, err error) {
|
|
data, err := service.SysImRegistration().GetConfig(ctx)
|
|
if err != nil {
|
|
return
|
|
}
|
|
res = new(imregistration.GetRes)
|
|
res.ImRegistrationConfigModel = data
|
|
return
|
|
}
|
|
|
|
func (c *cImRegistration) Update(ctx context.Context, req *imregistration.UpdateReq) (res *imregistration.UpdateRes, err error) {
|
|
err = service.SysImRegistration().UpdateConfig(ctx, &req.ImRegistrationConfigUpdateInp)
|
|
return
|
|
}
|