39 lines
860 B
Go
39 lines
860 B
Go
package analysisstorelogic
|
|
|
|
import (
|
|
"context"
|
|
|
|
analysis "lone-services/rpc/analysis/pb"
|
|
"lone-services/services/analysis/internal/logic/common"
|
|
"lone-services/services/analysis/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type StoreDetailLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
}
|
|
|
|
func NewStoreDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StoreDetailLogic {
|
|
return &StoreDetailLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
func (l *StoreDetailLogic) StoreDetail(in *analysis.StoreDetailReq) (*analysis.Response, error) {
|
|
storeId, _, fail := common.RequireStoreId(l.ctx)
|
|
if fail != nil {
|
|
return fail, nil
|
|
}
|
|
|
|
info, fail := loadPassedStore(l.ctx, storeId)
|
|
if fail != nil {
|
|
return fail, nil
|
|
}
|
|
return common.OkResponse(skinStore(info)), nil
|
|
}
|