fix mod
This commit is contained in:
31
tpl/logic.go
31
tpl/logic.go
@@ -15,9 +15,38 @@ func {func}(ctx context.Context, in *pb.{input}) (reply *pb.{output},err error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
{valid}
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return
|
||||
{return}
|
||||
}
|
||||
`
|
||||
var CreateCode = `
|
||||
`
|
||||
|
||||
var ValidCode = `
|
||||
// valildate request id,identity.
|
||||
if in.Id == 0 && in.Identity == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
`
|
||||
|
||||
var FetchValidCode = `
|
||||
// valildate request page_no,page_size.
|
||||
if in.GetPageNo() < 1 {
|
||||
in.PageNo = 1
|
||||
}
|
||||
if in.GetPageSize() < 10 {
|
||||
in.PageSize = 50
|
||||
}
|
||||
`
|
||||
|
||||
var StatusReplyCode = `
|
||||
return &pb.StatusReply{
|
||||
Status: 200,
|
||||
Message: "ok",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
}, nil
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user