This commit is contained in:
2025-04-10 17:25:23 +08:00
parent 23c5220745
commit dd8913297e
3 changed files with 79 additions and 15 deletions

View File

@@ -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
`