github.com/unionj-cloud/go-doudou/v2@v2.3.5/toolkit/astutils/testdata/svc.go (about) 1 package main 2 3 import ( 4 "context" 5 "mime/multipart" 6 ) 7 8 // 用户服务接口 9 // v1版本 10 type Usersvc interface { 11 // You can define your service methods as your need. Below is an example. 12 PageUsers(ctx context.Context, query PageQuery) (code int, data PageRet, msg error) 13 14 // comment1 15 // comment2 16 GetUser(ctx context.Context, 17 // 用户ID 18 // @validate(gt=0,lte=10) 19 userId, 20 // 测试 21 school, 22 // 图片地址 23 photo string, 24 ) ( 25 // 业务状态码 26 code int, 27 // 结果 28 data string, 29 // 错误 30 msg error) 31 32 // comment3 33 SignUp(ctx context.Context, 34 // @validate(gt=0,lte=10) 35 username string, password int, actived bool, score float64) (code int, data string, msg error) 36 37 // comment4 38 UploadAvatar(context.Context, []*multipart.FileHeader, string) (int, string, error) 39 40 // comment5 41 DownloadAvatar(ctx context.Context, userId string, userAttrs ...int) (a, b string) 42 43 // @role(SUPER_ADMIN) 44 BulkSaveOrUpdate(context.Context, int) error 45 }