20 lines
587 B
Go
20 lines
587 B
Go
package storeAdmin
|
|
|
|
import (
|
|
"context"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"server/internal/model"
|
|
"server/internal/service"
|
|
|
|
"server/api/storeAdmin/v1"
|
|
)
|
|
|
|
func (c *ControllerV1) Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoRes, err error) {
|
|
storeAdminId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
|
out, err := service.StoreAdmin().Info(ctx, &model.StoreAdminInfoIn{StoreAdminId: storeAdminId})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.InfoRes{Id: out.Id, StoreId: out.StoreId, Username: out.Username, Realname: out.RealName, IsPrimary: out.IsPrimary}, nil
|
|
}
|