代码调整
This commit is contained in:
parent
6183b7cf4d
commit
41c1be4763
|
|
@ -4,6 +4,7 @@ package api.v1;
|
|||
option go_package = "voucher/api/v1;v1";
|
||||
import "validate/validate.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "v1/common.proto";
|
||||
|
||||
service Cmb {
|
||||
|
||||
|
|
@ -55,6 +56,12 @@ service Cmb {
|
|||
};
|
||||
}
|
||||
|
||||
rpc Test (Empty) returns (Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/voucher/cmb/v1/test",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message CmbRequest {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package api.v1;
|
||||
option go_package = "voucher/api/v1;v1";
|
||||
|
||||
// 空请求或返回
|
||||
message Empty {}
|
||||
|
|
@ -62,3 +62,12 @@ func (s *CmbService) DecryptBody(ctx context.Context, request *v1.EncryptBodyReq
|
|||
DecryptBody: decryptBody,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *VoucherService) Test(ctx context.Context, request *v1.Empty) (*v1.Empty, error) {
|
||||
|
||||
if err := s.VoucherBiz.ExecuteNotice(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/transport/http"
|
||||
"github.com/robfig/cron"
|
||||
"voucher/internal/biz"
|
||||
"voucher/internal/conf"
|
||||
|
|
@ -24,12 +23,3 @@ func NewVoucherService(
|
|||
VoucherBiz: VoucherBiz,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *VoucherService) Test(ctx http.Context) error {
|
||||
|
||||
if err := s.VoucherBiz.ExecuteNotice(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,24 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/api.v1.CmbRequest'
|
||||
/voucher/cmb/v1/test:
|
||||
post:
|
||||
tags:
|
||||
- Cmb
|
||||
operationId: Cmb_Test
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/api.v1.Empty'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/api.v1.Empty'
|
||||
components:
|
||||
schemas:
|
||||
api.v1.CmbOrderRequest:
|
||||
|
|
@ -236,6 +254,10 @@ components:
|
|||
properties:
|
||||
decryptBody:
|
||||
type: string
|
||||
api.v1.Empty:
|
||||
type: object
|
||||
properties: {}
|
||||
description: 空请求或返回
|
||||
api.v1.EncryptBodyRequest:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
|||
Loading…
Reference in New Issue