forked from TheLastHobbit/AA_DID
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request TheLastHobbit#10 from 1303-yzym/main
完善后端功能
- Loading branch information
Showing
6 changed files
with
51 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package v1 | ||
|
||
import "github.com/gogf/gf/v2/frame/g" | ||
|
||
type GetMessageReq struct { | ||
g.Meta `path:"/user/get-message" method:"get" tags:"UserService" summary:"get-message 用户发送邮件后,后端获取最新邮件"` | ||
} | ||
|
||
type GetMessageRes struct { | ||
OK bool `dc:"若获取成功,返回true"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package user | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
v1 "github.com/gogf/gf-demo-user/v2/api/user/v1" | ||
"github.com/gogf/gf-demo-user/v2/internal/service" | ||
"os" | ||
"time" | ||
) | ||
|
||
func (c *ControllerV1) GetMessage(cxt context.Context, req *v1.GetMessageReq) (res *v1.GetMessageRes, err error) { | ||
// 等待邮件发送成功 | ||
time.Sleep(10 * time.Second) | ||
// 获取邮件 | ||
service.Email().GetEmail(cxt) | ||
content, err := os.ReadFile("text/email.txt") | ||
// r := g.RequestFromCtx(cxt) | ||
// r.Response.Write(content) | ||
fmt.Println(string(content)) | ||
return | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.