123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- // Copyright 2019 getensh.com. All rights reserved.
- // Use of this source code is governed by getensh.com.
- package impl
- import (
- "context"
- "adm-vehicle-style/pb"
- v1 "adm-vehicle-style/pb/v1"
- "adm-vehicle-style/impl/v1/brand"
- "adm-vehicle-style/impl/v1/maintainance"
- "adm-vehicle-style/impl/v1/query"
- "adm-vehicle-style/impl/v1/series"
- "adm-vehicle-style/impl/v1/style"
- "git.getensh.com/common/gopkgsv2/tasker/rpctasker"
- "google.golang.org/grpc"
- )
- // 具体实现
- type Rcvr struct{}
- func Register(s *grpc.Server) {
- pb.RegisterVehicleStyleServer(s, &Rcvr{})
- }
- func (c *Rcvr) BrandList(ctx context.Context, req *v1.BrandListRequest) (reply *v1.BrandListReply, err error) {
- t1 := func() error {
- reply, err = brand.List(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) Search(ctx context.Context, req *v1.SearchRequest) (reply *v1.SearchReply, err error) {
- t1 := func() error {
- reply, err = brand.Search(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateSYBrand(ctx context.Context, req *v1.UpdateSYBrandRequest) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = brand.Update(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GetMaker(ctx context.Context, req *v1.GetMakerRequest) (reply *v1.GetMakerReply, err error) {
- t1 := func() error {
- reply, err = brand.MakerList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateMaker(ctx context.Context, req *v1.UpdateMakerRequest) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = brand.UpdateMaker(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) SeriesList(ctx context.Context, req *v1.SeriesListRequest) (reply *v1.SeriesListReply, err error) {
- t1 := func() error {
- reply, err = series.List(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateSeries(ctx context.Context, req *v1.UpdateSeriesRequest) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = series.Update(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) StyleList(ctx context.Context, req *v1.StyleListRequest) (reply *v1.StyleListReply, err error) {
- t1 := func() error {
- reply, err = style.List(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateStyle(ctx context.Context, req *v1.UpdateStyleRequest) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = style.Update(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) StyleInfo(ctx context.Context, req *v1.StyleInfoRequest) (reply *v1.StyleInfoReply, err error) {
- t1 := func() error {
- reply, err = style.Info(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateStyleInfo(ctx context.Context, req *v1.UpdateStyleInfoRequest) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = style.UpdateStyleInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaintainManual(
- ctx context.Context,
- req *v1.MaintainManualRequest,
- ) (reply *v1.MaintainManualReply, err error) {
- t1 := func() error {
- reply, err = maintainance.Manual(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ItemList(ctx context.Context, req *v1.ItemListRequest) (reply *v1.ItemListReply, err error) {
- t1 := func() error {
- reply, err = maintainance.ItemList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateMaintainManual(
- ctx context.Context,
- req *v1.UpdateMaintainManualRequest,
- ) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = maintainance.Update(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaintainManualInfo(
- ctx context.Context,
- req *v1.MaintainManualInfoRequest,
- ) (reply *v1.MaintainManualInfoReply, err error) {
- t1 := func() error {
- reply, err = maintainance.Info(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) StyleItem(
- ctx context.Context,
- req *v1.MaintainManualRequest,
- ) (reply *v1.StyleItemReply, err error) {
- t1 := func() error {
- reply, err = maintainance.StyleItem(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) C2List(ctx context.Context, req *v1.C2ListRequest) (reply *v1.C2ListReply, err error) {
- t1 := func() error {
- reply, err = maintainance.C2List(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateStyleItem(ctx context.Context, req *v1.UpdateStyleItemRequest) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = maintainance.UpdateStyleItem(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) DeleteMaintainace(
- ctx context.Context,
- req *v1.DeleteMaintainaceRequest,
- ) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = maintainance.Delete(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ExportStyle(ctx context.Context, req *v1.ExportStyleRequest) (reply *v1.ExportStyleReply, err error) {
- t1 := func() error {
- reply, err = style.Export(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ExportStyleTaskList(
- ctx context.Context,
- req *v1.EmptyReply,
- ) (reply *v1.ExportStyleTaskListReply, err error) {
- t1 := func() error {
- reply, err = style.ExportTaskList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) DeleteExportStyleTask(
- ctx context.Context,
- req *v1.DeleteExportStyleTaskRequest,
- ) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = style.DeleteExportTask(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) Query(ctx context.Context, req *v1.QueryRequest) (reply *v1.QueryResponse, err error) {
- t1 := func() error {
- reply, err = query.Query(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) DeleteStyleItem(
- ctx context.Context,
- req *v1.DeleteStyleItemRequest,
- ) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = maintainance.DeleteStyleItem(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TemplateList(ctx context.Context, req *v1.TemplateListRequest) (reply *v1.TemplateListReply, err error) {
- t1 := func() error {
- reply, err = maintainance.TemplateList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TemplateDetailList(
- ctx context.Context,
- req *v1.TemplateDetailListRequest,
- ) (reply *v1.TemplateDetailListReply, err error) {
- t1 := func() error {
- reply, err = maintainance.TemplateDetailList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TemplateDetail(
- ctx context.Context,
- req *v1.TemplateDetailRequest,
- ) (reply *v1.TemplateDetailReply, err error) {
- t1 := func() error {
- reply, err = maintainance.TemplateDetail(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) AddTemplateDetail(
- ctx context.Context,
- req *v1.AddTemplateDetailRequest,
- ) (reply *v1.AddTemplateDetailReply, err error) {
- t1 := func() error {
- reply, err = maintainance.AddTemplateDetail(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) UpdateTemplateDetail(
- ctx context.Context,
- req *v1.UpdateMaintainManualRequest,
- ) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = maintainance.UpdateTemplateDetail(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ChooseTemplateDetail(
- ctx context.Context,
- req *v1.ChooseTemplateDetailRequest,
- ) (reply *v1.EmptyReply, err error) {
- t1 := func() error {
- reply, err = maintainance.ChooseTemplateDetail(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TemplateItemList(ctx context.Context, req *v1.TemplateItemListRequest) (reply *v1.ItemListReply, err error) {
- t1 := func() error {
- reply, err = maintainance.TemplateItemList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
|